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 |
|---|---|---|---|---|---|
AyoubZahid/odoo | addons/mail/controllers/bus.py | 16 | 3407 | # -*- coding: utf-8 -*
import base64
import openerp
from openerp import SUPERUSER_ID
from openerp.http import request
class MailChatController(openerp.addons.bus.controllers.main.BusController):
def _default_request_uid(self):
""" For Anonymous people, they receive the access right of SUPERUSER_ID since... | gpl-3.0 |
zane-techempower/FrameworkBenchmarks | toolset/benchmark/utils.py | 41 | 5044 | import ConfigParser
import os
import glob
import json
import socket
from ast import literal_eval
def gather_tests(include = [], exclude=[], benchmarker=None):
'''
Given test names as strings, returns a list of FrameworkTest objects.
For example, 'aspnet-mysql-raw' turns into a FrameworkTest object with
varia... | bsd-3-clause |
nikhila05/MicroSite | micro_blog/migrations/0001_initial.py | 1 | 4172 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
m... | gpl-2.0 |
alphagov/notifications-api | migrations/versions/0083_add_perm_types_and_svc_perm.py | 1 | 2344 | """empty message
Revision ID: 0083_add_perm_types_and_svc_perm
Revises: 0082_add_go_live_template
Create Date: 2017-05-12 11:29:32.664811
"""
# revision identifiers, used by Alembic.
revision = '0083_add_perm_types_and_svc_perm'
down_revision = '0082_add_go_live_template'
from alembic import op
import sqlalchemy as... | mit |
joshua-cogliati-inl/raven | tests/framework/user_guide/physicalCode/analyticalbateman/BatemanClass.py | 2 | 23137 | # Copyright 2017 Battelle Energy Alliance, LLC
#
# 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 t... | apache-2.0 |
michalkurka/h2o-3 | h2o-py/tests/testdir_algos/stackedensemble/pyunit_stackedensemble_max_runtime_secs.py | 2 | 2643 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import h2o
import sys
from h2o.exceptions import H2OResponseError
sys.path.insert(1, "../../../") # allow us to run this standalone
from h2o.grid import H2OGridSearch
from h2o.estimators.gbm import H2OGradientBoostingEstimator
f... | apache-2.0 |
jonasfj/dxr | tests/test_functions.py | 1 | 2593 | """Tests for searches about functions"""
from dxr.testing import SingleFileTestCase, MINIMAL_MAIN
class ReferenceTests(SingleFileTestCase):
"""Tests for finding out where functions are referenced or declared"""
source = r"""
#include <stdio.h>
const char* getHello() {
return "He... | mit |
mavit/ansible | lib/ansible/modules/windows/win_uri.py | 25 | 6804 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Corwin Brown <corwin@corwinbrown.com>
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
lidaobing/itcc | itcc/ccs2/solvent_caflisch.py | 1 | 3718 | import pkg_resources
import math
from itcc import tools
ff_cache = {}
caflisch_dat = None
r_probe = 1.4
pij_bonded = 0.8875
pij_nonbonded = 0.3516
class Caflisch(object):
def __init__(self, data):
self.data = data
assert len(self.data) == 5
def _r_min(self):
return self.data[1]
... | gpl-3.0 |
Nepherhotep/django | django/db/__init__.py | 376 | 2322 | from django.core import signals
from django.db.utils import (
DEFAULT_DB_ALIAS, DJANGO_VERSION_PICKLE_KEY, ConnectionHandler,
ConnectionRouter, DatabaseError, DataError, Error, IntegrityError,
InterfaceError, InternalError, NotSupportedError, OperationalError,
ProgrammingError,
)
__all__ = [
'backe... | bsd-3-clause |
anaoaktree/vcgen | vcgen/test.py | 1 | 1786 | # Copyright (c) 2011, Jay Conrod.
# 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 ... | mit |
tvibliani/odoo | addons/hr_holidays/hr_holidays.py | 24 | 34392 | # -*- coding: utf-8 -*-
##################################################################################
#
# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
# and 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $
#
# This program is free software: you can redistri... | agpl-3.0 |
zlsun/XX-Net | code/default/python27/1.0/lib/traceback.py | 64 | 11285 | """Extract, format and print information about Python stack traces."""
import linecache
import sys
import types
__all__ = ['extract_stack', 'extract_tb', 'format_exception',
'format_exception_only', 'format_list', 'format_stack',
'format_tb', 'print_exc', 'format_exc', 'print_exception',
... | bsd-2-clause |
FatBumbleee/namebench | nb_third_party/dns/rdtypes/ANY/GPOS.py | 248 | 5304 | # Copyright (C) 2003-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 |
willwray/dash | qa/pull-tester/rpc-tests.py | 2 | 8777 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Run Regression Test Suite
This module calls down into individual test cases via subprocess. It will
... | mit |
kthordarson/CouchPotatoServer | couchpotato/core/media/movie/charts/main.py | 37 | 2589 | from CodernityDB.database import RecordNotFound
from couchpotato import Env, get_db
from couchpotato.core.helpers.variable import getTitle, splitString
from couchpotato.core.logger import CPLog
from couchpotato.api import addApiView
from couchpotato.core.event import fireEvent
from couchpotato.core.plugins.base import... | gpl-3.0 |
Yubico/yubiadmin-dpkg | yubiadmin/config.py | 1 | 2301 | # Copyright (c) 2013 Yubico AB
# 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-2-clause |
Tesora-Release/tesora-horizon | openstack_dashboard/contrib/sahara/content/data_processing/job_executions/tables.py | 25 | 7042 | # 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
# distributed under the... | apache-2.0 |
VoiDeD/Sick-Beard | lib/dateutil/tzwin.py | 304 | 5828 | # This code was originally contributed by Jeffrey Harris.
import datetime
import struct
import _winreg
__author__ = "Jeffrey Harris & Gustavo Niemeyer <gustavo@niemeyer.net>"
__all__ = ["tzwin", "tzwinlocal"]
ONEWEEK = datetime.timedelta(7)
TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
TZ... | gpl-3.0 |
mompiou/misorientation | misorientation.py | 1 | 48149 | #!/usr/bin/python
from __future__ import division
import numpy as np
from Tkinter import *
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
from matplotlib import pyplot as plt
from PIL import Image
from PIL import PngImagePlugin
impo... | gpl-2.0 |
webmull/phantomjs | src/qt/qtbase/src/3rdparty/freetype/src/tools/cordic.py | 401 | 1588 | # compute arctangent table for CORDIC computations in fttrigon.c
import sys, math
#units = 64*65536.0 # don't change !!
units = 256
scale = units/math.pi
shrink = 1.0
comma = ""
def calc_val( x ):
global units, shrink
angle = math.atan(x)
shrink = shrink * math.cos(angle)
return angle/math.pi *... | bsd-3-clause |
Comunitea/alimentacion | automatic_update_cost_from_bom/mrp_bom.py | 2 | 1560 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2012 Pexego Sistemas Informáticos All Rights Reserved
# $Omar Castiñeira Saavedra$ <omar@pexego.es>
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
jdelgad/IRefuse | irefuse/irefuse.py | 1 | 6388 | # -*- encoding: UTF-8 -*-
"""
'I Refuse' web application.
Copyright (C) 2017 Jacob Delgado
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, either version 3 of the License, or
(at your option... | agpl-3.0 |
flyingSprite/spinelle | task_inventory/order_1_to_30/order_16_use_faker.py | 1 | 2553 |
""" Order 16: Use faker in python.
Generate lots of kinds data with Faker
* User information
"""
from faker import Faker, Factory
class FakerGenerator(object):
"""Generate different data by this class."""
fake = None
def __init__(self, language=None):
if language:
self.fake = Factor... | mit |
bootandy/sqlalchemy | lib/sqlalchemy/dialects/mysql/cymysql.py | 80 | 2349 | # mysql/cymysql.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+cymysql
:name: CyMySQL
:dbapi: cymysql
:connect... | mit |
Victory/realpython-tdd | contacts/user_contacts/views.py | 1 | 1864 | from django.shortcuts import (
render,
render_to_response)
from django.template import RequestContext
from django.http import HttpResponseRedirect, HttpResponse
from django.views.generic import DetailView
from django.core.exceptions import ValidationError
from django.views.decorators.http import require_http_me... | mit |
jlnaudin/x-drone | MissionPlanner-master/packages/IronPython.StdLib.2.7.4/content/Lib/httplib.py | 73 | 48093 | """HTTP/1.1 client library
<intro stuff goes here>
<other stuff, too>
HTTPConnection goes through a number of "states", which define when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:
(null)
|
| HTTPConnection()... | gpl-3.0 |
dwengen/linux | tools/perf/util/setup.py | 989 | 1543 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
icoxfog417/pystan | pystan/tests/test_extract.py | 4 | 3038 | import unittest
import numpy as np
import pystan
class TestExtract(unittest.TestCase):
@classmethod
def setUpClass(cls):
ex_model_code = '''
parameters {
real alpha[2,3];
real beta[2];
}
model {
for (i in 1:2) for (j in 1:3)
al... | gpl-3.0 |
bjarnagin/manyquery | manyquery/cli.py | 1 | 1598 | import click
import csv
from manyquery.connection import Connection, MultiConnection
@click.command()
@click.option('--host', '-h', default=['ict.croptrak.com'], multiple=True,
help='Hostname. Repeatable.')
@click.option('--user', '-u', help='MySQL username')
@click.option('--password', '-p', prompt=... | mit |
conchyliculture/wikipoff-tools | tests/units.py | 1 | 18483 | #!/usr/bin/python
# encoding: utf-8
from __future__ import unicode_literals
import os.path
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), u'..'))
sys.path.append(
os.path.join(
os.path.dirname(__file__),
u'..', u'lib', u'python{0:d}.{1:d}'.format(
sys.version_info.m... | gpl-3.0 |
happyleavesaoc/home-assistant | homeassistant/components/device_tracker/tplink.py | 4 | 12470 | """
Support for TP-Link routers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.tplink/
"""
import base64
import hashlib
import logging
import re
import threading
from datetime import timedelta
import requests
import voluptuous as vol
im... | apache-2.0 |
maelnor/nova | nova/tests/api/openstack/compute/contrib/test_virtual_interfaces.py | 3 | 4805 | # Copyright (C) 2011 Midokura KK
# 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 ... | apache-2.0 |
bellwethers-in-se/defects | src/old/axe/cube.py | 3 | 13251 | from __future__ import division
import sys
sys.dont_write_bytecode = True
from lib import *
from demos import *
from counts import *
from table import *
from fi import *
from dtree import *
def sides0(**also):
return Thing().override(also)
dists={}
def dist(t,x,y,opt):
if not opt.cache:
return dist... | mit |
tensorflow/probability | tensorflow_probability/python/distributions/blockwise.py | 1 | 15570 | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
collinjackson/mojo | sky/tools/webkitpy/common/net/layouttestresults.py | 50 | 4256 | # 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 |
Venturi/cms | env/lib/python2.7/site-packages/pip/download.py | 45 | 22491 | import cgi
import email.utils
import hashlib
import getpass
import mimetypes
import os
import platform
import re
import shutil
import sys
import tempfile
import pip
from pip.backwardcompat import urllib, urlparse, raw_input
from pip.exceptions import InstallationError, HashMismatch
from pip.util import (splitext, rmt... | gpl-2.0 |
ankurjimmy/catawampus | tr/http.py | 5 | 21623 | #!/usr/bin/python
# Copyright 2011 Google Inc. 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 appli... | apache-2.0 |
vadimtk/chrome4sdp | tools/telemetry/third_party/webpagereplay/dnsproxy.py | 20 | 9331 | #!/usr/bin/env python
# Copyright 2010 Google Inc. 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... | bsd-3-clause |
SlimRemix/android_external_chromium_org | native_client_sdk/src/tools/create_nmf.py | 44 | 24616 | #!/usr/bin/env python
# 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.
"""Tool for automatically creating .nmf files from .nexe/.pexe/.bc executables.
As well as creating the nmf file this tool can als... | bsd-3-clause |
Gitlab11/odoo | addons/sale_service/__init__.py | 354 | 1060 | # -*- 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 |
suncycheng/intellij-community | python/helpers/py2only/docutils/parsers/rst/languages/ca.py | 128 | 4467 | # $Id: ca.py 7119 2011-09-02 13:00:23Z milde $
# Author: Ivan Vilata i Balaguer <ivan@selidor.net>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# trans... | apache-2.0 |
kiwicopple/MyMDb | venv/Lib/site-packages/pygments/lexers/installers.py | 72 | 12866 | # -*- coding: utf-8 -*-
"""
pygments.lexers.installers
~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for installer/packager DSLs and formats.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, includ... | mit |
Livefyre/django-cms | develop.py | 10 | 14676 | #!/usr/bin/env python
from __future__ import print_function, with_statement
import contextlib
import multiprocessing
import pkgutil
import pyclbr
import subprocess
import os
import sys
import warnings
from django.core.exceptions import DjangoRuntimeWarning
from django.core.exceptions import ImproperlyConfigured
from ... | bsd-3-clause |
AlanD88/website | seadssite/urls.py | 1 | 1364 | from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth.views import login, logout, password_reset, password_reset_done, password_reset_confirm,\
password_reset_complete
from django.conf import settings
from django.conf.urls.static import static
from seadssite import view... | mit |
khkaminska/scikit-learn | sklearn/svm/base.py | 156 | 36018 | from __future__ import print_function
import numpy as np
import scipy.sparse as sp
import warnings
from abc import ABCMeta, abstractmethod
from . import libsvm, liblinear
from . import libsvm_sparse
from ..base import BaseEstimator, ClassifierMixin, ChangedBehaviorWarning
from ..preprocessing import LabelEncoder
from... | bsd-3-clause |
Oppium/BTCeGUI | BTCeGUI.py | 1 | 21599 | #! python3
import tkinter
import tkinter.ttk as ttk
import threading
import operator
import time
import copy
import os.path
import datetime
import queue
import BTCe
api = BTCe.API('BTCe.ini')
console = None
def format_float(value):
return ('{:0.8f}'.format(float(value)).rstrip('0').rstrip('.'))
def validate_float(v... | mit |
swharden/SWHLab | doc/uses/EPSCs-and-IPSCs/smooth histogram method/05.py | 1 | 1812 | """
MOST OF THIS CODE IS NOT USED
ITS COPY/PASTED AND LEFT HERE FOR CONVENIENCE
"""
import os
import sys
# in case our module isn't installed (running from this folder)
if not os.path.abspath('../../../') in sys.path:
sys.path.append('../../../') # helps spyder get docs
import swhlab
import swhlab.common as cm
i... | mit |
keedio/hue | apps/pig/src/pig/management/commands/pig_setup.py | 29 | 2462 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
SoftwareMaven/django | django/core/management/commands/compilemessages.py | 315 | 5174 | from __future__ import unicode_literals
import codecs
import glob
import os
from django.core.management.base import BaseCommand, CommandError
from django.core.management.utils import find_command, popen_wrapper
from django.utils._os import npath, upath
def has_bom(fn):
with open(fn, 'rb') as f:
sample =... | bsd-3-clause |
enalisnick/stick-breaking_dgms | models/variational_coders/decoders.py | 1 | 3064 | import numpy as np
import theano
import theano.tensor as T
### Regular Decoder
class Decoder(object):
def __init__(self, rng, input, latent_size, out_size, activation, W_z = None, b = None):
self.input = input
self.activation = activation
# setup the params ... | mit |
faust64/ansible | lib/ansible/modules/network/a10/a10_virtual_server.py | 25 | 11675 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage A10 Networks slb virtual server objects
(c) 2014, Mischa Peters <mpeters@a10networks.com>,
Eric Chou <ericc@a10networks.com>
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GN... | gpl-3.0 |
blbarker/spark-tk | regression-tests/sparktkregtests/testcases/models/gmm_test.py | 12 | 7116 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel 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 require... | apache-2.0 |
IBMPredictiveAnalytics/SPSSINC_RECODEEX | src/SPSSINC_RECODEEX.py | 1 | 20980 |
#/***********************************************************************
# * Licensed Materials - Property of IBM
# *
# * IBM SPSS Products: Statistics Common
# *
# * (C) Copyright IBM Corp. 1989, 2020
# *
# * US Government Users Restricted Rights - Use, duplication or disclosure
# * restricted by GSA ADP Schedule C... | apache-2.0 |
moylop260/odoo-dev | addons/base_report_designer/plugin/openerp_report_designer/bin/script/__init__.py | 384 | 1414 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
leehz/android_kernel_samsung_ms013g | 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 |
Fireforge/AcronatorServer | acronization.py | 1 | 5783 | import json
import argparse
import random
import sys
import requests
BIGHUGELABS_API_KEY = 'f79909b74265ba8593daf87741f3c874'
buzzWords = ['alignment','bot', 'collusion', 'derivative', 'engagement', 'focus', 'gathering' ,'housing','liability','management','nomenclature','operation','procedure','reduction','strategic... | mit |
jennyzhang0215/incubator-mxnet | example/module/sequential_module.py | 25 | 3414 | # 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 |
anistark/mozillians | vendor-local/lib/python/tablib/packages/openpyxl/workbook.py | 116 | 6200 | # file openpyxl/workbook.py
# Copyright (c) 2010 openpyxl
#
# 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, modif... | bsd-3-clause |
nzavagli/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/idlelib/textView.py | 26 | 3269 | """Simple text browser for IDLE
"""
from Tkinter import *
import tkMessageBox
class TextViewer(Toplevel):
"""A simple text viewer dialog for IDLE
"""
def __init__(self, parent, title, text, modal=True, _htest=False):
"""Show the given text in a scrollable window with a 'close' button
If... | mit |
jelugbo/ddi | common/djangoapps/course_modes/migrations/0003_auto__add_unique_coursemode_course_id_currency_mode_slug.py | 69 | 1564 | # -*- 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 unique constraint on 'CourseMode', fields ['course_id', 'currency', 'mode_slug']
db.create_unique('... | agpl-3.0 |
timohl/fast-lib | vendor/mosquitto-1.4.12/test/broker/06-bridge-b2br-disconnect-qos1.py | 10 | 2934 | #!/usr/bin/env python
# Does a bridge resend a QoS=1 message correctly after a disconnect?
import socket
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.c... | lgpl-3.0 |
vlegoff/tsunami | src/primaires/salle/commandes/etendue/creer.py | 1 | 2733 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
... | bsd-3-clause |
yawnosnorous/python-for-android | python3-alpha/python3-src/Lib/test/test_ast.py | 46 | 24757 | import sys, unittest
from test import support
import ast
def to_tuple(t):
if t is None or isinstance(t, (str, int, complex)):
return t
elif isinstance(t, list):
return [to_tuple(e) for e in t]
result = [t.__class__.__name__]
if hasattr(t, 'lineno') and hasattr(t, 'col_offset'):
... | apache-2.0 |
madhurrajn/samashthi | lib/requests/packages/chardet/sbcsgroupprober.py | 2936 | 3291 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | bsd-3-clause |
overdev/easygl-0.1.0-alpha1 | easygl/display/window.py | 1 | 11847 | # !/usr/bin/python
# -*- coding: utf-8 -*-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# The MIT License (MIT)
#
# Copyright (c) 2017 Jorge A. Gomes (jorgegomes83 at hotmail dot com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softwar... | mit |
abdallahynajar/foursquared.eclair | util/gen_class.py | 262 | 3173 | #!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
HEADER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.types;
%(imports)s
/**
* Auto-generated: %(timestamp)s
*
* @author Joe LaPenna (joe@joelapenna.com)
*/
public class %(type... | apache-2.0 |
vrenaville/ngo-addons-backport | addons/l10n_it/__openerp__.py | 165 | 2072 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010
# OpenERP Italian Community (<http://www.openerp-italia.org>)
# Servabit srl
# Agile Business Group sagl
# Domsense srl
# Albato... | agpl-3.0 |
winksaville/common-tool | dotconfig.py | 6 | 8450 | #!/usr/bin/env python
'''
Python functionality for manipulating a Kconfig .config file.
The Kconfig build configuration system produces .config files that are
essentially conf format (a.k.a. INI) with no sections. When editing multiple
such files, usually some combination of sed and awk are enough, but
occasionally y... | bsd-2-clause |
ashemedai/ansible | docs/docsite/rst/dev_guide/conf.py | 52 | 11624 | # -*- coding: utf-8 -*-
#
# dev_guide documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 15 13:24:02 2016.
#
# 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
# autogenerated file.
#
#... | gpl-3.0 |
testalt/electrum-ppc-server | src/utils.py | 1 | 6099 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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... | agpl-3.0 |
pku9104038/edx-platform | common/djangoapps/pipeline_mako/__init__.py | 22 | 2354 | from edxmako.shortcuts import render_to_string
from pipeline.conf import settings
from pipeline.packager import Packager
from pipeline.utils import guess_type
from static_replace import try_staticfiles_lookup
def compressed_css(package_name):
package = settings.PIPELINE_CSS.get(package_name, {})
if package:
... | agpl-3.0 |
rmit-ir/SummaryRank | summaryrank/svmlight_tools.py | 1 | 11505 | """
SVMLight tools
"""
import sys
import argparse
import gzip
import math
import numpy as np
import random
import re
PROG = 'python svmlight_format.py'
ID_NAME_PATTERN = re.compile(r'^#\s*(\d+)\s*:\s*(\S+.*)\s*$')
class AutoHelpArgumentParser(argparse.ArgumentParser):
""" """
def error(self, message):
... | mit |
BladeSun/NliWithKnowledge | session2/dam_bk_1.py | 1 | 59183 | '''
Build a neural machine translation model with soft attention
'''
import theano
import theano.tensor as tensor
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
import cPickle as pkl
import ipdb
import numpy
import copy
import os
import warnings
import sys
import time
import logging
from colle... | bsd-3-clause |
spesmilo/electrum | electrum/gui/qt/amountedit.py | 1 | 4862 | # -*- coding: utf-8 -*-
from decimal import Decimal
from typing import Union
from PyQt5.QtCore import pyqtSignal, Qt, QSize
from PyQt5.QtGui import QPalette, QPainter
from PyQt5.QtWidgets import (QLineEdit, QStyle, QStyleOptionFrame, QSizePolicy)
from .util import char_width_in_lineedit, ColorScheme
from electrum.u... | mit |
gjwajda/Computational-Tools-For-Big-Data | Exercise11/exercise11_2.py | 1 | 3455 | #!C:/Users/Greg/Anaconda/Python
import json
from time import time
from os import listdir
import re
import numpy as np
from random import shuffle
from pprint import pprint
#Folder with json files
path = "./json/"
# Function to load all json files into python
def merge_json(path):
merged_json = []
for filename in lis... | mit |
yashaswi-reddy/icsisumm | tac09/decoder2.py | 8 | 4229 | import sys, os
import ilp
if len(sys.argv) < 5 or len(sys.argv) > 8:
sys.stderr.write('USAGE: %s <length_constraint> <sentence_lengths> <concepts_in_sentences> <concept_weights> [sentence_groups] [dependencies] [atleast]\n')
sys.exit(1)
solver = ilp.IntegerLinearProgram(debug=0, tmp = "tmp_decoder.%d.%s.%s" %... | gpl-3.0 |
tboyce1/home-assistant | homeassistant/components/climate/econet.py | 1 | 7250 | """
Support for Rheem EcoNet water heaters.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.econet/
"""
import datetime
import logging
import voluptuous as vol
from homeassistant.components.climate import (
DOMAIN, PLATFORM_SCHEMA, STATE_ECO... | apache-2.0 |
gnu-sandhi/sandhi | modules/gr36/volk/gen/volk_tmpl_utils.py | 40 | 2390 | #!/usr/bin/env python
#
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
xen/babel | babel/messages/catalog.py | 4 | 32868 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... | bsd-3-clause |
zenefits/sentry | src/sentry/south_migrations/0072_auto__add_affecteduserbygroup__add_unique_affecteduserbygroup_project_.py | 36 | 21742 | # -*- 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 'AffectedUserByGroup'
db.create_table('sentry_affecteduserbygroup', (
('id', self... | bsd-3-clause |
Xeralux/tensorflow | tensorflow/contrib/input_pipeline/python/ops/input_pipeline_ops_test.py | 61 | 3514 | # 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 |
renhaoqi/gem5-stable | src/arch/x86/isa/insts/x87/stack_management/clear_state.py | 91 | 2150 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
viki9698/jizhanggroup | django/contrib/localflavor/fi/forms.py | 109 | 1907 | """
FI-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.contrib.localflavor.fi.fi_municipalities import MUNICIPALITY_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexFie... | bsd-3-clause |
KirillShaman/escalate_gspread | app/channels/models.py | 1 | 5656 | # The MIT License (MIT)
# Escalate Copyright (c) [2014] [Chris Smith]
# 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, c... | mit |
hickford/youtube-dl | youtube_dl/extractor/videott.py | 109 | 2100 | from __future__ import unicode_literals
import re
import base64
from .common import InfoExtractor
from ..utils import (
unified_strdate,
int_or_none,
)
class VideoTtIE(InfoExtractor):
ID_NAME = 'video.tt'
IE_DESC = 'video.tt - Your True Tube'
_VALID_URL = r'http://(?:www\.)?video\.tt/(?:(?:video... | unlicense |
jgasteiz/fuzzingtheweb | settings.py | 1 | 3336 | # -*- coding: utf-8 -*-
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Javi Manzano', 'javi.manzano.oller@gmail.com'),
)
MANAGERS = ADMINS
ALLOWED_HOSTS = ['176.58.120.22', 'fuzzingtheweb.com']
TIME_ZONE = 'Europe/London'
USE_TZ = True
LANGUAGE_CODE = 'en-gb'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
MEDIA... | mit |
ianw/pip | pip/baseparser.py | 149 | 9643 | """Base option parser setup"""
from __future__ import absolute_import
import sys
import optparse
import os
import re
import textwrap
from distutils.util import strtobool
from pip._vendor.six import string_types
from pip._vendor.six.moves import configparser
from pip.locations import (
legacy_config_file, config_b... | mit |
Paczesiowa/youtube-dl | youtube_dl/extractor/dailymotion.py | 1 | 10862 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
import itertools
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
int_or_none,
orderedSet,
str_to_int,
unescapeHTML,
)
class D... | unlicense |
chudaol/edx-platform | common/lib/xmodule/xmodule/video_module/bumper_utils.py | 86 | 4238 | """
Utils for video bumper
"""
import copy
import json
import pytz
import logging
from collections import OrderedDict
from datetime import datetime, timedelta
from django.conf import settings
from .video_utils import set_query_parameter
try:
import edxval.api as edxval_api
except ImportError:
edxval_api = No... | agpl-3.0 |
KousikaGanesh/purchaseandInventory | openerp/addons/membership/__init__.py | 441 | 1101 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
jdmcbr/blaze | blaze/compute/dask.py | 7 | 2876 | from __future__ import absolute_import, division, print_function
from numbers import Number
from toolz import concat, first, curry, compose
from datashape import DataShape
from blaze import compute, ndim
from blaze.dispatch import dispatch
from blaze.compute.core import compute_up, optimize
from blaze.expr import (El... | bsd-3-clause |
gfyoung/numpy | tools/swig/test/testVector.py | 116 | 15018 | #! /usr/bin/env python
from __future__ import division, absolute_import, print_function
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadListError = TypeE... | bsd-3-clause |
mahak/neutron | neutron/tests/unit/services/trunk/fakes.py | 9 | 1495 | # 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
# distributed under the... | apache-2.0 |
vladryk/horizon | openstack_dashboard/dashboards/admin/routers/tabs.py | 50 | 1549 | # 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 |
o0o0o/Unblock-Youku | dns-reverse-proxy/dns-proxy.py | 6 | 30638 | # vim:fileencoding=utf-8:sw=4:et:syntax=python
# DNS proxy server that hijack some filtered domain
# RFC5625: DNS Proxy Implementation Guidelines
# https://tools.ietf.org/html/rfc5625
dgram = require("dgram")
dns = require("dns")
EventEmitter = require("events").EventEmitter
lutils = require("./lutils")
log = lutils.l... | agpl-3.0 |
franekp/millandict | ankidict/thirdparty/sqlalchemy/dialects/oracle/zxjdbc.py | 55 | 8112 | # oracle/zxjdbc.py
# Copyright (C) 2005-2016 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
"""
.. dialect:: oracle+zxjdbc
:name: zxJDBC for Jython
:dbapi: zxjdbc
... | mit |
jaimeMF/youtube-dl | youtube_dl/extractor/washingtonpost.py | 52 | 5626 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
strip_jsonp,
)
class WashingtonPostIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?washingtonpost\.com/.*?/(?P<id>[^/]+)/(?:$|[?#])'
_TESTS = [{
'url': ... | unlicense |
sergeyromanov/flask-restful | flask_restful/fields.py | 7 | 13051 | from datetime import datetime
from calendar import timegm
import pytz
from decimal import Decimal as MyDecimal, ROUND_HALF_EVEN
from email.utils import formatdate
import six
try:
from urlparse import urlparse, urlunparse
except ImportError:
# python3
from urllib.parse import urlparse, urlunparse
from flask... | bsd-3-clause |
vlinhd11/vlinhd11-android-scripting | python/src/Tools/freeze/parsesetup.py | 53 | 3010 | # Parse Makefiles and Python Setup(.in) files.
import re
# Extract variable definitions from a Makefile.
# Return a dictionary mapping names to values.
# May raise IOError.
makevardef = re.compile('^([a-zA-Z0-9_]+)[ \t]*=(.*)')
def getmakevars(filename):
variables = {}
fp = open(filename)
pendingline =... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.