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 |
|---|---|---|---|---|---|
w3nd1go/android_external_skia | platform_tools/android/gyp_gen/makefile_writer.py | 25 | 7208 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Functions for creating an Android.mk from already created dictionaries.
"""
import os
def write_group(f, name, items, append):
"""Helper function to list all n... | bsd-3-clause |
dmitriy0611/django | tests/urlpatterns_reverse/tests.py | 7 | 42428 | # -*- coding: utf-8 -*-
"""
Unit tests for reverse URL lookups.
"""
from __future__ import unicode_literals
import sys
import unittest
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.conf.urls import include
from django.contrib.auth.models import User
from django.core... | bsd-3-clause |
pombredanne/dateparser-1 | dateparser/conf.py | 1 | 2222 | # -*- coding: utf-8 -*-
from pkgutil import get_data
from yaml import load as load_yaml
"""
:mod:`dateparser`'s parsing behavior can be configured like below
*``PREFER_DAY_OF_MONTH``* defaults to ``current`` and can have ``first`` and ``last`` as values::
>>> from dateparser.conf import settings
>>> from da... | bsd-3-clause |
luiseduardohdbackup/odoo | addons/crm/crm_phonecall.py | 255 | 14844 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
ghxandsky/ceph-deploy | ceph_deploy/hosts/__init__.py | 2 | 5008 | """
We deal (mostly) with remote hosts. To avoid special casing each different
commands (e.g. using `yum` as opposed to `apt`) we can make a one time call to
that remote host and set all the special cases for running commands depending
on the type of distribution/version we are dealing with.
"""
import logging
from cep... | mit |
simbs/edx-platform | lms/djangoapps/courseware/management/commands/tests/test_dump_course.py | 44 | 9075 | # coding=utf-8
"""Tests for Django management commands"""
import json
from nose.plugins.attrib import attr
from path import Path as path
import shutil
from StringIO import StringIO
import tarfile
from tempfile import mkdtemp
import factory
from django.conf import settings
from django.core.management import call_comm... | agpl-3.0 |
phaustin/pythermo | code/thermlib/rootfinder.py | 1 | 1456 | #!/usr/bin/env python
import numpy
from scipy import optimize
def find_interval(f, x, *args):
x1 = x
x2 = x
if x == 0.:
dx = 1./50.
else:
dx = x/50.
maxiter = 40
twosqrt = numpy.sqrt(2)
a = x
fa = f(a, *args)
b = x
fb = f(b, *args)
for i in ran... | mit |
alexproca/askbot-devel | askbot/migrations/0095_postize_award_and_repute.py | 18 | 31809 | # encoding: utf-8
import sys
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from askbot.utils.console import ProgressBar
class Migration(DataMigration):
def forwards(self, orm):
# ContentType for Post model should be created no later than in migrati... | gpl-3.0 |
acarmel/CouchPotatoServer | libs/html5lib/filters/optionaltags.py | 1727 | 10500 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2... | gpl-3.0 |
DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/examples/decomposition/plot_sparse_coding.py | 1 | 4054 | """
===========================================
Sparse coding with a precomputed dictionary
===========================================
Transform a signal as a sparse combination of Ricker wavelets. This example
visually compares different sparse coding methods using the
:class:`sklearn.decomposition.SparseCoder` esti... | mit |
txominpelu/airflow | airflow/jobs.py | 11 | 24429 | from builtins import str
from past.builtins import basestring
from collections import defaultdict
from datetime import datetime
import getpass
import logging
import signal
import socket
import subprocess
import sys
from time import sleep
from sqlalchemy import Column, Integer, String, DateTime, func, Index
from sqlalc... | apache-2.0 |
agiliq/django-graphos | graphos/renderers/flot.py | 1 | 3255 | import json
from .base import BaseChart
from ..utils import get_default_options, JSONEncoderForHTML
class BaseFlotChart(BaseChart):
""" LineChart """
def get_serieses(self):
# Assuming self.data_source.data is:
# [['Year', 'Sales', 'Expenses'], [2004, 100, 200], [2005, 300, 250]]
dat... | bsd-2-clause |
nammaste6/kafka | system_test/utils/setup_utils.py | 117 | 1848 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
bertucho/moviestalk2 | venv/Lib/encodings/mac_greek.py | 593 | 13977 | """ Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.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,input,err... | mit |
vbshah1992/microblog | flask/lib/python2.7/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py | 17 | 13150 | # sqlite/pysqlite.py
# Copyright (C) 2005-2012 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
"""Support for the SQLite database via pysqlite.
Note that pysqlite is the same dr... | bsd-3-clause |
NL66278/odoo | addons/google_account/controllers/main.py | 350 | 1270 | import simplejson
import urllib
import openerp
from openerp import http
from openerp.http import request
import openerp.addons.web.controllers.main as webmain
from openerp.addons.web.http import SessionExpiredException
from werkzeug.exceptions import BadRequest
import werkzeug.utils
class google_auth(http.Controller):... | agpl-3.0 |
repotvsupertuga/repo | plugin.video.TVsupertuga/resources/lib/zsources/xmovies.py | 4 | 4807 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | gpl-2.0 |
njase/numpy | numpy/distutils/command/build.py | 187 | 1618 | from __future__ import division, absolute_import, print_function
import os
import sys
from distutils.command.build import build as old_build
from distutils.util import get_platform
from numpy.distutils.command.config_compiler import show_fortran_compilers
class build(old_build):
sub_commands = [('config_cc', ... | bsd-3-clause |
georgyberdyshev/ascend | pygtk/canvas/asclibrary.py | 1 | 2535 | '''Import the SWIG wrapper'''
import os
DEFAULT_CANVAS_MODEL_LIBRARY_FOLDER = os.path.join('..','..','models','test','canvas')
try:
import ascpy
except ImportError as e:
print "Error: Could not load ASCEND Library. Please check the paths \
ASECNDLIBRARY and LD_LIBRARY_PATH\n",e
from blocktype import BlockType
from... | gpl-2.0 |
angelman/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py | 118 | 11747 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | bsd-3-clause |
crazy-cat/incubator-mxnet | example/speech-demo/train_lstm_proj.py | 25 | 13880 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
tectronics/open-ihm | src/openihm/gui/interface/frmproject_configure_wildfoodincome.py | 3 | 6232 | #!/usr/bin/env python
"""
This file is part of open-ihm.
open-ihm 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.
open-ihm is di... | lgpl-3.0 |
c2theg/DDoS_Information_Sharing | libraries/suds-jurko-0.6/suds/serviceproxy.py | 18 | 2838 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 is distributed in the hope that it will b... | mit |
grupoprog3/proyecto_final | proyecto/flask/Lib/shutil.py | 1 | 41006 | """Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
import fnmatch
import collections
import errno
import tarfile
try:
import bz2
del bz2
_BZ2_SUPPORT... | apache-2.0 |
ChrisBeaumont/brut | bubbly/hyperopt.py | 2 | 2563 | """
A simple interface for random exploration of hyperparameter space
"""
import random
import numpy as np
from scipy import stats
from sklearn.metrics import auc
from sklearn import metrics as met
class Choice(object):
"""Randomly select from a list"""
def __init__(self, *choices):
self._choices = ... | mit |
Zhongqilong/mykbengineer | kbe/src/lib/python/Tools/scripts/fixdiv.py | 94 | 13938 | #! /usr/bin/env python3
"""fixdiv - tool to fix division operators.
To use this tool, first run `python -Qwarnall yourscript.py 2>warnings'.
This runs the script `yourscript.py' while writing warning messages
about all uses of the classic division operator to the file
`warnings'. The warnings look like this:
<fil... | lgpl-3.0 |
wbbeyourself/cn-deep-learning | ipnd-neural-network/NN.py | 6 | 2597 | import numpy as np
class NeuralNetwork(object):
def sigmoid(self, x):
return 1/(1 + np.exp(-x))
def __init__(self, input_nodes, hidden_nodes, output_nodes, learning_rate):
# Set number of nodes in input, hidden and output layers.
self.input_nodes = input_nodes
self.hidden_n... | mit |
EvilKanoa/ardupilot | libraries/AP_OpticalFlow/examples/ADNS3080ImageGrabber/ADNS3080ImageGrabber.py | 53 | 6246 | # File: ADNS3080ImageGrabber.py
import serial
import string
import math
import time
from Tkinter import *
from threading import Timer
comPort = 'COM8' #default com port
comPortBaud = 115200
class App:
grid_size = 15
num_pixels = 30
image_started = FALSE
image_current_row = 0;
se... | gpl-3.0 |
CentOS-PaaS-SIG/linchpin | linchpin/provision/action_plugins/gcp_compute_network.py | 3 | 1255 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.action import ActionBase
import linchpin.MockUtils.MockUtils as mock_utils
class ActionModule(ActionBase):
def run(self, tmp=None, task_vars=None):
"""
Simple action plugin that returns th... | gpl-3.0 |
ubc/edx-ora2 | openassessment/assessment/worker/training.py | 10 | 12547 | """
Asynchronous tasks for training classifiers from examples.
"""
import datetime
from collections import defaultdict
from celery import task
from celery.utils.log import get_task_logger
from dogapi import dog_stats_api
from django.conf import settings
from django.db import DatabaseError
from openassessment.assessment... | agpl-3.0 |
westinedu/sovleit | django/test/simple.py | 150 | 15012 | import unittest as real_unittest
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models import get_app, get_apps
from django.test import _doctest as doctest
from django.test.utils import setup_test_environment, teardown_test_environment
from django.test.testcases ... | bsd-3-clause |
jrabbit/compose | tests/unit/cli/command_test.py | 9 | 3080 | # ~*~ encoding: utf-8 ~*~
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import pytest
import six
from compose.cli.command import get_config_path_from_options
from compose.config.environment import Environment
from compose.const import IS_WINDOWS_PLATFORM
from tests import m... | apache-2.0 |
rhyolight/nupic | src/nupic/data/dict_utils.py | 49 | 5295 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
thingsinjars/electron | script/dump-symbols.py | 144 | 1962 | #!/usr/bin/env python
import os
import sys
from lib.config import PLATFORM
from lib.util import atom_gyp, execute, rm_rf
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
CHROMIUM_DIR = os.path.join(... | mit |
tima/ansible | contrib/inventory/vmware.py | 92 | 18476 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
VMware Inventory Script
=======================
Retrieve information about virtual machines from a vCenter server or
standalone ESX host. When `group_by=false` (in the INI file), host systems
are also returned in addition to VMs.
This script will attempt to read conf... | gpl-3.0 |
Nachtfeuer/concept-py | tests/test_vector_2d.py | 1 | 5600 | """
=======
License
=======
Copyright (c) 2017 Thomas Lehmann
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 u... | mit |
kickstandproject/python-ripcordclient | ripcordclient/tests/v1/test_subscriber.py | 1 | 2502 | # -*- coding: utf-8 -*-
# Copyright (c) 2013 PolyBeacon, 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 applica... | apache-2.0 |
OpenDataNode/ckanext-odn-ic2pc-sync | ckanext/commands/publishing_cmd.py | 1 | 5849 | '''
Created on 30.10.2014
@author: mvi
'''
from ckan.lib.cli import CkanCommand
import sys
import logging
from ckanext.model.external_catalog import external_catalog_table,\
migrate_to_v0_3, migrate_to_v0_4, migrate_to_v0_6
log = logging.getLogger('ckanext')
class PublishingCmd(CkanCommand):
'''Pushes datas... | agpl-3.0 |
mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/lib/galaxy/webapps/tool_shed/model/migrate/versions/0020_add_repository_type_column.py | 1 | 1608 | """Migration script to add the type column to the repository table."""
from sqlalchemy import *
from sqlalchemy.orm import *
from migrate import *
from migrate.changeset import *
# Need our custom types, but don't import anything else from model
from galaxy.model.custom_types import *
import sys, logging
log = loggi... | gpl-3.0 |
jdugge/QGIS | tests/src/python/test_qgsserver_wfs.py | 7 | 34015 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServer WFS.
From build dir, run: ctest -R PyQgsServerWFS -V
.. 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 Licen... | gpl-2.0 |
Mauricio3000/fk_ik_sine_rig | tests/test_rig/test_sine_rig.py | 1 | 1187 | import unittest
import pymel.core as pm
from tool.errors import errors
from tool.rig import sine_rig
class Test_sine_rig(unittest.TestCase):
def test_sine_rig_build_errors(self):
self.assertRaises(errors.InputError, sine_rig.build)
self.assertRaises(errors.InputError, sine_rig.build,
... | gpl-3.0 |
AltSchool/django | tests/gis_tests/layermap/models.py | 235 | 2523 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=25)
objects = models.GeoManager()
class Meta:
abstract = True
required_db_features = ['gis_enabled']
... | bsd-3-clause |
collective/cyn.in | products/WebServerAuth/tests/test_extraction.py | 4 | 2764 | """Unit tests for extraction plugin"""
from Products.PloneTestCase import PloneTestCase
from Products.CMFCore.utils import getToolByName
from Products.WebServerAuth.utils import firstInstanceOfClass
from Products.WebServerAuth.plugin import usernameKey, defaultUsernameHeader, stripDomainNamesKey, usernameHeaderKey
fro... | gpl-3.0 |
dhanunjaya/neutron | neutron/agent/l3/dvr.py | 26 | 2827 | # Copyright (c) 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 ... | apache-2.0 |
ThiagoGarciaAlves/erpnext | erpnext/accounts/doctype/cost_center/cost_center.py | 16 | 2789 | # 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 msgprint, _
from frappe.utils.nestedset import NestedSet
class CostCenter(NestedSet):
nsm_parent_field = 'parent_co... | agpl-3.0 |
watchdogpolska/feder | feder/institutions/migrations/0008_auto_20161001_2053.py | 1 | 2085 | # Generated by Django 1.10.1 on 2016-10-01 20:53
import django.utils.timezone
import model_utils.fields
from django.db import migrations, models
def forwards_func(apps, schema_editor):
# We get the model from the versioned app registry;
# if we directly import it, it'll be the wrong version
Institution =... | mit |
mandeepdhami/netvirt-ctrl | cli/midw.py | 3 | 18056 | #
# Copyright (c) 2012,2013 Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html
#
# Unless required by applica... | epl-1.0 |
doug-fish/horizon | openstack_dashboard/test/api_tests/cinder_tests.py | 21 | 8000 | # Copyright 2012 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 agre... | apache-2.0 |
chrishokamp/fuel | fuel/converters/caltech101_silhouettes.py | 12 | 2497 | import os
import h5py
from scipy.io import loadmat
from fuel.converters.base import fill_hdf5_file, MissingInputFiles
def convert_silhouettes(size, directory, output_directory,
output_file=None):
""" Convert the CalTech 101 Silhouettes Datasets.
Parameters
----------
size : ... | mit |
norangmangto/pypi-default | setup.py | 1 | 4103 | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
import re
import ... | gpl-3.0 |
jabesq/home-assistant | homeassistant/components/caldav/calendar.py | 1 | 9850 | """Support for WebDav Calendar."""
import copy
from datetime import datetime, timedelta
import logging
import re
import voluptuous as vol
from homeassistant.components.calendar import (
ENTITY_ID_FORMAT, PLATFORM_SCHEMA, CalendarEventDevice, calculate_offset,
get_date, is_offset_reached)
from homeassistant.co... | apache-2.0 |
charukiewicz/beer-manager | venv/lib/python3.4/site-packages/jinja2/testsuite/filters.py | 394 | 19169 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.filters
~~~~~~~~~~~~~~~~~~~~~~~~
Tests for the jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Markup, Environment
fro... | mit |
i945/An | An/extra_apps/xadmin/migrations/0002_log.py | 15 | 1849 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-15 05:50
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
... | mit |
houzhenggang/OpenWRT-1 | scripts/dl_cleanup.py | 202 | 5942 | #!/usr/bin/env python
"""
# OpenWRT download directory cleanup utility.
# Delete all but the very last version of the program tarballs.
#
# Copyright (C) 2010 Michael Buesch <mb@bu3sch.de>
# Copyright (C) 2013 OpenWrt.org
"""
import sys
import os
import re
import getopt
# Commandline options
opt_dryrun = False
def ... | gpl-2.0 |
tianchaijz/MTHTTPServerWFM | MTHTTPServerWFM.py | 1 | 19948 | #!/usr/bin/env python
# encoding: utf-8
"""Multiple Threading HTTP Server With File Management.
This program is extended from the standard `SimpleHTTPServer` module by adding
upload and delete file features.
"""
__version__ = "0.31"
__all__ = ["HTTPRequestHandlerWFM"]
__author__ = "Jinzheng Zhang"
__email__ = "tian... | mit |
siosio/intellij-community | plugins/hg4idea/testData/bin/mercurial/verify.py | 93 | 10933 | # verify.py - repository integrity checking for Mercurial
#
# Copyright 2006, 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 nullid, short
from i18n import _
import os
import r... | apache-2.0 |
leiferikb/bitpop | depot_tools/third_party/pylint/reporters/html.py | 20 | 2541 | # Copyright (c) 2003-2006 Sylvain Thenault (thenault@gmail.com).
# Copyright (c) 2003-2011 LOGILAB S.A. (Paris, FRANCE).
# 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 L... | gpl-3.0 |
CMPUT410W15T02/CMPUT410W15-project | testenv/lib/python2.7/site-packages/django/contrib/contenttypes/forms.py | 93 | 3837 | from __future__ import unicode_literals
from django.db import models
from django.forms import ModelForm, modelformset_factory
from django.forms.models import BaseModelFormSet
from django.contrib.contenttypes.models import ContentType
class BaseGenericInlineFormSet(BaseModelFormSet):
"""
A formset for generic... | gpl-2.0 |
kelvin13/Knockout | pygments/lexers/configs.py | 21 | 27854 | # -*- coding: utf-8 -*-
"""
pygments.lexers.configs
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for configuration file formats.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, default, words, bygro... | gpl-3.0 |
alexlo03/ansible | lib/ansible/modules/cloud/ovirt/ovirt_host_pm.py | 8 | 8366 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUME... | gpl-3.0 |
nearai/program_synthesis | program_synthesis/naps/uast/uast.py | 1 | 66502 | from __future__ import print_function
import functools
import six
import sys
import time
import math
import numpy as np
import re
from operator import mul
from sortedcontainers import SortedDict, SortedSet
from .uast_watcher import WatcherEvent, tuplify
DEBUG_INFO = False
LARGEST_INT = 2 ** 64
OBJECT = "object"
B... | apache-2.0 |
jni/networkx | networkx/algorithms/components/connected.py | 10 | 4068 | # -*- coding: utf-8 -*-
"""
Connected components.
"""
# Copyright (C) 2004-2013 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.utils.decorators import not_implemented_for
... | bsd-3-clause |
NickShaffner/rhea | rhea/build/boards/xilinx/_xula.py | 2 | 7089 | #
# Copyright (c) 2014-2015 Christopher Felton
#
from rhea.build import FPGA
from rhea.build.extintf import Port
# @todo: get SDRAM interface from rhea.cores.sdram
# from ...extintf._sdram import SDRAM
from rhea.build.toolflow import ISE
class Xula(FPGA):
vendor = 'xilinx'
family = 'spartan3A'
device = '... | mit |
insertnamehere1/maraschino | lib/sqlalchemy/dialects/sybase/base.py | 22 | 15166 | # sybase/base.py
# Copyright (C) 2010-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
# get_select_precolumns(), limit_clause() implementation
# copyright (C) 2007 Fisch Asset Management
# AG http://www.fam.ch, with coding by Alexander Houben
# alexander.houben@thor-solutions.ch
#
# This module is par... | mit |
raghavs1108/DataPlotter | examples/GLVolumeItem.py | 28 | 1968 | # -*- coding: utf-8 -*-
"""
Demonstrates GLVolumeItem for displaying volumetric data.
"""
## Add path to library (just for examples; you do not need this)
import initExample
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph.opengl as gl
app = QtGui.QApplication([])
w = gl.GLViewWidget()
w.opts['distance'] = 2... | mit |
ktan2020/legacy-automation | win/Lib/hotshot/log.py | 20 | 6433 | import _hotshot
import os.path
import parser
import symbol
from _hotshot import \
WHAT_ENTER, \
WHAT_EXIT, \
WHAT_LINENO, \
WHAT_DEFINE_FILE, \
WHAT_DEFINE_FUNC, \
WHAT_ADD_INFO
__all__ = ["LogReader", "ENTER", "EXIT", "LINE"]
ENTER = WHAT_ENTER
EXIT = WHAT_EXIT
LI... | mit |
e-dorigatti/pyspider | pyspider/libs/multiprocessing_queue.py | 14 | 2808 | import six
import platform
import multiprocessing
from multiprocessing.queues import Queue as BaseQueue
# The SharedCounter and Queue classes come from:
# https://github.com/vterron/lemon/commit/9ca6b4b
class SharedCounter(object):
""" A synchronized shared counter.
The locking done by multiprocessing.Value ... | apache-2.0 |
zoeyangyy/event-extraction | tf_test/lstm-pos.py | 1 | 7622 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import gensim
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
from tensorflow.contrib import rnn
import numpy as np
'''
For Chinese word segmentation.
https://github.com/yongyehuang/Tensorflow-Tutor... | mit |
longman694/youtube-dl | youtube_dl/extractor/tass.py | 64 | 2016 | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
js_to_json,
qualities,
)
class TassIE(InfoExtractor):
_VALID_URL = r'https?://(?:tass\.ru|itar-tass\.com)/[^/]+/(?P<id>\d+)'
_TESTS = [
{
'url': 'http://tas... | unlicense |
ryfeus/lambda-packs | Tensorflow_OpenCV_Nightly/source/tensorflow/contrib/keras/python/keras/applications/vgg16.py | 30 | 9077 | # 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... | mit |
iivic/BoiseStateX | common/test/acceptance/tests/studio/test_studio_general.py | 105 | 5669 | """
Acceptance tests for Studio.
"""
from unittest import skip
from bok_choy.web_app_test import WebAppTest
from ...pages.studio.asset_index import AssetIndexPage
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.studio.checklists import ChecklistsPage
from ...pages.studio.course_info import CourseUpda... | agpl-3.0 |
cloudfoundry/php-buildpack-legacy | builds/runtimes/python-2.7.6/lib/python2.7/test/test_posixpath.py | 71 | 17716 | import unittest
from test import test_support, test_genericpath
import posixpath, os
from posixpath import realpath, abspath, dirname, basename
# An absolute path to a temporary filename for testing. We can't rely on TESTFN
# being an absolute path, so we need this.
ABSTFN = abspath(test_support.TESTFN)
def skip_if... | mit |
cloudfoundry/php-buildpack-legacy | builds/runtimes/python-2.7.6/lib/python2.7/test/test_cfgparser.py | 71 | 27744 | import ConfigParser
import StringIO
import os
import unittest
import UserDict
from test import test_support
class SortedDict(UserDict.UserDict):
def items(self):
result = self.data.items()
result.sort()
return result
def keys(self):
result = self.data.keys()
result.so... | mit |
ondrejmular/pcs | pcs/utils.py | 3 | 87422 | # pylint: disable=too-many-lines
import os
import sys
import subprocess
import xml.dom.minidom
from xml.dom.minidom import parseString
import xml.etree.ElementTree as ET
import re
import json
import tempfile
import signal
import time
from io import BytesIO
import tarfile
import getpass
import base64
import threading
im... | gpl-2.0 |
woodpecker1/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/memoized.py | 211 | 2482 | # Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
MycChiu/tensorflow | tensorflow/contrib/tensor_forest/python/kernel_tests/sample_inputs_op_test.py | 56 | 6058 | # 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 |
loveward/yingsuo | shadowsocks/obfsplugin/http_simple.py | 4 | 12316 | #!/usr/bin/env python
#
# Copyright 2015-2015 breakwa11
#
# 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 |
amisrs/angular-flask | angular_flask/lib/python2.7/site-packages/pip/commands/uninstall.py | 798 | 2884 | from __future__ import absolute_import
import pip
from pip.wheel import WheelCache
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.basecommand import Command
from pip.exceptions import InstallationError
class UninstallCommand(Command):
"""
Uninstall packages.
pip is a... | mit |
else/mosquitto | test/lib/02-subscribe-qos2.py | 7 | 2349 | #!/usr/bin/env python
# Test whether a client sends a correct SUBSCRIBE to a topic with QoS 2.
# The client should connect to port 1888 with keepalive=60, clean session set,
# and client id subscribe-qos2-test
# The test will send a CONNACK message to the client with rc=0. Upon receiving
# the CONNACK and verifying t... | bsd-3-clause |
Scaravex/clue-hackathon | clustering/time_profile_cluster.py | 2 | 1438 | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 19 11:21:47 2017
@author: mskara
"""
import pandas as pd
import matplotlib.pyplot as plt
from src.pre_process import load_binary
def create_profile_for_symptoms(df, date_range=15):
profiles = {}
for symptom in symptoms:
temp = df[df['symptom'... | apache-2.0 |
bottompawn/kbengine | kbe/res/scripts/common/Lib/multiprocessing/process.py | 98 | 9144 | #
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['BaseProcess', 'current_process', 'active_children']
#
# Imports
#
import os
import sys
import signal
import i... | lgpl-3.0 |
onceuponatimeforever/oh-mainline | vendor/packages/oauthlib/oauthlib/oauth2/rfc6749/request_validator.py | 36 | 19514 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import unicode_literals, absolute_import
import logging
log = logging.getLogger(__name__)
class RequestValidator(object):
def client_authentication_required(self, request, *args, **kwargs):
... | agpl-3.0 |
nathanaevitas/odoo | openerp/addons/purchase/company.py | 383 | 1576 | # -*- 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 |
willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/EnviroFacts/Toxins/FacilitiesSearchByZip.py | 5 | 4077 | # -*- coding: utf-8 -*-
###############################################################################
#
# FacilitiesSearchByZip
# Retrieves a list of EPA-regulated facilities in the Toxics Release Inventory (TRI) database within a given area code.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
#... | gpl-2.0 |
swdream/neutron | neutron/notifiers/batch_notifier.py | 56 | 2337 | # 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
# d... | apache-2.0 |
Wuteyan/VTK | Examples/Rendering/Python/FilterCADPart.py | 42 | 2338 | #!/usr/bin/env python
# This simple example shows how to do simple filtering in a pipeline.
# See CADPart.py and Cylinder.py for related information.
import vtk
from vtk.util.colors import light_grey
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# This creates a polygonal cylinder model w... | bsd-3-clause |
beckdaniel/GPy | GPy/util/mocap.py | 8 | 27243 | import os
import numpy as np
import math
from GPy.util import datasets as dat
class vertex:
def __init__(self, name, id, parents=[], children=[], meta = {}):
self.name = name
self.id = id
self.parents = parents
self.children = children
self.meta = meta
def __str__(self)... | bsd-3-clause |
JoseBlanca/franklin | test/utils/seqio_utils_test.py | 1 | 3293 | '''
Created on 2009 uzt 28
@author: peio
'''
# Copyright 2009 Jose Blanca, Peio Ziarsolo, COMAV-Univ. Politecnica Valencia
# This file is part of franklin.
# franklin 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 Softwar... | agpl-3.0 |
mcfletch/AutobahnPython | examples/twisted/wamp/auth/persona/server.py | 7 | 9085 | ###############################################################################
##
## Copyright (C) 2011-2014 Tavendo GmbH
##
## 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
##
## h... | apache-2.0 |
JamesShaeffer/QGIS | python/plugins/db_manager/dlg_export_vector.py | 62 | 8183 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : Oct 13, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
mookaka/mywebblog | www/pymonitor.py | 1 | 1762 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'mookaka'
import os, sys, time, subprocess
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
command = ['echo', 'ok']
process = None
def log(s):
print('[Monitor] %s' % s)
class MyFileSystemEventHandler(FileSys... | mit |
jpaalasm/pyglet | tests/window/WINDOW_SET_VSYNC.py | 29 | 2009 | #!/usr/bin/env python
'''Test that vsync can be set.
Expected behaviour:
A window will alternate between red and green fill.
- Press "v" to toggle vsync on/off. "Tearing" should only be visible
when vsync is off (as indicated at the terminal).
Not all video drivers support vsync. On Linux,... | bsd-3-clause |
PatKayongo/patkayongo.github.io | node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_phpbuiltins.py | 95 | 122088 | # -*- coding: utf-8 -*-
"""
pygments.lexers._phpbuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file loads the function names and their modules from the
php webpage and generates itself.
Do not alter the MODULES dict by hand!
WARNING: the generation transfers quite much data over your
... | mit |
mkennedy04/knodj | env/Lib/site-packages/django/contrib/auth/decorators.py | 117 | 3021 | from functools import wraps
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import PermissionDenied
from django.shortcuts import resolve_url
from django.utils.decorators import available_attrs
from django.utils.six.moves.urllib.parse import urlparse
de... | mit |
ihipi/Sick-Beard | sickbeard/name_cache.py | 14 | 2259 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | gpl-3.0 |
roy2220/srs | trunk/research/code-statistic/csr.py | 5 | 3514 | #!/usr/bin/python
'''
The MIT License (MIT)
Copyright (c) 2013-2016 SRS(ossrs)
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,... | mit |
hawk-lord/gnucash | src/optional/python-bindings/example_scripts/quotes_historic.py | 13 | 2473 | #!/usr/bin/env python
# quotes_historic.py -- Example Script to read historic quote data into gnucash
#
## @file
# @brief Example Script to read historic stock data into gnucash
# @author Peter Holtermann
# @date January 2011
# @ingroup python_bindings_examples
#
# Call the perl-script @code
# ./get_... | gpl-2.0 |
PopCap/GameIdea | Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/ctypes/test/test_cast.py | 81 | 3212 | from ctypes import *
import unittest
import sys
class Test(unittest.TestCase):
def test_array2pointer(self):
array = (c_int * 3)(42, 17, 2)
# casting an array to a pointer works.
ptr = cast(array, POINTER(c_int))
self.assertEqual([ptr[i] for i in range(3)], [42, 17, 2])
i... | bsd-2-clause |
zuku1985/scikit-learn | sklearn/utils/tests/test_multiclass.py | 58 | 14316 |
from __future__ import division
import numpy as np
import scipy.sparse as sp
from itertools import product
from sklearn.externals.six.moves import xrange
from sklearn.externals.six import iteritems
from scipy.sparse import issparse
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sp... | bsd-3-clause |
bformet/django-admin-bootstrapped | django_admin_bootstrapped/renderers.py | 20 | 2302 | from __future__ import absolute_import
from django.contrib.auth.forms import ReadOnlyPasswordHashWidget
from django.contrib.admin.widgets import (AdminDateWidget, AdminTimeWidget,
AdminSplitDateTime, RelatedFieldWidgetWrapper)
from django.forms import (FileInput, CheckboxInput... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.