repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ElDeveloper/scikit-learn | refs/heads/master | sklearn/utils/tests/test_class_weight.py | 90 | import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import make_blobs
from sklearn.utils.class_weight import compute_class_weight
from sklearn.utils.class_weight import compute_sample_weight
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testin... |
SpectraLogic/samba | refs/heads/master | third_party/pyiso8601/docs/conf.py | 32 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pyiso8601 documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 27 16:05:52 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# ... |
js0701/chromium-crosswalk | refs/heads/master | native_client_sdk/src/build_tools/sdk_tools/download.py | 31 | # 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.
import hashlib
import os
import sys
# when pylint runs the third_party module is the one from depot_tools
# pylint: disable=E0611
from third_party import... |
peterstace/project-euler | refs/heads/master | OLD_PY_CODE/project_euler_old_old/110/number_theory.py | 2 | """This module implements functions that have to do with number theory."""
from operator import mul
_stock_primes = [2, 3, 5, 7, 11, 13, 17, 19]
def int_pow(x, n):
"""Raise x to the power n (if n is negative a ValueError is raised).
intPow(0, 0) is defined to be 0.
"""
if n < 0:
raise ValueEr... |
timchen86/ntulifeguardapp | refs/heads/master | gdata-2.0.18/src/gdata/tlslite/utils/Cryptlib_AES.py | 359 | """Cryptlib AES implementation."""
from cryptomath import *
from AES import *
if cryptlibpyLoaded:
def new(key, mode, IV):
return Cryptlib_AES(key, mode, IV)
class Cryptlib_AES(AES):
def __init__(self, key, mode, IV):
AES.__init__(self, key, mode, IV, "cryptlib")
sel... |
aperigault/ansible | refs/heads/devel | test/units/module_utils/urls/test_RequestWithMethod.py | 144 | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# 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
from ansible.module_utils.urls import RequestWithMethod
def test_RequestWi... |
Theer108/invenio | refs/heads/master | invenio/ext/jasmine/testsuite/__init__.py | 423 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 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) any later... |
oihane/odoo | refs/heads/8.0 | addons/website_sale/models/sale_order.py | 21 | # -*- coding: utf-8 -*-
import random
from openerp import SUPERUSER_ID
from openerp.osv import osv, orm, fields
from openerp.addons.web.http import request
from openerp.tools.translate import _
class sale_order(osv.Model):
_inherit = "sale.order"
def _cart_qty(self, cr, uid, ids, field_name, arg, context=No... |
chouseknecht/ansible | refs/heads/devel | test/units/plugins/lookup/test_lastpass.py | 55 | # (c)2016 Andrew Zenk <azenk@umn.edu>
#
# 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.
#
# ... |
vponomaryov/manila | refs/heads/master | manila/tests/db/sqlalchemy/test_api.py | 1 | # Copyright 2013 OpenStack Foundation
# Copyright (c) 2014 NetApp, Inc.
# Copyright (c) 2015 Rushil Chugh
# 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
#
# ... |
stevelle/glance | refs/heads/master | glance/db/sqlalchemy/migrate_repo/versions/039_add_changes_to_satisfy_models_metadef.py | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
kingvuplus/ops | refs/heads/master | lib/python/Plugins/SystemPlugins/DefaultServicesScanner/plugin.py | 4 | #from Components.ActionMap import ActionMap, NumberActionMap
#from Components.Input import Input
#from Components.Ipkg import IpkgComponent
#from Components.Label import Label
#from Components.MenuList import MenuList
#from Components.Slider import Slider
from Components.NimManager import nimmanager
from Plugins.Plugin... |
benstreb/crontab-parser | refs/heads/master | crontab.py | 1 | import datetime
from math import ceil
from enum import Enum
from collections import namedtuple
class Bounds(namedtuple('Bound', ("min", "max")), Enum):
minute = (0, 59)
hour = (0, 23)
dom = (1, 31)
month = (1, 12)
dow = (1, 7)
def range(self, step=1):
return Range(self.min, self.max,... |
Chyroc/WechatSogou | refs/heads/master | wechatsogou/filecache.py | 1 | # -*- coding: utf-8 -*-
from werkzeug.contrib.cache import FileSystemCache
class WechatCache(FileSystemCache):
"""基于文件的缓存
"""
def __init__(self, cache_dir='/tmp/wechatsogou-cache', default_timeout=300):
"""初始化
cache_dir是缓存目录
"""
super(WechatCache, self).__init__(cache_d... |
Sbalbp/DIRAC | refs/heads/integration | ResourceStatusSystem/Client/ResourceManagementClient.py | 6 | # $HeadURL: $
""" ResourceManagementClient
Client to interact with the ResourceManagementDB.
"""
from DIRAC import gLogger, S_ERROR
from DIRAC.Core.DISET.RPCClient import RPCClient
__RCSID__ = '$Id: $'
class ResourceManagementClient( object ):
"""
The :class:`ResourceManagementClient`... |
robovm/robovm-studio | refs/heads/master | plugins/hg4idea/testData/bin/hgext/inotify/linux/watcher.py | 92 | # watcher.py - high-level interfaces to the Linux inotify subsystem
# Copyright 2006 Bryan O'Sullivan <bos@serpentine.com>
# This library is free software; you can redistribute it and/or modify
# it under the terms of version 2.1 of the GNU Lesser General Public
# License, or any later version.
'''High-level interfa... |
widgetpl/kubernetes | refs/heads/master | hack/boilerplate/boilerplate.py | 300 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
tumbl3w33d/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_snmp_trap.py | 38 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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',
... |
yangjiandong/djangosnippets | refs/heads/yang | cab/templatetags/core_tags.py | 1 | from django.db.models.loading import get_model
from django.db.models.query import QuerySet
from django.db.models.fields import DateTimeField, DateField
from django import template
register = template.Library()
@register.filter
def latest(model_or_obj, num=5):
# load up the model if we were given a string
if i... |
hittu123/ruhive | refs/heads/master | src/basic/tools/templatetags/utils.py | 13 | from django import template
def parse_ttag(token, required_tags):
"""
A function to parse a template tag.
Pass in the token to parse, and a list of keywords to look for.
It sets the name of the tag to 'tag_name' in the hash returned.
>>> from test_utils.templatetags.utils import parse_ttag
>>... |
fernandalavalle/mlab-ns | refs/heads/master | server/apiclient/mimeparse.py | 189 | # Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.o... |
rschnapka/odoo | refs/heads/7.0 | addons/account/project/wizard/account_analytic_inverted_balance_report.py | 56 | # -*- 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... |
fujunwei/chromium-crosswalk | refs/heads/master | chrome/common/extensions/docs/examples/apps/hello-python/httplib2/__init__.py | 451 | from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyrigh... |
tangfeixiong/nova | refs/heads/stable/juno | nova/tests/unit/test_safeutils.py | 55 | # Copyright 2011 Justin Santa Barbara
#
# 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 l... |
Trust-Code/addons-yelizariev | refs/heads/8.0 | gamification_extra/__openerp__.py | 7 | {
'name' : 'Gamification extra',
'version' : '1.0.0',
'author' : 'Ivan Yelizariev',
'category' : 'Human Resources',
'website' : 'https://yelizariev.github.io',
'description': """
Improvements for gamification module:
* allows don't hide challenge, after reaching a goal
* new computation modes: ... |
twitter/pants | refs/heads/master | contrib/node/src/python/pants/contrib/node/subsystems/package_managers.py | 2 | # coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from builtins import object
from pants.contrib.node.subsystems.command im... |
lwiecek/django | refs/heads/master | django/templatetags/static.py | 91 | from django import template
from django.apps import apps
from django.utils.encoding import iri_to_uri
from django.utils.six.moves.urllib.parse import urljoin
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<PrefixNode for %r>" % self.name
def __init__(self... |
WhireCrow/openwrt-mt7620 | refs/heads/master | staging_dir/host/lib/python2.7/test/test_module.py | 99 | # Test the module type
import unittest
from test.test_support import run_unittest, gc_collect
import sys
ModuleType = type(sys)
class ModuleTests(unittest.TestCase):
def test_uninitialized(self):
# An uninitialized module has no __dict__ or __name__,
# and __doc__ is None
foo = ModuleType.... |
gavinp/chromium | refs/heads/trunk | chrome/tools/build/win/resedit.py | 4 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""A utility script that can extract and edit resources in a Windows binary.
For detailed help, see the script's usage by invoking... |
srznew/heat | refs/heads/master | heat_integrationtests/functional/test_conditional_exposure.py | 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
USGSDenverPychron/pychron | refs/heads/develop | pychron/pyscripts/tasks/visual_el_programmer/visual_el_programmer_task.py | 1 | # ===============================================================================
# Copyright 2014 Jake Ross
#
# 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/licens... |
wtolson/gnsq | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
setup(
name='gnsq',
version='1.0.2',
description='A gevent based python client for NSQ.',
long_description=readme,
long_description_content_type='tex... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/275_test_hashlib.py | 51 | # Test hashlib module
#
# $Id$
#
# Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
import array
import hashlib
import itertools
import sys
try:
import threading
except ImportError:
threading = None
import unittest
import warnings
from test impor... |
vanpact/scipy | refs/heads/master | scipy/optimize/_trustregion_ncg.py | 135 | """Newton-CG trust-region optimization."""
from __future__ import division, print_function, absolute_import
import math
import numpy as np
import scipy.linalg
from ._trustregion import (_minimize_trust_region, BaseQuadraticSubproblem)
__all__ = []
def _minimize_trust_ncg(fun, x0, args=(), jac=None, hess=None, hess... |
yjmade/odoo | refs/heads/8.0 | openerp/http.py | 2 | # -*- coding: utf-8 -*-
#----------------------------------------------------------
# OpenERP HTTP layer
#----------------------------------------------------------
import ast
import collections
import contextlib
import errno
import functools
import getpass
import inspect
import logging
import mimetypes
import os
impor... |
DEVSENSE/PTVS | refs/heads/master | Python/Tests/TestData/MissingImport/ImportMissing.py | 7 | import AbsentModule
|
lodevil/cpy | refs/heads/master | cpy/parser/test/__init__.py | 400 | from .test_import import *
|
kubeflow/kubeflow | refs/heads/master | py/kubeflow/kubeflow/ci/notebook_servers/notebook_server_jupyter_pytorch_full_tests.py | 1 | """"Argo Workflow for testing notebook-server-jupyter-pytorch-full OCI images"""
from kubeflow.kubeflow.ci import workflow_utils
from kubeflow.testing import argo_build_util
class Builder(workflow_utils.ArgoTestBuilder):
def __init__(self, name=None, namespace=None, bucket=None,
test_target_name=... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pycrypto-2.6.1/lib/Crypto/SelfTest/st_common.py | 118 | # -*- coding: utf-8 -*-
#
# SelfTest/st_common.py: Common functions for SelfTest modules
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicati... |
GoogleCloudPlatform/PerfKitBenchmarker | refs/heads/master | perfkitbenchmarker/linux_packages/gluster.py | 1 | # Copyright 2016 PerfKitBenchmarker 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 appli... |
jptomo/rpython-lang-scheme | refs/heads/master | rpython/translator/goal/targetrpystone.py | 2 | from rpython.translator.goal import targetrpystonex
LOOPS = 2000000
# __________ Entry point __________
# _____ Define and setup target _____
# _____ Run translated _____
(entry_point,
target,
run) = targetrpystonex.make_target_definition(LOOPS)
def get_llinterp_args():
return [1]
|
ojengwa/grr | refs/heads/master | lib/rdfvalues/standard.py | 7 | #!/usr/bin/env python
"""Standard RDFValues."""
import re
from grr.lib import config_lib
from grr.lib import rdfvalue
from grr.lib import type_info
from grr.proto import jobs_pb2
class RegularExpression(rdfvalue.RDFString):
"""A semantic regular expression."""
def ParseFromString(self, value):
super(Regula... |
wood-galaxy/cdl-site | refs/heads/master | cdl/urls.py | 1 | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
from django.contrib import admin
import symposion.views
WIKI_SLUG = r"(([\w-]{2,})(/[\w-]{2,})*)"
urlpatterns = patterns(
"",
url(r"... |
dcloud/django-calaccess-raw-data | refs/heads/master | setup.py | 28 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from setuptools import setup
setup(
name='django-calaccess-raw-data',
version='0.1.2',
packages=(
'calaccess_raw',
'calaccess_raw.admin',
'calaccess_raw.management',
'calaccess_raw.managem... |
seem-sky/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/crashers/mutation_inside_cyclegc.py | 346 |
# The cycle GC collector can be executed when any GC-tracked object is
# allocated, e.g. during a call to PyList_New(), PyDict_New(), ...
# Moreover, it can invoke arbitrary Python code via a weakref callback.
# This means that there are many places in the source where an arbitrary
# mutation could unexpectedly occur.... |
dawnpower/nova | refs/heads/master | nova/virt/xenapi/pool.py | 61 | # Copyright (c) 2012 Citrix Systems, Inc.
# Copyright 2010 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... |
iPlantCollaborativeOpenSource/libcloud | refs/heads/trunk | libcloud/test/backup/test_base.py | 19 | # 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 ... |
fevxie/odoo | refs/heads/8.0 | addons/account_budget/__init__.py | 444 | # -*- 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... |
jeffzheng1/tensorflow | refs/heads/master | tensorflow/python/ops/special_math_ops.py | 5 | # 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/incubator-allura | refs/heads/master | Allura/allura/ext/search/__init__.py | 5 | # 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 (t... |
drjeep/django | refs/heads/master | django/conf/locale/az/formats.py | 1059 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y г.'
TIME_FORMAT = 'G:i'
DAT... |
miguelmarco/sage-wiki | refs/heads/master | data/plugin/action/SubirHoja.py | 1 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - Action to load page content from a sage worksheet upload
@copyright: 2007-2008 MoinMoin:ReimarBauer,
2008 MoinMoin:ThomasWaldmann
2014 Miguel Marco
@license: GNU GPL, see COPYING for details.
"""
import os
from MoinMoin import wi... |
yx91490/pgcli | refs/heads/master | pgcli/packages/pgspecial/main.py | 7 | import os
import logging
from collections import namedtuple
from . import export
log = logging.getLogger(__name__)
NO_QUERY = 0
PARSED_QUERY = 1
RAW_QUERY = 2
SpecialCommand = namedtuple('SpecialCommand',
['handler', 'syntax', 'description', 'arg_type', 'hidden', 'case_sensitive'])
@export
class CommandNot... |
daviddupont69/CouchPotatoServer | refs/heads/develop | libs/sqlalchemy/orm/dynamic.py | 18 | # orm/dynamic.py
# Copyright (C) 2005-2013 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
"""Dynamic collection API.
Dynamic collections act like Query() objects for read opera... |
Juniper/ansible | refs/heads/juniper-pr | lib/ansible/runner/connection_plugins/local.py | 8 | # (c) 2012, 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) any lat... |
nathanielvarona/airflow | refs/heads/master | airflow/providers/tableau/operators/tableau_refresh_workbook.py | 3 | # 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... |
Lekanich/intellij-community | refs/heads/master | python/testData/intentions/beforeConvertTripleQuotedUnicodeString.py | 83 | s = u"""<caret>string
"""
|
hybrid-storage-dev/cinder-client-fs-111t-hybrid-cherry | refs/heads/master | v1/limits.py | 8 | # Copyright 2011 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 w... |
cleverhans-lab/cleverhans | refs/heads/master | cleverhans_v3.1.0/examples/nips17_adversarial_competition/eval_infra/code/eval_lib/dataset_helper.py | 1 | """Various helpers for the dataset.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import hashlib
import logging
import os
import shutil
import subprocess
import numpy as np
from PIL import Image
from six import iteritems
class DatasetMe... |
mika-koivusaari/read_pulse_mysql | refs/heads/master | counter_emulator.py | 1 | #!/usr/bin/python
import random
random.seed()
text=raw_input()
while text!='':
if text=='GET':
print "Counters: "+str(random.randint(0,15))+","+str(random.randint(0,15))
text=raw_input()
|
maxdeliso/elevatorSim | refs/heads/master | Lib/encodings/punycode.py | 250 | """ Codec for the Punicode encoding, as specified in RFC 3492
Written by Martin v. Löwis.
"""
import codecs
##################### Encoding #####################################
def segregate(str):
"""3.1 Basic code point segregation"""
base = bytearray()
extended = set()
for c in str:
if ord... |
PennyDreadfulMTG/Penny-Dreadful-Tools | refs/heads/master | decksite/controllers/metagame.py | 2 | import urllib.parse
from typing import List, Optional
from flask import redirect, request, url_for
from werkzeug import wrappers
from decksite import APP, SEASONS, auth, get_season_id
from decksite.cache import cached
from decksite.data import archetype as archs
from decksite.data import card as cs
from decksite.data... |
goodking-bq/websshclient | refs/heads/master | demos/demo_simple.py | 28 | #!/usr/bin/env python
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 2.... |
cclib/cclib | refs/heads/master | test/bridge/testase.py | 3 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2021, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Tests for the cclib2ase bridge in cclib."""
import unittest
import numpy as np
from cclib import ccopen
from cclib.b... |
JackGavin13/octoprint-test-not-finished | refs/heads/master | src/octoprint/util/comm.py | 1 | # coding=utf-8
from __future__ import absolute_import, division, print_function
__author__ = "Gina Häußge <osd@foosel.net> based on work by David Braam"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the A... |
mdanielwork/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/conf/locale/no/formats.py | 685 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FOR... |
rossasa/server-tools | refs/heads/8.0 | setup/sql_export/setup.py | 7073 | import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
|
saebrahimi/Emotion-Recognition-RNN | refs/heads/master | RNN/rnn_multi_frame.py | 2 | import numpy as np
import theano
import theano.tensor as T
from model import Model
class RNN(Model):
def __init__(self, nin, nout, nhid, numpy_rng, theano_rng, scale=1.0,
window_size=1, dropout_rate=0):
self.nin = nin
self.nout = nout
self.nhid = nhid
... |
Hellowlol/PyTunes | refs/heads/master | libs/requests/packages/urllib3/_collections.py | 68 | # urllib3/_collections.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from collections import MutableMapping
from threading import Lock
try: # Python 2.7+
... |
proversity-org/edx-platform | refs/heads/master | cms/djangoapps/contentstore/tests/test_crud.py | 24 | from xmodule import templates
from xmodule.capa_module import CapaDescriptor
from xmodule.course_module import CourseDescriptor
from xmodule.html_module import HtmlDescriptor
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.exceptions import DuplicateCourseError
from xmodule.modulestore.tests.dj... |
pumaking/hackracer | refs/heads/master | lib/werkzeug/contrib/atom.py | 311 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.atom
~~~~~~~~~~~~~~~~~~~~~
This module provides a class called :class:`AtomFeed` which can be
used to generate feeds in the Atom syndication format (see :rfc:`4287`).
Example::
def atom_feed(request):
feed = AtomFeed("My Blog", feed... |
jzoldak/edx-platform | refs/heads/master | openedx/core/djangoapps/content/block_structure/tests/test_tasks.py | 9 | """
Unit tests for the Course Blocks tasks
"""
from mock import patch
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from ..tasks import update_course_in_cache
class UpdateCourseInCacheTaskTest(ModuleStoreTestCase):
"""
Ensures that the update_course_in_cache task runs as expected.
... |
SexualHealthInnovations/django-wizard-builder | refs/heads/master | wizard_builder/views.py | 2 | '''
docs / reference:
- https://docs.djangoproject.com/en/1.11/topics/class-based-views/
views should define:
- templates
'''
from . import view_partials
class NewWizardView(
view_partials.WizardRedirectPartial,
):
step = 0
class WizardView(
view_partials.WizardPartial,
):
template_name =... |
rechie1995/me | refs/heads/master | python/ml/svm/svm.py | 1 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from numpy import *
import time
import matplotlib.pyplot as plt
# calulate kernel value
def calcKernelValue(matrix_x, sample_x, kernelOption):
kernelType = kernelOption[0]
numSamples = matrix_x.shape[0]
kernelValue = mat(zeros((numSamples, 1... |
lbartoletti/QGIS | refs/heads/master | python/plugins/db_manager/dlg_table_properties.py | 30 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : Oct 13, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... |
aviciimaxwell/odoo | refs/heads/8.0 | openerp/osv/osv.py | 337 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
MtMoon/lab_codes | refs/heads/master | related_info/ostep/ostep3-malloc.py | 53 | #! /usr/bin/env python
import random
from optparse import OptionParser
class malloc:
def __init__(self, size, start, headerSize, policy, order, coalesce, align):
# size of space
self.size = size
# info about pretend headers
self.headerSize = headerSize
# i... |
cold-brew-coding/protagonist | refs/heads/precompiled | drafter/ext/snowcrash/tools/gyp/tools/pretty_vcproj.py | 2637 | #!/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.
"""Make the format of a vcproj really pretty.
This script normalize and sort an xml. It also fetches all the properties
inside linked... |
zstackio/zstack-woodpecker | refs/heads/master | integrationtest/vm/license/test_global_config_defaultvalue_issame_value.py | 1 | '''
New Integration Test for global config defaultValue is same value.
@Antony yetian
@date: 2019-05-20
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_ops
import os
import time
import datetime
import uuid
... |
hackaugusto/pipe.py | refs/heads/master | setup.py | 1 | # -*- coding: utf-8 -*-
import sys
from setuptools import setup
from setuptools.command.test import test
class Tox(test):
def initialize_options(self):
test.initialize_options(self)
self.tox_args = None
def finalize_options(self):
test.finalize_options(self)
self.test_args = [... |
m4h7/juriscraper | refs/heads/master | juriscraper/opinions/united_states/state/missctapp.py | 2 | """Scraper for Mississippi Court of Appeals
CourtID: missctapp
Court Short Name: Miss. Ct. App.
Author: Jon Andersen
Reviewer: mlr
Type: Precedential
History:
2014-09-21: Created by Jon Andersen
"""
from datetime import date
from juriscraper.opinions.united_states.state import miss
class Site(miss.Site):
de... |
Affix/CouchPotatoServer | refs/heads/master | libs/git/repository.py | 109 | # Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.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 the above copyright
# notice, this li... |
lilida/teletraan | refs/heads/master | deploy-board/deploy_board/webapp/metrics_views.py | 8 | # Copyright 2016 Pinterest, 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 to in writi... |
hehongliang/tensorflow | refs/heads/master | tensorflow/compiler/tests/conv2d_test.py | 22 | # 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... |
stea4lth/TimelineJS | refs/heads/master | fabfile.py | 47 | from os.path import abspath, basename, dirname, join
import sys
from fabric.api import env
from fabric.decorators import roles, runs_once, task
import distutils.core
#
# Project-specific settings, alter as needed
#
# env.project_name = basename(dirname(__file__))
env.project_name = 'TimelineJS'
#
# Add paths
#
def ad... |
blrm/robottelo | refs/heads/master | robottelo/ui/domain.py | 4 | # -*- encoding: utf-8 -*-
"""Implements Domain UI"""
from robottelo.ui.base import Base, UIError
from robottelo.ui.locators import common_locators, locators
from robottelo.ui.navigator import Navigator
class Domain(Base):
"""Manipulates Foreman's domain from UI"""
def _configure_domain(self, description=None... |
caisq/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/estimators/composable_model_test.py | 56 | # 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... |
TheCamusean/DLRCev3 | refs/heads/master | scripts/reinforcement_learning/reinf_function.py | 1 | import numpy as np
def robot_state_update(rob_pos, vel_robot,Ts): # vel_robot = (cm/s ; degrees/s)
incr_r = vel_robot[0]*Ts
incr_teta = vel_robot[1]*Ts
new_pos_rob[0] = pos_rob[0] + incr_r*np.cos((pos_rob[2]+incr_teta/2)*pi/180)
new_pos_rob[1] = pos_rob[1] + incr_r*np.sin((pos_rob[2]+incr_teta/2)*pi/180)
new_... |
chennan47/osf.io | refs/heads/develop | scripts/osfstorage/utils.py | 6 | #!/usr/bin/env python
# encoding: utf-8
import os
import glob
import subprocess
import boto3
from scripts.osfstorage import settings as storage_settings
def create_parity_files(file_path, redundancy=5):
"""
:raise: `ParchiveError` if creation of parity files fails
"""
try:
stat = os.stat(fi... |
Elite-Kernels/elite_bullhead | refs/heads/Elite-M | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
Lujeni/ansible | refs/heads/devel | test/units/modules/network/fortios/test_fortios_vpn_ipsec_phase1_interface.py | 21 | # Copyright 2019 Fortinet, Inc.
#
# 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 program is distributed in the... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_bracer_camo_l.py | 85615 | import sys
def setup(core, object):
return |
dparnell/rethinkdb | refs/heads/materialized | test/rql_test/connections/http_support/werkzeug/testsuite/contrib/fixers.py | 146 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.fixers
~~~~~~~~~~~~~~~~~~~~~~~~~
Server / Browser fixers.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.datastructures import Res... |
tupolev/plugin.video.mitele | refs/heads/master | lib/youtube_dl/extractor/ruleporn.py | 76 | from __future__ import unicode_literals
from .nuevo import NuevoBaseIE
class RulePornIE(NuevoBaseIE):
_VALID_URL = r'https?://(?:www\.)?ruleporn\.com/(?:[^/?#&]+/)*(?P<id>[^/?#&]+)'
_TEST = {
'url': 'http://ruleporn.com/brunette-nympho-chick-takes-her-boyfriend-in-every-angle/',
'md5': '86861... |
amohanta/miasm | refs/heads/master | miasm2/expression/expression_helper.py | 5 | #
# Copyright (C) 2011 EADS France, Fabrice Desclaux <fabrice.desclaux@eads.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any late... |
Bforartists/scons | refs/heads/master | scons-local/SCons/Tool/JavaCommon.py | 3 | """SCons.Tool.JavaCommon
Stuff for processing Java.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# 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
... |
ibinti/intellij-community | refs/heads/master | python/helpers/profiler/ply/lex.py | 98 | # -----------------------------------------------------------------------------
# ply: lex.py
#
# Copyright (C) 2001-2015,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ar... |
MER-GROUP/intellij-community | refs/heads/master | python/testData/inspections/EmptyListOfBaseClasses_after.py | 239 | class C:
pass |
c24b/authomatic | refs/heads/master | tests/functional_tests/expected_values/openid_wordpress.py | 12 | import fixtures
from authomatic.providers import openid
conf = fixtures.get_configuration('openid_wordpress')
OPENID_IDENTIFIER = 'https://{0}.wordpress.com/'.format(conf.user_username)
CONFIG = {
'openid_identifier': OPENID_IDENTIFIER,
'logout_url': 'https://peterhudec.wordpress.com/wp-login.php?action=logo... |
kk6/onedraw | refs/heads/master | onedraw/tweets/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-26 12:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.