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 |
|---|---|---|---|---|---|
jshackley/darkstar | pydarkstar/pydarkstar/common.py | 1 | 3140 | import datetime
import logging
import shutil
import os
import re
def create_path(*args, **kwargs):
"""
Construct a path. You can access dt or datetime as objects.
:param args: path components passed to :py:func:`os.path.join`
:param absolute: make path absolute
:param dt: datetime object
:pa... | gpl-3.0 |
sharag/py_analis | razlad/for_stat.py | 1 | 7047 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.ticker import LinearLocator, FormatStrFormatter
from razlad.functions import f_probability, max_probabil
import pickle
# Формирвоание скачков
# Характеристики скачков
graph_len... | gpl-3.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-60/files/myenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py | 3121 | 45978 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | gpl-3.0 |
ctmcquilkin/cal-mgt | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | mit |
bladebo/1flow | oneflow/base/tests/test_models.py | 4 | 5695 | # -*- coding: utf-8 -*-
# pylint: disable=E1103,C0103
"""
Copyright 2012-2014 Olivier Cortès <oc@1flow.io>
This file is part of the 1flow project.
1flow is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Soft... | agpl-3.0 |
anbangisak/thikey_scrape | govgroup_scrape/fetchone/begin_scrape.py | 1 | 6393 | import time
# from os.path import abspath, dirname
from selenium import webdriver
from fetchone.models import GovDetail, DetailLink, ListinLink
# from selenium.webdriver.common.keys import Keys
# driver = webdriver.Firefox()
# chrome_driver_path = abspath(dirname(dirname(__file__))) + "/chromedriver"
class ScrapeIn... | apache-2.0 |
guschmue/tensorflow | tensorflow/contrib/gan/python/eval/python/summaries_impl.py | 22 | 5519 | # 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 |
dpetzold/django | tests/sites_tests/tests.py | 251 | 10760 | from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.contrib.sites import models
from django.contrib.sites.management import create_default_site
from django.contrib.sites.middleware import CurrentSiteMiddleware
from django.contrib.sites.models import Site, c... | bsd-3-clause |
MrNuggles/HeyBoet-Telegram-Bot | temboo/Library/Parse/Users/__init__.py | 5 | 1205 | from temboo.Library.Parse.Users.DeleteUser import DeleteUser, DeleteUserInputSet, DeleteUserResultSet, DeleteUserChoreographyExecution
from temboo.Library.Parse.Users.LinkExistingUser import LinkExistingUser, LinkExistingUserInputSet, LinkExistingUserResultSet, LinkExistingUserChoreographyExecution
from temboo.Library.... | gpl-3.0 |
irudayarajisawa/django-cms | cms/south_migrations/0059_auto__del_pagemoderatorstate.py | 63 | 17926 | # -*- 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):
# Deleting model 'PageModeratorState'
db.delete_table(u'cms_pagemoderator... | bsd-3-clause |
rfguri/vimfiles | bundle/ycm/third_party/ycmd/third_party/python-future/docs/3rd-party-py3k-compat-code/ipython_py3compat.py | 13 | 5293 | # coding: utf-8
"""Compatibility tricks for Python 3. Mainly to do with unicode."""
import __builtin__
import functools
import sys
import re
import types
from .encoding import DEFAULT_ENCODING
orig_open = open
def no_code(x, encoding=None):
return x
def decode(s, encoding=None):
encoding = encoding or DEFAU... | mit |
pantsbuild/pex | pex/vendor/_vendored/wheel/wheel/cli/convert.py | 10 | 9498 | import os.path
import re
import shutil
import sys
import tempfile
import zipfile
from distutils import dist
from glob import iglob
from ..bdist_wheel import bdist_wheel
from ..wheelfile import WheelFile
from . import WheelError, require_pkgresources
egg_info_re = re.compile(r'''
(?P<name>.+?)-(?P<ver>.+?)
(-(... | apache-2.0 |
shurihell/testasia | cms/djangoapps/contentstore/features/advanced_settings.py | 60 | 5054 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from nose.tools import assert_false, assert_equal, assert_regexp_matches
from common import type_in_codemirror, press_the_notification_button, get_codemirror_value
KEY_CSS = '.key h3.title'
DISPLAY_NAME_KEY = "C... | agpl-3.0 |
angela278/UPDream | lib/oauthlib/oauth1/rfc5849/endpoints/base.py | 49 | 10388 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth1.rfc5849.endpoints.base
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for signing and checking OAuth 1.0 RFC 5849 requests.
"""
from __future__ import absolute_import, unicode_literals
import time
from oauthlib.common import... | apache-2.0 |
emanuelmellblom/opendlv.scaledcars | thirdparty/cxxtest/build_tools/SCons/test/eprouvette.py | 51 | 6472 | #!/usr/bin/env python
# vim: fileencoding=utf-8
#-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v3
# For more information, see the COPYING file in ... | gpl-2.0 |
aniketshukla/flask | tests/test_views.py | 155 | 4202 | # -*- coding: utf-8 -*-
"""
tests.views
~~~~~~~~~~~
Pluggable views.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import flask
import flask.views
from werkzeug.http import parse_set_header
def common_test(app):
c = app.test_client()... | bsd-3-clause |
g8os/grid | pyclient/zeroos/orchestrator/client/BridgeCreateSetting.py | 2 | 2452 | """
Auto-generated class for BridgeCreateSetting
"""
from . import client_support
class BridgeCreateSetting(object):
"""
auto-generated. don't touch.
"""
@staticmethod
def create(cidr, end, start):
"""
:type cidr: str
:type end: str
:type start: str
:rtype... | apache-2.0 |
rth/PyKrige | pykrige/__init__.py | 1 | 2155 | __author__ = 'Benjamin S. Murphy'
__version__ = '1.4.0'
__doc__ = """
PyKrige
=======
Code by Benjamin S. Murphy and the PyKrige Developers
bscott.murphy@gmail.com
Summary
-------
Kriging toolkit for Python.
ok: Contains class OrdinaryKriging, which is a convenience class for easy
access to 2D ordi... | bsd-3-clause |
pio-masaki/at100-kernel | 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 |
lyft/incubator-airflow | airflow/providers/google/cloud/hooks/bigtable.py | 4 | 11499 | #
# 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... | apache-2.0 |
admire93/youtube-dl | youtube_dl/extractor/pladform.py | 103 | 3156 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
xpath_text,
qualities,
)
class PladformIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://
(?:
... | unlicense |
40223225/40223225-cdb-0622 | static/Brython3.1.1-20150328-091302/Lib/fnmatch.py | 894 | 3163 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... | gpl-3.0 |
haoyuchen1992/osf.io | scripts/dataverse/migrate_user_settings_field.py | 44 | 1267 | """
First run the following in a mongo shell:
db.getCollection('addondataversenodesettings').update({'user_settings': {'$type': 2}}, {$rename: { user_settings: 'foreign_user_settings'}}, {multi: true})
Then change the user_settings field of AddonDataverseNodeSettings to foreign_user_settings
"""
import sys
impor... | apache-2.0 |
stinos/micropython | tests/thread/stress_aes.py | 8 | 8869 | # Stress test for threads using AES encryption routines.
#
# AES was chosen because it is integer based and inplace so doesn't use the
# heap. It is therefore a good test of raw performance and correctness of the
# VM/runtime. It can be used to measure threading performance (concurrency is
# in principle possible) an... | mit |
marcosleonefilho/hoop-tastypie | tests/testcases.py | 13 | 3034 | import socket
import threading
from django.core.handlers.wsgi import WSGIHandler
from django.core.servers import basehttp
from django.test.testcases import TransactionTestCase
from django.core.management import call_command
class StoppableWSGIServer(basehttp.WSGIServer):
"""WSGIServer with short timeout, so that ... | bsd-3-clause |
uwafsl/MissionPlanner | Lib/distutils/command/bdist_rpm.py | 53 | 20983 | """distutils.command.bdist_rpm
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""
__revision__ = "$Id$"
import sys
import os
import string
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.file_util import write_file
from dis... | gpl-3.0 |
alkadis/vcv | src/adhocracy/migration/versions/021_user_settings.py | 4 | 1369 | from datetime import datetime
from pprint import pprint
from sqlalchemy import *
from migrate import *
import migrate.changeset
meta = MetaData()
def upgrade(migrate_engine):
meta.bind = migrate_engine
user_table = Table('user', meta,
Column('id', Integer, primary_key=True),
Column('user_nam... | agpl-3.0 |
rlanyi/mitro | browser-ext/login/makejsresource.py | 26 | 1921 | #!/usr/bin/env python
# *****************************************************************************
# Copyright (c) 2012, 2013, 2014 Lectorius, Inc.
# Authors:
# Vijay Pandurangan (vijayp@mitro.co)
# Evan Jones (ej@mitro.co)
# Adam Hilss (ahilss@mitro.co)
#
#
# This program is free software: you can redistribute... | gpl-3.0 |
aalmah/pylearn2 | pylearn2/devtools/tests/docscrape.py | 44 | 25668 | """Extract reference documentation from the NumPy source tree.
"""
from __future__ import print_function
import inspect
from nose.plugins.skip import SkipTest
import re
import sys
from theano.compat import six
class Reader(object):
"""A line-based string reader.
"""
def __init__(self, data):
... | bsd-3-clause |
markeTIC/OCB | addons/account/project/report/quantity_cost_ledger.py | 358 | 6204 | # -*- 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 |
jinghaomiao/apollo | modules/tools/record_parse_save/record_parse_save.py | 2 | 4478 | #!/usr/bin/env python3
###############################################################################
# Copyright 2018 The Apollo 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... | apache-2.0 |
leebird/bionlp17 | src/compute_scores.py | 1 | 7459 | from __future__ import print_function, division
import pickle
import sys
import os
# Compute precision, recall, F-score and specificity.
folder = 'eval/pr_points'
# Used by Table 5 and Fig. 2.
expriments = {
# Results in Table 5.
'basic': [
('baseline', '{}.pk'),
('DPFreq', '{}_mindepfreq_5.... | mit |
lkmmmj/MongooseIM | tools/zabbix_add_counters.py | 29 | 2459 | #!/usr/bin/env python
'''
Created on 2011-08-12
@author: radoslaw.szymczyszyn@erlang-solutions.com
'''
import os, re, sys, traceback
from zabbix_api import ZabbixAPI, ZabbixAPIException
# options
server = "http://127.0.0.1/zabbix"
username = "admin"
password = "zabbix"
hostname = "Zabbix Server"... | gpl-2.0 |
supertom/ansible | contrib/inventory/apache-libcloud.py | 151 | 11756 | #!/usr/bin/env python
# (c) 2013, Sebastien Goasguen <runseb@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 ... | gpl-3.0 |
waterponey/scikit-learn | doc/sphinxext/sphinx_gallery/downloads.py | 14 | 3334 | # -*- coding: utf-8 -*-
r"""
Utilities for downloadable items
================================
"""
# Author: Óscar Nájera
# License: 3-clause BSD
from __future__ import absolute_import, division, print_function
import os
import zipfile
CODE_DOWNLOAD = """
\n.. container:: sphx-glr-download
:download:`Download ... | bsd-3-clause |
eerohele/sublime-lxml | st3_windows_x64/lxml/html/builder.py | 149 | 4310 | # --------------------------------------------------------------------
# The ElementTree toolkit is
# Copyright (c) 1999-2004 by Fredrik Lundh
# --------------------------------------------------------------------
"""
A set of HTML generator tags for building HTML documents.
Usage::
>>> from lxml.html.builder im... | mit |
zhongzw/skia-sdl | third_party/externals/poppler/regtest/TestReferences.py | 2 | 2913 | # TestReferences.py
#
# Copyright (C) 2011 Carlos Garcia Campos <carlosgc@gnome.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; either version 2 of the License, or
# (at your option) any ... | bsd-3-clause |
baliame/http-hmac-python | httphmac/v1.py | 1 | 4735 | from .base_signer import BaseSigner
import base64
import hashlib
import hmac
import re
class V1Signer(BaseSigner):
def __init__(self, digest):
"""Initializes a V1Signer object.
Keyword arguments:
digest -- A callable which, when called, returns a hasher object.
For example (a... | mit |
jswope00/griffinx | common/lib/xmodule/xmodule/modulestore/django.py | 7 | 6889 | """
Module that provides a connection to the ModuleStore specified in the django settings.
Passes settings.MODULESTORE as kwargs to MongoModuleStore
"""
from __future__ import absolute_import
from importlib import import_module
from django.conf import settings
if not settings.configured:
settings.configure()
fro... | agpl-3.0 |
mtp1376/youtube-dl | youtube_dl/extractor/youjizz.py | 148 | 2297 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
)
class YouJizzIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?youjizz\.com/videos/[^/#?]+-(?P<id>[0-9]+)\.html(?:$|[?#])'
_TEST = {
'url': 'http://www.youjizz.com/video... | unlicense |
emsrc/daeso-dutch | test/bin/test_scripts.py | 1 | 1144 | """
test Daeso Dutch command line scripts
"""
# If tests fail, make sure to manually kill server processes!
# Assumes that all executables are in PATH
import pprint
import socket
import subprocess
import time
import unittest
import xmlrpclib
class Test_graph_align_server(unittest.TestCase):
def setUp(self):... | gpl-3.0 |
DataDog/python-github3 | pygithub3/core/errors.py | 7 | 1159 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from pygithub3.core import json
from pygithub3.exceptions import NotFound, BadRequest, UnprocessableEntity
class GithubError(object):
""" Handler for API errors """
def __init__(self, response):
self.response = response
self.status_code = respo... | isc |
snnn/tensorflow | tensorflow/contrib/distributions/python/ops/mvn_diag.py | 22 | 8846 | # 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 |
Drahflow/lymph | lymph/exceptions.py | 3 | 1254 | import six
class RpcError(Exception):
def __repr__(self):
return '<%s: %s>' % (self.__class__.__name__, self)
class RpcRequestError(RpcError):
def __init__(self, request, *args, **kwargs):
self.request = request
super(RpcError, self).__init__(*args, **kwargs)
class Timeout(RpcReque... | apache-2.0 |
chenjun0210/tensorflow | tensorflow/python/kernel_tests/sparse_conditional_accumulator_test.py | 132 | 22955 | # 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 |
TorrenTV/TorrenTV | dist/mac/yoursway-create-dmg/support/dmg-license.py | 84 | 5300 | #! /usr/bin/env python
"""
This script adds a license file to a DMG. Requires Xcode and a plain ascii text
license file.
Obviously only runs on a Mac.
Copyright (C) 2011 Jared Hobbs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "S... | gpl-3.0 |
Akasurde/ansible | test/support/integration/plugins/modules/timezone.py | 30 | 36506 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Shinichi TAMURA (@tmshn)
# 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 |
akvo/akvo-rsr | akvo/iati/checks/fields/legacy_data.py | 1 | 1025 | # -*- coding: utf-8 -*-
# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
def legacy_data(project):
"""
... | agpl-3.0 |
nathaliaspatricio/febracev | photologue/views.py | 1 | 4446 | from django.conf import settings
from django.shortcuts import get_object_or_404, render_to_response
from django.http import Http404, HttpResponseRedirect
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.db impor... | gpl-2.0 |
Turbo87/skylines | skylines/model/geo.py | 3 | 4088 | # -*- coding: utf-8 -*-
from sqlalchemy import func
from sqlalchemy.sql.expression import cast
from geoalchemy2.elements import WKTElement
from geoalchemy2.types import Geometry, Geography
from geoalchemy2.shape import to_shape
from skylines.database import db
from skylines.lib.geo import geographic_distance
class ... | agpl-3.0 |
rismalrv/edx-platform | lms/djangoapps/lms_migration/management/commands/manage_course_groups.py | 250 | 2091 | #!/usr/bin/python
#
# File: manage_course_groups
#
# interactively list and edit membership in course staff and instructor groups
import re
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User, Group
#-----------------------------------------------------------------------... | agpl-3.0 |
phalt/django | tests/defer_regress/tests.py | 36 | 11634 | from __future__ import unicode_literals
from operator import attrgetter
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.backends.db import SessionStore
from django.db import models
from django.db.models import Count
from django.test import TestCase, override_settings
from .mod... | bsd-3-clause |
p01arst0rm/decorum-linux | _resources/kernels/xnu-x86/tools/lldbmacros/plugins/speedtracer.py | 2 | 1900 | import json, urllib, urllib2
from urllib2 import Request, urlopen, HTTPError
kern_version = None
def plugin_init(kernel_target, config, lldb_obj, isConnected):
""" initialize the common data as required by plugin """
global kern_version
kern_version = str(kernel_target.version)
def plugin_execute(command_... | gpl-3.0 |
consulo/consulo-mercurial | src/test/resources/bin/mercurial/changelog.py | 91 | 12028 | # changelog.py - changelog class for mercurial
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from node import bin, hex, nullid
from i18n import _
import util, error, revlog,... | apache-2.0 |
LoHChina/nova | nova/scheduler/filters/isolated_hosts_filter.py | 60 | 3357 | # Copyright (c) 2011-2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | apache-2.0 |
shacker/django | tests/view_tests/generic_urls.py | 72 | 1313 | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.views.generic import RedirectView
from . import views
from .models import Article, DateArticle
date_based_info_dict = {
'queryset': Article.objects.all(),
'date_field': 'date_created',
'month_format': '%m',
}
... | bsd-3-clause |
SouthForkResearch/CHaMP_Metrics | test/topometrics/run_single_visit.py | 1 | 1579 | import os
import argparse
import sys
from lib.channelunits import createChannelUnitJSONFile
from tools.topometrics.topometrics import visitTopoMetrics
def runSingleVisit(visitID, visitFolder, visitOutputFolder, workbenchDB, bVerbose):
xmlFile = os.path.join(visitOutputFolder, "topometrics.xml")
logFile = os.p... | gpl-3.0 |
Peetz0r/micropython-esp32 | tests/wipy/uart.py | 6 | 3950 | '''
UART test for the CC3200 based boards.
UART0 and UART1 must be connected together for this test to pass.
'''
from machine import UART
from machine import Pin
import os
import time
mch = os.uname().machine
if 'LaunchPad' in mch:
uart_id_range = range(0, 2)
uart_pins = [[('GP12', 'GP13'), ('GP12', 'GP13', ... | mit |
sinkuri256/python-for-android | python3-alpha/python3-src/Lib/test/test_codecencodings_cn.py | 55 | 3144 | #!/usr/bin/env python3
#
# test_codecencodings_cn.py
# Codec encoding tests for PRC encodings.
#
from test import support
from test import test_multibytecodec_support
import unittest
class Test_GB2312(test_multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'gb2312'
tstring = test_multibytecodec... | apache-2.0 |
carrillo/scikit-learn | sklearn/datasets/base.py | 196 | 18554 | """
Base IO code for all datasets
"""
# Copyright (c) 2007 David Cournapeau <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
import os
import csv
import shutil
from os import environ
from os.pa... | bsd-3-clause |
MakeHer/edx-platform | lms/djangoapps/certificates/migrations/0001_initial.py | 33 | 12581 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import certificates.models
import model_utils.fields
import xmodule_django.models
import django_extensions.db.fields
import django_extensions.db.fields.json
import django.db.models.deletion
import django.utils.time... | agpl-3.0 |
edfungus/Crouton-Python-Example | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/request.py | 853 | 5751 | try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.... | mit |
yidongxiainl/lammps | tools/i-pi/ipi/utils/io/io_xml.py | 33 | 15954 | """Contains the functions used to read the input file and print the checkpoint
files with xml formatting.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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 Fou... | gpl-2.0 |
praekelt/django-mobiclicks | mobiclicks/middleware.py | 1 | 1762 | import urllib
import urlparse
from django.http import HttpResponseRedirect
from mobiclicks import conf
from mobiclicks.tasks import confirm_click
class MobiClicksMiddleware(object):
'''
If a request is redirected from MobiClicks,
stores the acquisition code in the session
so that conversions can be ... | bsd-3-clause |
chrishas35/django-travis-ci | django/utils/ipv6.py | 99 | 7871 | # This code was mostly based on ipaddr-py
# Copyright 2007 Google Inc. http://code.google.com/p/ipaddr-py/
# Licensed under the Apache License, Version 2.0 (the "License").
from django.core.exceptions import ValidationError
def clean_ipv6_address(ip_str, unpack_ipv4=False,
error_message="This is not a valid IP... | bsd-3-clause |
defionscode/ansible | lib/ansible/modules/packaging/os/rhsm_repository.py | 22 | 7912 | #!/usr/bin/python
# Copyright: (c) 2017, Giovanni Sciortino (@giovannisciortino)
# 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 |
maruen/yowsup.jlguardi | yowsup/layers/protocol_profiles/protocolentities/iq_picture_get_result.py | 64 | 1766 | from .iq_picture import PictureIqProtocolEntity
from yowsup.structs import ProtocolTreeNode
class ResultGetPictureIqProtocolEntity(PictureIqProtocolEntity):
'''
<iq type="result" from="{{jid}}" id="{{id}}">
<picture type="image | preview" id="{{another_id}}">
{{Binary bytes of the picture.}}
... | gpl-3.0 |
nheijmans/random_scripts | yaps/plugins/find_exe.py | 1 | 2731 | #!/usr/bin/python
# Copyright (c) 2018 nheijmans
#
# 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, ... | gpl-3.0 |
landscapeio/pylint-django | pylint_django/tests/input/func_noerror_form_fields.py | 1 | 2425 | """
Checks that Pylint does not complain about various
methods on Django form forms.
"""
# pylint: disable=missing-docstring,R0904
from __future__ import print_function
from datetime import datetime, date
from django import forms
from django.contrib.auth.forms import UserCreationForm
class ManyFieldsForm(forms.Form)... | gpl-2.0 |
manaschaturvedi/oscarbuddy | html5lib-python-master/html5lib/tests/test_whitespace_filter.py | 453 | 5642 | from __future__ import absolute_import, division, unicode_literals
import unittest
from html5lib.filters.whitespace import Filter
from html5lib.constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
try:
unittest.TestCase.assertEqual
except AttributeError:
unittest.TestCase.assertEqual =... | mit |
bgxavier/nova | nova/tests/unit/image/fake.py | 22 | 9432 | # Copyright 2011 Justin Santa Barbara
# Copyright 2012 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/l... | apache-2.0 |
OpenDA-Association/OpenDA | course/exercise_black_box_enkf_polution/original_model/reactive_pollution_model.py | 4 | 21917 | #!/usr/bin/env python3
'''A one dimensional reactive pollution model. '''
from __future__ import print_function
import csv
import sys
import math
import string
import argparse
import logging
import os.path
import yaml
DEFAULT_INPUT = {
'reaction_time': [3.0], # reaction time (inverse of rate) in seconds
... | lgpl-3.0 |
plast-lab/llvm-datalog | src/main/cclyzer/analysis.py | 2 | 9324 | import logging
import os
import pickle
from .project import Project, ProjectManager
from .analysis_stats import AnalysisStatisticsBuilder as StatBuilder
from .analysis_steps import (_CleaningStep, _FactGenerationStep, _DatabaseCreationStep,
_SanityCheckStep, _UserOptionsStep, _LoadProjectSt... | mit |
gfelbing/cppstyle | cppstyle/utils.py | 1 | 1389 | def args():
import argparse as arg
parser = arg.ArgumentParser(description="Check the style of your C/C++ code.")
parser.add_argument("--config", default=".cppstyle")
parser.add_argument("-i", dest="files", default=[], action="append")
return parser.parse_args()
def config(file):
import yaml a... | gpl-3.0 |
gw0/myhdl | example/cookbook/stopwatch/TimeCount.py | 6 | 1628 | from myhdl import *
def TimeCount(tens, ones, tenths, startstop, reset, clock):
""" 3 digit time counter in seconds and tenths of a second.
tens: most significant digit of the seconds
ones: least significant digit of the seconds
tenths: tenths of a second
startstop: input that starts or stops the... | lgpl-2.1 |
gammalib/gammalib | inst/cta/test/dev/example_sim_photons.py | 1 | 4984 | #! /usr/bin/env python
# ==========================================================================
# This script illustrates how the GammaLib photon simulator works.
#
# Based on the MAGIC spectrum of the Crab nebula, and by assuming a powerlaw,
# it will create a Monte Carlo sample of photons.
#
# If matplotlib is in... | gpl-3.0 |
nanolearningllc/edx-platform-cypress-2 | lms/lib/courseware_search/test/test_lms_filter_generator.py | 53 | 15971 | """
Tests for the lms_filter_generator
"""
from mock import patch, Mock
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from student.tests.factories import UserFactory
fr... | agpl-3.0 |
eugena/django | django/contrib/admin/bin/compress.py | 266 | 2282 | #!/usr/bin/env python
import argparse
import os
import subprocess
import sys
try:
import closure
except ImportError:
closure_compiler = None
else:
closure_compiler = os.path.join(os.path.dirname(closure.__file__), 'closure.jar')
js_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'static', ... | bsd-3-clause |
johnnyLadders/Nathive_CITA | utils/docgen/docmethod.py | 1 | 1646 | #!/usr/bin/env python
#coding=utf-8
# Nathive (and this file) 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 newer.
#
# You should have received a copy of the GNU General ... | gpl-3.0 |
EpicCM/SPH-D700-Kernel | 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 |
Michagogo/bitcoin | qa/rpc-tests/walletbackup.py | 85 | 7304 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Exercise the wallet backup code. Ported from walletbackup.sh.
Test case is:
4 nodes. 1 2 and 3 send... | mit |
atsaki/ansible | test/units/parsing/vault/test_vault.py | 60 | 5974 | # (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 |
asiersarasua/QGIS | tests/src/python/test_qgsimagecache.py | 7 | 4180 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsImageCache.
.. note:: 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) any later version.
"""
__a... | gpl-2.0 |
Eric-Zhong/odoo | addons/email_template/tests/__init__.py | 260 | 1093 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY 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 |
odoousers2014/odoo_addons-2 | clv_frame/seq/clv_frame_category_seq.py | 2 | 3783 | # -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | agpl-3.0 |
ritchyteam/odoo | addons/hr_timesheet_invoice/report/report_analytic.py | 299 | 5164 | # -*- 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 |
devs1991/test_edx_docmode | common/djangoapps/util/tests/test_request.py | 35 | 3500 | """Tests for util.request module."""
import unittest
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.test.client import RequestFactory
from util.request import course_id_from_url, safe_get_host
class ResponseTestCase(unittest.TestCase):
""" Tests for response-... | agpl-3.0 |
robinandeer/MultiQC | multiqc/modules/theta2/theta2.py | 1 | 3814 | #!/usr/bin/env python
""" MultiQC module to parse output from THetA2 """
from __future__ import print_function
from collections import OrderedDict
import logging
import os
import re
from multiqc import config
from multiqc.plots import bargraph
from multiqc.modules.base_module import BaseMultiqcModule
# Initialise t... | gpl-3.0 |
weblabdeusto/weblabdeusto | server/src/weblab/experiment/devices/gpib/exc.py | 3 | 1822 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... | bsd-2-clause |
tvalacarta/tvalacarta | python/main-classic/lib/youtube_dl/extractor/ntvcojp.py | 16 | 1939 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
js_to_json,
smuggle_url,
)
class NTVCoJpCUIE(InfoExtractor):
IE_NAME = 'cu.ntv.co.jp'
IE_DESC = 'Nippon Television Network'
_VALID_URL = r'https?://cu\.ntv\.co\.jp/(?!program)(?P<id>[^/... | gpl-3.0 |
snehasi/servo | tests/wpt/css-tests/tools/html5lib/html5lib/trie/py.py | 817 | 1763 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError("All keys m... | mpl-2.0 |
vitorespindola/home-assistant | homeassistant/components/script.py | 4 | 5044 | """
homeassistant.components.script
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Scripts are a sequence of actions that can be triggered manually
by the user or automatically based upon automation events, etc.
"""
import logging
from datetime import timedelta
import homeassistant.util.dt as date_util
import threading
from homeas... | mit |
timvandermeij/mobile-radio-tomography | control/Infrared_Sensor.py | 3 | 5407 | # Core imports
import os
import shutil
import sys
import thread
import time
# Library imports
import pylirc
# Package imports
from ..core.Threadable import Threadable
from ..settings import Arguments
class Infrared_Sensor(Threadable):
def __init__(self, arguments, thread_manager):
"""
Initialize ... | gpl-3.0 |
o5k/openerp-oemedical-v0.1 | openerp/addons/web/doc/_themes/flask_theme_support.py | 2228 | 4875 | # flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
class FlaskyStyle(Style):
background_color = "#f8f8f8"
default_style = "... | agpl-3.0 |
hkawasaki/kawasaki-aio8-0 | common/djangoapps/edxmako/paths.py | 40 | 1803 | """
Set up lookup paths for mako templates.
"""
import os
import pkg_resources
from django.conf import settings
from mako.lookup import TemplateLookup
from . import LOOKUP
class DynamicTemplateLookup(TemplateLookup):
"""
A specialization of the standard mako `TemplateLookup` class which allows
for addin... | agpl-3.0 |
kuiwei/edx-platform | lms/djangoapps/shoppingcart/processors/tests/test_CyberSource.py | 159 | 13163 | """
Tests for the CyberSource processor handler
"""
from collections import OrderedDict
from django.test import TestCase
from django.test.utils import override_settings
from django.conf import settings
from student.tests.factories import UserFactory
from shoppingcart.models import Order, OrderItem
from shoppingcart.pro... | agpl-3.0 |
demon-ru/iml-crm | addons/portal_project/project.py | 103 | 1769 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-TODAY OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
alvarolopez/atrope | atrope/exception.py | 1 | 3557 | # -*- coding: utf-8 -*-
# Copyright 2014 Alvaro Lopez Garcia
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
popazerty/SDG-gui | lib/python/Tools/Notifications.py | 46 | 1588 |
notifications = [ ]
notificationAdded = [ ]
# notifications which are currently on screen (and might be closed by similiar notifications)
current_notifications = [ ]
def __AddNotification(fnc, screen, id, *args, **kwargs):
if ".MessageBox'>" in `screen`:
kwargs["simple"] = True
notifications.append((fnc, screen... | gpl-2.0 |
robinro/ansible-modules-core | windows/win_stat.py | 8 | 1725 | #!/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 distributed... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.