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 |
|---|---|---|---|---|---|
lotusk/tushare | tushare/futures/domestic_cons.py | 2 | 5300 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Created on 2017年06月04日
@author: debugo
@contact: me@debugo.com
'''
import re
import datetime
CFFEX_DAILY_URL = 'http://www.cffex.com.cn/fzjy/mrhq/%s/%s/%s_1.csv'
SHFE_DAILY_URL = 'http://www.shfe.com.cn/data/dailydata/kx/kx%s.dat'
SHFE_VWAP_URL = 'http://www.shfe.com.c... | bsd-3-clause |
hotzenklotz/pybeerxml | pybeerxml/yeast.py | 1 | 1747 | from typing import Optional, Text, Any
from pybeerxml.utils import cast_to_bool
class Yeast:
def __init__(self):
self.name: Optional[Text] = None
self.version: Optional[int] = None
self.type: Optional[Text] = None
self.form: Optional[Text] = None # May be "Liquid", "Dry", "Slant"... | mit |
orekyuu/intellij-community | python/lib/Lib/whichdb.py | 240 | 3353 | # !/usr/bin/env python
"""Guess which db package to use to open a db file."""
import os
import struct
import sys
try:
import dbm
_dbmerror = dbm.error
except ImportError:
dbm = None
# just some sort of valid exception which might be raised in the
# dbm test
_dbmerror = IOError
def whichdb(fil... | apache-2.0 |
cyberark-bizdev/ansible | lib/ansible/modules/cloud/amazon/efs.py | 5 | 24222 | #!/usr/bin/python
# Copyright: 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__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
schober2/tc359_helper_methods | path/ruby/2.0.0/gems/nokogiri-1.6.6.2/ext/nokogiri/tmp/x86_64-apple-darwin14/ports/libxml2/2.9.2/libxml2-2.9.2/python/tests/build.py | 37 | 1551 | #!/usr/bin/python -u
import libxml2
import sys
# Memory debug specific
libxml2.debugMemory(1)
doc = libxml2.newDoc("1.0")
comment = doc.newDocComment("This is a generated document")
doc.addChild(comment)
pi = libxml2.newPI("test", "PI content")
doc.addChild(pi)
root = doc.newChild(None, "doc", None)
ns = root.newNs("... | mit |
nivertech/peru | peru/resources/plugins/hg/hg_plugin.py | 4 | 3238 | #! /usr/bin/env python3
import os
import shutil
import subprocess
import textwrap
CACHE_PATH = os.environ['PERU_PLUGIN_CACHE']
URL = os.environ['PERU_MODULE_URL']
REV = os.environ['PERU_MODULE_REV'] or 'default'
REUP = os.environ['PERU_MODULE_REUP'] or 'default'
def hg(*args, hg_dir=None, capture_output=False):
... | mit |
bilalliberty/android_kernel_htc_K2UL | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
10clouds/edx-platform | lms/djangoapps/discussion_api/tests/test_api.py | 4 | 126488 | """
Tests for Discussion API internal interface
"""
from datetime import datetime, timedelta
import itertools
from urlparse import parse_qs, urlparse, urlunparse
from urllib import urlencode
import ddt
import httpretty
import mock
from nose.plugins.attrib import attr
from pytz import UTC
from django.core.exceptions i... | agpl-3.0 |
Johnzero/OE7 | openerp/addons-modules/account_asset/account_asset.py | 14 | 29289 | # -*- encoding: 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 G... | agpl-3.0 |
bakkou-badri/dataminingproject | env/lib/python2.7/site-packages/werkzeug/testsuite/exceptions.py | 100 | 3325 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.exceptions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The tests for the exception classes.
TODO:
- This is undertested. HTML is never checked
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
fro... | gpl-2.0 |
LuminateWireless/bazel | third_party/py/concurrent/futures/_compat.py | 179 | 4645 | from keyword import iskeyword as _iskeyword
from operator import itemgetter as _itemgetter
import sys as _sys
def namedtuple(typename, field_names):
"""Returns a new subclass of tuple with named fields.
>>> Point = namedtuple('Point', 'x y')
>>> Point.__doc__ # docstring for the new cla... | apache-2.0 |
wackymaster/QTClock | Libraries/numpy/distutils/tests/test_fcompiler_intel.py | 146 | 1224 | from __future__ import division, absolute_import, print_function
import numpy.distutils.fcompiler
from numpy.testing import TestCase, run_module_suite, assert_
intel_32bit_version_strings = [
("Intel(R) Fortran Intel(R) 32-bit Compiler Professional for applications"
"running on Intel(R) 32, Version 11.1", '... | mit |
seaotterman/tensorflow | tensorflow/python/kernel_tests/diag_op_test.py | 56 | 19710 | # 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 |
markdoerr/testing | lara/generators/momentum_code_generator.py | 1 | 42959 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#_____________________________________________________________________________
#
# PROJECT: LARA
# CLASS: momentum_code_generator
# FILENAME: momentum_code_generator.py
#
# CATEGORY:
#
# AUTHOR: mark doerr
# EMAIL: mark@ismeralda.org
#
# VERSION: 0.2.4
#
# CREATION_DATE: 2... | gpl-2.0 |
BackupGGCode/python-for-android | python-modules/twisted/twisted/test/test_twistd.py | 49 | 41163 | # Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.application.app} and L{twisted.scripts.twistd}.
"""
import signal, inspect, errno
import os, sys, cPickle, StringIO
try:
import pwd, grp
except ImportError:
pwd = grp = None
from zope.interface import i... | apache-2.0 |
OMFGBKANG/nk2 | scripts/build-all.py | 282 | 8889 | #! /usr/bin/env python
# Copyright (c) 2009, Code Aurora Forum. 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... | gpl-2.0 |
ychen820/microblog | src/lib/flask/templating.py | 783 | 4707 | # -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... | bsd-3-clause |
pombredanne/django-allauth-api | src/allauth_api/account/rest_framework/authentication.py | 1 | 4631 | from django.contrib.auth import logout as auth_logout
from rest_framework.status import HTTP_401_UNAUTHORIZED, HTTP_204_NO_CONTENT
from rest_framework.response import Response
from rest_framework.authentication import BaseAuthentication, BasicAuthentication
from rest_framework.exceptions import AuthenticationFailed
f... | bsd-2-clause |
dbbhattacharya/kitsune | vendor/packages/logilab-common/deprecation.py | 6 | 4472 | # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | bsd-3-clause |
gauribhoite/personfinder | env/google_appengine/lib/django-1.4/django/utils/dates.py | 488 | 2237 | "Commonly-used date structures"
from django.utils.translation import ugettext_lazy as _, pgettext_lazy
WEEKDAYS = {
0:_('Monday'), 1:_('Tuesday'), 2:_('Wednesday'), 3:_('Thursday'), 4:_('Friday'),
5:_('Saturday'), 6:_('Sunday')
}
WEEKDAYS_ABBR = {
0:_('Mon'), 1:_('Tue'), 2:_('Wed'), 3:_('Thu'), 4:_('Fri')... | apache-2.0 |
astrikov-d/dartcms | dartcms/apps/users/urls.py | 1 | 1621 | # -*- coding: utf-8 -*-
from dartcms.utils.config import DartCMSConfig
from dartcms.views import DeleteObjectView, GridView
from django.conf.urls import url
from django.utils.translation import ugettext_lazy as _
from .forms import UserForm
from .models import CMSUser
from .views import ChangePasswordView, CMSUserInse... | mit |
mulkieran/pyblk | src/pyblk/_utils.py | 1 | 2609 | # -*- coding: utf-8 -*-
# Copyright (C) 2015 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, or (at your option) any later version.
# This program is distributed in th... | gpl-2.0 |
ThinkingBridge/platform_external_chromium_org | tools/json_to_struct/json_to_struct.py | 69 | 6904 | #!/usr/bin/env python
# Copyright 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.
# Format for the JSON schema file:
# {
# "type_name": "DesiredCStructName",
# "headers": [ // Optional list of headers to ... | bsd-3-clause |
dvliman/jaikuengine | .google_appengine/lib/django-1.2/django/contrib/auth/decorators.py | 63 | 1940 | try:
from functools import update_wrapper, wraps
except ImportError:
from django.utils.functional import update_wrapper, wraps # Python 2.4 fallback.
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.http import HttpResponseRedirect
from django.utils.decorators import available_attrs
from django... | apache-2.0 |
meejah/torperf | analyze_guards.py | 2 | 2559 | #!/usr/bin/python
#
# This script takes a list of extradata files and tells you some statistics
# about the guard selection used by checking against the current consensus.
#
# Use the script like this:
# ./analyze_guards.py slowratio50kb.extradata slowratio1mb50kb.extradata
#
# It should then print out ranking stats on... | bsd-3-clause |
thinkopensolutions/account-fiscal-rule | account_fiscal_position_rule_sale/models/sale.py | 2 | 1295 | # -*- coding: utf-8 -*-
# Copyright (C) 2009-TODAY Akretion <http://www.akretion.com>
# @author Sébastien BEAU <sebastien.beau@akretion.com>
# @author Renato Lima <renato.lima@akretion.com>
# @author Raphaël Valyi <raphael.valyi@akretion.com>
# Copyright 2012 Camptocamp SA
# @author: Guewen Baconnie... | agpl-3.0 |
mith1979/ansible_automation | applied_python/applied_python/lib/python2.7/site-packages/pygal/graph/base.py | 2 | 8663 | # -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2015 Kozea
#
# This library is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version... | apache-2.0 |
myarti/kivybits | Base/modules/screen.py | 1 | 4333 | '''Screen
======
This module changes some environement and configuration variables
to match the density / dpi / screensize of a specific device.
To see a list of the available screenid's, just run::
python main.py -m screen
To simulate a medium-density screen such as the Motolora Droid 2::
python main.py -... | mit |
mscuthbert/abjad | abjad/tools/timespantools/test/test_timespantools_Timespan___or__.py | 2 | 3746 | # -*- encoding: utf-8 -*-
from abjad import *
def test_timespantools_Timespan___or___01():
timespan_1 = timespantools.Timespan(0, 15)
timespan_2 = timespantools.Timespan(-10, -5)
result = timespan_1 | timespan_2
assert result == timespantools.TimespanInventory([
timespantools.Timespan(-10, -5)... | gpl-3.0 |
treetrnk/Tuxemon | tuxemon/core/components/event/actions/play_sound.py | 2 | 1305 | # -*- coding: utf-8 -*-
#
# Tuxemon
# Copyright (c) 2014-2017 William Edwards <shadowapex@gmail.com>,
# Benjamin Bean <superman2k5@gmail.com>
#
# This file is part of Tuxemon
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public L... | gpl-3.0 |
TomBaxter/osf.io | addons/onedrive/migrations/0001_initial.py | 22 | 2662 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-21 16:50
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import osf.models.base
import osf.utils.datetime_aware_jsonfield
class Migration(migrations.Migra... | apache-2.0 |
alfanugraha/LUMENS-repo | processing/gdal/ColorRelief.py | 4 | 3811 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ColorRelief.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*************... | gpl-2.0 |
gusai-francelabs/datafari | windows/python/Lib/email/test/test_email_codecs_renamed.py | 298 | 2842 | # Copyright (C) 2002-2006 Python Software Foundation
# Contact: email-sig@python.org
# email package unit tests for (optional) Asian codecs
import unittest
from test.test_support import run_unittest
from email.test.test_email import TestEmailBase
from email.charset import Charset
from email.header import Header, deco... | apache-2.0 |
Lujeni/ansible | lib/ansible/modules/system/filesystem.py | 13 | 13388 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Alexander Bulimov <lazywolf0@gmail.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_ver... | gpl-3.0 |
1tush/reviewboard | reviewboard/webapi/resources/review_group.py | 1 | 13050 | from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.utils import six
from djblets.util.decorators import augment_method_from
from djblets.webapi.decorators import (webapi_login_required,
webapi_r... | mit |
merenlab/anvio | anvio/panops.py | 1 | 49412 | # -*- coding: utf-8
# pylint: disable=line-too-long
"""
Classes for pan operations.
anvi-pan-genome is the default client using this module
"""
import os
import json
import math
import copy
import multiprocessing
import pandas as pd
from itertools import chain
import anvio
import anvio.utils as utils
import ... | gpl-3.0 |
koderiter/mineos | procfs_reader.py | 4 | 4504 | """
A python script to get procfs info (/proc)
"""
__author__ = "William Dizon"
__license__ = "GNU GPL v3.0"
__version__ = "0.6.0"
__email__ = "wdchromium@gmail.com"
import os
from binascii import b2a_qp
_PROCFS_PATHS = ['/proc',
'/usr/compat/linux/proc']
for procfs in _PROCFS_PATHS:
try:
... | gpl-3.0 |
biocore/qiime | qiime/make_per_library_sff.py | 15 | 3549 | #!/usr/bin/env python
from __future__ import division
__author__ = "Kyle Bittinger"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Kyle Bittinger"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Kyle Bittinger"
__email__ = "kylebittinger@gmail.com"
import itertools
import os
imp... | gpl-2.0 |
hipnusleo/laserjet | resource/pypi/cryptography-1.7.1/tests/hazmat/primitives/test_rsa.py | 1 | 82608 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import binascii
import itertools
import math
import os
import... | apache-2.0 |
wandec/grr | lib/hunts/implementation.py | 1 | 36869 | #!/usr/bin/env python
"""The implementation of hunts.
A hunt is a mechanism for automatically scheduling flows on a selective subset
of clients, managing these flows, collecting and presenting the combined results
of all these flows.
In essence a hunt is just another flow which schedules child flows using
CallFlow().... | apache-2.0 |
yakovenkodenis/rethinkdb | test/common/test_exceptions.py | 37 | 1071 | #!/usr/bin/env python
'''Collection of the shared exceptions used in testing'''
class TestingFrameworkException(Exception):
'''Generic exception for this testing framework, mostly a base class for others'''
_message = 'A generic testing framework error occured'
detail = None
debugInfo = None
... | agpl-3.0 |
darith27/wagtail | wagtail/tests/testapp/migrations/0001_initial.py | 22 | 18850 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
import modelcluster.contrib.taggit
import wagtail.wagtailimages.models
import wagtail.wagtailadmin.taggable
import modelcluster.fields
import wagtai... | bsd-3-clause |
daniponi/django | tests/servers/tests.py | 33 | 6903 | # -*- encoding: utf-8 -*-
"""
Tests for django.core.servers.
"""
from __future__ import unicode_literals
import contextlib
import errno
import os
import socket
from django.core.exceptions import ImproperlyConfigured
from django.test import LiveServerTestCase, override_settings
from django.utils._os import upath
from ... | bsd-3-clause |
gpodder/mygpo | mygpo/api/simple.py | 1 | 11069 | import json
import string
from functools import wraps
from django.shortcuts import render
from django.core.cache import cache
from django.http import HttpResponse, HttpResponseBadRequest
from django.views.decorators.cache import cache_page
from django.views.decorators.csrf import csrf_exempt
from django.views.decorato... | agpl-3.0 |
dkodnik/Ant | addons/auth_openid/controllers/main.py | 52 | 10261 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
mitocw/edx-platform | openedx/core/lib/api/permissions.py | 4 | 5499 | """
API library for Django REST Framework permissions-oriented workflows
"""
from django.conf import settings
from django.http import Http404
from edx_django_utils.monitoring import set_custom_metric
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from rest_condition import C
from r... | agpl-3.0 |
duramato/SickRage | lib/guessit/language.py | 25 | 11576 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
awemulya/fieldsight-kobocat | onadata/apps/logger/south_migrations/0039_auto__del_field_xform_surveys_with_geopoints__add_field_xform_instance.py | 13 | 12668 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'XForm.surveys_with_geopoints'
db.delete_column(u'odk_logger_xform', 'surveys_with_geopoint... | bsd-2-clause |
dturner-tw/pants | contrib/scrooge/tests/python/pants_test/contrib/scrooge/tasks/test_scrooge_gen.py | 5 | 4867 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from textw... | apache-2.0 |
belevtsoff/luigi | luigi/scheduler.py | 1 | 40532 | # -*- 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 |
tmpgit/intellij-community | python/lib/Lib/site-packages/django/utils/simplejson/encoder.py | 430 | 15620 | """Implementation of JSONEncoder
"""
import re
c_encode_basestring_ascii = None
c_make_encoder = None
ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]')
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')
HAS_UTF8 = re.compile(r'[\x80-\xff]')
ESCAPE_DCT = {
'\\': '\\\\',
'"': '\\"',
'\b': '\\b',
'\f': '\\f',
... | apache-2.0 |
zenodo/zenodo | zenodo/modules/github/__init__.py | 8 | 1057 | # -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2016 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 2 of the
# License, or (at your option) any later v... | gpl-2.0 |
tensorflow/agents | tf_agents/policies/async_policy_saver.py | 1 | 5880 | # coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
miquelmartos/geeksphone-kernel-zero-3.0 | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
anntzer/scikit-learn | sklearn/utils/multiclass.py | 11 | 16256 | # Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi
#
# License: BSD 3 clause
"""
Multi-class / multi-label utility function
==========================================
"""
from collections.abc import Sequence
from itertools import chain
import warnings
from scipy.sparse import issparse
from scipy.sparse.base import s... | bsd-3-clause |
jindongh/boto | boto/cloudsearch/__init__.py | 145 | 1731 | # Copyright (c) 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 without... | mit |
Eksmo/calibre | src/calibre/gui2/wizard/device_ui.py | 1 | 2709 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/gugu/w/calibre/src/calibre/gui2/wizard/device.ui'
#
# Created: Thu Jul 19 23:32:29 2012
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromU... | gpl-3.0 |
jnewland/home-assistant | tests/helpers/test_entity_component.py | 4 | 16190 | """The tests for the Entity component helper."""
# pylint: disable=protected-access
from collections import OrderedDict
import logging
from unittest.mock import patch, Mock
from datetime import timedelta
import asynctest
import pytest
import homeassistant.core as ha
from homeassistant.exceptions import PlatformNotRea... | apache-2.0 |
ahamilton55/ansible | lib/ansible/modules/network/iosxr/iosxr_command.py | 42 | 7299 | #!/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 |
saurabh6790/medsyn-app1 | hr/doctype/leave_allocation/leave_allocation.py | 30 | 5292 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint, flt
from webnotes import msgprint
class DocType:
def __init__(self, doc, doclist):
self.doc, se... | agpl-3.0 |
ajenkins-cargometrics/pyflow | pyflow/workflow_state.py | 1 | 3093 | import attr
@attr.s
class InvocationState(object):
"""
Encapsulates the state of an invocation, such as a lambda invocation, activity, timer, etc.
"""
NOT_STARTED = 0
HANDLED = 1
STARTED = 2
FAILED = 3
TIMED_OUT = 4
CANCELED = 5
SUCCEEDED = 6
DONE_STATES = (FAILED, TIMED_... | mit |
sunlianqiang/kbengine | kbe/src/lib/python/Lib/asyncio/unix_events.py | 61 | 31408 | """Selector event loop for Unix with signal handling."""
import errno
import fcntl
import os
import signal
import socket
import stat
import subprocess
import sys
import threading
from . import base_events
from . import base_subprocess
from . import constants
from . import events
from . import selector_events
from . ... | lgpl-3.0 |
moijes12/oh-mainline | vendor/packages/beautifulsoup4/scripts/demonstrate_parser_differences.py | 73 | 2976 | """Demonstrate how different parsers parse the same markup.
Beautiful Soup can use any of a number of different parsers. Every
parser should behave more or less the same on valid markup, and
Beautiful Soup's unit tests make sure this is the case. But every
parser handles invalid markup differently. Even different vers... | agpl-3.0 |
cloudbau/cinder | cinder/backup/driver.py | 3 | 1107 | # Copyright (C) 2013 Deutsche Telekom AG
# 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 r... | apache-2.0 |
ganeshnalawade/ansible-modules-core | cloud/openstack/os_server_actions.py | 14 | 7960 | #!/usr/bin/python
# coding: utf-8 -*-
# Copyright (c) 2015, Jesse Keating <jlk@derpops.bike>
#
# 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 opti... | gpl-3.0 |
franosincic/edx-platform | cms/djangoapps/contentstore/management/commands/export_all_courses.py | 70 | 2311 | """
Script for exporting all courseware from Mongo to a directory and listing the courses which failed to export
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.xml_exporter import export_course_to_xml
from xmodule.modulestore.django import modulestore
from xmodule.content... | agpl-3.0 |
Panos512/invenio | modules/bibcatalog/lib/bibcatalog_dblayer.py | 18 | 1848 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012 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 option) a... | gpl-2.0 |
davenovak/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/rules-rebuild/gyptest-default.py | 345 | 2242 | #!/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.
"""
Verifies that a rule that generates multiple outputs rebuilds
correctly when the inputs change.
"""
import TestGyp
test = TestGyp.Test... | gpl-3.0 |
ThinkOpen-Solutions/odoo | openerp/addons/base/tests/test_base.py | 127 | 33971 | import unittest2
import openerp.tests.common as common
from openerp.osv.orm import except_orm
class test_base(common.TransactionCase):
def setUp(self):
super(test_base,self).setUp()
self.res_partner = self.registry('res.partner')
self.res_users = self.registry('res.users')
self.re... | agpl-3.0 |
0111001101111010/hyde | hyde/tests/ext/test_requirejs.py | 1 | 1184 | # -*- coding: utf-8 -*-
"""
Use nose
`$ pip install nose`
`$ nosetests`
"""
from hyde.generator import Generator
from hyde.site import Site
from fswrap import File, Folder
RJS_SOURCE = File(__file__).parent.child_folder('requirejs')
TEST_SITE = File(__file__).parent.parent.child_folder('_test')
class TestRequireJS(o... | mit |
Sentient07/svgpng | svgpng/demo/views.py | 1 | 1741 | # Create your views here.
from django import forms
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
import math
import cairocffi as cairo
import io
from cairosvg import svg2png
WIDTH, HEIGHT = 256, 256
class TestForm(forms.Form):
pas... | mit |
AngelinaScheck/BachelorBioinfo | libsvm-master/python/svmutil.py | 64 | 8695 | #!/usr/bin/env python
import os
import sys
from svm import *
from svm import __all__ as svm_all
__all__ = ['evaluations', 'svm_load_model', 'svm_predict', 'svm_read_problem',
'svm_save_model', 'svm_train'] + svm_all
sys.path = [os.path.dirname(os.path.abspath(__file__))] + sys.path
def svm_read_problem(... | bsd-3-clause |
prasannav7/ggrc-core | src/ggrc/converters/query_helper.py | 3 | 10819 | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
import datetime
import collections
from sqlalchemy import and_
from sqlalchemy i... | apache-2.0 |
danirus/django-comments-xtd | django_comments_xtd/tests/test_models.py | 1 | 31353 | try:
from unittest.mock import patch
except ImportError:
from mock import patch
from datetime import datetime
from django.db.models.signals import pre_save
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.test import TestCase as DjangoTestCase
... | bsd-2-clause |
jonypx09/new_kernel_kylessopen | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
caio2k/kernel-n9 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
ramiro/scrapy | scrapy/commands/settings.py | 33 | 1511 | from __future__ import print_function
from scrapy.command import ScrapyCommand
class Command(ScrapyCommand):
requires_project = False
default_settings = {'LOG_ENABLED': False}
def syntax(self):
return "[options]"
def short_desc(self):
return "Get settings values"
def add_options... | bsd-3-clause |
Leoniela/nipype | nipype/interfaces/camino/tests/test_auto_LinRecon.py | 9 | 1320 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.camino.odf import LinRecon
def test_LinRecon_inputs():
input_map = dict(args=dict(argstr='%s',
),
bgmask=dict(argstr='-bgmask %s',
),
environ=dict(nohash=True,
usedefault=True,
... | bsd-3-clause |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Lib/multiprocessing/heap.py | 50 | 8582 | #
# Module which supports allocation of memory from an mmap
#
# multiprocessing/heap.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributi... | apache-2.0 |
jose36/jmdl2 | servers/facebook.py | 44 | 2955 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para videos externos de facebook
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import... | gpl-2.0 |
alsrgv/tensorflow | tensorflow/python/data/experimental/benchmarks/snapshot_dataset_benchmark.py | 2 | 4301 | # Copyright 2019 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 |
melodous/designate | designate/openstack/common/fixture/config.py | 69 | 3062 | #
# Copyright 2013 Mirantis, Inc.
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licen... | apache-2.0 |
opax/exist | bin/deprecated/query.py | 18 | 8079 | #!/usr/bin/python
# eXist xml document repository and xpath implementation
# Copyright (C) 2001, Wolfgang M. Meier (meier@ifs.tu-darmstadt.de)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public License
# as published by the Free Software Fou... | lgpl-2.1 |
alejo8591/cymetria-php | lab9/vendor/phpdocumentor/phpdocumentor/docs/.exts/plantuml.py | 31 | 3621 | # -*- coding: utf-8 -*-
"""
sphinxcontrib.plantuml
~~~~~~~~~~~~~~~~~~~~~~
Embed PlantUML diagrams on your documentation.
:copyright: Copyright 2010 by Yuya Nishihara <yuya@tcha.org>.
:license: BSD, see LICENSE for details.
"""
import os, subprocess
try:
from hashlib import sha1
except ImportEr... | mit |
nelango/ViralityAnalysis | model/lib/nltk/translate/ibm3.py | 3 | 13875 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: IBM Model 3
#
# Copyright (C) 2001-2013 NLTK Project
# Authors: Chin Yee Lee, Hengfeng Li, Ruxin Hou, Calvin Tanujaya Lim
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Translation model that considers how a word can be aligned to
multiple w... | mit |
arshesney/winelauncher | setup.py | 1 | 3808 | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.absp... | gpl-3.0 |
yvesalexandre/bandicoot | bandicoot/tests/testing_tools.py | 1 | 3237 | # The MIT License (MIT)
#
# Copyright (c) 2015-2016 Massachusetts Institute of Technology.
#
# 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 ... | mit |
jmztaylor/android_kernel_htc_m4 | scripts/gcc-wrapper.py | 74 | 3544 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, Code Aurora Forum. 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 a... | gpl-2.0 |
bendykst/deluge | deluge/configmanager.py | 3 | 3497 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import... | gpl-3.0 |
jaddison/ansible-modules-core | utilities/logic/wait_for.py | 82 | 18083 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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... | gpl-3.0 |
kennho/oppia | core/controllers/editor.py | 1 | 37827 | # coding: utf-8
# Copyright 2014 The Oppia 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 requir... | apache-2.0 |
alistairlow/tensorflow | tensorflow/contrib/slim/python/slim/nets/resnet_v2.py | 31 | 14548 | # 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 |
alirizakeles/zato | code/zato-web-admin/src/zato/admin/web/views/load_balancer.py | 1 | 11755 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2010 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
import json, logging
from traceback import format_exc
from xmlrpclib imp... | gpl-3.0 |
hapylestat/appcore | apputils/views.py | 1 | 4436 | # coding=utf-8
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# Copyright (c) 2018 Reishin <hapy.lestat@gmail.com>... | lgpl-3.0 |
caisq/tensorflow | tensorflow/python/eager/graph_callable.py | 2 | 17077 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
imron/scalyr-agent-2 | scripts/circleci/upload_circleci_artifacts.py | 1 | 13293 | #!/usr/bin/env python
# Copyright 2014-2020 Scalyr 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 ... | apache-2.0 |
barseghyanartur/django-security | conf.py | 5 | 6433 | # -*- coding: utf-8 -*-
#
# django-security documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 24 18:23:00 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | bsd-3-clause |
oneminot/xbmc | lib/gtest/test/gtest_xml_outfiles_test.py | 2526 | 5340 | #!/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 |
jwhui/openthread | tests/scripts/thread-cert/border_router/test_dnssd_server.py | 3 | 14851 | #!/usr/bin/env python3
#
# Copyright (c) 2021, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause |
timoschwarzer/blendworks | BlendWorks Server/python/Lib/encodings/mbcs.py | 860 | 1211 | """ Python 'mbcs' Codec for Windows
Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
which was written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
# Import them explicitly to cause an ImportError
# on non-Windows systems
from codecs import mbcs... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.