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 |
|---|---|---|---|---|---|
toontownfunserver/Panda3D-1.9.0 | python/Lib/JOD/JamoDrumNodePath.py | 3 | 10460 | """
NodePath for Jam-o-Drum model
@author: Ben Buchwald <bb2@alumni.cmu.edu>
Last Updated: 11/29/2005
@var DRUMPAD_RADIUS: constant representing the radius of the drumpad as a percentage
of the radius of the table
@type DRUMPAD_RADIUS: float
@var SPINNER_RADIUS: constant representing the radius o... | bsd-3-clause |
natetrue/ReplicatorG | skein_engines/skeinforge-35/skeinforge_application/skeinforge_plugins/craft_plugins/export_plugins/gcode_time_segment.py | 6 | 9072 | """
This page is in the table of contents.
Gcode time segment is an export plugin to convert gcode from float position to number of steps.
An export plugin is a script in the export_plugins folder which has the getOutput function, the globalIsReplaceable variable and if it's output is not replaceable, the writeOutput ... | gpl-2.0 |
twiest/openshift-tools | openshift/installer/vendored/openshift-ansible-git-2016-04-27/lookup_plugins/oo_option.py | 28 | 3249 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
'''
oo_option lookup plugin for openshift-ansible
Usage:
- debug:
msg: "{{ lookup('oo_option', '<key>') | default('<default_value>', True) }}"
This returns, by order of priority:
* if it exists, the `cli_<key>` ansible... | apache-2.0 |
hydroshare/hydroshare_temp | ga_resources/utils.py | 2 | 10245 | """ This module contains miscellaneous utility functions and classes for creating the OWS webservices. The most useful
functions in the module are probably the date manipulation functions.
"""
from collections import namedtuple
import datetime
import json
from django.contrib.auth.models import User
from django.core.e... | bsd-3-clause |
meetsandeepan/meetsandeepan.github.io | node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/vim.py | 364 | 1976 | # -*- coding: utf-8 -*-
"""
pygments.styles.vim
~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by vim.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keywor... | mit |
todaychi/hue | desktop/core/ext-py/cryptography-1.3.1/src/_cffi_src/openssl/pkcs7.py | 8 | 2332 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <openssl/pkcs7.h>
"""
TYPES = """
typedef struct... | apache-2.0 |
xxshutong/openerp-7.0 | openerp/addons/l10n_fr_hr_payroll/report/__init__.py | 424 | 1091 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
teamfx/openjfx-8u-dev-rt | modules/web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py | 1 | 4331 | #!/usr/bin/env python
#
# Copyright (c) 2014, 2016 Apple Inc. All rights reserved.
# Copyright (c) 2014 University of Washington. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributio... | gpl-2.0 |
adlius/osf.io | api_tests/registrations/views/test_registration_embeds.py | 10 | 3156 | import pytest
from nose.tools import * # noqa:
import functools
from framework.auth.core import Auth
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from osf.utils.permissions import WRITE
from osf_tests.factories import (
ProjectFactory,
AuthUserFactory,
RegistrationFa... | apache-2.0 |
MatiasBjorling/lightnvm-moved-to-OpenChannelSSD-Linux | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
digitalocean/netbox | netbox/secrets/models.py | 1 | 14739 | import os
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Util import strxor
from django.conf import settings
from django.contrib.auth.hashers import make_password, check_password
from django.contrib.auth.models import Group, User
from django.contrib.contenttypes.fields import GenericForeign... | apache-2.0 |
5nizza/party-elli | synthesis/model_k_searcher.py | 1 | 1140 | import logging
from helpers.logging_helper import log_entrance
from interfaces.LTS import LTS
from interfaces.solver_interface import SolverInterface
from synthesis.coreach_encoder import CoreachEncoder
from synthesis.smt_format import make_check_sat
@log_entrance()
def search(min_size:int, max_size:int,
... | mit |
GreenLunar/Bookie | bookie/tests/test_api/test_admin.py | 6 | 7463 | """Test that we're meeting delicious API specifications"""
import logging
import json
import transaction
import unittest
from pyramid import testing
from bookie.models import Bmark
from bookie.models import DBSession
from bookie.models.auth import Activation
from bookie.models.queue import ImportQueue
from bookie.test... | agpl-3.0 |
qdonnellan/django_emailoto | emailoto/config.py | 1 | 1065 | from django.conf import settings
class EmailOtoConfig(object):
def __init__(self):
"""Read from settings.py and apply defaults (or raise exceptions.)"""
self.redis_host = settings.EMAILOTO.get('redis_host', 'localhost')
self.redis_port = settings.EMAILOTO.get('redis_port', 6379)
... | mit |
sandow-digital/easy-thumbnails-cropman | easy_thumbnails/files.py | 6 | 28958 | import os
from django.utils import six
from django.core.files.base import File, ContentFile
from django.core.files.storage import (
default_storage, Storage)
from django.db.models.fields.files import ImageFieldFile, FieldFile
from django.core.files.images import get_image_dimensions
from django.utils.safestring i... | bsd-3-clause |
tarkatronic/opbeat_python | tests/instrumentation/python_memcached_tests.py | 2 | 2048 | from functools import partial
from django.test import TestCase
import mock
import memcache
import opbeat
from opbeat.traces import trace
from tests.contrib.django.django_tests import get_client
class InstrumentMemcachedTest(TestCase):
def setUp(self):
self.client = get_client()
opbeat.instrumenta... | bsd-3-clause |
SysCompass/compass-core | compass/api/api.py | 4 | 43733 | """Define all the RestfulAPI entry points"""
import logging
import simplejson as json
from flask import request
from flask.ext.restful import Resource
from sqlalchemy.sql import and_, or_
from compass.api import app, util, errors
from compass.tasks.client import celery
from compass.db import database
from compass.db.m... | apache-2.0 |
Pythonify/awesome | venv/lib/python2.7/site-packages/pip/utils/packaging.py | 343 | 2080 | from __future__ import absolute_import
from email.parser import FeedParser
import logging
import sys
from pip._vendor.packaging import specifiers
from pip._vendor.packaging import version
from pip._vendor import pkg_resources
from pip import exceptions
logger = logging.getLogger(__name__)
def check_requires_pyth... | gpl-3.0 |
EPyutao/tfProject | Resnet.py | 1 | 1879 | from __future__ import division, print_function, absolute_import
import tflearn
# Residual blocks
# 32 layers: n=5, 56 layers: n=9, 110 layers: n=18
n = 5
# Data loading
from tflearn.datasets import cifar10
(X, Y), (testX, testY) = cifar10.load_data()
Y = tflearn.data_utils.to_categorical(Y, 10)
testY = tflearn.data... | mit |
HewlettPackard/oneview-ansible | library/oneview_enclosure_group_facts.py | 1 | 4175 | #!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2019) Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licen... | apache-2.0 |
techtonik/readthedocs.org | readthedocs/core/forms.py | 31 | 3185 | import logging
from haystack.forms import SearchForm
from haystack.query import SearchQuerySet
from django import forms
from django.forms.fields import CharField
from django.utils.translation import ugettext_lazy as _
from .models import UserProfile
log = logging.getLogger(__name__)
class UserProfileForm(forms.Mod... | mit |
brad-kaiser/spark | examples/src/main/python/mllib/isotonic_regression_example.py | 100 | 2394 | #
# 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 us... | apache-2.0 |
RaRe-Technologies/gensim | docs/src/auto_examples/howtos/run_downloader_api.py | 8 | 4515 | r"""
How to download pre-trained models and corpora
==============================================
Demonstrates simple and quick access to common corpora and pretrained models.
"""
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
#############################... | lgpl-2.1 |
shaz13/oppia | core/domain/html_cleaner.py | 4 | 4289 | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
ragupta-git/ImcSdk | imcsdk/mometa/equipment/EquipmentSystemIOController.py | 1 | 2755 | """This module contains the general information for EquipmentSystemIOController ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class EquipmentSystemIOControllerConsts:
ADMIN_POWER_CMC_REBOOT = "cmc-reboot"
ADMIN_POWER_... | apache-2.0 |
aerosara/thesis | notebooks_archive_10112014/pycse Examples.py | 1 | 2176 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=3>
# Example from pycse 1
# <codecell>
# copied from http://kitchingroup.cheme.cmu.edu/blog/tag/events/
from pycse import odelay
import matplotlib.pyplot as plt
import numpy as np
def ode(Y,x):
y1, y2 = Y
dy1dx = y2
dy2dx = -y1
... | mit |
ilpianista/ansible | lib/ansible/cli/doc.py | 4 | 32339 | # Copyright: (c) 2014, James Tanner <tanner.jc@gmail.com>
# Copyright: (c) 2018, 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
import datetime
import json
import os
im... | gpl-3.0 |
hanv89/api-client-python | lib/pyasn1_modules/rfc1157.py | 127 | 3285 | #
# SNMPv1 message syntax
#
# ASN.1 source from:
# http://www.ietf.org/rfc/rfc1157.txt
#
# Sample captures from:
# http://wiki.wireshark.org/SampleCaptures/
#
from pyasn1.type import univ, namedtype, namedval, tag, constraint
from pyasn1_modules import rfc1155
class Version(univ.Integer):
namedValues = namedval.Na... | apache-2.0 |
mtsgrd/PynamoDB2 | pynamodb/connection/table.py | 1 | 7391 | """
PynamoDB Connection classes
~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from .base import Connection
class TableConnection(object):
"""
A higher level abstraction over botocore
"""
def __init__(self, table_name, region=None, host=None):
self._hash_keyname = None
self._range_keyname = None
... | mit |
BeegorMif/HTPC-Manager | autoProcessTV/mediaToSickbeard.py | 1 | 6654 | #!/usr/bin/env python2
import sys
import os
import time
import ConfigParser
import logging
sickbeardPath = os.path.split(os.path.split(sys.argv[0])[0])[0]
sys.path.append(os.path.join( sickbeardPath, 'lib'))
sys.path.append(sickbeardPath)
configFilename = os.path.join(sickbeardPath, "config.ini")
import requests
con... | gpl-3.0 |
sontek/rethinkdb | external/v8_3.30.33.16/tools/nacl-run.py | 77 | 4883 | #!/usr/bin/env python
#
# Copyright 2013 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
# noti... | agpl-3.0 |
victorpoughon/master-thesis | python/outlier_analysis.py | 1 | 1365 | #!/usr/bin/env python3
import os
import os.path
import sys
import numpy as np
import matplotlib.pyplot as plt
from features_common import match_angle, base_plot
def outlier_frequency_plot(path, angles, threshold):
f, ax = base_plot()
ax.plot(100 * np.cumsum(np.abs(angles) > threshold) / angles.size)
ax.s... | mit |
trondhindenes/ansible | test/units/module_utils/facts/base.py | 47 | 2309 | # base unit test classes for ansible/module_utils/facts/ tests
# -*- coding: utf-8 -*-
#
# 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 |
plq/spyne | spyne/test/interop/server/soap12/soap_http_basic.py | 3 | 1938 | #!/usr/bin/env python
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ve... | lgpl-2.1 |
dkodnik/arp | addons/base_report_designer/installer.py | 40 | 3107 | # -*- 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 |
uclouvain/OSIS-Louvain | base/migrations/0240_auto_20180316_1041.py | 2 | 1315 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-03-16 09:41
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0239_message_template_proposal_cancel'),
]
... | agpl-3.0 |
aperigault/ansible | lib/ansible/modules/cloud/openstack/os_port_facts.py | 31 | 7153 | #!/usr/bin/python
# Copyright (c) 2016 IBM
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
pombredanne/bokeh | examples/plotting/file/choropleth.py | 3 | 1413 | from bokeh.plotting import figure, show, output_file
from bokeh.sampledata.us_counties import data as counties
from bokeh.sampledata.us_states import data as states
from bokeh.sampledata.unemployment import data as unemployment
del states["HI"]
del states["AK"]
EXCLUDED = ("ak", "hi", "pr", "gu", "vi", "mp", "as")
s... | bsd-3-clause |
openlmi/openlmi-scripts | commands/selinux/lmi/scripts/selinux/__init__.py | 2 | 8875 | # Copyright (C) 2013-2014 Red Hat, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and... | bsd-2-clause |
saumishr/django | django/conf/locale/sr_Latn/formats.py | 655 | 1980 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_F... | bsd-3-clause |
dcf21/4most-4gp-scripts | src/scripts/synthesize_samples/synthesize_galah_with_microturbulence.py | 1 | 4084 | #!../../../../virtualenv/bin/python3
# -*- coding: utf-8 -*-
# NB: The shebang line above assumes you've installed a python virtual environment alongside your working copy of the
# <4most-4gp-scripts> git repository. It also only works if you invoke this python script from the directory where it
# is located. If these... | mit |
nhalloran/three.js | utils/exporters/blender/addons/io_three/exporter/__init__.py | 119 | 2708 | import os
import sys
import traceback
from .. import constants, logger, exceptions, dialogs
from . import scene, geometry, api, base_classes
def _error_handler(func):
def inner(filepath, options, *args, **kwargs):
level = options.get(constants.LOGGING, constants.DISABLED)
version = options.ge... | mit |
DonRyuDragoni/vy | vyapp/plugins/ibash.py | 7 | 3046 | """ To be able to run commands as root you can use sudo. You need to specify
export SUDO_ASKPASS=/usr/bin/ssh-askpass in your .bashrc file.
To log on as root.
sudo bash -i
"""
from untwisted.network import core, xmap, cmap, READ, WRITE, Device
from untwisted.tkinter import extern
from untwisted.utils.iofd import *
f... | mit |
SamHames/scikit-image | skimage/viewer/canvastools/base.py | 1 | 5472 | import numpy as np
try:
from matplotlib import lines
except ImportError:
pass
__all__ = ['CanvasToolBase', 'ToolHandles']
def _pass(*args):
pass
class CanvasToolBase(object):
"""Base canvas tool for matplotlib axes.
Parameters
----------
ax : :class:`matplotlib.axes.Axes`
Matpl... | bsd-3-clause |
EvanK/ansible | lib/ansible/modules/cloud/amazon/ec2_win_password.py | 54 | 6593 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
yosshy/nova | nova/db/sqlalchemy/migrate_repo/versions/227_fix_project_user_quotas_resource_length.py | 81 | 1366 | # Copyright 2013 NEC Corporation
#
# 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 ag... | apache-2.0 |
emonty/sqlalchemy-migrate | migrate/exceptions.py | 135 | 1860 | """
Provide exception classes for :mod:`migrate`
"""
class Error(Exception):
"""Error base class."""
class ApiError(Error):
"""Base class for API errors."""
class KnownError(ApiError):
"""A known error condition."""
class UsageError(ApiError):
"""A known error condition where help should be d... | mit |
mbertrand/cga-worldmap | geonode/migrations/avatar/0001_initial.py | 2 | 4673 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Avatar'
db.create_table('avatar_avatar', (
('id', self.gf('django.db.models.fi... | gpl-3.0 |
DavidMikeSimon/ansible | lib/ansible/compat/tests/unittest.py | 375 | 1147 | # (c) 2014, Toshio Kuratomi <tkuratomi@ansible.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 later... | gpl-3.0 |
davidhax0r/Rocket | flask/lib/python2.7/site-packages/setuptools/tests/test_test.py | 286 | 3710 | # -*- coding: UTF-8 -*-
"""develop tests
"""
import sys
import os, shutil, tempfile, unittest
import tempfile
import site
from distutils.errors import DistutilsError
from setuptools.compat import StringIO
from setuptools.command.test import test
from setuptools.command import easy_install as easy_install_pkg
from set... | mit |
ajoubert-mitre/geoq | geoq/accounts/migrations/0001_initial.py | 6 | 4643 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UserProfile'
db.create_table(u'accounts_userprofile', (
(u'id', self.gf('django.... | mit |
ow-krioles/go-mongo-backup | lambda/mongo-backup/requests/packages/chardet/mbcssm.py | 1783 | 19590 | ######################## 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... | mit |
raycarnes/knowledge | __unported__/document_multiple_records/document.py | 15 | 3790 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or m... | agpl-3.0 |
AkhilHector/Rex.Inc | .env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py | 2965 | 12784 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
raymondnijssen/QGIS | tests/src/python/test_project_storage_postgres.py | 12 | 5031 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for the postgres project storage.
Note: to prepare the DB, you need to run the sql files specified in
tests/testdata/provider/testdata_pg.sh
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as... | gpl-2.0 |
rdmilligan/SaltwashAR | scripts/sportyrobotframes.py | 1 | 174815 | # Copyright (C) 2015 Ross D Milligan
# GNU GENERAL PUBLIC LICENSE Version 3 (full notice can be found at https://github.com/rdmilligan/SaltwashAR)
### Auto-generated code ###
from OpenGL.GL import *
import PIL.Image
def sporty_robot_body_frame():
materials = {}
image = PIL.Image.open('images/sporty_rob... | gpl-3.0 |
wallyworld/juju | acceptancetests/repository/xenial/mysql/hooks/common.py | 4 | 3781 | # vim: syntax=python
import os
import sys
import MySQLdb
import subprocess
import uuid
def get_service_user_file(service):
return '/var/lib/mysql/%s.service_user2' % service
def get_service_user(service):
if service == '':
return (None, None)
sfile = get_service_user_file(service)
if os.path... | agpl-3.0 |
roderyc/enso | enso/plugins.py | 7 | 4042 | # Copyright (c) 2008, Humanized, 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:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | bsd-3-clause |
celiafish/VisTrails | vistrails/core/data_structures/graph.py | 2 | 37473 | ###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | bsd-3-clause |
ychfan/tensorflow | tensorflow/python/debug/__init__.py | 19 | 2701 | # 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 |
rhelmer/socorro-lib | socorro/external/postgresql/base.py | 1 | 15947 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""Deprecated by socorro/external/postgresql/service_base.py"""
import contextlib
import logging
import psycopg2
impo... | mpl-2.0 |
syphar/django | django/conf/locale/pl/formats.py | 504 | 1147 | # -*- 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 = 'j E Y'
TIME_FORMAT = 'H:i'
DATETI... | bsd-3-clause |
honestbleeps/django-oauth-toolkit | setup.py | 8 | 1756 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
import re
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(package, '__init__.py')).read()
return re.match("__version__ ... | bsd-2-clause |
GauravSahu/odoo | openerp/tools/mail.py | 56 | 29682 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2012-TODAY OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
tchernomax/ansible | lib/ansible/modules/net_tools/nios/nios_host_record.py | 11 | 8800 | #!/usr/bin/python
# Copyright (c) 2018 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview... | gpl-3.0 |
pdehaye/theming-edx-platform | lms/djangoapps/shoppingcart/migrations/0002_auto__add_field_paidcourseregistration_mode.py | 182 | 8687 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'PaidCourseRegistration.mode'
db.add_column('shoppingcart_paidcourseregistration', 'mode',
... | agpl-3.0 |
abele/bokeh | bokeh/charts/tests/test_data_adapter.py | 37 | 3285 | """ This is the Bokeh charts testing interface.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with thi... | bsd-3-clause |
leondz/entity-recognition | run_tagger.py | 2 | 3917 | #!/usr/bin/env python3
# params:
# 1. <conll training data path>
# 2. <brown clusters path>
# 3. <model file path>
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-f", "--file", dest="infile",
help="read data to be tagged (e.g. conll, json) from this file")
parser.add_op... | apache-2.0 |
nitirohilla/upm | examples/python/loudness.py | 7 | 2070 | #!/usr/bin/python
# Author: Jon Trulson <jtrulson@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 l... | mit |
javipalanca/Django-facebook | django_facebook/tests.py | 21 | 37938 | from __future__ import with_statement
from django.contrib.auth.models import AnonymousUser
from django.contrib.sessions.middleware import SessionMiddleware
from django.core.urlresolvers import reverse
from django.http import QueryDict
from django.test.client import Client, RequestFactory
from django_facebook import exc... | bsd-3-clause |
mezz64/home-assistant | homeassistant/components/modbus/sensor.py | 5 | 8243 | """Support for Modbus Register sensors."""
import logging
import struct
from typing import Any, Optional, Union
from pymodbus.exceptions import ConnectionException, ModbusException
from pymodbus.pdu import ExceptionResponse
import voluptuous as vol
from homeassistant.components.sensor import DEVICE_CLASSES_SCHEMA, PL... | apache-2.0 |
mmedenjak/hazelcast-client-protocol | py/__init__.py | 1 | 10457 | import keyword
import re
def py_types_encode_decode(t):
if t not in _py_types:
raise NotImplementedError("Missing type Mapping")
_pattern1 = re.compile("(.)([A-Z][a-z]+)")
_pattern2 = re.compile("([a-z0-9])([A-Z])")
def py_param_name(type_name):
type_name = _pattern1.sub(r"\1_\2", type_name)
t... | apache-2.0 |
lidavidm/sympy | sympy/combinatorics/group_constructs.py | 25 | 2032 | from __future__ import print_function, division
from sympy.combinatorics.perm_groups import PermutationGroup
from sympy.combinatorics.permutations import Permutation
from sympy.utilities.iterables import uniq
from sympy.core.compatibility import xrange
_af_new = Permutation._af_new
def DirectProduct(*groups):
"... | bsd-3-clause |
gdos/pylygon | examples/collidepoly.py | 2 | 2634 | """
this example demonstrates how to implement discrete collision detection and
find minimum translation distances using the collidepoly method
"""
from math import ceil, floor
from operator import mul
from pylygon import Polygon
import pygame
from pygame import display, draw, event, mouse, Surface
f... | gpl-3.0 |
intgr/django | django/utils/jslex.py | 104 | 7707 | """JsLex: a lexer for Javascript"""
# Originally from https://bitbucket.org/ned/jslex
import re
class Tok:
"""
A specification for a token class.
"""
num = 0
def __init__(self, name, regex, next=None):
self.id = Tok.num
Tok.num += 1
self.name = name
self.regex = re... | bsd-3-clause |
thomasaarholt/hyperspy | hyperspy/misc/ipython_tools.py | 2 | 3087 | # -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | gpl-3.0 |
didzis/AMRParsing | stanfordnlp/unidecode/__init__.py | 103 | 1852 | # -*- coding: utf-8 -*-
"""Transliterate Unicode text into plain 7-bit ASCII.
Example usage:
>>> from unidecode import unidecode:
>>> unidecode(u"\u5317\u4EB0")
"Bei Jing "
The transliteration uses a straightforward map, and doesn't have alternatives
for the same character based on language, position, or anything els... | gpl-2.0 |
thfield/sf-base-election-data | venv/lib/python3.4/site-packages/django/contrib/gis/db/backends/spatialite/schema.py | 518 | 6882 | from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
from django.db.utils import DatabaseError
class SpatialiteSchemaEditor(DatabaseSchemaEditor):
sql_add_geometry_column = (
"SELECT AddGeometryColumn(%(table)s, %(column)s, %(srid)s, "
"%(geom_type)s, %(dim)s, %(null)s)"
)
sq... | bsd-3-clause |
lightcn/odoo | addons/fleet/fleet.py | 266 | 46376 | # -*- 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 |
chenpota/python | type-hints/example/01_builtin-type.py | 1 | 1067 | def pass_int(v: int) -> None:
pass
pass_int(3.4) # error
pass_int(5)
#######################################
def pass_float(v: float) -> None:
pass
pass_float(3.4)
pass_float(5)
#######################################
def pass_str(v: str) -> None:
pass
pass_str('text')
pass_str(3.4) # error
#######... | mit |
hughsaunders/keystone | keystone/service.py | 3 | 3752 | # 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 |
gangadharkadam/letzbench | bench/release.py | 16 | 5007 | #! env python
import json
import os
import sys
import semantic_version
import git
import json
import requests
import getpass
import argparse
import re
from requests.auth import HTTPBasicAuth
import requests.exceptions
from time import sleep
from .utils import get_config
github_username = None
github_password = None
r... | gpl-3.0 |
eaplatanios/tensorflow | tensorflow/python/keras/_impl/keras/estimator.py | 2 | 19729 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
pirius/draught-board-puzzle-aka-checkerboard-puzzle-solver | python/source/checkerboardpuzzle_utils.py | 1 | 1570 | from numpy import array, rot90, fliplr, array_equal
from checkerboardpuzzle_stone import Rotation
def generate_rotated_nparrays(nparray):
"""generate rotated and mirrored versions of given nparray."""
r1 = rot90(nparray)
r2 = rot90(r1)
r3 = rot90(r2)
f1 = fliplr(nparray)
f2 = fliplr(r1)
f3 ... | lgpl-3.0 |
jing-bao/pa-chromium | native_client_sdk/src/build_tools/sdk_tools/sdk_update_common.py | 168 | 3249 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions for sdk_update.py and sdk_update_main.py."""
import errno
import logging
import os
import shutil
import subprocess
import sys
impor... | bsd-3-clause |
seeba8/str8tssolver | field.py | 1 | 6062 | from square import Square
from street import Street
class Field:
def __init__(self, test=None):
self.streets = set()
if test != None:
blacks = test["blacks"]
values = test["values"]
self.squares = [Square(i, blacks[i] == "1", "123456789" if values[i] == "0" ... | gpl-3.0 |
lliss/model-my-watershed | deployment/cfn/worker.py | 1 | 15672 | from troposphere import (
Parameter,
Ref,
Output,
Tags,
GetAtt,
Base64,
Join,
Equals,
cloudwatch as cw,
ec2,
elasticloadbalancing as elb,
autoscaling as asg,
route53 as r53
)
from utils.cfn import get_recent_ami
from utils.constants import (
ALLOW_ALL_CIDR,
... | apache-2.0 |
myjang0507/slte | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
hashtag1138/pass_wallet | menutrousseau.py | 1 | 2983 | from error_handler import MyError, ErrorScreen0
from menu import Menu
import os, time
class Trousseau0(Menu):
def __init__(self, parent):
super().__init__(parent)
self.entrees = None
self.selected = 0
def loadPasswordList(self):
try:
# --- Open ---
conf_file = open('config.txt', 'r')
line = conf... | gpl-3.0 |
terranodo/geonode | geonode/base/models.py | 1 | 34374 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
kaichogami/sympy | sympy/physics/quantum/state.py | 58 | 29186 | """Dirac notation for states."""
from __future__ import print_function, division
from sympy import (cacheit, conjugate, Expr, Function, integrate, oo, sqrt,
Tuple)
from sympy.core.compatibility import u, range
from sympy.printing.pretty.stringpict import stringPict
from sympy.physics.quantum.qexpr ... | bsd-3-clause |
orkestra-studios/nebuu-service | stats.py | 1 | 2397 | from datetime import date, datetime
from services import *
from collections import defaultdict
import sys
CATEGORIES = ["populerkultur", "yazmevsimi", "kismevsimi", "yesilcam", "emojiler", "gol", "turkdizileri", "evlilik", "para", "kultursanat", "sesinicikar", "ikililer", "okul", "taklit", "osmanli", "markalar", "parti... | gpl-3.0 |
hujiajie/chromium-crosswalk | tools/telemetry/telemetry/decorators_unittest.py | 8 | 8102 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry import decorators
import mock
class FakePlatform(object):
def GetOSName(self):
return 'os_name'
def GetOSVersionNa... | bsd-3-clause |
jonathanfisher/wl18xx | tools/perf/scripts/python/netdev-times.py | 1544 | 15191 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
lemonade512/personal-blog | lib/werkzeug/utils.py | 345 | 22972 | # -*- coding: utf-8 -*-
"""
werkzeug.utils
~~~~~~~~~~~~~~
This module implements various utilities for WSGI applications. Most of
them are used by the request and response wrappers but especially for
middleware development it makes sense to use them without the wrappers.
:copyright: (c) 2014 ... | mit |
40223148/finaltest | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_case.py | 738 | 51689 | import difflib
import pprint
import pickle
import re
import sys
import warnings
import weakref
import inspect
from copy import deepcopy
from test import support
import unittest
from .support import (
TestEquality, TestHashing, LoggingResult,
ResultWithNoStartTestRunStopTestRun
)
class Test(object):
"Ke... | gpl-3.0 |
sexroute/commandergenius | project/jni/python/src/Demo/tkinter/guido/tkman.py | 43 | 9005 | #! /usr/bin/env python
# Tk man page browser -- currently only shows the Tcl/Tk man pages
import sys
import os
import string
import re
from Tkinter import *
from ManPage import ManPage
MANNDIRLIST = ['/depot/sundry/man/mann','/usr/local/man/mann']
MAN3DIRLIST = ['/depot/sundry/man/man3','/usr/local/man/man3']
found... | lgpl-2.1 |
alex8866/cinder | cinder/quota_utils.py | 11 | 2646 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
dangra/scrapy | tests/test_loader.py | 6 | 20798 | import unittest
import attr
from itemadapter import ItemAdapter
from itemloaders.processors import Compose, Identity, MapCompose, TakeFirst
from scrapy.http import HtmlResponse
from scrapy.item import Item, Field
from scrapy.loader import ItemLoader
from scrapy.selector import Selector
try:
from dataclasses imp... | bsd-3-clause |
Karlamon/roundware-server | roundware/api1/views.py | 2 | 7998 | # Roundware Server is released under the GNU Affero General Public License v3.
# See COPYRIGHT.txt, AUTHORS.txt, and LICENSE.txt in the project root directory.
# Roundware API1 views. Part REST, part not.
from __future__ import unicode_literals
import string
import json
import traceback
import django_filters
from dja... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.