repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
yousrabk/mne-python | examples/inverse/plot_dics_source_power.py | 18 | 2925 | """
=========================================
Compute source power using DICS beamfomer
=========================================
Compute a Dynamic Imaging of Coherent Sources (DICS) filter from single trial
activity to estimate source power for two frequencies of interest.
The original reference for DICS is:
Gross e... | bsd-3-clause |
zarelit/django-localflavor | tests/test_fi.py | 4 | 16333 | from __future__ import unicode_literals
from django.test import SimpleTestCase
from localflavor.fi.forms import (FIZipCodeField, FISocialSecurityNumber,
FIMunicipalitySelect)
class FILocalFlavorTests(SimpleTestCase):
def test_FIMunicipalitySelect(self):
f = FIMunicipali... | bsd-3-clause |
wskplho/sl4a | python/src/Tools/freeze/makefreeze.py | 46 | 2710 | import marshal
import bkfile
# Write a file containing frozen code for the modules in the dictionary.
header = """
#include "Python.h"
static struct _frozen _PyImport_FrozenModules[] = {
"""
trailer = """\
{0, 0, 0} /* sentinel */
};
"""
# if __debug__ == 0 (i.e. -O option given), set Py_OptimizeFlag in frozen... | apache-2.0 |
Lightmatter/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/django/conf/locale/en/formats.py | 394 | 1815 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIM... | mit |
jmalonzo/pywebkitgtk | tests/test_webbackforwardlist.py | 1 | 2703 |
from webkit import WebHistoryItem, WebBackForwardList, WebView
import gobject
import unittest
class TestWebBackForwardList (unittest.TestCase):
"""Test WebBackForwardList functions"""
def setUp(self):
gobject.threads_init()
self.view = WebView()
self.bf_list = self.view.get_back_forw... | lgpl-2.1 |
frederica07/Dragon_Programming_Process | PyOpenGL-3.0.2/OpenGL/GL/NV/register_combiners2.py | 4 | 1914 | '''OpenGL extension NV.register_combiners2
This module customises the behaviour of the
OpenGL.raw.GL.NV.register_combiners2 to provide a more
Python-friendly API
Overview (from the spec)
The NV_register_combiners extension provides a powerful fragment
coloring mechanism. This specification extends the register... | bsd-2-clause |
pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py | 713 | 5879 | from __future__ import absolute_import
from collections import namedtuple
from ..exceptions import LocationParseError
url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment']
class Url(namedtuple('Url', url_attrs)):
"""
Datastructure for representing an HTTP URL. Used as a return value f... | gpl-2.0 |
jank3/django | django/views/decorators/vary.py | 586 | 1200 | from functools import wraps
from django.utils.cache import patch_vary_headers
from django.utils.decorators import available_attrs
def vary_on_headers(*headers):
"""
A view decorator that adds the specified headers to the Vary header of the
response. Usage:
@vary_on_headers('Cookie', 'Accept-langu... | bsd-3-clause |
GeekTrainer/Flask | Work/Trivia - Module 5/env/Lib/site-packages/setuptools/tests/test_sandbox.py | 342 | 2170 | """develop tests
"""
import sys
import os
import shutil
import unittest
import tempfile
import types
import pkg_resources
import setuptools.sandbox
from setuptools.sandbox import DirectorySandbox, SandboxViolation
def has_win32com():
"""
Run this to determine if the local machine has win32com, and if it
d... | apache-2.0 |
martinsch/vigra | vigranumpy/lib/pyqt/imagewindow.py | 1 | 23939 | #######################################################################
#
# Copyright 2009-2010 by Ullrich Koethe
#
# This file is part of the VIGRA computer vision library.
# The VIGRA Website is
# http://hci.iwr.uni-heidelberg.de/vigra/
# Please direct questions, bug reports, and contributions... | mit |
171121130/SWI | venv/Lib/site-packages/markdown/extensions/headerid.py | 44 | 5926 | """
HeaderID Extension for Python-Markdown
======================================
Auto-generate id attributes for HTML headers.
Basic usage:
>>> import markdown
>>> text = "# Some Header #"
>>> md = markdown.markdown(text, ['headerid'])
>>> print md
<h1 id="some-header">Some Header</h1>
All head... | mit |
brainwane/zulip | zilencer/management/commands/add_remote_server.py | 8 | 1123 | from argparse import ArgumentParser
from typing import Any
from zerver.lib.management import ZulipBaseCommand
from zilencer.models import RemoteZulipServer
class Command(ZulipBaseCommand):
help = """Add a remote Zulip server for push notifications."""
def add_arguments(self, parser: ArgumentParser) -> None:... | apache-2.0 |
GitHublong/hue | desktop/core/ext-py/cx_Oracle-5.1.2/test/CursorVar.py | 34 | 1887 | """Module for testing cursor variables."""
import struct
import sys
class TestCursorVar(BaseTestCase):
def testBindCursor(self):
"test binding in a cursor"
cursor = self.connection.cursor()
self.failUnlessEqual(cursor.description, None)
self.cursor.execute("""
begi... | apache-2.0 |
kawamon/hue | desktop/core/ext-py/Django-1.11.29/tests/sitemaps_tests/base.py | 380 | 1079 | from django.apps import apps
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.test import TestCase, modify_settings, override_settings
from .models import I18nTestModel, TestModel
@modify_settings(INSTALLED_APPS={'append': 'django.contrib.sitemaps'})
@override_settings(ROO... | apache-2.0 |
kyleabeauchamp/mdtraj | mdtraj/scripts/mdconvert.py | 10 | 20675 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors:
#
# MDTraj is free software: ... | lgpl-2.1 |
emon10005/scikit-image | doc/examples/plot_medial_transform.py | 14 | 2220 | """
===========================
Medial axis skeletonization
===========================
The medial axis of an object is the set of all points having more than one
closest point on the object's boundary. It is often called the **topological
skeleton**, because it is a 1-pixel wide skeleton of the object, with the same
... | bsd-3-clause |
JonathanRaiman/theano_lstm | theano_lstm/__init__.py | 9 | 21559 | """
Small Theano LSTM recurrent network module.
@author: Jonathan Raiman
@date: December 10th 2014
Implements most of the great things that came out
in 2014 concerning recurrent neural networks, and
some good optimizers for these types of networks.
Note (from 5 January 2015): Dropout api is a bit sophisticated due t... | bsd-3-clause |
apechimp/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treebuilders/_base.py | 715 | 13699 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent formatting
# fr... | mpl-2.0 |
mgedmin/scrapy | scrapy/loader/processors.py | 145 | 2850 | """
This module provides some commonly used processors for Item Loaders.
See documentation in docs/topics/loaders.rst
"""
from scrapy.utils.misc import arg_to_iter
from scrapy.utils.datatypes import MergeDict
from .common import wrap_loader_context
class MapCompose(object):
def __init__(self, *functions, **def... | bsd-3-clause |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/test/test_netrc.py | 50 | 4636 | import netrc, os, unittest, sys, textwrap
from test import test_support
temp_filename = test_support.TESTFN
class NetrcTestCase(unittest.TestCase):
def make_nrc(self, test_data):
test_data = textwrap.dedent(test_data)
mode = 'w'
if sys.platform != 'cygwin':
mode += 't'
... | gpl-2.0 |
rhinstaller/anaconda | pyanaconda/modules/payloads/source/rpm_ostree/rpm_ostree.py | 3 | 4806 | #
# The RPM OSTree source module.
#
# Copyright (C) 2020 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 distri... | gpl-2.0 |
asimshankar/tensorflow | tensorflow/python/autograph/pyct/templates.py | 5 | 8776 | # 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 |
philsch/ansible | test/units/playbook/test_task.py | 66 | 2426 | # (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 |
elimelec/pjproject | tests/pjsua/mod_recvfrom.py | 39 | 2746 | # $Id$
import imp
import sys
import inc_sip as sip
import inc_const as const
import re
from inc_cfg import *
# Read configuration
cfg_file = imp.load_source("cfg_file", ARGS[1])
# Default server port (should we randomize?)
srv_port = 50070
def test_func(test):
pjsua = test.process[0]
dlg = sip.Dialog("127.0.0.1", ... | gpl-2.0 |
eagleamon/home-assistant | homeassistant/components/fan/__init__.py | 1 | 8794 | """
Provides functionality to interact with fans.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/fan/
"""
from datetime import timedelta
import logging
import os
import voluptuous as vol
from homeassistant.components import group
from homeassistant.co... | apache-2.0 |
uclouvain/OSIS-Louvain | base/migrations/0315_auto_20180724_0823.py | 3 | 1725 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-07-24 06:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0314_auto_20180723_1503'),
]
operations = [
migrations.AddField(
... | agpl-3.0 |
SerialShadow/SickRage | sickbeard/metadata/kodi.py | 12 | 4553 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | gpl-3.0 |
andfoy/margffoy-tuay-server | env/lib/python2.7/site-packages/future-0.14.3-py2.7.egg/libpasteurize/fixes/fix_features.py | 61 | 2679 | u"""
Warn about features that are not present in Python 2.5, giving a message that
points to the earliest version of Python 2.x (or 3.x, if none) that supports it
"""
from .feature_base import Feature, Features
from lib2to3 import fixer_base
FEATURES = [
#(FeatureName,
# FeaturePattern,
# FeatureMinVersio... | gpl-2.0 |
TelematicaUSM/Tidys | src/exceptions.py | 2 | 2179 | # -*- coding: UTF-8 -*-
# COPYRIGHT (c) 2016 Cristóbal Ganter
#
# GNU AFFERO GENERAL PUBLIC LICENSE
# Version 3, 19 November 2007
#
# 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 |
kissbac/upm | examples/python/isd1820.py | 16 | 2384 | #!/usr/bin/python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 limi... | mit |
mathiasertl/django-ca | ca/django_ca/apps.py | 1 | 1049 | # This file is part of django-ca (https://github.com/mathiasertl/django-ca).
#
# django-ca 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... | gpl-3.0 |
simobasso/ansible | lib/ansible/playbook/play.py | 7 | 12711 | # (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 |
jelugbo/hebs_master | common/djangoapps/terrain/stubs/ora.py | 47 | 17337 | """
Stub implementation of ORA service.
This is an extremely simple version of the service, with most
business logic removed. In particular, the stub:
1) Provides an infinite number of peer and calibration essays,
with dummy data.
2) Simulates a set number of pending submissions for each student;
grades submi... | agpl-3.0 |
GeoCat/QGIS | src/plugins/grass/scripts/db.connect-login.pg.py | 7 | 3778 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
***************************************************************************
db.connect-login.pg.py - Connect to PostgreSQL
---------------------
Date : July 2009
Copyright : (C) 2009 by Radim Blazek
Email : ... | gpl-2.0 |
QuickSander/CouchPotatoServer | libs/chardet/hebrewprober.py | 215 | 13240 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | gpl-3.0 |
nbp/git-repo | color.py | 36 | 4089 | #
# 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 |
pim89/youtube-dl | youtube_dl/extractor/viceland.py | 9 | 4345 | # coding: utf-8
from __future__ import unicode_literals
import time
import hashlib
import json
from .adobepass import AdobePassIE
from ..compat import compat_HTTPError
from ..utils import (
int_or_none,
parse_age_limit,
str_or_none,
parse_duration,
ExtractorError,
extract_attributes,
)
class... | unlicense |
smuzaffar/root | interpreter/llvm/src/tools/clang/bindings/python/tests/cindex/test_type.py | 34 | 11500 | import gc
from clang.cindex import CursorKind
from clang.cindex import TranslationUnit
from clang.cindex import TypeKind
from nose.tools import raises
from .util import get_cursor
from .util import get_tu
kInput = """\
typedef int I;
struct teststruct {
int a;
I b;
long c;
unsigned long d;
signed long e;
... | lgpl-2.1 |
rgom/Pydev | plugins/org.python.pydev/pysrc/pydevd_vm_type.py | 64 | 1567 | import sys
#=======================================================================================================================
# PydevdVmType
#=======================================================================================================================
class PydevdVmType:
PYTHON = 'python'
... | epl-1.0 |
jmesteve/medical | openerp/addons_extra/yowsup/Contacts/contacts.py | 4 | 6072 | '''
Copyright (c) <2012> Tarek Galal <tare2.galal@gmail.com>
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... | agpl-3.0 |
thaim/ansible | lib/ansible/plugins/lookup/cartesian.py | 141 | 2174 | # (c) 2013, Bradley Young <young.bradley@gmail.com>
# (c) 2017 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
DOCUMENTATION = """
lookup: cartesian
version_added... | mit |
elba7r/builder | frappe/desk/doctype/event/event.py | 2 | 6853 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import (getdate, cint, add_months, date_diff, add_days,
nowdate, get_datetime_str, cstr, get_datetime, now_datetime)
from frappe.model.document i... | mit |
dvirtz/gmusicapi | example.py | 3 | 2663 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from getpass import getpass
from gmusicapi import Mobileclient
def ask_for_credentials():
"""Make an instance of the api and attempts to login with it.
Return the authenticated api.
"""
# We're not going to upload anything, so the Mobileclient is what w... | bsd-3-clause |
airbnb/airflow | airflow/providers/openfaas/hooks/openfaas.py | 2 | 4134 | #
# 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 |
satdav/mozillians | vendor-local/lib/python/celery/app/amqp.py | 13 | 13396 | # -*- coding: utf-8 -*-
"""
celery.app.amqp
~~~~~~~~~~~~~~~
AMQ related functionality.
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from datetime import timedelta
from kombu import BrokerConnection, Exchange
fr... | bsd-3-clause |
igord-daynix/virt-test | samples/ls_disk.py | 35 | 1224 | """
Shows all existing disk partitions.
This test requires test-provider to be qemu.
Try this test without config, than put ls_disk.cfg into $tests/cfg/ directory
and see the difference.
Additionally you might put ls_disk_v2.cfg into $tests/cfg/ directory and
execute ls_disk_v2 test (which also uses this script!) and... | gpl-2.0 |
tswast/google-cloud-python | dataproc/google/cloud/dataproc_v1/proto/jobs_pb2.py | 2 | 157176 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/dataproc_v1/proto/jobs.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message a... | apache-2.0 |
wereallfeds/webshag | webshag/gui/gui_images.py | 1 | 223034 | ## ################################################################# ##
## (C) SCRT - Information Security, 2007 - 2008 // author: ~SaD~ ##
## ################################################################# ##
## This program is free software: you can redistribute it and/or ##
## modify it under the terms of ... | gpl-3.0 |
lorin/ansible-modules-core | cloud/rax_queue.py | 76 | 3799 | #!/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 |
ReganDryke/airtime | python_apps/media-monitor/mm2/media/monitor/events.py | 10 | 10115 | # -*- coding: utf-8 -*-
import os
import abc
import re
import pure as mmp
from pure import LazyProperty
from metadata import Metadata
from log import Loggable
from exceptions import BadSongFile
from ..saas.thread import getsig, user
class PathChannel(object):
""" Simple stru... | agpl-3.0 |
cobbr/ObfuscatedEmpire | lib/modules/powershell/credentials/mimikatz/cache.py | 10 | 2639 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Mimikatz LSA Dump',
'Author': ['@JosephBialek', '@gentilkiwi'],
'Description': ("Runs PowerSploit's Invoke-Mimikatz function "
... | bsd-3-clause |
swimablefish/my-emacs | .emacs.d/anaconda-mode/0.1.1/jedi/parser/token.py | 38 | 1188 | from __future__ import absolute_import
from jedi._compatibility import is_py3
from token import *
COMMENT = N_TOKENS
tok_name[COMMENT] = 'COMMENT'
N_TOKENS += 1
NL = N_TOKENS
tok_name[NL] = 'NL'
N_TOKENS += 1
if is_py3:
BACKQUOTE = N_TOKENS
tok_name[BACKQUOTE] = 'BACKQUOTE'
N_TOKENS += 1
else:
RARR... | gpl-2.0 |
openfun/edx-platform | common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py | 28 | 22896 | # -*- coding: utf-8 -*-
"""
End-to-end tests for the LMS Instructor Dashboard.
"""
from nose.plugins.attrib import attr
from bok_choy.promise import EmptyPromise
from ..helpers import UniqueCourseTest, get_modal_alert, EventsTestMixin
from ...pages.common.logout import LogoutPage
from ...pages.lms.auto_auth import Au... | agpl-3.0 |
GSA/PricesPaidAPI | SolrLodr.py | 1 | 4723 | #!/usr/local/bin/python
import solr
import sys, traceback
# This file is for (for example) Apache with mod_wsgi.
import sys, os
# import sys
# sys.path.insert(0, '../configuration/')
# The purpose of this file is to take the standard
# datafiles and load them into SOLR in such a way that they
# will be searchable.... | unlicense |
Eric-Gaudiello/tensorflow_dev | tensorflow_home/tensorflow_venv/lib/python3.4/site-packages/numpy/distutils/cpuinfo.py | 173 | 22970 | #!/usr/bin/env python
"""
cpuinfo
Copyright 2002 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy (BSD style) license. See LICENSE.txt that came with
this distribution for specifics.
NO WARRANTY IS EXP... | gpl-3.0 |
eayunstack/horizon | openstack_dashboard/dashboards/admin/routers/views.py | 46 | 3047 | # Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... | apache-2.0 |
rubasben/namebench | nb_third_party/dns/rdtypes/IN/DHCID.py | 248 | 2116 | # Copyright (C) 2006, 2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED... | apache-2.0 |
ntoll/code-dojo | adventure/week3/team3/adventure.py | 1 | 6088 | from cmd import Cmd
import re
DIRECTIONS = 'N', 'E', 'S', 'W'
NORTH, EAST, SOUTH, WEST = DIRECTIONS
class Player(object):
def __init__(self, location, name='Player'):
assert isinstance(location, Location)
self.location = location
self.name = name
class Location(object):
... | mit |
4rado/RepositoryForProject | Lib/encodings/mac_cyrillic.py | 593 | 13710 | """ Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... | gpl-3.0 |
amanzi/ats-dev | tools/meshing_ats/meshing_ats/meshing_ats.py | 1 | 34933 | """Extrudes a 2D mesh to generate an ExodusII 3D mesh.
Works with and assumes all polyhedra cells (and polygon faces).
To see usage, run:
------------------------------------------------------------
python meshing_ats.py -h
Example distributed with this source, to run:
--------------------------------------------... | bsd-3-clause |
shakamunyi/sahara | sahara/service/api/v2/images.py | 3 | 2680 | # Copyright (c) 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
sestrella/ansible | lib/ansible/module_utils/network/common/config.py | 22 | 14343 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
HalcyonChimera/osf.io | admin_tests/subjects/test_views.py | 19 | 2188 | from nose import tools as nt
from django.test import RequestFactory
from django.core.urlresolvers import reverse
from django.core.exceptions import PermissionDenied
from django.contrib.auth.models import Permission
from tests.base import AdminTestCase
from osf_tests.factories import AuthUserFactory, SubjectFactory
fro... | apache-2.0 |
RonnyPfannschmidt-Attic/pyflakes-old | pyflakes/messages.py | 2 | 2772 | # (c) 2005 Divmod, Inc. See LICENSE file for details
class Message(object):
message = ''
message_args = ()
use_column = True
names = ()
def __init__(self, filename, source_node, *message_args):
self.filename = filename
self.lineno = source_node.lineno
if self.use_column:
... | mit |
pecryptfs/pecryptfs | pecryptfs/cmd_genfile.py | 1 | 2753 | #!/usr/bin/env python3
# pecryptfs - Portable Userspace eCryptfs
# Copyright (C) 2015 Ingo Ruhnke <grumbel@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the L... | gpl-3.0 |
qbdsoft/pip | pip/_vendor/requests/packages/urllib3/filepost.py | 1009 | 2281 | import codecs
from uuid import uuid4
from io import BytesIO
from .packages import six
from .packages.six import b
from .fields import RequestField
writer = codecs.lookup('utf-8')[3]
def choose_boundary():
"""
Our embarassingly-simple replacement for mimetools.choose_boundary.
"""
return uuid4().hex... | mit |
mixturemodel-flow/tensorflow | tensorflow/python/framework/subscribe.py | 33 | 11056 | # 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 |
molotof/infernal-twin | build/pillow/build/lib.linux-i686-2.7/PIL/TarIO.py | 77 | 1223 | #
# The Python Imaging Library.
# $Id$
#
# read files from within a tar file
#
# History:
# 95-06-18 fl Created
# 96-05-28 fl Open files in binary mode
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1995-96.
#
# See the README file for information on usage and redistribution.
#
from PIL impor... | gpl-3.0 |
ptphp/PyLib | src/fangte/fetch/fetch58_bak.py | 1 | 29601 | # -*- coding: utf-8 -*-
import time
import datetime
import random
import cookielib
import urllib
import urllib2
from urlparse import urlparse
from config import *
from common import *
from BeautifulSoup import BeautifulSoup
class BaseCrawl(object):
#房源类型 1 出售 2 出租 3 求购 4 求租
flag = None
isStoped = False
... | apache-2.0 |
dimroc/tensorflow-mnist-tutorial | lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/dataframe/tensorflow_dataframe.py | 75 | 29377 | # 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 |
AntaresConsulting/odoo-marble | product_marble/models/stock.py | 1 | 25218 | # -*- 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... | gpl-2.0 |
CiscoSystems/dashboard-quantum-beta | django-openstack/django_openstack/api.py | 1 | 19242 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Fourth Paradigm Development, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Licen... | apache-2.0 |
redhat-openstack/neutron | neutron/db/migration/alembic_migrations/versions/2447ad0e9585_add_ipv6_mode_props.py | 17 | 2105 | # Copyright 2014 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 ... | apache-2.0 |
taknevski/tensorflow-xsmm | tensorflow/contrib/distributions/python/ops/mvn_diag.py | 24 | 7869 | # 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 |
markeTIC/OCB | addons/l10n_be/__openerp__.py | 251 | 3666 | # -*- 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 |
paran0ids0ul/MITMf | core/beefapi.py | 18 | 12022 | #! /usr/bin/env python2.7
# BeEF-API - A Python API for BeEF (The Browser Exploitation Framework) http://beefproject.com/
# Copyright (c) 2015-2016 Marcello Salvati - byt3bl33d3r@gmail.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License ... | gpl-3.0 |
chriseth/solidity-doc-test | docs/conf.py | 2 | 7899 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Solidity documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 7 12:32:57 2015.
#
# 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
# a... | mit |
unindented/streamcode | client/static/jsrepl/extern/python/closured/lib/python2.7/email/mime/image.py | 573 | 1764 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Class representing image/* type MIME documents."""
__all__ = ['MIMEImage']
import imghdr
from email import encoders
from email.mime.nonmultipart import MIMENonMultipart
class MIMEImage(MIMENonMultipart... | mit |
MortimerGoro/servo | python/tidy/servo_tidy/licenseck.py | 34 | 2348 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | mpl-2.0 |
twitchyliquid64/misc-scripts | s3tool/boto/ec2/volumestatus.py | 181 | 6329 | # 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 |
internap/netman | netman/core/objects/vrrp_group.py | 6 | 1042 | # Copyright 2015 Internap.
#
# 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, so... | apache-2.0 |
qrqiuren/sms-tools | lectures/03-Fourier-properties/plots-code/fft-zero-phase.py | 24 | 1140 | import matplotlib.pyplot as plt
import numpy as np
from scipy.fftpack import fft, fftshift
import sys
sys.path.append('../../../software/models/')
import utilFunctions as UF
(fs, x) = UF.wavread('../../../sounds/oboe-A4.wav')
N = 512
M = 401
hN = N/2
hM = (M+1)/2
start = .8*fs
xw = x[start-hM:start+hM-1] * np.h... | agpl-3.0 |
morissette/devopsdays-hackathon-2016 | venv/lib/python2.7/site-packages/botocore/vendored/requests/packages/chardet/euctwprober.py | 2994 | 1676 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
leotrs/decu | test/notsosimple_project/src/script.py | 1 | 1196 | """
testscript.py
-------------
This is a test script for decu.
"""
from decu import Script, experiment, figure, run_parallel
import numpy as np
import matplotlib.pyplot as plt
class TestScript(Script):
@experiment(data_param='data')
def exp(self, data, param, param2):
"""Compute x**param for each... | mit |
dandycheung/androguard | androguard/patch/zipfile.py | 45 | 53959 | """
Read and write ZIP files.
"""
import struct, os, time, sys, shutil
import binascii, cStringIO, stat
import io
import re
try:
import zlib # We may need its compression method
crc32 = zlib.crc32
except ImportError:
zlib = None
crc32 = binascii.crc32
__all__ = ["BadZipfile", "error", "ZIP_STORED", "Z... | apache-2.0 |
jkbradley/spark-perf | lib/sparkperf/main.py | 7 | 6733 | #!/usr/bin/env python
import argparse
import imp
import os
import logging
logger = logging.getLogger("sparkperf")
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler())
from sparkperf.commands import *
from sparkperf.cluster import Cluster
from sparkperf.mesos_cluster import MesosCluster
from spar... | apache-2.0 |
abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/buildmaster/tests/test_buildfarmjobbehavior.py | 1 | 11277 | # Copyright 2010-2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Unit tests for BuildFarmJobBehaviorBase."""
__metaclass__ = type
from datetime import datetime
import os
import shutil
import tempfile
from twisted.internet import defer... | agpl-3.0 |
rackerlabs/qonos | qonos/openstack/common/eventlet_backdoor.py | 1 | 4764 | # Copyright (c) 2012 OpenStack Foundation.
# 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 copy of the License a... | apache-2.0 |
sinbazhou/odoo | addons/multi_company/__openerp__.py | 259 | 1620 | # -*- 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 |
Jingru/CLRS | C10-Elementary-Data-Structures/exercise_code/deque.py | 11 | 1051 | #!/usr/bin/env python
# coding=utf-8
class Deque:
def __init__(self, size):
self.N = 0
self.head = 0
self.tail = size-1
self.array = [0]*size
self.size = size
def addFirst(self, item):
self.array[self.head] = item
self.N += 1
self.head = (self.h... | mit |
MJuddBooth/pandas | pandas/tests/reshape/test_reshape.py | 1 | 25248 | # -*- coding: utf-8 -*-
# pylint: disable-msg=W0612,E1101
from collections import OrderedDict
import numpy as np
from numpy import nan
import pytest
from pandas.compat import u
from pandas.core.dtypes.common import is_integer_dtype
import pandas as pd
from pandas import Categorical, DataFrame, Index, Series, get_d... | bsd-3-clause |
mlachwani/Android-4.4.3-HTC-M8-Kernel-ATT | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
eadgarchen/tensorflow | tensorflow/contrib/estimator/python/estimator/dnn_test.py | 32 | 5283 | # 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 |
BinMatrix/camshift_ros | scripts/camshift_node.py | 1 | 9812 | #!/usr/bin/env python
'''
Camshift node
================
This is a ros node that shows mean-shift based tracking
You select a color objects such as your face and it tracks it.
This subscrib from "/image" topic for reading image,
and publish the information of target to "/TargetPositionSize"
or "/roi" topic.
The posit... | gpl-3.0 |
faun/django_test | django/db/backends/oracle/creation.py | 6 | 11812 | import sys, time
from django.core import management
from django.db.backends.creation import BaseDatabaseCreation
TEST_DATABASE_PREFIX = 'test_'
PASSWORD = 'Im_a_lumberjack'
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated Oracle column
# types, as strings.... | bsd-3-clause |
rafallo/p2c | torrent/torrent.py | 1 | 10334 | # -*- coding: utf-8 -*-
import hashlib
import libtorrent as lt
import logging
from threading import Timer, Event
import os
import time
from p2c.exceptions import SessionNotBindedException, TorrentHasNotMetadataYet
import settings
from torrent.movie import Movie
SOURCE_TYPES = ("MAGNET", "TORRENT")
logger = logging.ge... | mit |
flwh/you-get | src/you_get/processor/rtmpdump.py | 19 | 1420 | #!/usr/bin/env python
import os.path
import subprocess
def get_usable_rtmpdump(cmd):
try:
p = subprocess.Popen([cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
return cmd
except:
return None
RTMPDUMP = get_usable_rtmpdump('rtmpdump')
def has_r... | mit |
RydrDojo/Ridr_app | pylotVenv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py | 152 | 12996 | """
The httplib2 algorithms ported for use with requests.
"""
import logging
import re
import calendar
import time
from email.utils import parsedate_tz
from pip._vendor.requests.structures import CaseInsensitiveDict
from .cache import DictCache
from .serialize import Serializer
logger = logging.getLogger(__name__)
... | mit |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/scipy/linalg/setup.py | 52 | 5888 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
import os
from os.path import join
def configuration(parent_package='', top_path=None):
from distutils.sysconfig import get_python_inc
from numpy.distutils.system_info import get_info, NotFoundError, numpy_info
from nu... | mit |
alexholcombe/dot-jump | dataRaw/Fixed Cue/test_dot-jump25Oct2016_17-11.py | 2 | 25090 | from __future__ import print_function
__author__ = """Alex "O." Holcombe, Charles Ludowici, """ ## double-quotes will be silently removed, single quotes will be left, eg, O'Connor
import time, sys, platform, os
from math import atan, atan2, pi, cos, sin, sqrt, ceil, radians, degrees
import numpy as np
import psychopy, ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.