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 |
|---|---|---|---|---|---|
akerl/fwknop | python/fko.py | 1 | 41136 | ##############################################################################
#
# fko.py
#
# License (GNU General Public License):
#
# 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 v... | gpl-2.0 |
power12317/weblate | weblate/trans/migrations/0024_auto__add_field_unit_previous_source.py | 1 | 15213 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
cl4rke/scikit-learn | examples/mixture/plot_gmm_selection.py | 248 | 3223 | """
=================================
Gaussian Mixture Model Selection
=================================
This example shows that model selection can be performed with
Gaussian Mixture Models using information-theoretic criteria (BIC).
Model selection concerns both the covariance type
and the number of components in th... | bsd-3-clause |
keichan100yen/ode-ext | boost/libs/mpi/test/python/ring_test.py | 64 | 1488 | # Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>.
# Use, modification and distribution is subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Test basic communication.
import boost.parallel.mpi as mpi
def r... | mit |
ThaTiemsz/jetski | rowboat/types/__init__.py | 3 | 2805 | import fnmatch
from disco.types.base import Model, SlottedModel, Field, ListField, DictField, text, snowflake
__all__ = [
'Model', 'SlottedModel', 'Field', 'ListField', 'DictField', 'text', 'snowflake', 'channel', 'raw',
'rule_matcher', 'lower',
]
def lower(raw):
return unicode(raw).lower()
def raw(ob... | mit |
petteyg/intellij-community | python/lib/Lib/encodings/cp500.py | 593 | 13377 | """ Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... | apache-2.0 |
nschloe/quadpy | src/quadpy/e2r/_helpers.py | 1 | 2341 | import json
import math
import numpy as np
from ..helpers import QuadratureScheme, expand_symmetries, plot_disks
schemes = {}
def register(in_schemes):
for scheme in in_schemes:
schemes[scheme.__name__] = scheme
class E2rScheme(QuadratureScheme):
def __init__(
self, name, symmetry_data, d... | mit |
AWI-Paleodyn/Python_Helpers | basemap_wrappers/plot_decorator.py | 2 | 1656 | # Ok, lets see if I can successfully figure out how to use decorators today...
# Let us start by making a function as we would regulalry want it to be in the plot absolute case for a global map:
def plot_nc_map_global(file, variable):
# This all happens before the actual plot command
f = get_remote_data(file)... | gpl-2.0 |
bluemini/kuma | vendor/packages/nose/plugins/xunit.py | 48 | 11667 | """This plugin provides test results in the standard XUnit XML format.
It's designed for the `Jenkins`_ (previously Hudson) continuous build
system, but will probably work for anything else that understands an
XUnit-formatted XML representation of test results.
Add this shell command to your builder ::
nosetests... | mpl-2.0 |
ghber/My-Django-Nonrel | django/utils/cache.py | 96 | 9483 | """
This module contains helper functions for controlling caching. It does so by
managing the "Vary" header of responses. It includes functions to patch the
header of response objects directly and decorators that change functions to do
that header-patching themselves.
For information on the Vary header, see:
http... | bsd-3-clause |
maestro-hybrid-cloud/keystone | keystone/tests/unit/test_ldap_pool_livetest.py | 4 | 8247 | # 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 |
tictakk/servo | tests/wpt/web-platform-tests/2dcontext/tools/specextract.py | 75 | 2105 | import html5lib
import html5lib.treebuilders.dom
# Expected use:
# curl --compressed http://www.whatwg.org/specs/web-apps/current-work/ >current-work
# python specextract.py
#
# Generates current-work-canvas.xhtml, for use by gentest.py to create the annotated spec document
def extract():
parser = html5lib.ht... | mpl-2.0 |
DennisDenuto/puppet-commonscripts | files/aws_cli/AWS-ElasticBeanstalk-CLI-2.6.3/eb/macosx/python3/lib/aws/requests/packages/charade/jisfreq.py | 3131 | 47315 | ######################## 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 |
sstrigger/Sick-Beard | lib/hachoir_core/memory.py | 177 | 2417 | import gc
#---- Default implementation when resource is missing ----------------------
PAGE_SIZE = 4096
def getMemoryLimit():
"""
Get current memory limit in bytes.
Return None on error.
"""
return None
def setMemoryLimit(max_mem):
"""
Set memory limit in bytes.
Use value 'None' to d... | gpl-3.0 |
jingr1/Linux-4.2.1-for-OK6410 | tools/perf/scripts/python/net_dropmonitor.py | 1812 | 1749 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
dgasmith/psi4 | psi4/driver/qcdb/vecutil.py | 3 | 11359 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2019 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
rimbalinux/MSISDNArea | django/contrib/sessions/models.py | 3 | 2091 | import base64
import cPickle as pickle
from django.db import models
from django.utils.translation import ugettext_lazy as _
class SessionManager(models.Manager):
def encode(self, session_dict):
"""
Returns the given session dictionary pickled and encoded as a string.
"""
... | bsd-3-clause |
hellfish2/treeio | messaging/urls.py | 3 | 2531 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Messaging module URLs
"""
from django.conf.urls import patterns, url
urlpatterns = patterns('treeio.messaging.views',
url(r'^(\.(?P<response_format>\w+))?$',
'index', name='messaging'),
... | mit |
SlimRemix/android_external_chromium_org | tools/auto_bisect/request_build.py | 36 | 12911 | # 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.
"""This module contains functionality for starting build try jobs via HTTP.
This includes both sending a request to start a job, and also related code
for q... | bsd-3-clause |
highweb-project/highweb-webcl-html5spec | tools/json_schema_compiler/cc_generator.py | 10 | 43492 | # 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.
from code import Code
from model import PropertyType
import cpp_util
import schema_util
import util_cc_helper
from cpp_namespace_environment import CppNa... | bsd-3-clause |
AsimmHirani/ISpyPi | tensorflow/contrib/tensorflow-master/tensorflow/python/debug/lib/debug_utils_test.py | 11 | 10736 | # 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 |
jbedorf/tensorflow | tensorflow/contrib/ffmpeg/ffmpeg_ops.py | 20 | 4672 | # 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 |
chipx86/reviewboard | reviewboard/reviews/views.py | 2 | 90019 | from __future__ import unicode_literals
import io
import json
import logging
import re
import struct
import dateutil.parser
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db.models import Q
from d... | mit |
Lipen/LipenDev | Azeroth/Northrend/ACO/draw_mds.py | 1 | 1595 | import numpy as np
import matplotlib.pyplot as plt
from sklearn import manifold
with open('opt', 'r') as f:
raw = f.read().splitlines()
ds_name = raw[0]
L_opt = int(raw[1])
T_opt = np.array(list(map(int, raw[2].split())))
with open(ds_name + '.txt', 'r') as f:
dists = [list(map(float, line.split())) for line in ... | gpl-3.0 |
lucashmorais/x-Bench | mozmill-env/python/Lib/site-packages/hgext/largefiles/overrides.py | 90 | 46667 | # Copyright 2009-2010 Gregory P. Ward
# Copyright 2009-2010 Intelerad Medical Systems Incorporated
# Copyright 2010-2011 Fog Creek Software
# Copyright 2010-2011 Unity Technologies
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'... | mit |
raccoongang/edx-platform | lms/djangoapps/grades/tasks.py | 1 | 11806 | """
This module contains tasks for asynchronous execution of grade updates.
"""
from logging import getLogger
import six
from celery import task
from celery_utils.logged_task import LoggedTask
from celery_utils.persist_on_failure import PersistOnFailureTask
from django.conf import settings
from django.contrib.auth.mo... | agpl-3.0 |
Bismarrck/tensorflow | tensorflow/python/ops/ragged/ragged_map_flat_values_op_test.py | 13 | 8954 | # Copyright 2018 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 |
lucventurini/mikado | Mikado/tests/parser_test.py | 1 | 15254 | import unittest
from Mikado.exceptions import InvalidParsingFormat
from Mikado.parsers import parser_factory
from Mikado.parsers.GTF import GTF
from Mikado.parsers.bam_parser import BamParser
from .. import parsers
from ..parsers.GFF import GFF3
from ..parsers.bed12 import Bed12Parser
from ..utilities import default_f... | lgpl-3.0 |
andykimpe/chromium-test-npapi | build/protoc_java.py | 90 | 1317 | #!/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.
"""Generate java source files from protobufs
Usage:
protoc_java.py {protoc} {proto_path} {java_out} {stamp_file} {proto_files}... | bsd-3-clause |
kernel-sanders/arsenic-mobile | Dependencies/Twisted-13.0.0/twisted/web/resource.py | 12 | 13069 | # -*- test-case-name: twisted.web.test.test_web -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation of the lowest-level Resource class.
"""
from __future__ import division, absolute_import
__all__ = [
'IResource', 'getChildForRequest',
'Resource', 'ErrorPage', 'NoRe... | gpl-3.0 |
MissCatLady/AlarmEZ | venv/lib/python2.7/site-packages/flask/testsuite/appctx.py | 558 | 3116 | # -*- coding: utf-8 -*-
"""
flask.testsuite.appctx
~~~~~~~~~~~~~~~~~~~~~~
Tests the application context.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
from flask.testsuite import FlaskTestCase
class AppContextTestCase(Flask... | mit |
sh4t/Sick-Beard | lib/hachoir_parser/misc/chm.py | 90 | 7546 | """
InfoTech Storage Format (ITSF) parser, used by Microsoft's HTML Help (.chm)
Document:
- Microsoft's HTML Help (.chm) format
http://www.wotsit.org (search "chm")
- chmlib library
http://www.jedrea.com/chmlib/
Author: Victor Stinner
Creation date: 2007-03-04
"""
from lib.hachoir_parser import Parser
from lib.h... | gpl-3.0 |
mhdella/scikit-learn | examples/neighbors/plot_digits_kde_sampling.py | 251 | 2022 | """
=========================
Kernel Density Estimation
=========================
This example shows how kernel density estimation (KDE), a powerful
non-parametric density estimation technique, can be used to learn
a generative model for a dataset. With this generative model in place,
new samples can be drawn. These... | bsd-3-clause |
ekiwi/tinyos-1.x | contrib/nestfe/python/pytos/Util.py | 2 | 2323 | #$Id: Util.py,v 1.1 2005/05/26 05:33:58 shawns Exp $
# "Copyright (c) 2000-2003 The Regents of the University of California.
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fee, and without written agreement
# is hereby granted... | bsd-3-clause |
ghber/My-Django-Nonrel | django/contrib/localflavor/pt/forms.py | 309 | 1561 | """
PT-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits_re = re.com... | bsd-3-clause |
MrCodeYu/spark | python/pyspark/sql/functions.py | 3 | 64763 | #
# 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 |
guke001/QMarkdowner | dpkt/http.py | 9 | 8777 | # $Id: http.py 59 2010-03-24 15:31:17Z jon.oberheide $
"""Hypertext Transfer Protocol."""
import cStringIO
import dpkt
def parse_headers(f):
"""Return dict of HTTP headers parsed from a file object."""
d = {}
while 1:
line = f.readline()
if not line:
raise dpkt.NeedData('prema... | mit |
levilucio/SyVOLT | GM2AUTOSAR_MM/overlap_rules/models/MapVirtualDevice_overlap_MDL.py | 1 | 15960 | """
__MapVirtualDevice_overlap_MDL.py_____________________________________________________
Automatically generated AToM3 Model File (Do not modify directly)
Author: levi
Modified: Thu Jun 6 11:39:18 2013
______________________________________________________________________________________
"""
from stickylink import ... | mit |
Reyuu/daiomen | animation.py | 1 | 4864 | import pygame
import ezpygame
import os
def load_png(directory, name):
"""
Load image and return image object
:param directory:
:param name:
"""
fullname = os.path.join(directory, name)
#fullname = name
try:
image = pygame.image.load(fullname)
if image.get_alpha() is N... | mit |
lenstr/rethinkdb | test/rql_test/connections/http_support/werkzeug/testapp.py | 294 | 9398 | # -*- coding: utf-8 -*-
"""
werkzeug.testapp
~~~~~~~~~~~~~~~~
Provide a small test application that can be used to test a WSGI server
and check it for WSGI compliance.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
impo... | agpl-3.0 |
SwordGO/SwordGO_app | example/kivymap/.buildozer/venv/lib/python2.7/site-packages/pip/commands/wheel.py | 170 | 7528 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import os
import warnings
from pip.basecommand import RequirementCommand
from pip.exceptions import CommandError, PreviousBuildDirError
from pip.req import RequirementSet
from pip.utils import import_or_raise
from pip.utils.build import Bui... | gpl-3.0 |
openstack/surveil | surveil/api/datamodel/status/metrics/time_interval.py | 1 | 1053 | # Copyright 2014 - Savoir-Faire Linux inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | apache-2.0 |
ptisserand/ansible | lib/ansible/modules/cloud/vmware/_vsphere_guest.py | 22 | 72136 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, 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',
... | gpl-3.0 |
chenjun0210/tensorflow | tensorflow/tools/graph_transforms/python/transform_graph_test.py | 170 | 3295 | # 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 applicable ... | apache-2.0 |
supergentle/migueltutorial | flask/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.py | 80 | 4814 | # Copyright (C) 2013-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
from .base import ischema_names
from ... import types as sqltypes
__all__ = ('INT4RANGE', 'INT8RANGE'... | bsd-3-clause |
ROIV/ViorCoin-ElectrumWallet | gui/qt/main_window.py | 1 | 90385 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 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... | gpl-3.0 |
andreparrish/python-for-android | python3-alpha/python3-src/Lib/sre_parse.py | 48 | 27922 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... | apache-2.0 |
phil65/plugin.image.cyanidehappiness | plugin.py | 1 | 2916 | # -*- coding: utf8 -*-
# Copyright (C) 2016- Philipp Temminghoff <phil65@kodi.tv>
# This program is Free Software see LICENSE file for details
from __future__ import absolute_import
import re
import random
import datetime
import xbmc
import xbmcplugin
import xbmcgui
import xbmcvfs
import routing
from kodi65 impor... | gpl-2.0 |
Molns/pyurdme | examples/mincde/mincde.py | 1 | 5094 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy
import os.path
import pyurdme
import dolfin
import numpy
class Membrane(dolfin.SubDomain):
def inside(self,x,on_boundary):
return on_boundary
class Cytosol(dolfin.SubDomain):
def inside(self,x,on_boundary):
return not on_boun... | gpl-3.0 |
kamyu104/GoogleCodeJam-2015 | World Finals/taking-over-the-world.py | 1 | 3741 | # Copyright (c) 2015 kamyu. All rights reserved.
#
# Google Code Jam 2015 World Finals - Problem D. Taking Over The World
# https://code.google.com/codejam/contest/5224486/dashboard#s=p3
#
# Time: O(K * N * M^2)
# Space: O(N^2)
#
from collections import deque
from heapq import heappush, heappop
TO, CAP, REV = 0, 1, ... | mit |
wangjun/odoo | addons/hr_timesheet_invoice/__openerp__.py | 260 | 2403 | # -*- 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 |
DarKnight24/owtf | framework/http/wafbypasser/core/detection.py | 2 | 1637 | """
# ****************Detection-Methods*********************
# These methods are detecting if a request is blocked by a WAF
"""
def contains(response, args):
"""This function detects if the body of an http response contains a
user defined string"""
phrase = args["phrase"]
body = response.body
if b... | bsd-3-clause |
fasaxc/calico-docker | calico_containers/calico_ctl/connectors.py | 10 | 1455 | # Copyright 2015 Metaswitch Networks
#
# 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 w... | apache-2.0 |
silveregg/moto | moto/opsworks/models.py | 7 | 21641 | from __future__ import unicode_literals
from moto.core import BaseBackend
from moto.ec2 import ec2_backends
import uuid
import datetime
from random import choice
from .exceptions import ResourceNotFoundException, ValidationException
class OpsworkInstance(object):
"""
opsworks maintains its own set of ec2 ins... | apache-2.0 |
DrMeers/django | django/test/utils.py | 6 | 17393 | from contextlib import contextmanager
import logging
import re
import sys
import time
from unittest import skipUnless
import warnings
from functools import wraps
from xml.dom.minidom import parseString, Node
from django.apps import apps
from django.conf import settings, UserSettingsHolder
from django.core import mail
... | bsd-3-clause |
valtandor/easybuild-framework | easybuild/framework/easyconfig/tools.py | 4 | 33344 | # #
# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (ht... | gpl-2.0 |
nicklhy/mxnet | example/rnn/old/gru.py | 52 | 6589 | # 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 |
sanjeevtripurari/hue | desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/contrib/ntlmpool.py | 1010 | 4507 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from ntlm import ntlm
from urllib3 import HTT... | apache-2.0 |
dtschan/weblate | weblate/trans/machine/microsoft.py | 2 | 4381 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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, eith... | gpl-3.0 |
ask/celery | celery/beat.py | 2 | 15243 | # -*- coding: utf-8 -*-
"""
celery.beat
~~~~~~~~~~~
The Celery periodic task scheduler.
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import errno
import os
import time
import shelve
import sys
import traceback
... | bsd-3-clause |
darshanthaker/nupic | tests/integration/nupic/opf/opf_checkpoint_test/experiments/non_temporal_multi_step/base.py | 31 | 14978 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2012-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This p... | agpl-3.0 |
hgl888/chromium-crosswalk | tools/perf/page_sets/intl_hi_ru.py | 13 | 1539 | # 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.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
class IntlHiRuPage(page_module.Page)... | bsd-3-clause |
football-fastball/pyTron | pytron_nice_page_name_compiled.py | 1 | 48704 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from subprocess import PIPE, Popen, STDOUT
import time
import ast
import uuid
import json
global pyGET
global pyPOST
global pySERVER
global pyFILES
global PREPROCESSOR_FOLDER
global SOURCE_FOLDER
global ensure # set to True initially, f... | gpl-2.0 |
jasimpson/gnuradio-jasimpson | gr-utils/src/python/gr_plot_psd_c.py | 16 | 1346 | #!/usr/bin/env python
#
# Copyright 2008 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 |
zstackorg/zstack-woodpecker | integrationtest/vm/multihosts/ha/test_min_ha_param_vm_ha_net_dis.py | 1 | 7769 | '''
Test for plug off host network vm ha located by quick ha setting
@author: SyZhao
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackw... | apache-2.0 |
mano3m/CouchPotatoServer | couchpotato/core/providers/automation/movies_io/main.py | 23 | 1092 | from couchpotato.core.event import fireEvent
from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.variable import tryInt, splitString
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.automation.base import Automation
log = CPLog(__name__)
class MoviesIO(Automation, RSS)... | gpl-3.0 |
Rogerp009/OC | system/js/fckeditor/editor/filemanager/connectors/py/fckconnector.py | 131 | 2686 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | gpl-2.0 |
aldian/tensorflow | tensorflow/python/estimator/training.py | 4 | 37623 | # 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 |
zjutjsj1004/third | boost/libs/python/test/properties.py | 12 | 2095 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
"""
This is test module for properties.
>>> r = properties.ret_type()
>>> r.i = 22.5
>>> r.i
22.5
>>> c = properties.crash_me... | mit |
Pluto-tv/chromium-crosswalk | tools/telemetry/telemetry/internal/backends/android_command_line_backend_unittest.py | 2 | 3616 | # Copyright 2013 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 logging
import unittest
from telemetry import decorators
from telemetry.internal.backends import android_command_line_backend
from telemetry.testing ... | bsd-3-clause |
GinnyN/Team-Fortress-RPG-Generators | tests/modeltests/unmanaged_models/tests.py | 97 | 2206 | from __future__ import absolute_import
from django.db import connection
from django.test import TestCase
from .models import A01, A02, B01, B02, C01, C02, Unmanaged2, Managed1
class SimpleTests(TestCase):
def test_simple(self):
"""
The main test here is that the all the models can be created wi... | bsd-3-clause |
EliasManj/habits | api/models/date.py | 1 | 2161 | import sqlite3
import datetime
class DateModel:
def __init__(year, month, day):
self.year = year
self.month = month
self.day = day
def getColumns():
connection = sqlite3.connect('data.db')
cursor = connection.cursor()
countColumns = "PRAGMA table_info(datesTabl... | gpl-3.0 |
Dwii/Master-Thesis | implementation/Palabos/palabos-master/scons/scons-local-2.1.0/SCons/Tool/mslink.py | 21 | 13453 | """SCons.Tool.mslink
Tool-specific initialization for the Microsoft linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ... | mit |
b0204888100/chen3 | lib/flask/json.py | 348 | 7530 | # -*- coding: utf-8 -*-
"""
flask.jsonimpl
~~~~~~~~~~~~~~
Implementation helpers for the JSON support in Flask.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import io
import uuid
from datetime import datetime
from .globals import current_app, request
fro... | apache-2.0 |
karimbahgat/PythonGis | (sandbox,tobemerged)/pythongis/raster/saver.py | 1 | 4371 |
import PIL
import PIL.TiffImagePlugin
import PIL.TiffTags
def to_file(grids, info, filepath):
if filepath.endswith((".ascii",".asc")):
# create header
width, height = img.size()
xorig, yorig = info["xy_geo"]
if info["cell_anchor"] == "center":
xorigtype = "xllcenter"
... | mit |
dhutty/ansible | lib/ansible/compat/__init__.py | 332 | 1088 | # (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 |
kifcaliph/odoo | addons/account_bank_statement_extensions/report/bank_statement_balance_report.py | 378 | 2723 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... | agpl-3.0 |
onyxfish/journalism | agate/aggregations/stdev.py | 4 | 2150 | #!/usr/bin/env python
from agate.aggregations import Aggregation
from agate.aggregations.has_nulls import HasNulls
from agate.aggregations.variance import Variance, PopulationVariance
from agate.data_types import Number
from agate.exceptions import DataTypeError
from agate.warns import warn_null_calculation
class St... | mit |
trtt/apitrace | wrappers/egltrace.py | 2 | 7224 | ##########################################################################
#
# Copyright 2011 LunarG, Inc.
# All Rights Reserved.
#
# Based on glxtrace.py, which has
#
# Copyright 2011 Jose Fonseca
# Copyright 2008-2010 VMware, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# ... | mit |
mjschultz/ansible-modules-extras | cloud/cloudstack/cs_sshkeypair.py | 10 | 8813 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (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 Software Foundation, either version 3 of the Lice... | gpl-3.0 |
StefanRijnhart/OpenUpgrade | addons/product/_common.py | 111 | 1418 | # -*- 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 |
averywallis/Radar | ggame/sysdeps.py | 227 | 1916 | def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
return True
if module_exists('browser') and module_exists('javascript'):
from browser import window, document
from javascript import JSObject, JSConstructor
GFX = JSObject(w... | mit |
sriharshaanp/Projects | PredictingSuccessOfNovel/thresholdProcessor.py | 1 | 2097 | '''
Created on Apr 19, 2015
@author: RAJ
'''
import os
import glob
import sys
def thresholdGenerator(file,genre,basePath,threshold):
file=open(file,"r")
withDate=[]
withoutDate=[]
fileThreshold={}
out=open("threshold.txt","w+")
for line in file.readlines():
features=line.split(",:;")
... | gpl-2.0 |
joshuajharris/NodejsRealTimeChat | node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py | 610 | 1611 | #!/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.
""" Unit tests for the ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon
... | mit |
elioth010/lugama | venv/lib/python2.7/site-packages/flask/testsuite/views.py | 561 | 5068 | # -*- coding: utf-8 -*-
"""
flask.testsuite.views
~~~~~~~~~~~~~~~~~~~~~
Pluggable views.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import flask.views
import unittest
from flask.testsuite import FlaskTestCase
from werkzeug.http import par... | gpl-2.0 |
kmstumpff/pyOBD2 | src/Gears.py | 1 | 1133 | import Ratios
import math
class Gears:
def __init__(self):
self.R = Ratios.Ratios()
self.tireD = (((self.R.tireW*(self.R.tireAR/100))*0.039370079)*2)+self.R.rimD
def getAvg(self, r1, r2):
return ((r1+r2)/2)
def getGearingRatio(self, mph, rpm):
return (math.pi * self.tireD *... | gpl-3.0 |
jesolem/PCV | examples/lktrack.py | 18 | 3757 | from numpy import *
import cv2
# some constants and default parameters
lk_params = dict(winSize=(15,15),maxLevel=2,
criteria=(cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT,10,0.03))
subpix_params = dict(zeroZone=(-1,-1),winSize=(10,10),
criteria = (cv2.TERM_CRITERIA_COUNT | cv... | bsd-2-clause |
sony/nnabla | python/test/function/test_random_flip.py | 1 | 2983 | # Copyright 2017,2018,2019,2020,2021 Sony Corporation.
# Copyright 2021 Sony Group 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-... | apache-2.0 |
johanek/salt-arista | _states/arista_interface.py | 1 | 1193 | # -*- coding: utf-8 -*-
'''
Configuration of Arista interfaces
'''
def managed(name,
host,
description='',
shutdown=False):
ret = {'changes': {},
'comment': '',
'name': name,
'result': True}
interface = __salt__['arista_interface.get'](name... | mit |
ShoRit/shipping-costs-sample | v2/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py | 360 | 11622 | from __future__ import absolute_import
import errno
import warnings
import hmac
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning
SSLContext = None
HAS_SNI = False
create_default_context = None
IS_PYOPENSSL = F... | apache-2.0 |
igrlas/CentralHub | CHPackage/src/centralhub/helpers/profile_handler.py | 1 | 1581 |
import datetime
from data import repository
repo = repository.Repository();
def find_current_state(element):
"""Override is top priority, if override is enabled, desired temperature is returned right away
if there is no override, current time gets compared to all times from the database for the current elem... | gpl-2.0 |
kartoza/geonode | geonode/contrib/favorite/tests.py | 21 | 8021 | # -*- 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 |
apiaryio/snowcrash | tools/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 2013 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | mit |
fajran/irclogview | irclogview/migrations/0002_add_index.py | 2 | 1623 | # 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 index on 'Log', fields ['date']
db.create_index('irclogview_log', ['date'])
def backwards(s... | agpl-3.0 |
marcovc/casper | examples/bindings/python/golfer.py | 1 | 1405 |
from casper import *
from casper.cp import *
w = 5
g = 4
s = 4
n = g*s
heuristic = 0
solver = Solver()
vars = IntVarArray3(solver,w,g,s,1,n)
# meet at most once
for wi in range(w):
for wj in range(wi+1,w):
for gi in range(g):
for gj in range(g):
solver.post(sum([asInt(vars[wi][gi][i]==vars[wj][gj][j])
... | apache-2.0 |
sklnet/openhdf-enigma2 | lib/python/Components/Ipkg.py | 3 | 7180 | import os
from enigma import eConsoleAppContainer
from Components.Harddisk import harddiskmanager
from Components.config import config
from shutil import rmtree
from boxbranding import getImageDistro, getImageVersion
opkgDestinations = []
opkgStatusPath = ''
def opkgExtraDestinations():
global opkgDestinations
retu... | gpl-2.0 |
mnahm5/django-estore | Lib/site-packages/PIL/TiffTags.py | 1 | 7453 | #
# The Python Imaging Library.
# $Id$
#
# TIFF tags
#
# This module provides clear-text names for various well-known
# TIFF tags. the TIFF codec works just fine without it.
#
# Copyright (c) Secret Labs AB 1999.
#
# See the README file for information on usage and redistribution.
#
##
# This module provides constant... | mit |
HKUST-SING/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/onehot_categorical_test.py | 30 | 10629 | # 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 |
joelbitar/rfinder | filter/file/rar.py | 1 | 1066 | import re
from filter.file.matcher import FileMatcherModule
class Matcher(FileMatcherModule):
REGEXPS = [
[".*part([\d]{1,2})\.rar$", ["1"]], # Special rule, only allow
".*\.rar$",
".*\.r[0]{1,2}[0,1]$"
]
def match(self, filename):
fileNameMatch = None
for regexp in... | lgpl-3.0 |
ashemedai/ansible | lib/ansible/module_utils/gcdns.py | 94 | 2529 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.