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 |
|---|---|---|---|---|---|
nishad-jobsglobal/odoo-marriot | openerp/service/model.py | 62 | 8421 | # -*- coding: utf-8 -*-
from functools import wraps
import logging
from psycopg2 import IntegrityError, OperationalError, errorcodes
import random
import threading
import time
import openerp
from openerp.tools.translate import translate
from openerp.osv.orm import except_orm
from contextlib import contextmanager
imp... | agpl-3.0 |
EricSekyere/airmozilla | airmozilla/manage/views/staticpages.py | 7 | 3250 | from django.contrib import messages
from django.shortcuts import render, redirect
from django.db import transaction
from airmozilla.base.utils import paginate
from airmozilla.main.models import Channel
from airmozilla.manage import forms
from airmozilla.staticpages.models import StaticPage
from .decorators import (
... | bsd-3-clause |
rrrrrr8/vnpy | vnpy/trader/gateway/cshshlpGateway/cshshlpGateway.py | 4 | 38445 | # encoding: UTF-8
import sys
import os
import json
import socket
import urllib
from time import sleep
import wmi
from vnpy.api.cshshlp import CsHsHlp
from vnpy.api.ctp import MdApi
from vnpy.trader.vtGateway import *
from vnpy.trader.vtFunction import getTempPath, getJsonPath
# 接口常量
FUNCTION_LOGIN = 331100
FUNCTIO... | mit |
openstenoproject/plover | plover/meta/attach.py | 3 | 2343 | from os.path import commonprefix
from plover.formatting import (
Case,
META_ATTACH_FLAG,
META_CARRY_CAPITALIZATION,
has_word_boundary,
rightmost_word,
)
from plover.orthography import add_suffix
def meta_attach(ctx, meta):
action = ctx.new_action()
begin = meta.startswith(META_ATTACH_FLAG... | gpl-2.0 |
grandcat/chordentlich | code/ipc.py | 1 | 4931 | import asyncio
import base64
import logging
import random
from helpers.messageParser import *
from helpers.aiomasTools import aiomas_parse_url
from helpers.messageDefinitions import *
class ApiServer(asyncio.Protocol):
"""
Class to connect to the Chord Node
"""
def __init__(self, dht_node):
... | apache-2.0 |
suiyuan2009/tensorflow | tensorflow/compiler/tests/pooling_ops_3d_test.py | 85 | 12646 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
unaguil/sphinx-swaggerdoc | setup.py | 2 | 1208 | import sys
import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return op... | mit |
techvoltage/cle | cle/idabin.py | 2 | 10337 | import logging
try:
idalink = __import__('idalink').idalink
except ImportError:
idalink = None
from .errors import CLEError
from .absobj import AbsObj
l = logging.getLogger("cle.idabin")
__all__ = ('IDABin',)
class IDABin(AbsObj):
'''
Get informations from binaries using IDA.
'''
def __ini... | bsd-2-clause |
Tehsmash/nova | nova/cmd/idmapshift.py | 68 | 7093 | # Copyright 2014 Rackspace, Andrew Melton
#
# 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... | apache-2.0 |
MrSenko/Nitrate | tcms/wsgi.py | 2 | 1978 | # -*- coding: utf-8 -*-
"""
WSGI config for tcms project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the... | gpl-2.0 |
endlessm/chromium-browser | third_party/catapult/experimental/alert_configs/memory.py | 4 | 6186 | #!/usr/bin/env python
# Copyright 2018 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.
"""
Run this script to generate the alert configs for memory benchmarks and
metrics to keep track of.
After making changes to this scri... | bsd-3-clause |
apsmi/PyTanks | server_tank.py | 1 | 6563 | # -*- coding: utf-8 -*-
from pygame import sprite, Rect
import random
class Tank_config():
"""
Данный класс описывает конфигурацию танка. Содержит только те свойства, которые влияют на поведение танка.
"""
def __init__(self, min_x, max_x, min_y, max_y, speed, lifes, dead_count):
self.dead_co... | gpl-2.0 |
nlehuby/osm2gtfs | osm2gtfs/creators/agency_creator.py | 4 | 1490 | # coding=utf-8
import logging
import transitfeed
class AgencyCreator(object):
def __init__(self, config):
self.config = config.data
def __repr__(self):
rep = ""
if self.config is not None:
rep += str(self.config) + " | "
return rep
def add_agency_to_feed(sel... | gpl-3.0 |
fdvarela/odoo8 | addons/hr/hr.py | 3 | 22628 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-Today OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | agpl-3.0 |
awkspace/ansible | test/units/modules/packaging/language/test_pip.py | 84 | 1432 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import json
import pytest
from ansible.modules.packaging.language import pip
pytestmark = pytest.mark.usefixtures('patch_ansible_module')
@pytest.mark.parametrize('patch_ansible_module... | gpl-3.0 |
potsmaster/cinder | cinder/api/contrib/volume_tenant_attribute.py | 20 | 3241 | # 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 a... | apache-2.0 |
yongshengwang/builthue | desktop/core/ext-py/python-openid-2.2.5/openid/test/test_verifydisco.py | 77 | 11216 | import unittest
from openid import message
from openid.test.support import OpenIDTestMixin
from openid.consumer import consumer
from openid.test.test_consumer import TestIdRes
from openid.consumer import discover
def const(result):
"""Return a function that ignores any arguments and just returns
the specified ... | apache-2.0 |
tboyce1/home-assistant | homeassistant/components/light/ihc.py | 2 | 4183 | """IHC light platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.ihc/
"""
from xml.etree.ElementTree import Element
import voluptuous as vol
from homeassistant.components.ihc import (
validate_name, IHC_DATA, IHC_CONTROLLER, IHC_INFO)
fr... | apache-2.0 |
Pexego/odoo | addons/base_action_rule/test_models.py | 16 | 1079 | from openerp.osv import fields, osv
AVAILABLE_STATES = [
('draft', 'New'),
('cancel', 'Cancelled'),
('open', 'In Progress'),
('pending', 'Pending'),
('done', 'Closed')
]
class lead_test(osv.Model):
_name = "base.action.rule.lead.test"
_columns = {
'name': fields.char('Subject', re... | agpl-3.0 |
parenthetical-e/fmri | catreward/roi/exps/run4s.py | 1 | 3530 | #! /usr/local/bin/python
import os
from fmri.catreward.roi.data import (get_durations, get_cumrewards,
get_trials, get_behave_data, get_similarity_data)
from fmri.catreward.roi.misc import subdir
from fmri.catreward.rl.data import get_rl_data, recode_rl_data
from fmri.catreward.roi.exps.base2 import Rewardreco... | bsd-2-clause |
liosha2007/temporary-groupdocs-python3-sdk | groupdocs/models/GetJobDocumentsResult.py | 2 | 1127 | #!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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 |
Mixser/django | django/core/checks/security/sessions.py | 477 | 2595 | from django.conf import settings
from .. import Tags, Warning, register
def add_session_cookie_message(message):
return message + (
" Using a secure-only session cookie makes it more difficult for "
"network traffic sniffers to hijack user sessions."
)
W010 = Warning(
add_session_cookie_... | bsd-3-clause |
log2timeline/dfvfs | dfvfs/vfs/root_only_file_system.py | 2 | 1727 | # -*- coding: utf-8 -*-
"""The root only file system implementation."""
import abc
from dfvfs.lib import errors
from dfvfs.vfs import file_system
class RootOnlyFileSystem(file_system.FileSystem):
"""Root only file system object."""
# pylint: disable=redundant-returns-doc
def _Close(self):
"""Closes the ... | apache-2.0 |
woju/qubes-core-admin | qubespolicy/tests/cli.py | 2 | 13908 | # -*- encoding: utf-8 -*-
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2017 Marek Marczykowski-Górecki
# <marmarek@invisiblethingslab.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#... | lgpl-2.1 |
p4lang/p4-hlir | p4_hlir/frontend/parser.py | 1 | 75070 | # Copyright 2013-present Barefoot Networks, 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 ... | apache-2.0 |
DarkRainX/ufoai | contrib/scripts/show_pixmap_combination.py | 4 | 5591 | #!/usr/bin/env python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil -*-
import dircache
import os.path
import Image
import sys
UFOAI_ROOT = os.path.realpath(sys.path[0] + '/../..')
class MapComposition(object):
def __init__(self):
file_name = os.path.join(UFOAI_ROOT, "base/pics/geoscape/map_e... | gpl-2.0 |
aleksandra-tarkowska/django | tests/forms_tests/tests/test_validators.py | 261 | 1540 | from __future__ import unicode_literals
import re
from unittest import TestCase
from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
class UserForm(forms.Form):
full_name = forms.CharField(
max_length=50,
validators=[
validato... | bsd-3-clause |
msimacek/samba | third_party/waf/wafadmin/Tools/gcc.py | 32 | 3979 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2008 (ita)
# Ralf Habacker, 2006 (rh)
# Yinon Ehrlich, 2009
import os, sys
import Configure, Options, Utils
import ccroot, ar
from Configure import conftest
@conftest
def find_gcc(conf):
cc = conf.find_program(['gcc', 'cc'], var='CC', mandatory=True)
cc = ... | gpl-3.0 |
clstl/servo | tests/wpt/css-tests/css-fonts-3_dev/html/support/fonts/makegsubfonts.py | 1616 | 14125 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
Distrotech/yum-utils | repo-rss.py | 5 | 10315 | #!/usr/bin/python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it w... | gpl-2.0 |
emersonsoftware/ansiblefork | test/units/plugins/connection/test_netconf.py | 6 | 3897 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
blaxter/samba | third_party/dnspython/dns/rdtypes/ANY/CNAME.py | 101 | 1091 | # Copyright (C) 2003-2007, 2009-2011 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 "... | gpl-3.0 |
ratnania/pyccel | src_old/tests/test_pyccel_openacc.py | 1 | 1291 | # coding: utf-8
# Usage:
# python tests/test_pyccel_openacc.py --openacc --compiler='pgfortran' --execute
import os
from pyccel.commands.console import pyccel
from utils import clean_tests
# ...
def test_core():
print('============== testing core ================')
ignored = []
base_dir = os.getcwd(... | mit |
bpsagar/css2video | css2video/interpolators/stylesheet.py | 1 | 3032 | from ..components import StyleSheetComponent
from .value import interpolate_value
class MissingProperty(Exception):
'''Exception raised when a property value is missing while interpolating
values'''
pass
class StyleSheetInterpolator(object):
'''Generate stylesheet dictionary object'''
def __ini... | mit |
azunite/gyp_20150930 | test/cxxflags/gyptest-cxxflags.py | 128 | 1034 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies the use of the environment during regeneration when the gyp file
changes, specifically via build of an executable with C++ flag... | bsd-3-clause |
zhuyongyong/crosswalk-test-suite | usecase/usecase-apptools-tests/inst.deb.py | 14 | 3130 | #!/usr/bin/env python
import os
import sys
import subprocess
from optparse import OptionParser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
def doCMD(cmd):
print "-->> \"%s\"" % cmd
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subproce... | bsd-3-clause |
mbauskar/tele-erpnext | erpnext/config/crm.py | 16 | 2937 | from frappe import _
def get_data():
return [
{
"label": _("Documents"),
"icon": "icon-star",
"items": [
{
"type": "doctype",
"name": "Lead",
"description": _("Database of potential customers."),
},
{
"type": "doctype",
"name": "Customer",
"description": _("Custome... | agpl-3.0 |
denisff/python-for-android | python-build/python-libs/BeautifulSoup/setup.py | 88 | 2927 | from distutils.core import setup
import unittest
import warnings
warnings.filterwarnings("ignore", "Unknown distribution option")
import sys
# patch distutils if it can't cope with the "classifiers" keyword
if sys.version < '2.2.3':
from distutils.dist import DistributionMetadata
DistributionMetadata.classifie... | apache-2.0 |
JeanKossaifi/scikit-learn | examples/applications/svm_gui.py | 287 | 11161 | """
==========
Libsvm GUI
==========
A simple graphical frontend for Libsvm mainly intended for didactic
purposes. You can create data points by point and click and visualize
the decision region induced by different kernels and parameter settings.
To create positive examples click the left mouse button; to create
neg... | bsd-3-clause |
vladzcloudius/net-next | tools/perf/python/twatch.py | 1565 | 1316 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
jrshust/spark | python/pyspark/mllib/stat/distribution.py | 137 | 1263 | #
# 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 |
AndreaCrotti/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 |
Guneet-Dhillon/mxnet | example/cnn_text_classification/old/text_cnn.py | 25 | 10228 | #!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | apache-2.0 |
schlueter/ansible | lib/ansible/modules/network/nxos/nxos_system.py | 31 | 11749 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
landler/flask-oauthlib | example/google.py | 5 | 1864 | """
google example
~~~~~~~~~~~~~~
This example is contributed by Bruno Rocha
GitHub: https://github.com/rochacbruno
"""
from flask import Flask, redirect, url_for, session, request, jsonify
from flask_oauthlib.client import OAuth
app = Flask(__name__)
app.config['GOOGLE_ID'] = "cloud.google.com/cons... | bsd-3-clause |
hsungchang/cdw11_g5 | static/plugin/liquid_tags/flickr.py | 278 | 3478 | """
Flickr Tag
----------
This implements a Liquid-style flickr tag for Pelican.
IMPORTANT: You have to create a API key to access the flickr api.
You can do this `here <https://www.flickr.com/services/apps/create/apply>`_.
Add the created key to your config under FLICKR_API_KEY.
Syntax
------
{% flickr image_id [sma... | agpl-3.0 |
barentsen/ads | setup.py | 3 | 1182 | # coding: utf-8
"""
A Python module for NASA's Astrophysical Data Service (ADS) that doesn't suck.
"""
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
major, minor1, minor2, release, serial = sys.version_info
readfile_kwargs = {"encodi... | mit |
margulies/ipython | setup.py | 3 | 1431 | #-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------... | bsd-3-clause |
barnsnake351/neutron | neutron/plugins/ml2/drivers/openvswitch/agent/extension_drivers/qos_driver.py | 11 | 2899 | # Copyright (c) 2015 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 |
krader1961/python-mode | pymode/libs3/rope/contrib/autoimport.py | 90 | 8103 | import re
from rope.base import (exceptions, pynames, resourceobserver,
taskhandle, pyobjects, builtins, resources)
from rope.refactor import importutils
class AutoImport(object):
"""A class for finding the module that provides a name
This class maintains a cache of global names in py... | lgpl-3.0 |
pwhelan/djshouts | django/utils/unittest/case.py | 151 | 42686 | """Test case implementation"""
import sys
import difflib
import pprint
import re
import unittest
import warnings
from django.utils.unittest import result
from django.utils.unittest.util import\
safe_repr, safe_str, strclass,\
unorderable_list_difference
from django.utils.unittest.compatibility import wraps
... | bsd-3-clause |
TD22057/T-Home | python/tHome/sma/start.py | 1 | 7027 | #===========================================================================
#
# Main report processing
#
#===========================================================================
import astral
import calendar
import datetime
import json
import time
from .. import util
from . import report
#=======================... | bsd-2-clause |
alhashash/yowsup | yowsup/structs/protocolentity.py | 67 | 1474 | from .protocoltreenode import ProtocolTreeNode
import unittest, time
class ProtocolEntity(object):
__ID_GEN = 0
def __init__(self, tag):
self.tag = tag
def getTag(self):
return self.tag
def isType(self, typ):
return self.tag == typ
def _createProtocolTreeNode(self, attri... | gpl-3.0 |
Balaji2198/coala | coalib/testing/LocalBearTestHelper.py | 6 | 13724 | import queue
import unittest
from contextlib import contextmanager
import pytest
from coalib.testing.BearTestHelper import generate_skip_decorator
from coalib.bears.LocalBear import LocalBear
from coala_utils.ContextManagers import prepare_file
from coalib.settings.Section import Section
from coalib.settings.Setting ... | agpl-3.0 |
ayoubg/gem5-graphics | gem5/tests/configs/simple-timing-mp.py | 69 | 2376 | # Copyright (c) 2013 ARM Limited
# 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 implementation of the functionality ... | bsd-3-clause |
sgzsh269/django | tests/modeladmin/models.py | 37 | 1595 | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
sign_date = models.DateFiel... | bsd-3-clause |
y-zeng/grpc | src/python/grpcio_health_checking/grpc/__init__.py | 13 | 1585 | # Copyright 2015, 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 f... | bsd-3-clause |
gaga3966/django-timepiece | timepiece/tests/base.py | 3 | 7344 | from urllib import urlencode
from urlparse import parse_qs, urlparse
from dateutil.relativedelta import relativedelta
from django.core.urlresolvers import reverse, reverse_lazy
from django.conf import settings
from django.contrib.auth import login
from django.http import HttpRequest
from django.utils import timezone
... | mit |
ChrisCinelli/pgessays | env/lib/python2.7/site-packages/genshi/output.py | 15 | 31267 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 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://genshi.edgewall.org/wiki/License.
#
# This software consist... | bsd-2-clause |
flyher/pymo | android/pgs4a-0.9.6/python-install/lib/python2.7/mailcap.py | 351 | 7427 | """Mailcap file handling. See RFC 1524."""
import os
__all__ = ["getcaps","findmatch"]
# Part 1: top-level interface.
def getcaps():
"""Return a dictionary containing the mailcap database.
The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
to a list of dictionaries corresponding to ... | mit |
cswiercz/sympy | sympy/integrals/quadrature.py | 69 | 14562 | from __future__ import print_function, division
from sympy.core import S, Dummy, pi
from sympy.functions.combinatorial.factorials import factorial
from sympy.functions.elementary.trigonometric import sin, cos
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.functions.special.gamma_functions import ... | bsd-3-clause |
cga-harvard/cga-worldmap | geonode/flexidates.py | 2 | 7920 | import exceptions
import logging
from datautil.date import FlexiDate
from django.core.exceptions import ValidationError
from django.db import models
from django.forms.widgets import Input
from django.utils.encoding import smart_str, force_unicode
from django import forms
from django.utils.translation import ugettext as... | gpl-3.0 |
Natashka89/python_training | test/add_contact_in_group.py | 1 | 1076 | # -*- coding: utf-8 -*-
__author__ = 'Администратор'
from model.contact import Contact
from model.group import Group
from fixture.orm import ORMFixture
import random
def test_add_contact_in_group(app, db):
db = ORMFixture(host="127.0.0.1", name = "addressbook", user="root", password="")
if len(db.get_contact_l... | apache-2.0 |
asajeffrey/servo | tests/wpt/update.py | 5 | 1366 | # 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 https://mozilla.org/MPL/2.0/.
import os
import sys
from wptrunner import wptcommandline
from update import updatecommandline
here = os.path.split(__... | mpl-2.0 |
dato-code/numpy | numpy/f2py/diagnose.py | 75 | 5178 | #!/usr/bin/env python
from __future__ import division, absolute_import, print_function
import os
import sys
import tempfile
def run_command(cmd):
print('Running %r:' % (cmd))
s = os.system(cmd)
print('------')
def run():
_path = os.getcwd()
os.chdir(tempfile.gettempdir())
print('------')
p... | bsd-3-clause |
ewandor/home-assistant | homeassistant/components/sensor/temper.py | 17 | 3506 | """
Support for getting temperature from TEMPer devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.temper/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const impor... | apache-2.0 |
gbraad/linux-meego-panda | tools/perf/scripts/python/sched-migration.py | 185 | 11668 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf trace event handlers have been generated by perf trace -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free ... | gpl-2.0 |
Curso-OpenShift/Formulario | OverFlow/ProjectFormulario/env/lib/python2.7/site-packages/django/db/models/fields/related_lookups.py | 33 | 6280 | from django.db.models.lookups import (
Exact, GreaterThan, GreaterThanOrEqual, In, IsNull, LessThan,
LessThanOrEqual,
)
class MultiColSource(object):
contains_aggregate = False
def __init__(self, alias, targets, sources, field):
self.targets, self.sources, self.field, self.alias = targets, so... | gpl-3.0 |
mustafat/odoo-1 | addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py | 301 | 14179 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c):
#
# 2005 pyopenoffice.py Martin Simon (http://www.bezirksreiter.de)
# 2005 Fabien Pinckaers, TINY SPRL. (http://tiny.be)
#
# This program is free software: you can redistribute it and/or ... | agpl-3.0 |
prisis/sublime-text-packages | Packages/Anaconda/anaconda_server/handlers/jedi_handler.py | 5 | 2768 | # -*- coding: utf8 -*-
# Copyright (C) 2014 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import logging
import jedi
from lib.anaconda_handler import AnacondaHandler
from jedi import refactoring as jedi_refactor
from commands import Doc, Goto, Rename, FindU... | mit |
dash1291/teleport-client | FSEventHandler.py | 1 | 2313 | from datetime import date
import os.path
from watchdog.events import FileSystemEventHandler
import requests
class FSEventHandler(FileSystemEventHandler):
def __init__(self, *args, **kwargs):
self.api_base_uri = kwargs['api_base_uri']
self.api_secret = kwargs['api_secret']
self.path_prefix ... | mit |
0asa/scikit-learn | benchmarks/bench_glmnet.py | 297 | 3848 | """
To run this, you'll need to have installed.
* glmnet-python
* scikit-learn (of course)
Does two benchmarks
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of... | bsd-3-clause |
gnu-sandhi/gnuradio | gr-blocks/python/qa_conjugate.py | 11 | 1663 | #!/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 |
ajdawson/biggus | biggus/tests/unit/test_BroadcastArray.py | 1 | 9852 | # (C) British Crown Copyright 2014, Met Office
#
# This file is part of Biggus.
#
# Biggus 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 3 of the License, or
# (at your option) any late... | gpl-3.0 |
USStateDept/FPA_Core | openspending/views/api_v2/countries.py | 2 | 4501 | import logging
import sys
import traceback
from slugify import slugify
import json
import collections
from flask import Blueprint, request, Response
#from flask.ext.login import current_user
#from openspending.core import db, sourcefiles
from openspending.model import Dataset
from openspending.lib.findui import jsonp... | agpl-3.0 |
elkingtonmcb/django | django/utils/datetime_safe.py | 535 | 2836 | # Python's datetime strftime doesn't handle dates before 1900.
# These classes override date and datetime to support the formatting of a date
# through its full "proleptic Gregorian" date range.
#
# Based on code submitted to comp.lang.python by Andrew Dalke
#
# >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%m/%d was... | bsd-3-clause |
liuyanghejerry/chromabrush | lib/html5lib/treewalkers/etree.py | 27 | 4383 | import gettext
_ = gettext.gettext
import new
import copy
import re
import _base
from html5lib.constants import voidElements
tag_regexp = re.compile("{([^}]*)}(.*)")
moduleCache = {}
def getETreeModule(ElementTreeImplementation):
name = "_" + ElementTreeImplementation.__name__+"builder"
if name in moduleCa... | apache-2.0 |
Peddle/hue | desktop/core/ext-py/Django-1.6.10/tests/inline_formsets/tests.py | 49 | 6672 | from __future__ import absolute_import, unicode_literals
from django.forms.models import inlineformset_factory
from django.test import TestCase, skipUnlessDBFeature
from django.utils import six
from .models import Poet, Poem, School, Parent, Child
class DeletionTests(TestCase):
def test_deletion(self):
... | apache-2.0 |
haydenth/ish_parser | ish_parser/ish_report.py | 1 | 20932 | from datetime import datetime, timedelta
import logging
import pytz
from .Temperature import Temperature
from .Speed import Speed
from .Units import Units
from .Distance import Distance
from .Humidity import Humidity
from .ReportType import ReportType
from .Pressure import Pressure
from .Direction import Direction
fro... | mit |
MalwareLabHagenberg/ambrosia | ambrosia/__init__.py | 1 | 9589 | # -*- coding: utf-8 -*-
###############################################################################
# #
# Ambrosia - a tool to visualize ANANAS results #
# ... | gpl-3.0 |
mzizzi/ansible | lib/ansible/modules/cloud/cloudstack/cs_volume.py | 66 | 15705 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Jefferson Girão <jefferson@girao.net>
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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... | gpl-3.0 |
Yubico/python-yubicommon | setup.py | 2 | 2271 | # 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 |
tperalta82/OpenWRT-Builder | scripts/dl_cleanup.py | 131 | 5871 | #!/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>
"""
import sys
import os
import re
import getopt
# Commandline options
opt_dryrun = False
def parseVer_1234(match, filepath):
... | gpl-2.0 |
Mark9013100/tgstation-m9 | tools/minibot/minibot.py | 107 | 5089 | #!/usr/bin/env python3
# This bot was made by tkdrg.
# Ask #coderbus@irc.rizon.net if this breaks.
# See LICENSE-bot_folder.txt for the license of the files in this folder.
from config import *
import collections
import time
import pickle
import socket
import sys
import threading
import logging
import logging.handlers ... | agpl-3.0 |
nwiizo/workspace_2017 | ansible-modules-extras/system/svc.py | 11 | 10101 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Brian Coca <bcoca@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 Licen... | mit |
pgagne/robottelo | tests/foreman/api/test_computeresource_libvirt.py | 3 | 17823 | # -*- encoding: utf-8 -*-
"""Unit tests for the ``compute_resource`` paths.
A full API reference for compute resources can be found here:
http://www.katello.org/docs/api/apidoc/compute_resources.html
:Requirement: Computeresource Libvirt
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: API
:Test... | gpl-3.0 |
kirbyherm/root-r-tools | tutorials/pyroot/hsimple.py | 11 | 2765 | #*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
#*-*
#*-* This program creates :
#*-* - a one dimensional histogram
#*-* - a two dimensional histogram
#*-* - a profile histogram
#*-* - a memory-resident ntuple
#*-*
#*-* These objects are filled with some random numbers and saved... | lgpl-2.1 |
yuewko/neutron | neutron/db/migration/alembic_migrations/core_init_ops.py | 15 | 5628 | # Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
miipl-naveen/optibizz | addons/l10n_pa/__init__.py | 2120 | 1456 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
ccclayton/DataWar | static/js/threejs.r65/utils/converters/obj/split_obj.py | 369 | 12687 | """Split single OBJ model into mutliple OBJ files by materials
-------------------------------------
How to use
-------------------------------------
python split_obj.py -i infile.obj -o outfile
Will generate:
outfile_000.obj
outfile_001.obj
...
outfile_XXX.obj
-------------------------------------
Parser based ... | mit |
2mny/mylar | lib/rtorrent/connection.py | 2 | 5251 | import logging
import urllib
from rtorrent.common import convert_version_tuple_to_str, join_uri, update_uri
from rtorrent.lib.xmlrpc.clients.http import HTTPServerProxy
from rtorrent.lib.xmlrpc.clients.scgi import SCGIServerProxy
from rtorrent.lib.xmlrpc.transports.basic_auth import BasicAuthTransport
try:
from ... | gpl-3.0 |
lukamicoder/moonpdf | ext/sumatra/scripts/extract_strings.py | 5 | 12816 | import codecs
import os
import os.path
import re
import sys
from util import uniquify
"""
Extracts translatable strings from *.c and *.h files, dumps statistics
about untranslated strings to stdout and adds untranslated strings as
comments at the end of strings file for each language.
"""
# whitelist som... | gpl-3.0 |
nmercier/linux-cross-gcc | linux/lib/python2.7/dist-packages/PIL/ImageQt.py | 15 | 5658 | #
# The Python Imaging Library.
# $Id$
#
# a simple Qt image interface.
#
# history:
# 2006-06-03 fl: created
# 2006-06-04 fl: inherit from QImage instead of wrapping it
# 2006-06-05 fl: removed toimage helper; move string support to ImageQt
# 2013-11-13 fl: add support for Qt5 (aurelien.ballier@cyclonit.com)
#
# Copyr... | bsd-3-clause |
danieldresser/cortex | test/IECore/ImageThinnerTest.py | 12 | 2239 | ##########################################################################
#
# Copyright (c) 2010, Image Engine Design 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:
#
# * Redistribu... | bsd-3-clause |
jimi-c/ansible | lib/ansible/modules/cloud/ovirt/ovirt_storage_domains.py | 2 | 26757 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# 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
#... | gpl-3.0 |
w19900227/kubernetes | cluster/juju/charms/trusty/kubernetes/unit_tests/lib/test_registrator.py | 232 | 2215 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
MoisesTedeschi/python | Scripts-Python/Modulos-Diversos/python-com-scrapy/Lib/encodings/iso2022_jp_1.py | 816 | 1061 | #
# iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_1')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... | gpl-3.0 |
nicoboss/Floatmotion | OpenGL/raw/GL/AMD/performance_monitor.py | 9 | 2391 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | agpl-3.0 |
fintech-circle/edx-platform | common/lib/xmodule/xmodule/fields.py | 3 | 9125 | import datetime
import logging
import re
import time
import dateutil.parser
from pytz import UTC
from xblock.fields import JSONField
log = logging.getLogger(__name__)
class Date(JSONField):
'''
Date fields know how to parse and produce json (iso) compatible formats. Converts to tz aware datetimes.
'''
... | agpl-3.0 |
5225225-zz/pyquiz | quiz.py | 1 | 2640 | import sys
import random
import time
class _Getch:
def __init__(self):
try:
self.impl = _GetchWindows()
except ImportError:
self.impl = _GetchUnix()
def __call__(self):
return self.impl()
class _GetchUnix:
def __init__(self):
import tty, sys
de... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.