repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
daniel-severo/dask-ml | refs/heads/master | tests/test_model_selection.py | 1 | from sklearn.svm import SVC
from scipy import stats
import dask_ml.model_selection as dms
def test_search_basic(xy_classification):
X, y = xy_classification
param_grid = {'class_weight': [None, 'balanced']}
a = dms.GridSearchCV(SVC(kernel='rbf'), param_grid)
a.fit(X, y)
param_dist = {'C': stats... |
bvacaliuc/pyrasdr | refs/heads/master | plugins/pyLMS7002M/pyLMS7002M/ADF4002.py | 2 | #***************************************************************
#* Name: ADF4002.py
#* Purpose: Class implementing ADF4002 functions
#* Author: Lime Microsystems ()
#* Created: 2016-11-14
#* Copyright: Lime Microsystems (limemicro.com)
#* License:
#**********************************************************... |
d2emon/generator-pack | refs/heads/master | src/sample_data/__init__.py | 1 | from .dndspeak import fill
fill()
|
bacontext/mopidy | refs/heads/develop | tests/file/test_lookup.py | 14 | from __future__ import unicode_literals
# TODO Test lookup()
|
Limags/MissionPlanner | refs/heads/master | Lib/encodings/cp1254.py | 93 | """ Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.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 d... |
postlund/home-assistant | refs/heads/dev | homeassistant/components/plant/__init__.py | 2 | """Support for monitoring plants."""
from collections import deque
from datetime import datetime, timedelta
import logging
import voluptuous as vol
from homeassistant.components.recorder.models import States
from homeassistant.components.recorder.util import execute, session_scope
from homeassistant.const import (
... |
haveal/googleads-python-lib | refs/heads/master | examples/dfp/v201508/contact_service/get_uninvited_contacts.py | 4 | #!/usr/bin/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 required b... |
indico/indico | refs/heads/master | indico/modules/__init__.py | 4 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
# TODO: remove imports below once they're imported from somewhere else:
import indico.modules.admin # noq... |
rshipp/python-appassure | refs/heads/development | tests/test_session.py | 1 | import unittest
try:
from mock import Mock
except ImportError:
from unittest.mock import Mock
from appassure.session import AppAssureSession
class TestSession(unittest.TestCase):
def setUp(self):
pass
def test_supports_context_manager(self):
try:
with AppAssureSession(Non... |
dgellis90/nipype | refs/heads/master | nipype/interfaces/slicer/tests/test_auto_GrayscaleModelMaker.py | 12 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..surface import GrayscaleModelMaker
def test_GrayscaleModelMaker_inputs():
input_map = dict(InputVolume=dict(argstr='%s',
position=-2,
),
OutputGeometry=dict(argstr='%s',
hash_files=False,
position... |
abougouffa/alfanous | refs/heads/master | src/alfanous-labs/Qrawler/QuranicCrawler.py | 3 | #!/usr/bin/env python
# coding: utf-8
'''
Created on 18 févr. 2010
a specific crawler to find ayates in the web,authentificate them and then index them
@author: Assem Chelli
@contact: assem.ch [at] gmail.com
@license: GPL
@todo: a deep study how to represent or how to find ayas inside documents
@todo: a deep study ... |
hippich/p2pool | refs/heads/master | p2pool/networks/terracoin_testnet.py | 30 | from p2pool.bitcoin import networks
PARENT = networks.nets['terracoin_testnet']
SHARE_PERIOD = 45 # seconds
CHAIN_LENGTH = 60*60//30 # shares
REAL_CHAIN_LENGTH = 60*60//30 # shares
TARGET_LOOKBEHIND = 200 # shares
SPREAD = 10 # blocks
IDENTIFIER = 'b41a282ca5b2d85a'.decode('hex')
PREFIX = '16d2b91182dab8a4'.decode('he... |
rysson/filmkodi | refs/heads/master | script.mrknow.urlresolver/lib/urlresolver9/plugins/exashare.py | 4 | """
Exashare.com urlresolver XBMC Addon
Copyright (C) 2014 JUL1EN094
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 prog... |
tosolveit/scikit-learn | refs/heads/master | sklearn/__check_build/setup.py | 333 | # Author: Virgile Fritsch <virgile.fritsch@inria.fr>
# License: BSD 3 clause
import numpy
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('__check_build', parent_package, top_path)
config.add_extension('_check_build',
... |
nvoron23/statsmodels | refs/heads/master | examples/incomplete/arima.py | 34 | from __future__ import print_function
from statsmodels.datasets.macrodata import load_pandas
from statsmodels.tsa.base.datetools import dates_from_range
from statsmodels.tsa.arima_model import ARIMA
import matplotlib.pyplot as plt
import numpy as np
import statsmodels.api as sm
plt.interactive(False)
# let's examine a... |
twhetzel/ud858-scalable-apps | refs/heads/master | ConferenceCentral_FINAL/conference.py | 1 | #!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'plwhetzel@gmail.com (Trish Whetzel)'
import time
from datetime import dat... |
ThiagoGarciaAlves/intellij-community | refs/heads/master | python/lib/Lib/imghdr.py | 91 | """Recognize image file formats based on their first few bytes."""
__all__ = ["what"]
#-------------------------#
# Recognize image headers #
#-------------------------#
def what(file, h=None):
if h is None:
if type(file) == type(''):
f = open(file, 'rb')
h = f.read(32)
el... |
cstipkovic/spidermonkey-research | refs/heads/master | testing/mozharness/configs/balrog/production.py | 1 | config = {
'balrog_servers': [
{
'balrog_api_root': 'https://aus4-admin.mozilla.org/api',
'ignore_failures': False,
'url_replacements': [
('http://archive.mozilla.org/pub', 'http://download.cdn.mozilla.net/pub'),
],
'balrog_username... |
SnabbCo/neutron | refs/heads/master | neutron/plugins/ml2/drivers/type_vlan.py | 5 | # Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
zaccoz/odoo | refs/heads/8.0 | addons/project/tests/__init__.py | 260 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
h4mu/bstone | refs/heads/master | com.github.h4mu.bstone/jni/SDL/src/joystick/sort_controllers.py | 125 | #!/usr/bin/env python
#
# Script to sort the game controller database entries in SDL_gamecontroller.c
import re
filename = "SDL_gamecontrollerdb.h"
input = open(filename)
output = open(filename + ".new", "w")
parsing_controllers = False
controllers = []
controller_guids = {}
split_pattern = re.compile(r'([^"]*")([^,... |
newsapps/panda | refs/heads/master | panda/utils/column_schema.py | 6 | #!/usr/bin/env python
import re
import unicodedata
def slugify(name):
"""
Slugify a column header for use as a name.
Adapted from Django.
"""
slug = name
slug = unicodedata.normalize('NFKD', unicode(slug)).encode('ascii', 'ignore')
slug = unicode(re.sub('[^\w\s-]', '', slug).strip().lower... |
rubik/mando | refs/heads/master | mando/napoleon/__init__.py | 2 | # -*- coding: utf-8 -*-
"""
sphinx.ext.napoleon
~~~~~~~~~~~~~~~~~~~
Support for NumPy and Google style docstrings.
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from six import iteritems
from mando.napoleon.docstring import GoogleDoc... |
biicode/client | refs/heads/develop | test/store/migration_store_test.py | 5 | import tempfile
import os
import shutil
from biicode.client.store import hivedb
from unittest import TestCase
from biicode.common.test.conf import BII_TEST_FOLDER
from nose.plugins.attrib import attr
from biicode.client.store.migration_store import MigrationStore
from biicode.common.test.migration.migration_utils impor... |
shepdelacreme/ansible | refs/heads/devel | test/units/modules/network/cnos/cnos_module.py | 16 | # Copyright (C) 2017 Lenovo, 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.
#
# Ansi... |
MattFaus/CrowdTube-Connector | refs/heads/master | lib/gdata-2.0.18/tests/gdata_tests/docs/data_test.py | 39 | #!/usr/bin/python
#
# Copyright 2009 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 b... |
memo/tensorflow | refs/heads/master | tensorflow/contrib/opt/__init__.py | 7 | # 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... |
steedos/odoo | refs/heads/8.0 | addons/stock_account/wizard/stock_return_picking.py | 342 | # -*- 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... |
Friedbaumer/litecoin | refs/heads/master | test/functional/bumpfee.py | 7 | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the bumpfee RPC.
Verifies that the bumpfee RPC creates replacement transactions successfully when
its ... |
Limags/MissionPlanner | refs/heads/master | Lib/site-packages/scipy/special/basic.py | 55 | #
# Author: Travis Oliphant, 2002
#
from numpy import pi, asarray, floor, isscalar, iscomplex, real, imag, sqrt, \
where, mgrid, cos, sin, exp, place, seterr, issubdtype, extract, \
complexfloating, less, vectorize, inexact, nan, zeros, sometrue
from _cephes import ellipk, mathieu_a, mathieu_b, iv, jv... |
deshipu/micropython | refs/heads/master | tests/bench/funcall-3-funcall-local.py | 101 | # Function call overhead test
# Perform the same trivial operation as calling function, cached in a
# local variable. This is commonly known optimization for overly dynamic
# languages (the idea is to cut on symbolic look up overhead, as local
# variables are accessed by offset, not by name)
import bench
def f(x):
... |
cmzz/shadowsocks | refs/heads/master | shadowsocks/utils.py | 30 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... |
entropy1337/infernal-twin | refs/heads/master | Modules/build/reportlab/build/lib.linux-i686-2.7/reportlab/graphics/widgets/__init__.py | 37 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/widgets/__init__.py
__version__=''' $Id$ '''
__doc__='''Some non-chart widgets'''
|
nagarjung/kubernetes | refs/heads/master | cluster/juju/charms/trusty/kubernetes/unit_tests/lib/test_registrator.py | 96 | #!/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... |
linkedin/indextank-service | refs/heads/master | backoffice/lib/exceptions.py | 4 |
class CloudException(Exception):
pass
class NoIndexerException(CloudException):
pass
|
dessHub/bc-14-online-store-application | refs/heads/master | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py | 3132 | ######################## 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... |
initOS/server-tools | refs/heads/8.0 | base_view_inheritance_extension/tests/__init__.py | 12 | # -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from . import test_base_view_inheritance_extension
|
tal-nino/shinken | refs/heads/master | contrib/plugins/check_shinken_mem.py | 21 | #!/usr/bin/env python
#
# Autors: David Hannequin <david.hannequin@gmail.com>,
# Hartmut Goebel <h.goebel@crazy-compilers.com>
# Date: 2012-07-12
#
# Requires: Python >= 2.7 or Python plus argparse
# Platform: Linux
#
import argparse
def MemValues():
"""
Read total mem, free mem and cached from... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/tangible/lair/base/shared_poi_all_lair_garbage_small_fog_red.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 = Tangible()
result.template = "object/tangible/lair/base/shared_poi_all_lair_garbage_small_fog_red.iff"
result.att... |
ganjianwei/hadoop_ekg | refs/heads/master | contrib/hod/testing/__init__.py | 1638 | #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 use thi... |
sspreitzer/tahoe-lafs | refs/heads/master | src/allmydata/test/test_iputil.py | 8 |
import re, errno, subprocess, os
from twisted.trial import unittest
from allmydata.util import iputil
import allmydata.test.common_util as testutil
from allmydata.util.namespace import Namespace
DOTTED_QUAD_RE=re.compile("^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$")
MOCK_IPADDR_OUTPUT = """\
1: lo: <LOOPBACK,UP,LOWER_UP> m... |
aequitas/home-assistant | refs/heads/dev | homeassistant/components/meteoalarm/__init__.py | 30 | """The meteoalarm component."""
|
cobalys/django | refs/heads/master | django/contrib/admin/options.py | 3 | from functools import update_wrapper, partial
from django import forms
from django.conf import settings
from django.forms.formsets import all_valid
from django.forms.models import (modelform_factory, modelformset_factory,
inlineformset_factory, BaseInlineFormSet)
from django.contrib.contenttypes.models import Conte... |
chemlab/chemlab | refs/heads/master | chemlab/core/attributes.py | 1 | import numpy as np
import six.moves
from six import string_types
class EntityProperty(object):
'''Main base class for ChemicalEntity property specification'''
class Attribute(EntityProperty):
def __init__(self, shape=None, dtype=None, dim=None, alias=None):
'''An array of values that belong to the cu... |
PLyczkowski/Sticky-Keymap | refs/heads/master | 2.74/python/lib/multiprocessing/sharedctypes.py | 90 | #
# Module which supports allocation of ctypes objects from shared memory
#
# multiprocessing/sharedctypes.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import ctypes
import weakref
from . import heap
from . import get_context
from .context import assert_spawning
from .... |
talbrecht/pism_pik07 | refs/heads/stable0.7 | doc/site-packages/pybtex/database/input/bibtexml.py | 4 | # Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Andrey Golovizin
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to ... |
sambrightman/emacs-for-python | refs/heads/master | python-libs/rope/refactor/topackage.py | 91 | import rope.refactor.importutils
from rope.base.change import ChangeSet, ChangeContents, MoveResource, CreateFolder
class ModuleToPackage(object):
def __init__(self, project, resource):
self.project = project
self.pycore = project.pycore
self.resource = resource
def get_changes(self)... |
yasfmy/chainer_attention_model | refs/heads/master | lib/__init__.py | 1 | import os
import sys
path = os.path.dirname(__file__)
sys.path.append(path)
|
Tiger66639/skia-buildbot | refs/heads/master | ct/py/remove_invalid_skps.py | 2 | #!/usr/bin/env python
# Copyright (c) 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.
"""Python utility to detect invalid SKPs and remove from local dir."""
import glob
import optparse
import os
import sys
# Set the... |
indashnet/InDashNet.Open.UN2000 | refs/heads/master | android/external/gtest/test/gtest_xml_test_utils.py | 398 | #!/usr/bin/env python
#
# Copyright 2006, 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... |
Catweazz/catweazz | refs/heads/master | lib/entities/CItemInfo.py | 33 |
class CItemInfo(object):
def __init__(self):
self.name = ''
self.src = 'url'
self.rule = ''
self.default = ''
self.build = ''
self.convert = [] |
silly-wacky-3-town-toon/SOURCE-COD | refs/heads/master | toontown/hood/BossbotHQ.py | 1 | from panda3d.core import Fog
import CogHood
from toontown.toonbase import ToontownGlobals
from toontown.coghq import BossbotCogHQLoader
from toontown.hood import ZoneUtil
class BossbotHQ(CogHood.CogHood):
def __init__(self, parentFSM, doneEvent, dnaStore, hoodId):
CogHood.CogHood.__init__(self, parentFSM,... |
eliangidoni/rethinkdb | refs/heads/next | test/common/http_support/werkzeug/datastructures.py | 146 | # -*- coding: utf-8 -*-
"""
werkzeug.datastructures
~~~~~~~~~~~~~~~~~~~~~~~
This module provides mixins and classes with an immutable interface.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
import cod... |
BaichuanWu/Blog_on_django | refs/heads/master | site-packages/django/contrib/auth/hashers.py | 28 | from __future__ import unicode_literals
import base64
import binascii
from collections import OrderedDict
import hashlib
import importlib
from django.dispatch import receiver
from django.conf import settings
from django.test.signals import setting_changed
from django.utils.encoding import force_bytes, force_str, forc... |
timlinux/QGIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/r_reclass.py | 30 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_reclass.py
------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
**********************************... |
horazont/aioxmpp | refs/heads/devel | aioxmpp/sasl.py | 1 | ########################################################################
# File name: sasl.py
# This file is part of: aioxmpp
#
# LICENSE
#
# This program 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,... |
daniel94/gedit | refs/heads/master | plugins/snippets/snippets/snippet.py | 2 | # Gedit snippets plugin
# Copyright (C) 2005-2006 Jesse van den Kieboom <jesse@icecrew.nl>
#
# 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
#... |
dgladkov/django | refs/heads/master | tests/admin_utils/admin.py | 148 | from django.contrib import admin
from .models import Article, ArticleProxy, Site
class ArticleInline(admin.TabularInline):
model = Article
fields = ['title']
class SiteAdmin(admin.ModelAdmin):
inlines = [ArticleInline]
site = admin.AdminSite(name='admin')
site.register(Article)
site.register(ArticleP... |
camilonos77/bootstrap-form-python-generator | refs/heads/master | enviroment/lib/python2.7/site-packages/pip/commands/list.py | 393 | from pip.basecommand import Command
from pip.exceptions import DistributionNotFound, BestVersionAlreadyInstalled
from pip.index import PackageFinder
from pip.log import logger
from pip.req import InstallRequirement
from pip.util import get_installed_distributions, dist_is_editable
from pip.cmdoptions import make_option... |
simplechen/oceanbase | refs/heads/master | oceanbase_0.4/tests/mergeserver/olap/deploy.py | 13 | #!/usr/bin/env python
import os
import sys
import re
import optparse
import textwrap
import shutil
import time
from optparse import OptionParser
class IndentedHelpFormatterWithNL(optparse.IndentedHelpFormatter):
def format_description(self, description):
if not description: return ""
desc_width = self.wid... |
danfairs/django-mailer-2 | refs/heads/master | django_mailer/engine.py | 2 | """
The "engine room" of django mailer.
Methods here actually handle the sending of queued messages.
"""
from django_mailer import constants, models, settings
from lockfile import FileLock, AlreadyLocked, LockTimeout
from socket import error as SocketError
import logging
import smtplib
import tempfile
import time
imp... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_load_balancers_operations.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
caseyrollins/osf.io | refs/heads/develop | osf_tests/test_registrations.py | 2 | import mock
import pytest
import datetime
from addons.wiki.models import WikiVersion
from django.utils import timezone
from framework.auth.core import Auth
from osf.models import Node, Registration, Sanction, RegistrationSchema, NodeLog
from addons.wiki.models import WikiPage
from osf.utils.permissions import READ, WR... |
Nitrokey/libnitrokey | refs/heads/master | unittest/conftest.py | 1 | """
Copyright (c) 2015-2019 Nitrokey UG
This file is part of libnitrokey.
libnitrokey 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
any later version.
libnitrokey is... |
nbborlongan/geonode | refs/heads/master | geonode/maps/utils.py | 35 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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
#... |
havaeimo/smartlearner | refs/heads/master | smartlearner/tasks/tasks.py | 1 | # -*- coding: utf-8 -*-
from __future__ import division, print_function
from time import time
from smartlearner.interfaces.task import Task, RecurrentTask
class MonitorVariable(Task):
def __init__(self, var):
super().__init__()
self.var = self.track_variable(var)
@property
def value(sel... |
klnprj/testapp | refs/heads/master | django/core/mail/backends/__init__.py | 1498 | # Mail backends shipped with Django.
|
DNFcode/edx-platform | refs/heads/master | scripts/metrics/coverage_metrics.py | 69 | """
Aggregate coverage data from XML reports.
groups.json is a JSON-encoded dict mapping group names to source file glob patterns:
{
"group_1": "group1/*.py",
"group_2": "group2/*.py"
}
This would calculate line coverage percentages for source files in each group,
and send those metrics to DataDog:
testeng.c... |
jabbalaci/jabbapylib | refs/heads/master | tests/number/test_number.py | 1 | from jabbapylib.number import number
def test_number_to_pretty_string():
assert number.number_to_pretty_string(1977) == '1,977'
assert number.number_to_pretty_string(1234567) == '1,234,567'
assert number.number_to_pretty_string(123) == '123'
def test_sizeof_fmt():
assert number.sizeof_fmt(23) == '23.... |
h3biomed/ansible | refs/heads/h3 | lib/ansible/modules/cloud/rackspace/rax_cdb_database.py | 102 | #!/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'],
... |
overtherain/scriptfile | refs/heads/master | software/googleAppEngine/lib/httplib2/httplib2/test/smoke_test.py | 310 | import os
import unittest
import httplib2
from httplib2.test import miniserver
class HttpSmokeTest(unittest.TestCase):
def setUp(self):
self.httpd, self.port = miniserver.start_server(
miniserver.ThisDirHandler)
def tearDown(self):
self.httpd.shutdown()
def testGetFile(self... |
inventree/InvenTree | refs/heads/master | InvenTree/company/migrations/0001_initial.py | 2 | # Generated by Django 2.2 on 2019-05-20 12:04
import company.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... |
tillahoffmann/tensorflow | refs/heads/master | tensorflow/contrib/data/python/kernel_tests/map_dataset_op_test.py | 3 | # 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... |
callmetaste/PHCpack | refs/heads/master | src/Python/PHCpy2/phcpy/solver.py | 1 | """
The main functionality of PHCpack is its blackbox solver
and the wide variety of start systems and homotopies.
The blackbox solver is exported by the function solve.
An important task of the solver is the mixed-volume computation,
available in the function mixed_volume.
For start systems based on the degrees of the... |
OpenPymeMx/OCB | refs/heads/7.0 | addons/document_page/web/widgets/wikimarkup/__init__.py | 47 | # coding: latin1
"""
MediaWiki-style markup
Copyright (C) 2008 David Cramer <dcramer@gmail.com>
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) a... |
Fafou/Sick-Beard | refs/heads/development | lib/imdb/parser/http/topBottomParser.py | 128 | """
parser.http.topBottomParser module (imdb package).
This module provides the classes (and the instances), used to parse the
lists of top 250 and bottom 100 movies.
E.g.:
http://akas.imdb.com/chart/top
http://akas.imdb.com/chart/bottom
Copyright 2009 Davide Alberani <da@erlug.linux.it>
This program is free... |
TeddyDesTodes/PyRfK | refs/heads/master | lib/rfk/helper/daemonize.py | 4 | """Disk And Execution MONitor (Daemon)
Configurable daemon behaviors:
1.) The current working directory set to the "/" directory.
2.) The current file creation mode mask set to 0.
3.) Close all open files (1024).
4.) Redirect standard I/O streams to "/dev/null".
A failed call to fork() now raises an exc... |
pculture/unisubs | refs/heads/dev | utils/management/commands/update_scheduled_jobs.py | 1 | import importlib
import logging
import os
from django.core.management.base import BaseCommand
from django.conf import settings
import django_rq
from utils import dates
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Update the RQ Schedule'
args = '<queue>'
def handle(self, *arg... |
sql-viewer/SQLGlimpse | refs/heads/master | sqlviewer/glimpse/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-08 21:30
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrat... |
petemounce/ansible | refs/heads/devel | lib/ansible/modules/network/lenovo/cnos_bgp.py | 59 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, 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
# ... |
mivade/logserver | refs/heads/master | logserver/__main__.py | 1 | from .standalone import main
main()
|
dsarrut/RTK | refs/heads/master | utilities/SimpleRTK/Testing/IOTest.py | 4 | #==========================================================================
#
# Copyright Insight Software Consortium & RTK Consortium
#
# 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
... |
ThinkOpen-Solutions/odoo | refs/heads/stable | addons/base_import/controllers.py | 347 | # -*- coding: utf-8 -*-
import simplejson
from openerp.http import Controller, route
class ImportController(Controller):
@route('/base_import/set_file')
def set_file(self, req, file, import_id, jsonp='callback'):
import_id = int(import_id)
written = req.session.model('base_import.import').wri... |
squarerootfury/distrochooser | refs/heads/master | backend/distrochooser/calculations/default.py | 2 | from distrochooser.constants import TRANSLATIONS
from distrochooser.models import GivenAnswer, ResultDistroSelection, ResultDistroSelection, Distribution, SelectionReason, Answer, AnswerDistributionMatrix, UserSession
from django.forms.models import model_to_dict
from django.db import transaction
def saveAnswers(... |
nicoulaj/rainbow | refs/heads/master | rainbow/command/print_path.py | 1 | # ----------------------------------------------------------------------
# rainbow, a terminal colorizer - https://github.com/nicoulaj/rainbow
# copyright (c) 2010-2018 rainbow contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... |
chauhanhardik/populo_2 | refs/heads/master | lms/djangoapps/notification_prefs/__init__.py | 274 | NOTIFICATION_PREF_KEY = "notification_pref"
|
YuriyKhoma/ecg-identification | refs/heads/master | config.py | 1 | # directories path
BASIC_DIR = "~/ECG_Analysis/ECG_data"
ECG_eHEALTH_DATA_DIR = BASIC_DIR + '/eHealth_ECG'
ECG_ID_DATA_DIR = BASIC_DIR + '/ECG-ID/resampled'
ECG_eHEALTH_DATA_DIR = BASIC_DIR + '/eHealth_ECG'
ECG_eHEALTH_TRAIN_DATA_DIR = BASIC_DIR + '/trainECG'
ECG_eHEALTH_TEST_DATA_DIR = BASIC_DIR + '/testECG'
SEGMEN... |
evodify/genotype-files-manipulations | refs/heads/master | snp_annotation_to_genes_annotation.py | 1 | #! /usr/bin/env python2
'''
Transforms stats annotated with genes to genes annotated with stats.
input.txt:
chr pos annotation1 annotation2 genes
chr1 1 liver liverTF ENSCAFG00000000170,ENSCAFG00000000171,ENSCAFG00000000172,ENSCAFG00000029562,ENSCAFG00000029833
chr1 2 liver pancreaseTF ENSCAFG00000000171,ENSCAFG00000... |
alex/django-old | refs/heads/master | docs/conf.py | 3 | # -*- coding: utf-8 -*-
#
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleab... |
PopCap/GameIdea | refs/heads/master | Engine/Source/ThirdParty/HTML5/emsdk/emscripten/1.30.0/third_party/ply/example/newclasscalc/calc.py | 151 | #!/usr/bin/env python
# -----------------------------------------------------------------------------
# calc.py
#
# A simple calculator with variables. This is from O'Reilly's
# "Lex and Yacc", p. 63.
#
# Class-based example contributed to PLY by David McNab.
#
# Modified to use new-style classes. Test case.
# ---... |
KanchanChauhan/erpnext | refs/heads/develop | erpnext/stock/doctype/batch/__init__.py | 37694 | from __future__ import unicode_literals
|
Tejal011089/fbd_erpnext | refs/heads/develop | erpnext/setup/doctype/terms_and_conditions/__init__.py | 37694 | from __future__ import unicode_literals
|
TomTranter/OpenPNM | refs/heads/master | openpnm/models/geometry/pore_size.py | 1 | r"""
The pore-size models in this sub-module are used to apply desired pore-size
distributions to a pore network. Most of the models accept pore seeds, and
then look-up pore-sizes from cumuative distribtions functions. There is also
a model for finding the largest possible sphere that can be placed on each
site.
.. ... |
krishnazure/Flask | refs/heads/master | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/status_codes.py | 695 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... |
hudbrog/OctoPrint | refs/heads/master | octoprint/settings.py | 1 | # coding=utf-8
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
import ConfigParser
import sys
import os
import yaml
APPNAME="OctoPrint"
OLD_APPNAME="PrinterWebUI"
instance = None
def settings():
global instance
if instance is None... |
bioinfo-core-BGU/neatseq-flow | refs/heads/master | neatseq_flow/step_classes/Generic_module/Generic.py | 1 | # -*- coding: UTF-8 -*-
"""
``Generic``
-----------------------
:Authors: Liron Levin
:Affiliation: Bioinformatics core facility
:Organization: National Institute of Biotechnology in the Negev, Ben Gurion University.
Short Description
~~~~~~~~~~~~~~~~~~~~~
A generic module that enables the user to design new module... |
JorisDeRieck/Flexget | refs/heads/develop | flexget/tests/test_imdb_list_interface.py | 4 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import pytest
from flexget.components.managed_lists.lists.imdb_list import ImdbEntrySet
@pytest.mark.skip(reason="It rarely works")
@pytest.mark.online
class TestIMDBLis... |
mayank-johri/LearnSeleniumUsingPython | refs/heads/master | Section 2 - Advance Python/Chapter S2.04 - Database/code/sqlalchemy/one2many/1_3_one2many_basic.py | 2 | # -*- coding: utf-8 -*-
"""
Created on 30 Apr 2017
@author: Mayank Johri
Description:
In the below example we will be create a sample
for Many to one relationship using sqlalchemy
Tip:
-----
- Place a foreign key in the parent table referencing the one.
- `relationship` is declared on the many, where a new scalar-hol... |
janisozaur/terminator | refs/heads/master | terminatorlib/plugins/terminalshot.py | 9 | #!/usr/bin/python
# Terminator by Chris Jones <cmsj@tenshu.net>
# GPL v2 only
"""terminalshot.py - Terminator Plugin to take 'screenshots' of individual
terminals"""
import os
import gtk
import terminatorlib.plugin as plugin
from terminatorlib.translation import _
from terminatorlib.util import widget_pixbuf
# Every ... |
cloudbau/nova | refs/heads/master | nova/virt/__init__.py | 56 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Citrix Systems, 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/LICE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.