repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
vortex-ape/scikit-learn | refs/heads/master | sklearn/_config.py | 6 | """Global configuration state and functions for management
"""
import os
from contextlib import contextmanager as contextmanager
_global_config = {
'assume_finite': bool(os.environ.get('SKLEARN_ASSUME_FINITE', False)),
'working_memory': int(os.environ.get('SKLEARN_WORKING_MEMORY', 1024))
}
def get_config():
... |
christophlsa/odoo | refs/heads/8.0 | addons/edi/models/res_company.py | 437 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
tomjelinek/pcs | refs/heads/master | pcs_test/tier0/lib/booth/test_config_files.py | 3 | import os.path
from unittest import mock, TestCase
from pcs_test.tools import fixture
from pcs_test.tools.assertions import assert_report_item_list_equal
from pcs import settings
from pcs.common import file_type_codes
from pcs.common.file import RawFileError
from pcs.common.reports import codes as report_codes
from p... |
lliendo/PyZ80 | refs/heads/master | pyz80/tests/test_jump.py | 1 | # -*- coding: utf-8 -*-
"""
This file is part of PyZ80.
PyZ80 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 later version.
PyZ80 is distributed ... |
zhhf/charging | refs/heads/master | charging/db/migration/alembic_migrations/versions/f9263d6df56_remove_dhcp_lease.py | 16 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 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... |
yanheven/cinder | refs/heads/master | cinder/volume/drivers/vmware/datastore.py | 4 | # Copyright (c) 2014 VMware, 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... |
yashchandak/GNN | refs/heads/master | Sample_Run/DOPE/parser.py | 1 | import argparse
class Parser(object):
def __init__(self):
parser = argparse.ArgumentParser()
parser.add_argument("--path", default='/home/priyesh/Desktop/Expt_Deep_CC',
help="Base path for the code")
parser.add_argument("--project", default='DO... |
GabrielBrascher/cloudstack | refs/heads/master | test/selenium/cspages/__init__.py | 40 | # 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... |
SamYaple/neutron | refs/heads/master | neutron/extensions/l3_ext_ha_mode.py | 25 | # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... |
OSGeoLabBp/tutorials | refs/heads/master | english/data_processing/lessons/code/pfilter.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" filter point file
"""
import sys
import re
def GetNext(fp, separator=';'):
""" get next line from file and parse """
buf = fp.readline()
res = tuple() # empty tuple marks invalid input line
if buf: # None returned on end of file
fields = ... |
g0v/LittleBeeGeo | refs/heads/master | LittleBeeGeo_backend/scripts/templates/simple_module/tests/+test_package_dirname+/__init__.py | 18 | def setup():
pass
def teardown():
pass
|
teamtuga4/teamtuga4ever.repository | refs/heads/master | plugin.video.pancas/resources/lib/libraries/client2.py | 7 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... |
mkouhei/django-openid-auth-debian | refs/heads/master | django_openid_auth/tests/urls.py | 44 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2009-2013 Canonical Ltd.
#
# 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 ... |
NateChambers/flexx | refs/heads/master | flexx/webruntime/browser.py | 21 | """ Web runtime based on a common browser
Opens browser via webbrowser module.
"""
import webbrowser
import logging
from .common import BaseRuntime
BROWSER_MAP = {'chrome': ['google-chrome', 'chrome',
'chromium-browser', 'chromium'],
'chromium': ['chromium-browser', 'chrom... |
teddziuba/pqauth | refs/heads/master | python/pqauth/pqauth_django_server/models.py | 1 | from django.contrib.auth.models import User
from django.db import models
from pqauth import crypto
class PublicKey(models.Model):
user = models.ForeignKey(User, related_name="public_keys")
# keys MD5-fingerprint to 47 characters, including colons for readability
fingerprint = models.CharField(max_length=... |
steakknife/ldns | refs/heads/master | contrib/python/examples/ldns-buf.py | 9 | #!/usr/bin/python
import ldns
buf = ldns.ldns_buffer(1024)
buf.printf("Test buffer")
print buf
|
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/markdown/__main__.py | 75 | """
COMMAND-LINE SPECIFIC STUFF
=============================================================================
"""
import markdown
import sys
import optparse
import logging
from logging import DEBUG, INFO, CRITICAL
logger = logging.getLogger('MARKDOWN')
def parse_options():
"""
Define and parse `optparse` ... |
niieani/rethinkdb | refs/heads/next | test/interface/name_collision.py | 9 | #!/usr/bin/env python
# Copyright 2010-2015 RethinkDB, all rights reserved.
import os, pprint, random, string, sys, threading, time
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import driver, rdb_unittest, scenario_common, utils, vcoptparse
opts = vcoptparse.Opt... |
tmm1/home-assistant | refs/heads/dev | homeassistant/components/sensor/glances.py | 8 | """
homeassistant.components.sensor.glances
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Gathers system information of hosts which running glances.
Configuration:
To use the glances sensor you will need to add something like the following
to your configuration.yaml file.
sensor:
platform: glances
name: Glances sensor... |
equa/wal-e | refs/heads/master | tests/test_bytedeque.py | 11 | import pytest
from wal_e import pipebuf
@pytest.fixture
def bd():
return pipebuf.ByteDeque()
def test_empty(bd):
assert bd.byteSz == 0
bd.get(0)
with pytest.raises(AssertionError):
bd.get(1)
with pytest.raises(ValueError):
bd.get(-1)
def test_defragment(bd):
bd.add('1')... |
adrenaline0206/blog | refs/heads/master | wallet/BIP0032/xpriv_xpub.py | 1 | #master extended private key
#module taken in past articles
from rootseed import *
from decode_encode import *
#text
privatekey = rootseed()
def bip32_master_key(seed):
I = hmac.new(bytes("Bitcoin seed", 'utf-8'), seed, hashlib.sha512).digest()
vbytes = b'\x04\x88\xAD\xE4'
depth = 0
fingerprint =... |
dariemp/odoo | refs/heads/8.0 | addons/l10n_cl/__init__.py | 2120 | # -*- 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... |
Changaco/oh-mainline | refs/heads/master | vendor/packages/python-openid/examples/djopenid/server/models.py | 10644 | from django.db import models
# Create your models here.
|
vegitron/ansible | refs/heads/devel | test/units/mock/__init__.py | 2520 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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) an... |
rfguri/vimfiles | refs/heads/master | bundle/ycm/python/ycm/client/tests/command_request_test.py | 2 | # Copyright (C) 2016 YouCompleteMe Contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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) ... |
ThiagoGarciaAlves/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/mpatch.py | 96 | # mpatch.py - Python implementation of mpatch.c
#
# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import struct
try:
from cStringIO import StringIO
except ImportError:... |
AMOboxTV/AMOBox.LegoBuild | refs/heads/master | script.module.youtube.dl/lib/yd_private_libs/util.py | 7 | # -*- coding: utf-8 -*-
import xbmc, xbmcgui, xbmcaddon
import os, sys, traceback, binascii
ADDON = xbmcaddon.Addon(id='script.module.youtube.dl')
T = ADDON.getLocalizedString
TMP_PATH = os.path.join(xbmc.translatePath(ADDON.getAddonInfo('profile')).decode('utf-8'),'tmp')
if not os.path.exists(TMP_PATH): os.makedirs(... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/mobile/shared_kima.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_kima.iff"
result.attribute_template_id = 9
result.stfName("mo... |
openthread/openthread | refs/heads/main | tools/harness-automation/autothreadharness/pdu_controller_factory.py | 9 | # Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditio... |
rhblind/django-rest-framework | refs/heads/master | rest_framework/utils/humanize_datetime.py | 144 | """
Helper functions that convert strftime formats into more readable representations.
"""
from rest_framework import ISO_8601
def datetime_formats(formats):
format = ', '.join(formats).replace(
ISO_8601,
'YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]'
)
return humanize_strptime(format)
... |
aruizramon/alec_erpnext | refs/heads/master | erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py | 59 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from frappe import _
def get():
return {
_("Application of Funds (Assets)"): {
_("Current Assets"): {
_("Accounts Receivabl... |
BruceDai/crosswalk-test-suite | refs/heads/master | embeddingapi/embedding-build-android-tests/gradle/crosswalk_local_gradle_build_all_app.py | 18 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
PXke/invenio | refs/heads/dev-pu | invenio/modules/alerts/user_settings.py | 4 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio 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) a... |
uranusjr/django | refs/heads/master | django/contrib/redirects/migrations/0001_initial.py | 69 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Redirect',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=Fals... |
googleads/googleads-python-lib | refs/heads/master | examples/ad_manager/v202011/creative_set_service/update_creative_set.py | 1 | #!/usr/bin/env python
#
# Copyright 2015 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 requir... |
chyeh727/django | refs/heads/master | tests/admin_custom_urls/tests.py | 276 | from __future__ import unicode_literals
import datetime
from django.contrib.admin.utils import quote
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.template.response import TemplateResponse
from django.test import TestCase, override_settings
from .models import A... |
ujenmr/ansible | refs/heads/devel | test/units/modules/notification/test_slack.py | 54 | import json
import pytest
from units.compat.mock import patch
from ansible.modules.notification import slack
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args
class TestSlackModule(ModuleTestCase):
def setUp(self):
super(TestSlackModule, self).setUp()
... |
toshywoshy/ansible | refs/heads/devel | lib/ansible/plugins/doc_fragments/netconf.py | 44 | # -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCUMENTATION = r'''
options:
host:
description:
- Specifies the DNS host name or address for connecting t... |
duqiao/django | refs/heads/master | tests/introspection/models.py | 216 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Reporter(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
email = models.EmailField(... |
minixalpha/Online-Judge | refs/heads/master | LeetCode/Python/combination_sum_ii.py | 2 | #!/usr/bin/env python
#coding: utf-8
class Solution:
def _cb(self, candidates, target, start, end, curR, totalR):
if target < 0: return
if target == 0:
totalR.append(curR)
return
pre = None
while start < end:
if pre != candidates[start]:... |
eviljeff/zamboni | refs/heads/master | mkt/translations/tests/test_helpers.py | 12 | from django.conf import settings
from django.utils import translation
import jingo
from mock import Mock, patch
from nose.tools import eq_
from mkt.site.tests import TestCase
from mkt.translations import helpers
from mkt.translations.fields import save_signal
from mkt.translations.models import PurifiedTranslation
fr... |
monnetproject/rdfconverters | refs/heads/master | rdfconverters/xbrl2rdf/monetary.py | 1 | import re
from decimal import *
getcontext().rounding=ROUND_HALF_UP
class Monetary:
'''MFO's xsd:monetary representation with overloaded operators for arithmetic'''
@staticmethod
def from_string(str_monetary):
currency = str_monetary[-3:]
amount = str_monetary[:-3]
return Monetar... |
izapolsk/integration_tests | refs/heads/master | cfme/containers/provider/openshift.py | 1 | from os import path
from urllib.error import URLError
import attr
from cached_property import cached_property
from wrapanapi.systems.container import Openshift
from cfme.common import Taggable
from cfme.common.provider import DefaultEndpoint
from cfme.common.vm_console import ConsoleMixin
from cfme.containers.provide... |
Nexenta/s3-tests | refs/heads/master | virtualenv/lib/python2.7/site-packages/boto/pyami/scriptbase.py | 153 | import os
import sys
from boto.utils import ShellCommand, get_ts
import boto
import boto.utils
class ScriptBase(object):
def __init__(self, config_file=None):
self.instance_id = boto.config.get('Instance', 'instance-id', 'default')
self.name = self.__class__.__name__
self.ts = get_ts()
... |
jeremiedecock/pyarm | refs/heads/master | pyarm/model/muscle/__init__.py | 1 | # PyArm
# The MIT License
#
# Copyright (c) 2010,2015 Jeremie DECOCK (http://www.jdhp.org)
#
# 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... |
mesocentrefc/easybuild-framework | refs/heads/master | easybuild/toolchains/gmpich2.py | 3 | ##
# Copyright 2012-2014 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 (htt... |
mrquim/mrquimrepo | refs/heads/master | script.module.exodus/lib/resources/lib/sources/en/seriescr.py | 5 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This progra... |
indictranstech/erpnext | refs/heads/develop | erpnext/non_profit/doctype/donor/donor.py | 23 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
from frappe.contacts.address_and_contact import load_address_and_contact
class Donor(Documen... |
restless/cookiecutter-django-lfs | refs/heads/master | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/contrib/sites/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
bplancher/odoo | refs/heads/9.0 | openerp/addons/base/__openerp__.py | 18 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Base',
'version': '1.3',
'category': 'Hidden',
'description': """
The kernel of OpenERP, needed for all installation.
===================================================
""",
'website': 'h... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.7/Lib/fractions.py | 252 | # Originally contributed by Sjoerd Mullender.
# Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>.
"""Rational, infinite-precision, real numbers."""
from __future__ import division
from decimal import Decimal
import math
import numbers
import operator
import re
__all__ = ['Fraction', 'gcd']
Rational... |
philschatz/rhaptos2.repo | refs/heads/master | docs/spec/utils.py | 1 | #!/usr/bin/env python
#! -*- coding: utf-8 -*-
###
# Copyright (c) Rice University 2012
# This software is subject to
# the provisions of the GNU Lesser General
# Public License Version 2.1 (LGPL).
# See LICENCE.txt for details.
###
import md5
import uuid
txt = """
<html> ... |
mduggan/cdifflib | refs/heads/main | tests/testdata.py | 1 | """
Test data from bug https://github.com/mduggan/cdifflib/issues/5
Revealed some bugs with autojunk handling
"""
a5 = [
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 124, 16, 12, 12, 12, 108, 588, 1316, 12, 8, 42, 6, 168, 36, 12, 10, 10,
158, 36, 10, 24, 152, 914, 84, 216... |
barnsnake351/nova | refs/heads/master | nova/api/openstack/compute/floating_ip_dns.py | 32 | # Copyright 2011 Andrew Bogott for the Wikimedia 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 requi... |
trondhindenes/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_asg_facts.py | 69 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
ESS-LLP/erpnext-healthcare | refs/heads/master | erpnext/assets/doctype/asset_maintenance_task/asset_maintenance_task.py | 14 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AssetMaintenanceTask(Document):
def autoname(self):
self.name = self.... |
csanquer/git-app-version | refs/heads/master | git_app_version/githandler.py | 1 | # -*- coding: utf-8 -*-
'''
Git manipulation
'''
from __future__ import unicode_literals
import re
from git import GitCommandError, Repo
import git_app_version.helper.date as dthelper
RESERVED_KEYS = (
'abbrev_commit', 'author_date', 'author_email', 'author_name',
'author_timestamp', 'branches', 'commit... |
hagne/atm-py | refs/heads/master | atmPy/data_archives/arm/_1twr10xC1.py | 1 | from atmPy.general import timeseries as _timeseries
from atmPy.data_archives.arm import _netCDF
class ArmDatasetSub(_netCDF.ArmDataset):
def __init__(self,*args, **kwargs):
self._data_period = 60.
self._time_offset = (- self._data_period, 's')
super(ArmDatasetSub,self).__init__(*args, **kw... |
AkA84/edx-platform | refs/heads/master | lms/envs/discussionsettings.py | 116 |
# We intentionally define variables that aren't used
# pylint: disable=unused-wildcard-import
DISCUSSION_ALLOWED_UPLOAD_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff')
|
zhangxq5012/sky_engine | refs/heads/master | mojo/tools/mopy/mojo_python_tests_runner.py | 9 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import sys
import unittest
import mopy.paths
class MojoPythonTestRunner(object):
"""Helper class to run python tests on the bo... |
jrshust/spark | refs/heads/master | examples/src/main/python/ml/string_indexer_example.py | 123 | #
# 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... |
podsvirov/grpc | refs/heads/master | tools/distrib/python/grpcio_tools/grpc/tools/__init__.py | 48 | # Copyright 2016, 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... |
ostinelli/pyopenspime | refs/heads/master | lib/dns/rdtypes/ANY/__init__.py | 1 | # Copyright (C) 2003-2007 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 "AS IS" AND ... |
tiagocoutinho/qarbon | refs/heads/master | qarbon/external/pint/pint/unit.py | 1 | # -*- coding: utf-8 -*-
"""
pint.unit
~~~~~~~~~
Functions and classes related to unit definitions and conversions.
:copyright: 2013 by Pint Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import division, unicode_literals, print_function, ab... |
srluge/SickRage | refs/heads/master | lib/unidecode/x0ce.py | 253 | data = (
'cwik', # 0x00
'cwit', # 0x01
'cwip', # 0x02
'cwih', # 0x03
'cyu', # 0x04
'cyug', # 0x05
'cyugg', # 0x06
'cyugs', # 0x07
'cyun', # 0x08
'cyunj', # 0x09
'cyunh', # 0x0a
'cyud', # 0x0b
'cyul', # 0x0c
'cyulg', # 0x0d
'cyulm', # 0x0e
'cyulb', # 0x0f
'cyuls', # 0x1... |
eunchong/build | refs/heads/master | scripts/slave/recipe_modules/chromite/test_api.py | 2 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import hashlib
from recipe_engine import recipe_test_api
DEPS = [
'gitiles',
]
class ChromiteTestApi(recipe_test_api.RecipeTestApi):
d... |
jingyany/gradient-descent | refs/heads/master | comparison.py | 1 | """
This module implements gradient descent algorithm of L2-regularized logistic regression. The method is launched on a real-world dataset, the "Spam"
data, which can be downloaded from https://statweb.stanford.edu/~tibs/ElemStatLearn/datasets/spam.data. It is also compared with L2-regularized logistic
regression in... |
Therp/odoo | refs/heads/8.0 | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py | 384 | #########################################################################
#
# 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... |
sestrella/ansible | refs/heads/devel | lib/ansible/plugins/callback/__init__.py | 25 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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) an... |
openstack/monasca-api | refs/heads/master | monasca_api/db/alembic/versions/30181b42434b_remove_event_and_migration_tables.py | 2 | # Copyright 2018 SUSE Linux GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
mbernasocchi/QGIS | refs/heads/master | cmake/FindPyQt5.py | 21 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
# 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... |
nutztherookie/wagtail | refs/heads/master | wagtail/wagtaildocs/views/chooser.py | 5 | from __future__ import absolute_import, unicode_literals
import json
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404, render
from wagtail.utils.pagination import paginate
from wagtail.wagtailadmin.forms import SearchForm
from wagtail.wagtailadmin.modal_workflow import rend... |
ProjektMedInf/ProjMedInf | refs/heads/master | magic-lantern/modules/module_strings_dump.py | 1 | # print the module_strings section from a ML module (*.mo)
# sorry, not compatible with Python 3 (patches welcome)
import os, sys
from struct import unpack
def getLongLE(d, a):
return unpack('<L',(d)[a:a+4])[0]
def getString(d, a):
return d[a : d.index('\0',a)]
strings = open(sys.argv[1], "rb").read()
# iter... |
GoogleCloudPlatform/dataflow-sample-applications | refs/heads/master | timeseries-streaming/timeseries-python-applications/ml_pipeline/timeseries/encoder_decoder/__init__.py | 40 | # Lint as: python2, python3
# Copyright 2020 Google LLC. 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 req... |
rockneurotiko/django | refs/heads/master | django/contrib/gis/db/backends/postgis/schema.py | 333 | from django.db.backends.postgresql.schema import DatabaseSchemaEditor
class PostGISSchemaEditor(DatabaseSchemaEditor):
geom_index_type = 'GIST'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND'
rast_index_wrapper = 'ST_ConvexHull(%s)'
sql_add_spatial_index = "CREATE INDEX %(index)s ON %(table)s USING %(inde... |
skipzone/Illumicone | refs/heads/master | sbin/opc.py | 3 | #!/usr/bin/env python
"""Python Client library for Open Pixel Control
http://github.com/zestyping/openpixelcontrol
Sends pixel values to an Open Pixel Control server to be displayed.
http://openpixelcontrol.org/
Recommended use:
import opc
# Create a client object
client = opc.Client('localhost:7890')
... |
jhayworth/config | refs/heads/master | .emacs.d/elpy/rpc-venv/local/lib/python2.7/site-packages/rope/contrib/fixmodnames.py | 22 | """Fix the name of modules
This module is useful when you want to rename many of the modules in
your project. That can happen specially when you want to change their
naming style.
For instance::
fixer = FixModuleNames(project)
changes = fixer.get_changes(fixer=str.lower)
project.do(changes)
Here it renames a... |
Endika/edx-platform | refs/heads/master | lms/djangoapps/certificates/migrations/0005_auto_20151208_0801.py | 83 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('certificates', '0004_certificategenerationhistory'),
]
operations = [
migrations.AlterField(
model_name='generat... |
cfg2015/EPT-2015-2 | refs/heads/master | addons/website_sale/models/__init__.py | 307 | import product
import sale_order
import payment
|
jimb0616/namebench | refs/heads/master | libnamebench/site_connector.py | 175 | # 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 by applicable law or ... |
ppietrasa/grpc | refs/heads/master | examples/python/multiplex/route_guide_pb2_grpc.py | 85 | import grpc
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities
import route_guide_pb2 as route__guide__pb2
class RouteGuideStub(object):
"""Interface exported by the server.
"""
def __init__(self, channel):
"""Constructor.
Args:
... |
zhenzhai/edx-platform | refs/heads/master | common/lib/i18n_tests/test_extract_and_generate.py | 16 | """
This test tests that i18n extraction (`paver i18n_extract -v`) works properly.
"""
from datetime import datetime, timedelta
import os
import random
import re
import sys
import string
import subprocess
from unittest import TestCase
from mock import patch
from polib import pofile
from pytz import UTC
from i18n impo... |
lordB8r/polls | refs/heads/master | ENV/lib/python2.7/site-packages/django/core/management/commands/sqlcustom.py | 242 | from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import AppCommand
from django.core.management.sql import sql_custom
from django.db import connections, DEFAULT_DB_ALIAS
class Command(AppCommand):
help = "Prints the custom table modifying SQL statements for... |
ryfeus/lambda-packs | refs/heads/master | Lxml_requests/source/pip/_vendor/distlib/wheel.py | 412 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2016 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import base64
import codecs
import datetime
import distutils.util
from email import message_from... |
henriquemiranda/yambo-py | refs/heads/master | yambopy/plot/__init__.py | 2 | # Copyright (C) 2018 Henrique Pereira Coutada Miranda
# All rights reserved.
#
# This file is part of yambopy
#
|
ahb0327/intellij-community | refs/heads/master | python/testData/formatter/alignmentInArgumentListWhereFirstArgumentIsEmptyCall.py | 79 | def test():
x=foobar(bar(),
z=baz) |
prometheanfire/cloud-init | refs/heads/gentoo-integration | cloudinit/config/cc_disable_ec2_metadata.py | 17 | # vi: ts=4 expandtab
#
# Copyright (C) 2009-2010 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This program is free software: you can redistribute it and/or modify
# ... |
geomview/gv2 | refs/heads/master | Py/CameraCanvas.py | 1 | from wxPython.wx import *
from wxPython.glcanvas import *
from EventHandler import EventHandler
from PyGv import *
from math import *
class CameraCanvas(wxGLCanvas):
def __init__(self, parent, app):
### Context parameter setup
# Parameters are specified as argum... |
txomon/vdsm-channel-controller-remove-hook | refs/heads/master | test.py | 1 | from __future__ import unicode_literals, print_function
import sys
from xml.dom.minidom import parseString
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock
hooking = Mock()
hooking.read_domxml.return_value = parseString('''
<domain type='kvm' id='38'>
<name>testvm</name>
<uuid>... |
usc-cs599-group5/Content_Enrichment | refs/heads/master | Part11/argK-means.py | 1 | #!/usr/bin/env python2.7
#
# 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 "... |
ky822/scikit-learn | refs/heads/master | sklearn/cluster/dbscan_.py | 92 | # -*- coding: utf-8 -*-
"""
DBSCAN: Density-Based Spatial Clustering of Applications with Noise
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Joel Nothman <joel.nothman@gmail.com>
# Lars Buitinck
#
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse
from ..ba... |
rowhit/h2o-2 | refs/heads/master | py/testdir_0xdata_slow/test_covtype200_upload.py | 9 | import unittest, time, sys, random, logging
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm, h2o_exec as h2e, h2o_jobs
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
... |
fengbaicanhe/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/gis/feeds.py | 327 | from django.contrib.syndication.feeds import Feed as BaseFeed, FeedDoesNotExist
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
class GeoFeedMixin(object):
"""
This mixin provides the necessary routines for SyndicationFeed subclasses
to produce simple GeoRSS or W3C Geo elements.
"""
... |
nielsbuwen/ilastik | refs/heads/master | ilastik/applets/autocontextClassification/opAutocontextBatch.py | 4 | ###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... |
pcn/graphite-web | refs/heads/add_kairosdb_support | webapp/graphite/render/grammar.py | 1 | from pyparsing import *
ParserElement.enablePackrat()
grammar = Forward()
expression = Forward()
# Literals
intNumber = Combine(
Optional('-') + Word(nums)
)('integer')
floatNumber = Combine(
Optional('-') + Word(nums) + Literal('.') + Word(nums)
)('float')
sciNumber = Combine(
(floatNumber | intNumber) + Ca... |
EderSantana/keras | refs/heads/master | examples/mnist_irnn.py | 7 | from __future__ import absolute_import
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.initializations import normal, identity
from keras.... |
bromerzz/repository.bromcy | refs/heads/master | zips/plugin.video.tomsballetcollection/default.py | 2 | # -*- coding: utf-8 -*-
""" ^ SECTION 1:
This should be at the top of your code to declare the type of text
format you're using. Without this you may find some text editors save
it in an incompatible format and this can make bug tracking extremely
confusing! More info here: https://www.python.org/dev/p... |
hernandito/SickRage | refs/heads/master | lib/sqlalchemy/engine/strategies.py | 75 | # engine/strategies.py
# Copyright (C) 2005-2014 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
"""Strategies for creating new instances of Engine types.
These are semi-private... |
Batterfii/django | refs/heads/master | django/contrib/gis/db/backends/spatialite/operations.py | 257 | """
SQL functions reference lists:
http://www.gaia-gis.it/spatialite-2.4.0/spatialite-sql-2.4.html
http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html
http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html
"""
import re
import sys
from django.contrib.gis.db.backends.base.operations import \
... |
acsone/bobtemplates.odoo | refs/heads/master | bobtemplates/odoo/hooks.py | 1 | # -*- coding: utf-8 -*-
# Copyright © 2016 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
import os
import re
from mrbob.bobexceptions import ValidationError
from mrbob.hooks import show_message
from pkg_resources import parse_version
def _dotted_to_camelcased(dotted):
r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.