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 |
|---|---|---|---|---|---|
vvc/mtasa-blue | vendor/google-breakpad/src/testing/test/gmock_output_test.py | 986 | 5999 | #!/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-3.0 |
koradiavatsal/Viper-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 |
zadgroup/edx-platform | common/lib/xmodule/xmodule/tests/test_annotatable_module.py | 172 | 5909 | """Module annotatable tests"""
import unittest
from lxml import etree
from mock import Mock
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.annotatable_module import AnnotatableModule
from opaque_keys.edx.locations import Location
from . import get_test_system
class Ann... | agpl-3.0 |
tunneln/CarnotKE | jyhton/lib-python/2.7/plat-mac/macerrors.py | 40 | 116661 | # -coding=latin1-
from warnings import warnpy3k
warnpy3k("In 3.x, the macerrors module is removed.", stacklevel=2)
svTempDisable = -32768 #svTempDisable
svDisabled = -32640 #Reserve range -32640 to -32768 for Apple temp disables.
fontNotOutlineErr = -32615 #bitmap font passed to routine that does outlin... | apache-2.0 |
brijeshkesariya/odoo | addons/google_spreadsheet/__openerp__.py | 312 | 1710 | # -*- 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 |
igueths/ansible-modules-extras | windows/win_unzip.py | 98 | 3637 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Phil Schwartz <schwartzmx@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 ... | gpl-3.0 |
stormi/tsunami | src/primaires/interpreteur/file.py | 1 | 7674 | # -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# 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
# lis... | bsd-3-clause |
maximus009/kaggle-galaxies | try_convnet_cc_multirotflip_3x69r45_8433n_maxout2048.py | 7 | 17257 | import numpy as np
# import pandas as pd
import theano
import theano.tensor as T
import layers
import cc_layers
import custom
import load_data
import realtime_augmentation as ra
import time
import csv
import os
import cPickle as pickle
from datetime import datetime, timedelta
# import matplotlib.pyplot as plt
# plt.i... | bsd-3-clause |
malaterre/ITK | Modules/ThirdParty/pygccxml/src/pygccxml/parser/directory_cache.py | 13 | 18950 | # Copyright 2014-2017 Insight Software Consortium.
# Copyright 2004-2009 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
#
# The initial version of the directory_cache_t class was written
# by Matthias Baas (baas@ira.uka.de).
"""
directory cache ... | apache-2.0 |
luo-chengwei/utilitomics | WGS/bamConverter.py | 1 | 1877 | #!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'Chengwei Luo (cluo@broadinstitute.org)'
__version__ = '0.1.0'
__date__ = 'Oct 2013'
"""
getAllReads takes a mapping BAM file and tranform it into *.PE.fa
for usage, type:
python getAllReads.py --help
"""
USAGE = \
"""
getAllReads takes a mapping BAM file and t... | gpl-3.0 |
TeachAtTUM/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/django_utils.py | 16 | 19242 | # encoding: utf-8
"""
Modulestore configuration for test cases.
"""
import copy
import functools
import os
from contextlib import contextmanager
from enum import Enum
from courseware.field_overrides import OverrideFieldData # pylint: disable=import-error
from courseware.tests.factories import StaffFactory
from django... | agpl-3.0 |
xuzhuoyi/PiBox | PiBox/PiHome/PiApp/forms.py | 4 | 3638 | #coding=utf-8
'''
# The modules contains PiApp's forms
# Any issues or improvements please contact jacob-chen@iotwrt.com
'''
#/usr/bin/python
#coding: utf8
from django import forms
from models import *
class PiSettingsForm(forms.ModelForm):
class Meta:
model = PiSettings
fields = ('ip',... | gpl-2.0 |
lababidi/tweepy-streamer | geostream.py | 2 | 3623 | #!/usr/bin/python
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler, Stream
import datetime, os, errno, argparse, json, geohash
from collections import Counter
#grab twitter auth tokens from external file
from tw_tokens import tokens
from dateutil import parser
def unix_time(dt):
epoch = ... | gpl-2.0 |
prashantv/thrift | test/py.tornado/test_suite.py | 50 | 6279 | #!/usr/bin/env python
#
# 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
# "L... | apache-2.0 |
0xwindows/InfoLeak | libmproxy/proxy/config.py | 15 | 7969 | from __future__ import (absolute_import, print_function, division)
import collections
import os
import re
from OpenSSL import SSL
from netlib import certutils, tcp
from netlib.http import authentication
from netlib.tcp import Address, sslversion_choices
from .. import utils, platform
CONF_BASENAME = "mitmproxy"
CA_D... | mit |
rlugojr/rekall | rekall-core/rekall/plugins/linux/proc_maps.py | 1 | 5933 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# 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 v... | gpl-2.0 |
thecubic/synergy-foss | tools/gtest-1.6.0/test/gtest_xml_output_unittest.py | 397 | 11279 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-2.0 |
netscaler/horizon | horizon/test/tests/selenium.py | 31 | 1182 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | apache-2.0 |
nbcesar/sabergrade | lib/python2.7/site-packages/werkzeug/testsuite/http.py | 89 | 18911 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.http
~~~~~~~~~~~~~~~~~~~~~~~
HTTP parsing utilities.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from datetime import datetime
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.... | apache-2.0 |
TrainerProjectF13X/trainer_web_app | users/migrations/0001_initial.py | 1 | 3591 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-25 23:15
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... | mit |
dgies/incubator-airflow | tests/dags/test_no_impersonation.py | 45 | 1139 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
ramitsurana/boto | tests/integration/iam/__init__.py | 148 | 1098 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, m... | mit |
sigmavirus24/glance | glance/cmd/cache_prefetcher.py | 18 | 1830 | #!/usr/bin/env python
# Copyright 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/LI... | apache-2.0 |
davidjonas/alice_python | en/parser/nltk_lite/parse/featurechart.py | 9 | 13135 | # Natural Language Toolkit: Chart Parser for Feature-Based Grammars
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Rob Speer <rspeer@mit.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: featurechart.py 3587 2006-10-20 06:13:32Z ehk $
"""
Extension of chart parsing ... | gpl-3.0 |
mtconley/turntable | test/lib/python2.7/site-packages/scipy/io/mmio.py | 9 | 22016 | """
Matrix Market I/O in Python.
"""
#
# Author: Pearu Peterson <pearu@cens.ioc.ee>
# Created: October, 2004
#
# References:
# http://math.nist.gov/MatrixMarket/
#
from __future__ import division, print_function, absolute_import
import os
import sys
from numpy import asarray, real, imag, conj, zeros, ndarray, conc... | mit |
ivan-fedorov/intellij-community | python/helpers/coverage/misc.py | 160 | 4376 | """Miscellaneous stuff for Coverage."""
import errno
import inspect
import os
import sys
from coverage.backward import md5, sorted # pylint: disable=W0622
from coverage.backward import string_class, to_bytes
def nice_pair(pair):
"""Make a nice string representation of a pair of numbers.
If the number... | apache-2.0 |
tseaver/gcloud-python | vision/google/cloud/vision_v1p3beta1/proto/product_search_pb2.py | 3 | 22066 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/vision_v1p3beta1/proto/product_search.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descripto... | apache-2.0 |
sivel/ansible | test/units/parsing/yaml/test_dumper.py | 10 | 4650 | # coding: utf-8
# 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 i... | gpl-3.0 |
johankaito/fufuka | microblog/flask/venv/lib/python2.7/site-packages/kombu/pidbox.py | 23 | 12704 | """
kombu.pidbox
===============
Generic process mailbox.
"""
from __future__ import absolute_import
import socket
import warnings
from collections import defaultdict, deque
from copy import copy
from itertools import count
from threading import local
from time import time
from . import Exchange, Queue, Consumer, ... | apache-2.0 |
stanley-cheung/grpc | examples/python/interceptors/headers/greeter_server.py | 13 | 1547 | # Copyright 2017 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 |
tejasnikumbh/AllSAT | lib/python2.7/site-packages/numpy/random/__init__.py | 124 | 5460 | """
========================
Random Number Generation
========================
==================== =========================================================
Utility functions
==============================================================================
random Uniformly distributed values of a given sha... | mit |
UltrasoundSam/metaArray | metaArray/drv_flex.py | 1 | 51731 | # drv_flex.py
#
# Copyright 2009 charley <y.fan@warwick.ac.uk>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at you... | gpl-2.0 |
dhruvsrivastava/OJ | flask/lib/python2.7/site-packages/sqlalchemy/event/legacy.py | 60 | 5814 | # event/legacy.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Routines to handle adaption of legacy call signatures,
generation of deprecation ... | bsd-3-clause |
atopuzov/nitro-python | nssrc/com/citrix/netscaler/nitro/resource/config/vpn/vpnglobal_auditsyslogpolicy_binding.py | 3 | 8532 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | apache-2.0 |
wshallum/ansible | lib/ansible/modules/system/at.py | 48 | 6616 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2014, Richard Isaacson <richard.c.isaacson@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 versi... | gpl-3.0 |
Agent007/deepchem | deepchem/models/tensorgraph/optimizers.py | 2 | 7009 | """Optimizers and related classes for use with TensorGraph."""
import tensorflow as tf
class Optimizer(object):
"""An algorithm for optimizing a TensorGraph based model.
This is an abstract class. Subclasses represent specific optimization algorithms.
"""
def _create_optimizer(self, global_step):
"""C... | mit |
abacuspix/NFV_project | Mastering Flask_Code Bundle/chapter_9/webapp/forms.py | 6 | 2219 | from flask_wtf import Form, RecaptchaField
from wtforms import StringField, TextAreaField, PasswordField, BooleanField
from wtforms.validators import DataRequired, Length, EqualTo, URL
from webapp.models import User
class CommentForm(Form):
name = StringField(
'Name',
validators=[DataRequired(), ... | mit |
iDTLabssl/hr | __unported__/hr_job_hierarchy/hr.py | 27 | 8232 | # -*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program 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 Software Foundation, eit... | agpl-3.0 |
fclairamb/iso8583py | setup.py | 1 | 2541 | #!/usr/bin/env python
from distutils.core import setup
setup(name='ISO8583-Module',
version='1.4',
description='ISO8583 LIBRARY',
author='Igor V. Custodio',
author_email='igorvc@vulcanno.com.br',
url='http://www.vulcanno.com.br/python',
download_url='http://code.google.com/p/iso8583py/downloads/list',
p... | gpl-3.0 |
BeyondTheClouds/nova | nova/volume/__init__.py | 9 | 1218 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
thalamus/Flexget | flexget/plugins/operate/sequence.py | 24 | 1733 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('sequence')
class PluginSequence(object):
""" Allows the same plugin to be configured multiple times in a task.
Example:
sequence:
-... | mit |
sandeepdsouza93/TensorFlow-15712 | tensorflow/contrib/linalg/python/ops/linear_operator_test_util.py | 2 | 7515 | # 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 |
kaushik94/boto | tests/unit/glacier/test_writer.py | 18 | 8352 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
sadaf2605/django | tests/prefetch_related/test_prefetch_related_objects.py | 35 | 4734 | from django.db.models import Prefetch, prefetch_related_objects
from django.test import TestCase
from .models import Author, Book, Reader
class PrefetchRelatedObjectsTests(TestCase):
"""
Since prefetch_related_objects() is just the inner part of
prefetch_related(), only do basic tests to ensure its API h... | bsd-3-clause |
gtesei/fast-furious | competitions/cdiscount-image-classification-challenge/mynet_reload.py | 1 | 13669 | import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from subprocess import check_output
import io
import bson # this is installed with the pymongo package
import matplotlib.pyplot as plt
from skimage.data import imread # or, whatever image ... | mit |
sillsdev/web-scriptureforge | scripts/interfacelanguage/extract-translation-ids.py | 9 | 5369 | #!/usr/bin/env python
import os, sys
import codecs
import argparse
import re
import unicodedata
html_attr_re1 = ur'translate="([^"]*)"'
html_attr_re2 = ur"translate='([^']*)'"
html_attr_re = re.compile(ur'{0}|{1}'.format(html_attr_re1, html_attr_re2))
angular_expr_re = re.compile(ur'{{(.*?)}}')
bar_translate_re = re... | mit |
yunxliu/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_script-src_unsafe-inline_blocked_ext-manual.py | 30 | 2752 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "script-src 'unsafe-in... | bsd-3-clause |
askeing/servo | tests/wpt/web-platform-tests/tools/gitignore/tests/test_gitignore.py | 98 | 2034 | import pytest
from ..gitignore import fnmatch_translate, PathFilter
match_data = [
("foo", False, ["a/foo", "foo"]),
("*.a", False, ["foo.a", "a/foo.a", "a/b/foo.a", "a.a/foo.a"]),
("*.py[co]", False, ["a.pyc", "a.pyo", "a/b/c.pyc"]),
("\\#*", False, ["#a", "a/#b"]),
("*#", False, ["a#", "a/b#", "... | mpl-2.0 |
XueqingLin/tensorflow | tensorflow/contrib/learn/python/learn/ops/tests/ops_test.py | 13 | 3392 | # 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 |
redhat-openstack/horizon | horizon/test/tests/base.py | 7 | 20521 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 OpenStack Foundation
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use t... | apache-2.0 |
fingeronthebutton/robotframework | src/robot/parsing/restsupport.py | 27 | 1790 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 |
tensorflow/models | official/nlp/transformer/data_download.py | 1 | 15292 | # Copyright 2021 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 |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.5/django/contrib/comments/views/utils.py | 100 | 2035 | """
A few bits of helper functions for comment views.
"""
import textwrap
try:
from urllib.parse import urlencode
except ImportError: # Python 2
from urllib import urlencode
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, resolve_url
from django.template impor... | bsd-3-clause |
hectormartinez/rougexstem | taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/sem/relextract.py | 9 | 12702 | # Natural Language Toolkit: Relation Extraction
#
# Copyright (C) 2005-2008 University of Edinburgh
# Author: Ewan Klein <ewan@inf.ed.ac.uk>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Code for extracting relational triples from the ieer and conll2002 corpora.
Relations are stored inter... | apache-2.0 |
ajayaa/keystone | keystone/contrib/example/migrate_repo/versions/001_example_table.py | 14 | 1090 | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
mdasifhasan/Experiments_HTN_Planner | PyHop/util_plot.py | 1 | 4996 | from bokeh.plotting import figure, output_file, show, ColumnDataSource, vplot, hplot, gridplot
from bokeh.layouts import column
from bokeh.charts import Step, Line
from bokeh.models import HoverTool
import numpy as np
def test():
x = range(1, 6)
y = [10, 5, 7, 1, 6]
plot = figure(title='Line example', x_axi... | gpl-3.0 |
ODM2/ODM2YODAParser | yodatools/dataloader/view/WizardDatabasePageView.py | 2 | 1773 | import wx
from yodatools.dataloader.controller.pnlDBConfig import pnlDBConfig
class WizardDatabasePageView(wx.Panel):
def __init__(self, parent):
super(WizardDatabasePageView, self).__init__(parent)
self.panel = pnlDBConfig(self, is_main=False)
self.sizer = wx.BoxSizer(wx.VERTICAL)
... | bsd-3-clause |
oktayacikalin/pyglet | doc/conf.py | 16 | 12281 | # -*- coding: utf-8 -*-
#
# pyglet documentation build configuration file.
#
# This file is execfile()d with the current directory set to its containing dir.
import os
import sys
import time
import datetime
sys.is_epydoc = True
document_modules = ["pyglet", "tests"]
# Patched extensions base path.
sys.path.insert(... | bsd-3-clause |
mbroadst/rethinkdb | external/gtest_1.7.0/test/gtest_shuffle_test.py | 3023 | 12549 | #!/usr/bin/env python
#
# Copyright 2009 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... | agpl-3.0 |
kaedroho/django | tests/db_functions/text/test_trim.py | 71 | 1357 | from django.db.models import CharField
from django.db.models.functions import LTrim, RTrim, Trim
from django.test import TestCase
from django.test.utils import register_lookup
from ..models import Author
class TrimTests(TestCase):
def test_trim(self):
Author.objects.create(name=' John ', alias='j')
... | bsd-3-clause |
boltnev/iktomi | iktomi/templates/__init__.py | 3 | 3489 | # -*- coding: utf-8 -*-
import os
import logging
logger = logging.getLogger(__name__)
from glob import glob
from ..web import Response, request_filter
from ..utils import cached_property
__all__ = ('Template',)
class TemplateError(Exception):
'''Error raised in the case template can not be found'''
pass
c... | mit |
sam-tsai/django-old | django/contrib/gis/shortcuts.py | 317 | 1161 | import cStringIO, zipfile
from django.conf import settings
from django.http import HttpResponse
from django.template import loader
def compress_kml(kml):
"Returns compressed KMZ from the given KML string."
kmz = cStringIO.StringIO()
zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED)
zf.writestr('doc.... | bsd-3-clause |
pytorch/fairseq | fairseq/models/lstm.py | 1 | 30480 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Dict, List, Optional, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import utils
f... | mit |
libracore/erpnext | erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py | 11 | 1878 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import nowdate, getdate
def execute(filters=None):
if not filters: filters = {}
columns = get_c... | gpl-3.0 |
rsjohnco/rez | src/rezgui/widgets/BrowsePackagePane.py | 3 | 1196 | from rezgui.qt import QtGui
from rezgui.widgets.BrowsePackageWidget import BrowsePackageWidget
from rezgui.widgets.ContextSettingsWidget import ContextSettingsWidget
from rezgui.mixins.ContextViewMixin import ContextViewMixin
from rezgui.util import get_icon
class BrowsePackagePane(QtGui.QTabWidget, ContextViewMixin)... | gpl-3.0 |
jmore-reachtech/reach-imx-u-boot | tools/buildman/test.py | 31 | 5931 | #
# Copyright (c) 2012 The Chromium OS Authors.
#
# SPDX-License-Identifier: GPL-2.0+
#
import os
import shutil
import sys
import tempfile
import time
import unittest
# Bring in the patman libraries
our_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(our_path, '../patman'))
import boa... | gpl-2.0 |
Jumpscale/web | pythonlib/mongoengine/document.py | 5 | 30981 | import warnings
import hashlib
import pymongo
import re
from pymongo.read_preferences import ReadPreference
from bson import ObjectId
from bson.dbref import DBRef
from mongoengine import signals
from mongoengine.common import _import_class
from mongoengine.base import (DocumentMetaclass, TopLevelDocumentMetaclass,
... | apache-2.0 |
openSAIL/MASTDataDelivery | get_data_kepler.py | 1 | 4585 | """
.. module:: get_data_kepler
:synopsis: Returns Kepler lightcurve data as a JSON string.
.. moduleauthor:: Scott W. Fleming <fleming@stsci.edu>
"""
from astropy.io import fits
from data_series import DataSeries
from parse_obsid_kepler import parse_obsid_kepler
#--------------------
def get_data_kepler(obsid):... | mit |
anistark/mozillians | vendor-local/lib/python/celery/abstract.py | 14 | 6279 | # -*- coding: utf-8 -*-
"""
celery.abstract
~~~~~~~~~~~~~~~
Implements components and boot-steps.
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from collections import defaultdict
from importlib import import_mod... | bsd-3-clause |
pforai/easybuild-framework | easybuild/tools/multidiff.py | 5 | 10585 | # #
# Copyright 2014-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (ht... | gpl-2.0 |
tango-controls/pytango | tango/futures_executor.py | 4 | 2027 | # ------------------------------------------------------------------------------
# This file is part of PyTango (http://pytango.rtfd.io)
#
# Copyright 2006-2012 CELLS / ALBA Synchrotron, Bellaterra, Spain
# Copyright 2013-2014 European Synchrotron Radiation Facility, Grenoble, France
#
# Distributed under the terms of ... | lgpl-3.0 |
markwal/OctoPrint | src/octoprint/server/api/connection.py | 37 | 3313 | # coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
from flask import request, j... | agpl-3.0 |
guorendong/iridium-browser-ubuntu | v8/tools/testrunner/local/progress.py | 1 | 11546 | # Copyright 2012 the V8 project 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | bsd-3-clause |
dims/oslo.messaging | doc/source/conf.py | 6 | 2018 | # -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
# -- General configuration ----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
e... | apache-2.0 |
Trilarion/imperialism-remake | source/imperialism_remake/client/preferences.py | 1 | 12913 | # Imperialism remake
# Copyright (C) 2016 Trilarion
#
# 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.
#
# This program i... | gpl-3.0 |
piyushroshan/fossmeet | models.py | 1 | 12287 | # -*- coding: utf-8 -*-
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.lastuser.sqlalchemy import UserBase
from app import app
from utils import makename
__all__ = ['db', 'SPACESTATUS', 'User', 'Tag', 'ProposalSpace', 'ProposalSpaceSection', 'Proposal',
'VoteSpace', 'Vote', 'CommentSpace', 'Com... | bsd-2-clause |
hxddh/youtube-dl | youtube_dl/extractor/mooshare.py | 128 | 3640 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
compat_urllib_parse,
)
from ..utils import (
ExtractorError,
)
class MooshareIE(InfoExtractor):
IE_NAME = 'mooshare'
IE_DESC = 'Mooshare.biz'
_VALID_URL = r'http:... | unlicense |
hitchtest/hitchhttp | hitchhttp/example.py | 1 | 6503 | import logging
from urllib.parse import urljoin
import asyncio
import aiohttp
from aiohttp import web
from functools import partial
import async_timeout
import aioodbc
import sys
TARGET_SERVER_BASE_URL = 'http://loveholidays.com'
RESPONSE_HEADERS_TO_DROP = ["transfer-encoding", "content-encoding"]
REQUEST_HEADERS_TO... | agpl-3.0 |
zerodark/httpie | httpie/utils.py | 48 | 1360 | from __future__ import division
import json
from httpie.compat import is_py26, OrderedDict
def load_json_preserve_order(s):
if is_py26:
return json.loads(s)
return json.loads(s, object_pairs_hook=OrderedDict)
def humanize_bytes(n, precision=2):
# Author: Doug Latornell
# Licence: MIT
# ... | bsd-3-clause |
Grirrane/odoo | addons/account_analytic_analysis/__openerp__.py | 7 | 2213 | # -*- 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 |
hendradarwin/VTK | Rendering/Label/Testing/Python/labeledContours.py | 11 | 2042 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# demonstrate labeling of contour with scalar value
# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.SetMultiSample... | bsd-3-clause |
smarthomeNG/smarthome | lib/plugin.py | 2 | 31899 | #!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2016- Martin Sinn m.sinn@gmx.de
# Copyright 2016 Christian Strassburg
# Copyright 2018 Stefan ... | gpl-3.0 |
C00kiie/Youtube-Mp3-telegram-bot | youtube_dl/extractor/cbs.py | 22 | 4231 | from __future__ import unicode_literals
from .theplatform import ThePlatformFeedIE
from ..utils import (
int_or_none,
find_xpath_attr,
xpath_element,
xpath_text,
update_url_query,
)
class CBSBaseIE(ThePlatformFeedIE):
def _parse_smil_subtitles(self, smil, namespace=None, subtitles_lang='en'):... | mit |
kytvi2p/Sigil | 3rdparty/python/Lib/ctypes/test/test_wintypes.py | 134 | 1466 | import sys
import unittest
from ctypes import *
@unittest.skipUnless(sys.platform.startswith('win'), 'Windows-only test')
class WinTypesTest(unittest.TestCase):
def test_variant_bool(self):
from ctypes import wintypes
# reads 16-bits from memory, anything non-zero is True
for true_value in... | gpl-3.0 |
creativcoder/servo | tests/wpt/css-tests/css-text-decor-3_dev/xhtml1print/reference/support/generate-text-emphasis-ruby-tests.py | 829 | 3042 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-ruby-001 ~ 004 which tests
emphasis marks with ruby in four directions. It outputs a list of all
tests it generated in the format of Mozilla reftest.list to the stdout.
"""
from __future__ import unicode_literals
TEST_FIL... | mpl-2.0 |
dogecoin/dogecoin | qa/rpc-tests/p2p-timeouts.py | 44 | 3519 | #!/usr/bin/env python3
# Copyright (c) 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.
""" TimeoutsTest -- test various net timeouts (only in extended tests)
- Create three bitcoind nodes:
no_... | mit |
Fr4ncky/git-repo | subcmds/start.py | 48 | 2221 | #
# Copyright (C) 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 required by applicable la... | apache-2.0 |
icodemachine/Stem | test/unit/tutorial.py | 4 | 9242 | """
Tests for the examples given in stem's tutorial.
"""
import io
import unittest
from stem.control import Controller
from stem.descriptor.reader import DescriptorReader
from stem.descriptor.server_descriptor import RelayDescriptor
from test import mocking
try:
from StringIO import StringIO
except ImportError:
... | lgpl-3.0 |
ezequielfreire007/proyectoIonic | myphoto/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py | 1417 | 12751 | #!/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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | mit |
ttsda/beets | beetsplug/bpm.py | 25 | 2717 | # This file is part of beets.
# Copyright 2015, aroquen
#
# 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, ... | mit |
fritsvanveen/QGIS | python/ext-libs/owslib/interfaces.py | 17 | 6066 | from __future__ import (absolute_import, division, print_function)
# Follows the 4 aspects of service metadata
class IServiceIdentificationMetadata:
"""OO-interface to service identification metadata.
"""
type = property("""Service name (string): "WMS", "WFS", "WCS", or "SOS".""")
version = property... | gpl-2.0 |
adaptive-learning/flocs-web | practice/serializers.py | 1 | 2901 | from rest_framework import serializers
from flocs.student import get_level, get_active_credits
from flocsweb.store import db_state
from .models import Student, TaskSession
class TaskSessionSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = TaskSession
fields = ('url', 'task_s... | gpl-3.0 |
devanlai/pyOCD | pyOCD/interface/pywinusb_backend.py | 2 | 3837 | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 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 ... | apache-2.0 |
BlindHunter/django | django/middleware/gzip.py | 478 | 1831 | import re
from django.utils.cache import patch_vary_headers
from django.utils.text import compress_sequence, compress_string
re_accepts_gzip = re.compile(r'\bgzip\b')
class GZipMiddleware(object):
"""
This middleware compresses content if the browser allows gzip compression.
It sets the Vary header acco... | bsd-3-clause |
donkeykang/kernel_opo_omni | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
tmerrick1/spack | var/spack/repos/builtin/packages/randfold/package.py | 5 | 1751 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
Kagami/kisa | lib/twisted/web/test/test_soap.py | 42 | 3030 | #
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Test SOAP support."""
try:
import SOAPpy
except ImportError:
SOAPpy = None
class SOAPPublisher: pass
else:
from twisted.web import soap
SOAPPublisher = soap.SOAPPublisher
from twisted.trial import unittest
from twisted... | cc0-1.0 |
kapilt/ansible | lib/ansible/plugins/shell/fish.py | 19 | 1154 | # (c) 2014, Chris Church <chris@ninemoreminutes.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) any lat... | gpl-3.0 |
jkshaver/virtualenv-1.8.2 | env/lib/python2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/install_scripts.py | 69 | 2059 | from distutils.command.install_scripts import install_scripts \
as _install_scripts
from pkg_resources import Distribution, PathMetadata, ensure_directory
import os
from distutils import log
class install_scripts(_install_scripts):
"""Do normal script install, plus any egg_info wrapper scripts"""
def ini... | mit |
villalonreina/dipy | doc/examples/reconst_dsi.py | 3 | 3360 | """
===========================================
Reconstruct with Diffusion Spectrum Imaging
===========================================
We show how to apply Diffusion Spectrum Imaging [Wedeen08]_ to
diffusion MRI datasets of Cartesian keyhole diffusion gradients.
First import the necessary modules:
"""
from dipy.dat... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.