repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
mccutchen/vokram | refs/heads/master | setup.py | 1 | import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='vokram',
version='1.0.1',
description='A toy Markov chain implementation.',
long_description=read('README.rst'),
url='https://github.com/mccutchen/vokra... |
miguelparaiso/PracticaOdoo | refs/heads/master | addons/account/wizard/account_change_currency.py | 385 | # -*- encoding: 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 G... |
sorenk/ansible | refs/heads/devel | contrib/inventory/lxd.py | 167 | #!/usr/bin/env python
# (c) 2013, Michael Scherer <misc@zarb.org>
# (c) 2014, Hiroaki Nakamura <hnakamur@gmail.com>
# (c) 2016, Andew Clarke <andrew@oscailte.org>
#
# This file is based on https://github.com/ansible/ansible/blob/devel/plugins/inventory/libvirt_lxc.py which is part of Ansible,
# and https://github.com/... |
amchoukir/YouCompleteMe | refs/heads/master | python/ycm/client/omni_completion_request.py | 48 | #!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# 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 you... |
ralhei/PyHDB | refs/heads/master | pyhdb/lib/tracing.py | 3 | # Copyright 2014, 2015 SAP SE
#
# 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,... |
madedotcom/ouroboros | refs/heads/master | ouroboros_ansible/eventstore_default_acl.py | 1 | #!/usr/bin/python
#
DOCUMENTATION = """
---
module: eventstore_default_acl
short_description: Manage the default ACLs in eventstire
description:
-
options:
host_uri:
description: The fully qualified host for eventstore, eg. https://evenstore.local:2113
required: true
admin_username:
... |
Prasad9/incubator-mxnet | refs/heads/master | example/reinforcement-learning/parallel_actor_critic/envs.py | 52 | # 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... |
RobLoach/POL-POM-5 | refs/heads/master | phoenicis-bash/src/main/python/Environment/__init__.py | 8 | __author__ = 'tinou'
|
modulexcite/catapult | refs/heads/master | dashboard/dashboard/__init__.py | 4 | # Copyright 2015 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 os
# Directories in catapult/third_party required by dashboard.
THIRD_PARTY_LIBRARIES = [
'apiclient',
'beautifulsoup4',
'graphy',
'... |
praveenaki/zulip | refs/heads/master | zerver/lib/timeout.py | 116 | from __future__ import absolute_import
import sys
import time
import ctypes
import threading
# Based on http://code.activestate.com/recipes/483752/
class TimeoutExpired(Exception):
'''Exception raised when a function times out.'''
def __str__(self):
return 'Function call timed out.'
def timeout(time... |
tedunderwood/fiction | refs/heads/master | variation/main_experiment.py | 1 | #!/usr/bin/env python3
# main_experiment.py
# USAGE syntax:
# python3 main_experiment.py *command*
# Where *command* is one of the following codes.
# I have tried to start with functions that are
# relatively important to the argument of the article.
# sf_periods
# Runs sf_periods(), which simply assesses the ease... |
mdanielwork/intellij-community | refs/heads/master | python/testData/refactoring/rename/renamePackageUpdatesFirstFormImports/before/foo/m1.py | 166 | def f():
return 0 |
vladryk/horizon | refs/heads/master | openstack_dashboard/dashboards/admin/hypervisors/tables.py | 27 | # Copyright 2013 B1 Systems 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 ag... |
leafclick/intellij-community | refs/heads/master | python/testData/inspections/UnnecessaryBackslash.py | 73 | var1 = (1,1,<warning descr="Unnecessary backslash in expression."><caret>\</warning>
2,<warning descr="Unnecessary backslash in expression.">\</warning>
3,
4) |
max-leuthaeuser/naoservice | refs/heads/master | modules/libs/suds/suds/mx/literal.py | 179 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) 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.
#
# This program is distributed in the hope that it will ... |
ICSACE/android_kernel_msm | refs/heads/master | tools/perf/scripts/python/failed-syscalls-by-pid.py | 944 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
tbachman/group-based-policy | refs/heads/master | gbpservice/neutron/services/servicechain/plugins/ncp/node_drivers/openstack_heat_api_client.py | 1 | # 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... |
rickerc/neutron_audit | refs/heads/cis-havana-staging | neutron/plugins/ml2/drivers/mech_agent.py | 4 | # 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 ... |
collex100/odoo | refs/heads/8.0 | addons/website_mail/controllers/main.py | 203 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
mosbasik/buzhug | refs/heads/master | javasrc/lib/Jython/Lib/netrc.py | 80 | """An object-oriented interface to .netrc files."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
from __future__ import with_statement
import os, shlex
__all__ = ["netrc", "NetrcParseError"]
class NetrcParseError(Exception):
"""Exception raised on syntax errors in the .netrc file."""
def __in... |
eryueniaobp/contest | refs/heads/master | xiaomi/newphoneV4_tower.py | 1 | # encoding=utf-8
import os
os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'
import tensorflow as tf
import datetime
import argparse
import tensorflow_addons as tfa
import tensorflow.keras.backend as K
from phone_constant import Constant
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
try:
tf... |
beezee/GAE-Django-site | refs/heads/master | django/contrib/localflavor/de/forms.py | 309 | """
DE-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
import re
id_re = re.compile(r"^(?P<residence>\d{10})(?P<origin>\w{1,3})[-\ ]?(?P<... |
linjunzhe/p2pool | refs/heads/master | p2pool/test/util/test_datachunker.py | 287 | import random
import unittest
from p2pool.util import datachunker
def random_bytes(length):
return ''.join(chr(random.randrange(2**8)) for i in xrange(length))
class Test(unittest.TestCase):
def test_stringbuffer(self):
for i in xrange(100):
sb = datachunker.StringBuffer()
... |
qrkourier/ansible | refs/heads/devel | test/units/module_utils/test_text.py | 63 | # -*- coding: utf-8 -*-
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... |
astrand/pyobfuscate | refs/heads/master | test/testfiles/tobeimported_everything.py | 1 |
__all__ = ["one", "two", "thirtynine"]
def one():
return 1
def two():
return 2
def thirtynine():
return 39
|
ryshah/ursula | refs/heads/master | library/keystone_service_provider.py | 7 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2016, IBM
# 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 applic... |
DmitryRendov/mob-site | refs/heads/master | mob/library/models.py | 1 | # coding=utf-8
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.db.models import permalink
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.conf import settings
import datetime
... |
danlurie/C-PAC | refs/heads/master | CPAC/reho/reho.py | 3 | # coding: utf-8
import os
import sys
import re
import commands
import nipype.pipeline.engine as pe
import nipype.interfaces.fsl as fsl
import nipype.interfaces.utility as util
from CPAC.reho.utils import *
def create_reho():
"""
Regional Homogeneity(ReHo) approach to fMRI data analysis
This workflow com... |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/gis/db/models/query.py | 5 | import warnings
from django.contrib.gis.db.models import aggregates
from django.contrib.gis.db.models.fields import (
GeometryField, LineStringField, PointField, get_srid_info,
)
from django.contrib.gis.db.models.lookups import GISLookup
from django.contrib.gis.db.models.sql import (
AreaField, DistanceField, ... |
ndtran/bank-payment | refs/heads/8.0 | account_banking_payment_transfer/model/__init__.py | 11 | from . import account_payment
from . import payment_line
from . import payment_mode
from . import account_move_reconcile
|
suyashphadtare/sajil-final-frappe | refs/heads/develop | frappe/website/doctype/about_us_settings/about_us_settings.py | 39 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AboutUsSettings(Document):
def on_update(self):
from ... |
ychen820/microblog | refs/heads/master | y/google-cloud-sdk/.install/.backup/lib/yaml/tokens.py | 986 |
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
attributes.sort()
arguments = ', '.join(['%s=... |
yangyangjuanjuan/DeepBindingDetection | refs/heads/master | loadBindingSite_highScoreNegativeSeqs.py | 1 | __author__ = 'Jichen Yang'
"""
This script is what created the dataset pickled.
1) You need to have a folder named "Xmers" including all sampled x-mers as negative cases.
2) You need have another folder named "BSPHighPWMScoreNonBinding" including negative cases with high PWM scores for each TF.
3) positive c... |
waltBB/neutron_read | refs/heads/master | neutron/agent/linux/utils.py | 2 | # Copyright 2012 Locaweb.
# 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 appl... |
jjmiranda/edx-platform | refs/heads/master | openedx/core/lib/xblock_utils.py | 15 | """
Functions that can are used to modify XBlock fragments for use in the LMS and Studio
"""
import datetime
import json
import logging
import markupsafe
import re
import static_replace
import uuid
from lxml import html, etree
from contracts import contract
from django.conf import settings
from django.contrib.staticf... |
ecosoft-odoo/odoo | refs/heads/8.0 | addons/im_chat/__init__.py | 349 | import im_chat
|
miksago/emailpie | refs/heads/master | tests.py | 1 | from gevent import monkey
monkey.patch_all()
import unittest
from emailpie import utils
from emailpie.spelling import correct
from emailpie.throttle import should_be_throttled, reset_throttle
class TestParse(unittest.TestCase):
def test_good_email(self):
validator = utils.EmailChecker('bryan@bryanhelmig.... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/draft_schematic/structure/city/shared_hospital_tatooine.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 = Intangible()
result.template = "object/draft_schematic/structure/city/shared_hospital_tatooine.iff"
result.attrib... |
NoelMacwan/SXDEagleKernels | refs/heads/hybrid | scripts/build-all.py | 1474 | #! /usr/bin/env python
# Copyright (c) 2009-2013, The Linux Foundation. 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
# ... |
mozilla/kuma | refs/heads/master | kuma/core/tasks.py | 1 |
from celery.task import task
from constance import config
from django.contrib.sessions.models import Session
from django.core.cache import cache
from django.db import connection
from django.utils import timezone
from .decorators import skip_in_maintenance_mode
from .models import IPBan
LOCK_ID = 'clean-sessions-lo... |
starimpact/fast-rcnn | refs/heads/master | lib/roi_data_layer/roidb.py | 43 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Transform a roidb into a trainable roidb by adding a bunch of metada... |
cryptobanana/ansible | refs/heads/devel | lib/ansible/modules/network/bigswitch/bcf_switch.py | 29 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ted Elhourani <ted@bigswitch.com>
# 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',
... |
ray-project/ray | refs/heads/master | streaming/python/tests/test_failover.py | 1 | import subprocess
import sys
import time
from typing import List
import ray
from ray.streaming import StreamingContext
def test_word_count():
try:
ray.init(
job_config=ray.job_config.JobConfig(code_search_path=sys.path))
# time.sleep(10) # for gdb to attach
ctx = StreamingCont... |
coreyfarrell/testsuite | refs/heads/master | lib/python/asterisk/phones.py | 2 | """Pluggable modules and classes to simulate phones.
Copyright (C) 2015, Digium, Inc.
John Bigelow <jbigelow@digium.com>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
"""
import sys
import logging
from twisted.internet import reactor, task
import pjsua as pj
... |
partrita/Gooey | refs/heads/master | gooey/python_bindings/gooey_decorator.py | 1 | '''
Created on Jan 24, 2014
@author: Chris
TODO: this
'''
import json
import os
import sys
from argparse import ArgumentParser
from gooey.gui.util.freeze import getResourcePath
from gooey.util.functional import merge
from . import config_generator
IGNORE_COMMAND = '--ignore-gooey'
# TODO: kwarg... |
mattcongy/itshop | refs/heads/master | docker-images/taigav2/taiga-back/tests/integration/test_hooks_bitbucket.py | 2 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Anler Hernández ... |
EmadHelmi/chipsec_gui | refs/heads/master | chipsec/modules/common/smrr.py | 1 | #CHIPSEC: Platform Security Assessment Framework
#Copyright (c) 2010-2015, Intel Corporation
#
#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; Version 2.
#
#This program is distributed in the hope... |
kuiwei/edx-platform | refs/heads/master | lms/djangoapps/instructor/management/commands/openended_stats.py | 63 | """
Command to get statistics about open ended problems.
"""
import csv
import time
from django.core.management.base import BaseCommand
from optparse import make_option
from xmodule.modulestore.django import modulestore
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.open_ended_grading_clas... |
karllessard/tensorflow | refs/heads/master | tensorflow/lite/python/interpreter.py | 2 | # Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... |
xutian/avocado-vt | refs/heads/master | virttest/libvirt_xml/nwfilter_protocols/icmpv6.py | 8 | """
icmpv6 protocl support class(es)
http://libvirt.org/formatnwfilter.html#nwfelemsRulesProtoICMPv6
"""
from virttest.libvirt_xml import accessors
from virttest.libvirt_xml.nwfilter_protocols import base
class Icmpv6(base.TypedDeviceBase):
"""
Create new Icmpv6 xml instances
Properties:
attrs... |
a0c/odoo | refs/heads/master | addons/stock_picking_wave/__openerp__.py | 61 | # -*- 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... |
proactivity-lab/py-sunriseset | refs/heads/master | sunriseset/__init__.py | 1 | from .sunriseset import *
|
xaviercobain88/framework-python | refs/heads/master | openerp/addons/product_visible_discount/product_visible_discount.py | 8 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
bigswitch/neutron | refs/heads/master | neutron/tests/tempest/api/base_security_groups.py | 1 | # Copyright 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 requ... |
beni55/edx-platform | refs/heads/master | lms/djangoapps/instructor_task/tests/test_base.py | 13 | """
Base test classes for LMS instructor-initiated background tasks
"""
import os
import json
from mock import Mock
import shutil
import unicodecsv
from uuid import uuid4
from celery.states import SUCCESS, FAILURE
from django.conf import settings
from django.test.testcases import TestCase
from django.contrib.auth.mod... |
hchauvet/beampy | refs/heads/master | doc-src/auto_themes/theme_ComplicatedBlue.py | 2 | """
ComplicatedBlue
===============
Redefine title page with new arguments and a page layout with add a progress
bar and slide numbers.
.. raw:: html
<iframe src="../_static/theme_html_outputs/complicatedblue.html" width="100%" height="500px"></iframe>
"""
from beampy import *
doc = document(theme="Complicated... |
peterjc/bioconda-recipes | refs/heads/master | recipes/searchgui/3.2.11/searchgui.py | 38 | #!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
# Program Parameters
#
import os
import s... |
libretees/libreshop | refs/heads/master | libreshop/products/migrations/0011_auto_20160531_0053.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-05-31 00:53
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('products', '0010_image_main'),
]
operations = [
migrations.RenameField(
mo... |
finnq/android_kernel_asus_tf101 | refs/heads/9.2.1.17 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
Medium/phantomjs-1 | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/executive_unittest.py | 124 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2009 Daniel Bates (dbates@intudata.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 co... |
sorgerlab/bioagents | refs/heads/master | bioagents/tra/ltl_nodes.py | 2 | import re
from copy import deepcopy
def is_balanced(s, lc='(', rc=')'):
is_bal = 0
for i in range(len(s))[1:]:
is_bal += (s[i] == lc) - (s[i-1] == rc)
return is_bal
def build_tree(formula_str, time_lim=None):
root = None
fstr = formula_str.strip()
str_r = fstr
str_l = None
whi... |
durden/tablib | refs/heads/develop | tablib/packages/yaml3/parser.py | 83 |
# The following YAML grammar is LL(1) and is parsed by a recursive descent
# parser.
#
# stream ::= STREAM-START implicit_document? explicit_document* STREAM-END
# implicit_document ::= block_node DOCUMENT-END*
# explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
# block_node_or_inden... |
ViDA-NYU/reprozip | refs/heads/1.0.x | reprozip/reprozip/utils.py | 2 | # Copyright (C) 2014-2017 New York University
# This file is part of ReproZip which is released under the Revised BSD License
# See file LICENSE for full license details.
# This file is shared:
# reprozip/reprozip/utils.py
# reprounzip/reprounzip/utils.py
"""Utility functions.
These functions are shared between ... |
codingcommando/tmtp | refs/heads/master | standalone/tmtpl/support.py | 2 | #!/usr/bin/python
#
# This file is part of the tmtp (Tau Meta Tau Physica) project.
# For more information, see http://www.sew-brilliant.org/
#
# Copyright (C) 2010, 2011 Susan Spencer and Steve Conklin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... |
dbbhattacharya/kitsune | refs/heads/master | vendor/packages/simplejson/simplejson/tests/test_tuple.py | 70 | import unittest
from simplejson.compat import StringIO
import simplejson as json
class TestTuples(unittest.TestCase):
def test_tuple_array_dumps(self):
t = (1, 2, 3)
expect = json.dumps(list(t))
# Default is True
self.assertEqual(expect, json.dumps(t))
self.assertEqual(expe... |
njmube/erpnext | refs/heads/develop | erpnext/selling/doctype/__init__.py | 37694 | from __future__ import unicode_literals
|
eHealthAfrica/onadata | refs/heads/master | onadata/apps/stats/views.py | 2 | from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from onadata.apps.logger.models imp... |
BonexGu/Blik2D-SDK | refs/heads/master | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/tools/docs/parser.py | 16 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
runekaagaard/django-contrib-locking | refs/heads/master | django/contrib/gis/gdal/error.py | 9 | """
This module houses the GDAL & SRS Exception objects, and the
check_err() routine which checks the status code returned by
GDAL/OGR methods.
"""
#### GDAL & SRS Exceptions ####
class GDALException(Exception):
pass
# Legacy name
OGRException = GDALException
class SRSException(Exception):
pass
class... |
TeslaProject/external_chromium_org | refs/heads/lp5.1 | third_party/protobuf/python/google/protobuf/internal/encoder.py | 484 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
sbidoul/buildbot | refs/heads/master | master/setup.py | 2 | #!/usr/bin/env python
#
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# A... |
Jonekee/chromium.src | refs/heads/nw12 | third_party/cython/src/Cython/Compiler/Code.py | 89 | # cython: language_level = 2
#
# Code output module
#
import cython
cython.declare(os=object, re=object, operator=object,
Naming=object, Options=object, StringEncoding=object,
Utils=object, SourceDescriptor=object, StringIOTree=object,
DebugFlags=object, basestring=object... |
rosslagerwall/xen | refs/heads/xsplice-real-squashed | tools/python/xen/__init__.py | 20578 | |
zx8/youtube-dl | refs/heads/master | youtube_dl/extractor/ard.py | 21 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .generic import GenericIE
from ..utils import (
determine_ext,
ExtractorError,
qualities,
int_or_none,
parse_duration,
unified_strdate,
xpath_text,
parse_xml,
)
class ARDMediathek... |
syaiful6/django | refs/heads/master | django/utils/archive.py | 562 | """
Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/
Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and contributors.
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 So... |
esetomo/mio | refs/heads/master | script/pymio/skinning/indexed_joint_weight_mapping.py | 1 | from cmio import IndexedJointWeightMapping |
stevenewey/django | refs/heads/master | django/contrib/contenttypes/admin.py | 273 | from __future__ import unicode_literals
from functools import partial
from django.contrib.admin.checks import InlineModelAdminChecks
from django.contrib.admin.options import InlineModelAdmin, flatten_fieldsets
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.forms impo... |
fu/p3d | refs/heads/master | src/test_installation.py | 3 | #!/usr/bin/env python
'''
Testing the installation of p3d
'''
import sys, p3d
from p3d import *
TESTFILES = ['../pdbs/1BPH.pdb.gz']
def module_info():
print('p3d module information:')
print(' * Version {0}'.format(p3d.__version__.__version__))
print(' * Installation path {0}\n'.format(p3d.__file__))
return
def... |
allenlavoie/tensorflow | refs/heads/master | tensorflow/python/client/session.py | 2 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
all-of-us/raw-data-repository | refs/heads/devel | rdr_service/api/redcap_workbench_audit_api.py | 1 | from flask import request
from rdr_service.api.base_api import BaseApi
from werkzeug.exceptions import BadRequest
from rdr_service.api_util import REDCAP
from rdr_service.app_util import auth_required
from rdr_service.dao.workbench_dao import WorkbenchResearcherDao, WorkbenchWorkspaceAuditDao
class BaseRedcapApi(Base... |
dzxs/django-photologue | refs/heads/master | photologue/management/commands/__init__.py | 27 | from photologue.models import PhotoSize
def get_response(msg, func=int, default=None):
while True:
resp = raw_input(msg)
if not resp and default is not None:
return default
try:
return func(resp)
except:
print 'Invalid input.'
def create_photosiz... |
RPGOne/scikit-learn | refs/heads/master | examples/cluster/plot_kmeans_stability_low_dim_dense.py | 338 | """
============================================================
Empirical evaluation of the impact of k-means initialization
============================================================
Evaluate the ability of k-means initializations strategies to make
the algorithm convergence robust as measured by the relative stan... |
thaim/ansible | refs/heads/fix-broken-link | lib/ansible/modules/remote_management/oneview/oneview_logical_interconnect_group_info.py | 19 | #!/usr/bin/python
# Copyright: (c) 2016-2017, Hewlett Packard Enterprise Development LP
# 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',
... |
tempbottle/servo | refs/heads/master | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/util.py | 497 | # Copyright 2011, 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... |
jasuka/pyBot | refs/heads/master | sysmodules/syscmd.py | 1 | import urllib.request
import http.client
import http.cookiejar
from bs4 import BeautifulSoup
import os
import re
import time
import sysErrorLog
import socket
import sqlite3
### Create cities DB, feel free to edit the list of cities
def createCitiesDatabase( self ):
cities = """Akaa, Alahärmä, Alajärvi, Alastaro, Alas... |
Endika/django | refs/heads/master | django/contrib/admin/checks.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from itertools import chain
from django.apps import apps
from django.conf import settings
from django.contrib.admin.utils import (
NotRelationField, flatten, get_fields_from_path,
)
from django.core import checks
from django.core.exceptions import Fi... |
eth-srl/OptOctagon | refs/heads/master | python_interface/tests/linexpr0_test.py | 2 | #
#
# This source file is part of ELINA (ETH LIbrary for Numerical Analysis).
# ELINA is Copyright © 2019 Department of Computer Science, ETH Zurich
# This software is distributed under GNU Lesser General Public License Version 3.0.
# For more information, see the ELINA project website at:
# http://elina.ethz.ch
#... |
BeATz-UnKNoWN/python-for-android | refs/heads/master | python-modules/twisted/twisted/python/versions.py | 60 | # -*- test-case-name: twisted.python.test.test_versions -*-
# Copyright (c) 2006-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Versions for Python packages.
See L{Version}.
"""
import sys, os
class _inf(object):
"""
An object that is bigger than all other objects.
"""
def __cmp__... |
KohlsTechnology/ansible | refs/heads/devel | lib/ansible/modules/notification/bearychat.py | 43 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Jiangge Zhang <tonyseek@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 Li... |
Wafflespeanut/servo | refs/heads/master | tests/wpt/web-platform-tests/content-security-policy/embedded-enforcement/support/echo-allow-csp-from.py | 100 | import json
def main(request, response):
headers = [("Content-Type", "text/html")]
if "allow_csp_from" in request.GET:
headers.append(("Allow-CSP-From", request.GET["allow_csp_from"]))
message = request.GET["id"]
return headers, '''
<!DOCTYPE html>
<html>
<head>
<title>This page enforces emb... |
mateor/pdroid | refs/heads/master | android-2.3.4_r1/tags/1.26/frameworks/base/tests/DumpRenderTree/assets/run_page_cycler.py | 6 | #!/usr/bin/python
"""Run page cycler tests using Android instrumentation.
First, you need to get an SD card or sdcard image that has page cycler tests.
Usage:
Run a single page cycler test:
run_page_cycler.py "file:///sdcard/android/page_cycler/moz/start.html?auto=1\&iterations=10"
"""
import logging
... |
himleyb85/django | refs/heads/master | django/conf/__init__.py | 84 | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import importlib
import os
import time
from django.conf import... |
netfirms/erpnext | refs/heads/develop | erpnext/accounts/report/financial_statements.py | 42 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, _dict
from frappe.utils import (flt, getdate, get_first_day, get_last_day,
add_months, add_days, formatdate)
def g... |
dvliman/jaikuengine | refs/heads/master | .google_appengine/google/appengine/_internal/django/core/xheaders.py | 23 | """
Pages in Django can are served up with custom HTTP headers containing useful
information about those pages -- namely, the content type and object ID.
This module contains utility functions for retrieving and doing interesting
things with these special "X-Headers" (so called because the HTTP spec demands
that custo... |
dezynetechnologies/odoo | refs/heads/8.0 | addons/l10n_fr/report/compute_resultant_report.py | 374 | # -*- coding: utf-8 -*-
#
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users w... |
alexus37/AugmentedRealityChess | refs/heads/master | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGL/GL/NV/shader_thread_shuffle.py | 9 | '''OpenGL extension NV.shader_thread_shuffle
This module customises the behaviour of the
OpenGL.raw.GL.NV.shader_thread_shuffle to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/NV/shader_thread_shuffle.txt
'''
from OpenGL import ... |
jat255/seaborn | refs/heads/master | examples/marginal_ticks.py | 24 | """
Scatterplot with marginal ticks
===============================
_thumb: .65, .35
"""
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="white", color_codes=True)
# Generate a random bivariate dataset
rs = np.random.RandomState(9)
mean = [0, 0]
cov = [(1, 0), (0, 2)]
x, y = rs.... |
vivyly/terralope | refs/heads/master | terralope/wsgi.py | 30 | """
WSGI config for project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting... |
sarakha63/persomov | refs/heads/master | couchpotato/core/media/movie/providers/trailer/youtube_dl/jsinterp.py | 23 | from __future__ import unicode_literals
import json
import re
from .utils import (
ExtractorError,
)
class JSInterpreter(object):
def __init__(self, code):
self.code = code
self._functions = {}
self._objects = {}
def interpret_statement(self, stmt, local_vars, allow_recursion=20... |
zamattiac/osf.io | refs/heads/develop | tests/test_addons_oauth.py | 17 | import mock
from nose.tools import *
from framework.auth.core import Auth
from framework.exceptions import PermissionsError
from website import settings
from website.addons.base import AddonConfig
from website.addons.base import AddonOAuthNodeSettingsBase
from website.addons.base import AddonOAuthUserSettingsBase
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.