repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
GTmac/deepwalk | refs/heads/master | setup.py | 8 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# TODO: put package requireme... |
woel0007/caravel | refs/heads/master | caravel/lib/python2.7/site-packages/pip/_vendor/progress/__init__.py | 916 | # Copyright (c) 2012 Giorgos Verigakis <[email protected]>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... |
vertoe/p2pool-drk | refs/heads/master | p2pool/test/util/test_graph.py | 284 | import unittest
from p2pool.util import graph
class Test(unittest.TestCase):
def test_keep_largest(self):
b = dict(a=1, b=3, c=5, d=7, e=9)
assert graph.keep_largest(3, 'squashed')(b) == {'squashed': 9, 'd': 7, 'e': 9}
assert graph.keep_largest(3)(b) == {'c': 5, 'd': 7, 'e': 9}
|
tuomassiren/proofofexistence | refs/heads/master | babel/messages/pofile.py | 136 | # -*- coding: utf-8 -*-
"""
babel.messages.pofile
~~~~~~~~~~~~~~~~~~~~~
Reading and writing of files in the ``gettext`` PO (portable object)
format.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import os
import re
from babel.messages.catalog import... |
brutkin/commons | refs/heads/master | src/python/twitter/common/dirutil/tail.py | 14 | # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
eternalthinker/flask-server-rq-example | refs/heads/master | edge_detect_tests/cv_fgcrop_test.py | 1 | import os
import cv2
import numpy as np
from matplotlib import pyplot as plt
def detect_all():
srcdir = "images"
i = 0
for f in os.listdir(srcdir):
if f.endswith(".jpg"):
i += 1
print "Processing:", i, f
detect_object(srcdir, f)
print "END"
def detect_object(srcdir, imgname):
imgpath = srcdir + os.s... |
shanecelis/ode-0.12-drawstuff | refs/heads/master | bindings/python/demos/tutorial2.py | 13 | #!/usr/bin/env python
# http://pyode.sourceforge.net/tutorials/tutorial2.html
# pyODE example 2: Connecting bodies with joints
# modified by Gideon Klompje (removed literals and using
# 'ode.Mass.setSphereTotal' instead of 'ode.Mass.setSphere')
import ode
import pygame
from pygame.locals import QUIT, KEYDOWN
# C... |
abdellatifkarroum/odoo | refs/heads/8.0 | addons/gamification/wizard/__init__.py | 389 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
kocsenc/problem-of-the-day | refs/heads/master | 2014/october/SentenceFinder/finder.py | 1 | # Kocsen Chung
# Sentence Finder
# PROBLEM
# Given the lipsum text create an array of all the sentences. Then with that data create a function that takes in
# a string and each sentence that contains that string. Partial word matches such as "sum" in the word "lipsum"
# still counts. Matching should also be case insen... |
sobjornstad/esc | refs/heads/master | esc/function_loader.py | 1 | """
function_loader.py - load esc functions from builtins and plugins onto menus
"""
import importlib
import os
from pathlib import Path
import sys
from .oops import ProgrammingError
def _import_user_functions():
"""
Dynamically import any .py files in the user's esc plugins directory.
The plugins dire... |
hustbeta/openstack-juno-api-adventure | refs/heads/master | examples/keystone/v3/10_create_user.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import keystoneclient
import keystoneclient.auth.identity.v3
import keystoneclient.exceptions
import keystoneclient.session
import keystoneclient.v3.client
import local_settings
def get_unscoped_client():
keystone = keystoneclient.v3.clien... |
demis001/scikit-bio | refs/heads/master | skbio/stats/ordination/tests/test_ordination.py | 3 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
laurenrevere/osf.io | refs/heads/develop | admin_tests/pre_reg/utils.py | 2 | from osf.models import DraftRegistration, MetaSchema
def draft_reg_util():
DraftRegistration.objects.all().delete()
return MetaSchema.objects.get(name='Prereg Challenge', schema_version=2)
SCHEMA_DATA = {
'q20': {
'comments': [],
'value': 'The Effect of sugar on brownie tastiness does no... |
nwokeo/supysonic | refs/heads/master | venv/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/specifiers.py | 1107 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import functools
import itertools
import re
from ._compat impo... |
usc-isi/extra-specs | refs/heads/master | nova/tests/api/openstack/compute/contrib/test_flavorextradata.py | 2 | # Copyright 2012 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
savanu/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wpt/stability.py | 22 | import os
import sys
from collections import OrderedDict, defaultdict
from mozlog import reader
from mozlog.formatters import JSONFormatter, TbplFormatter
from mozlog.handlers import BaseHandler, LogLevelFilter, StreamHandler
from markdown import markdown_adjust, table
from wptrunner import wptrunner
class LogActio... |
mikey1234/script.module.urlresolver | refs/heads/master | lib/urlresolver/plugins/megarelease.py | 3 | '''
Megarelease urlresolver plugin
Copyright (C) 2013 Vinnydude
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 i... |
imito/odin | refs/heads/master | tests/test_negative_binomial_disp.py | 1 | from __future__ import absolute_import, division, print_function
import os
import numpy as np
import tensorflow as tf
import torch
from odin.bay.distributions import NegativeBinomialDisp, ZeroInflated
from odin.stats import describe
from scvi.models.log_likelihood import log_nb_positive, log_zinb_positive
os.enviro... |
wwj718/murp-edx | refs/heads/master | common/djangoapps/student/tests/tests.py | 2 | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
import logging
import unittest
from datetime import datetime, timedelta
import pytz
from django.conf import settings
from django.test im... |
asherkhb/coge | refs/heads/master | bin/last_wrapper/Bio/Nexus/Nodes.py | 3 | # Copyright 2005-2008 by Frank Kauff & Cymon J. Cox. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
# Nodes.py
#
# Provides functionality of a linked list.
# Each node has one ... |
sbktechnology/sap_frappe | refs/heads/master | frappe/model/utils/__init__.py | 44 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _
"""
Model utilities, unclassified functions
"""
def set_default(doc, key):
"""Set is_default property of given doc and unset all others ... |
Argon-Zhou/django | refs/heads/master | django/db/backends/postgresql_psycopg2/operations.py | 207 | from __future__ import unicode_literals
from psycopg2.extras import Inet
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
class DatabaseOperations(BaseDatabaseOperations):
def unification_cast_sql(self, output_field):
internal_type = output_field.get... |
koyuawsmbrtn/eclock | refs/heads/master | windows/Python27/Lib/xml/dom/domreg.py | 238 | """Registration facilities for DOM. This module should not be used
directly. Instead, the functions getDOMImplementation and
registerDOMImplementation should be imported from xml.dom."""
from xml.dom.minicompat import * # isinstance, StringTypes
# This is a list of well-known implementations. Well-known names
# sho... |
Chaozz/happygg | refs/heads/master | src_tests/lib/googletest/test/gtest_env_var_test.py | 343 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
tangyiyong/odoo | refs/heads/8.0 | addons/website_event/__init__.py | 1577 | # -*- 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 ... |
mrquim/repository.mrquim | refs/heads/master | repo/plugin.video.live.streamspro/pyaesnew/aes.py | 177 | # The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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 use, copy, mod... |
frappe/shopping_cart | refs/heads/develop | shopping_cart/templates/utils.py | 8 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import json
import frappe
from frappe import _
from frappe.utils import cint, formatdate
from frappe import _
def get_transaction_list(doctype, sta... |
natefoo/pulsar | refs/heads/master | test/persistence_test.py | 2 | from contextlib import contextmanager
from os.path import exists, join
import time
from pulsar.managers.queued import QueueManager
from pulsar.managers.stateful import StatefulManagerProxy
from pulsar.tools.authorization import get_authorizer
from .test_utils import (
temp_directory,
TestDependencyManager
)
fr... |
repotvsupertuga/tvsupertuga.repository | refs/heads/master | plugin.video.plexus-streams/resources/core/parsers/arenavision-top/cleaner.py | 16 | # -*- coding: utf-8 -*-
"""
This plugin is 3rd party and not part of plexus-streams addon
Arenavision.in
"""
def clean(text):
text = text.replace(u'\xda','U').replace(u'\xc9','E').replace(u'\xd3','O').replace(u'\xd1','N').replace(u'\xcd','I').replace(u'\xc1','A')
return text
|
dssg/wikienergy | refs/heads/master | disaggregator/build/pandas/pandas/stats/interface.py | 14 | from pandas.core.api import Series, DataFrame, Panel, MultiIndex
from pandas.stats.ols import OLS, MovingOLS
from pandas.stats.plm import PanelOLS, MovingPanelOLS, NonPooledPanelOLS
import pandas.stats.common as common
def ols(**kwargs):
"""Returns the appropriate OLS object depending on whether you need
simp... |
rvalyi/OpenUpgrade | refs/heads/master | addons/portal_project/project.py | 103 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# 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... |
iffy/AutobahnPython | refs/heads/master | autobahn/wamp/test/test_uri_pattern.py | 2 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... |
OCA/server-tools | refs/heads/12.0 | attachment_synchronize/models/__init__.py | 2 | from . import attachment_queue, attachment_synchronize_task, storage_backend
|
dreamsxin/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_uu.py | 107 | """
Tests for uu module.
Nick Mathewson
"""
import unittest
from test import support
import sys, os
import uu
from io import BytesIO
import io
plaintext = b"The smooth-scaled python crept over the sleeping dog\n"
encodedtext = b"""\
M5&AE('-M;V]T:\"US8V%L960@<'ET:&]N(&-R97!T(&]V97(@=&AE('-L965P
(:6YG(&1O9PH """
# ... |
AlanJAS/iknowUruguay | refs/heads/master | recursos/0uruguay/datos/levels.py | 1 | # -*- coding: utf-8 -*-
from gettext import gettext as _
LEVEL1 = [
7,
_('Departments'),
['lineasDepto'],
[],
[
(_('Artigas'), _("It's easy")),
(_('Salto'), _("It's easy")),
(_('Paysandú'), _("It's easy")),
(_('Río Negro'), _("It's easy")),
(_('Rivera'), _("It's eas... |
eduNEXT/edunext-platform | refs/heads/master | openedx/core/djangoapps/util/management/commands/reset_db.py | 4 | # -*- coding: utf-8 -*-
"""
reset_db
========
Django command to drop and recreate a database.
Useful when running tests against a database which may previously have
had different migrations applied to it.
This handles the one specific use case of the "reset_db" command from
django-extensions that we were actually usi... |
AmrThabet/CouchPotatoServer | refs/heads/master | libs/suds/sax/text.py | 203 | # 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 ... |
DanielPWang/Replicating-DeepMind | refs/heads/master | sandbox/example3.py | 7 |
"""
First test using convolution
"""
import theano
import theano.tensor as T
import numpy as np
from theano.tensor.nnet import conv
# import theano.printing as tprint
import chessboard
def shared_dataset(data_xy):
"""
Transform data into theano.shared. This is important for parallelising computations later... |
JTarball/docker-django-polymer | refs/heads/master | docker/app/app/backend/apps/search/redis/redis-py-master/docs/conf.py | 48 | # -*- coding: utf-8 -*-
#
# redis-py documentation build configuration file, created by
# sphinx-quickstart on Fri Feb 8 00:47:08 2013.
#
# 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
# autogenerated file.
#
# ... |
ahb0327/intellij-community | refs/heads/master | python/lib/Lib/encodings/hex_codec.py | 528 | """ Python 'hex_codec' Codec - 2-digit hex content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg ([email protected]).
"""
import codecs, binascii
### Codec APIs
def hex_encode(... |
hmoco/osf.io | refs/heads/develop | api_tests/nodes/views/test_node_alternative_citations.py | 2 | from nose.tools import * # flake8: noqa
from website.util import permissions
from api.base.settings.defaults import API_BASE
from api.citations import utils as citation_utils
from tests.base import ApiTestCase
from osf_tests.factories import (
ProjectFactory,
RegistrationFactory,
AuthUserFactory,
A... |
Big-B702/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/encodings/mac_turkish.py | 272 | """ Python Character Mapping Codec mac_turkish generated from 'MAPPINGS/VENDORS/APPLE/TURKISH.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... |
SUNNYANDPJ/MongoAlchemy | refs/heads/master | mongoalchemy/query.py | 2 | # The MIT License
#
# Copyright (c) 2010 Jeffrey Jenkins
#
# 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 use, copy, modify,... |
djangoeshop/eshop | refs/heads/master | goods/urls.py | 2 | from django.conf.urls import include, url, patterns
urlpatterns = [
# Examples:
# url(r'^$', 'webcams.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^good_card/get/(?P<Wares_id>\d+)/$', 'goods.views.good_card'),
url(r'^$', 'goods.views.index'),
]
|
Asana/boto | refs/heads/develop | boto/roboto/__init__.py | 9480 | #
|
Yipit/troposphere | refs/heads/master | troposphere/ec2.py | 2 | # Copyright (c) 2012-2013, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSHelperFn, AWSObject, AWSProperty, FindInMap, Ref
from .validators import (
boolean, integer, integer_range, network_port, positive_integer
)
try:
from awacs.aws import Policy
... |
bgroff/kala-app | refs/heads/master | django_kala/projects/views/documents/settings/transfer_ownership.py | 1 | from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404, redirect
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.translation im... |
smurfix/MoaT | refs/heads/master | monitor/monitor.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division, unicode_literals
##
## This file is part of MoaT, the Master of all Things.
##
## MoaT is Copyright © 2007-2016 by Matthias Urlichs <[email protected]>,
## it is licensed under the GPLv3. See the file `READM... |
dongyue/cmglue | refs/heads/master | cmglib/common.py | 1 | """common functions and global variables of CMG."""
import os
import sys
import subprocess
import re
import configparser #for Python 3.x
#import ConfigParser #for Python 2.x
VERSION = "0.9.2" #CMG version
STREAMFILE = "_stream" #The file in root of container which stores the stream configuration.
BASELINEFILE = "_... |
macks22/scikit-learn | refs/heads/master | sklearn/covariance/shrunk_covariance_.py | 209 | """
Covariance estimators using shrinkage.
Shrinkage corresponds to regularising `cov` using a convex combination:
shrunk_cov = (1-shrinkage)*cov + shrinkage*structured_estimate.
"""
# Author: Alexandre Gramfort <[email protected]>
# Gael Varoquaux <[email protected]>
# Virgile ... |
faust64/ansible | refs/heads/devel | lib/ansible/modules/network/illumos/__init__.py | 12133432 | |
Anlim/decode-Django | refs/heads/master | Django-1.5.1/django/conf/locale/et/__init__.py | 12133432 | |
bunnyitvn/webptn | refs/heads/master | build/lib.linux-i686-2.7/django/contrib/sessions/backends/cached_db.py | 102 | """
Cached, database-backed sessions.
"""
from django.contrib.sessions.backends.db import SessionStore as DBStore
from django.core.cache import cache
from django.core.exceptions import SuspiciousOperation
from django.utils import timezone
KEY_PREFIX = "django.contrib.sessions.cached_db"
class SessionStore(DBStore):... |
michalsenkyr/spark | refs/heads/master | examples/src/main/python/ml/word2vec_example.py | 122 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
Microsoft/Tocino | refs/heads/master | src/buildings/bindings/modulegen__gcc_LP64.py | 38 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
h4ck3rm1k3/pywikibot-core | refs/heads/master | tests/timestripper_tests.py | 3 | # -*- coding: utf-8 -*-
"""Tests for archivebot.py/Timestripper."""
#
# (C) Pywikibot team, 2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
import datetime
from pywikibot.textlib import TimeStripper, tzoneFixedOffset
from test... |
XiaosongWei/crosswalk-test-suite | refs/heads/master | webapi/webapi-input-html5-tests/inst.xpk.py | 456 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... |
arista-eosplus/pyeapi | refs/heads/develop | test/system/test_api_mlag.py | 1 | #
# Copyright (c) 2014, Arista Networks, 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 condit... |
corburn/scikit-bio | refs/heads/master | skbio/diversity/tests/__init__.py | 160 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
abagh0703/RetailTrail | refs/heads/master | flask/lib/python2.7/site-packages/pip/_vendor/html5lib/html5parser.py | 310 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import with_metaclass
import types
from . import inputstream
from . import tokenizer
from . import treebuilders
from .treebuilders._base import Marker
from . import utils
from . import constants
from .constants import spaceChara... |
psychopenguin/st2contrib | refs/heads/master | packs/reamaze/actions/article_get.py | 7 | from lib.actions import BaseAction
class ArticleGet(BaseAction):
def run(self, slug):
slug = self._convert_slug(slug)
path = '/articles/%s' % slug
response = self._api_get(path)
return response
|
aptrishu/coala | refs/heads/master | tests/results/result_actions/ApplyPatchActionTest.py | 16 | import unittest
import os
from os.path import isfile
from coala_utils.ContextManagers import make_temp
from coalib.results.Diff import Diff
from coalib.results.Result import Result
from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction
from coalib.settings.Section import Section
class ApplyPatch... |
kingsdigitallab/tvof-django | refs/heads/master | merge_production_dotenvs_in_dotenv.py | 5 | import os
from pathlib import Path
from typing import Sequence
import pytest
ROOT_DIR_PATH = Path(__file__).parent.resolve()
PRODUCTION_DOTENVS_DIR_PATH = ROOT_DIR_PATH / ".envs" / ".production"
PRODUCTION_DOTENV_FILE_PATHS = [
PRODUCTION_DOTENVS_DIR_PATH / ".django",
PRODUCTION_DOTENVS_DIR_PATH / ".postgres"... |
JioCloud/cinder | refs/heads/master | cinder/cmd/manage.py | 2 | #!/usr/bin/env python
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
... |
ChristianKniep/QNIB | refs/heads/master | serverfiles/usr/local/lib/networkx-1.6/build/lib/networkx/external/decorator/__init__.py | 13 | """
Hack for including decorator-3.3.1 in NetworkX.
"""
import sys
if sys.version >= '3':
from ._decorator3 import *
_decorator = _decorator3
else:
from ._decorator import *
|
mbayon/TFG-MachineLearning | refs/heads/master | vbig/lib/python2.7/site-packages/pandas/tests/indexes/period/test_asfreq.py | 15 | import pytest
import numpy as np
import pandas as pd
from pandas.util import testing as tm
from pandas import PeriodIndex, Series, DataFrame
class TestPeriodIndex(object):
def setup_method(self, method):
pass
def test_asfreq(self):
pi1 = PeriodIndex(freq='A', start='1/1/2001', end='1/1/2001... |
Lujeni/ansible | refs/heads/devel | lib/ansible/modules/cloud/google/gcp_bigquery_table_info.py | 7 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
sorig/shogun | refs/heads/develop | examples/undocumented/python/graphical/lda.py | 10 | from pylab import figure,pcolor,scatter,contour,colorbar,show,subplot,plot,connect
from shogun import *
import util
util.set_title('LDA')
util.DISTANCE=0.5
gamma=0.1
# positive examples
pos=util.get_realdata(True)
plot(pos[0,:], pos[1,:], "r.")
# negative examples
neg=util.get_realdata(False)
plot(neg[0,:], neg[1,:... |
hustlzp/eve | refs/heads/develop | docs/_themes/flask_theme_support.py | 2228 | # flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
class FlaskyStyle(Style):
background_color = "#f8f8f8"
default_style = "... |
kalyons11/kevin | refs/heads/main | kevin/leet/spiral_matrix.py | 1 | """
https://leetcode.com/explore/interview/card/top-interview-questions-hard/116/array-and-strings/828/
"""
from typing import List
class Direction:
RIGHT = 0
DOWN = 1
LEFT = 2
UP = 3
# TODO eventually clean this up - DRY up this code for sure
class Solution:
def spiral_order(self, matrix: List... |
veger/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_host_storage_facts.py | 59 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMEN... |
NKUCodingCat/jolla | refs/heads/master | jolla/HTTPerror.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class HTTPError(Exception):
error_code = None
def __init__(self, info=None):
self.info = info
if self.info:
print '<' + self.info + '>'
class HTTP404Error(HTTPError):
error_code = 404
def __str__(self):
return "<404 ... |
GhostThrone/django | refs/heads/master | django/conf/locale/sk/formats.py | 504 | # -*- 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. F Y'
TIME_FORMAT = 'G:i'
DATET... |
gangadharkadam/v4_frappe | refs/heads/develop | frappe/core/doctype/communication/communication.py | 2 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import json
import urllib
from email.utils import formataddr
from frappe.website.utils import is_signup_enabled
from frappe.utils import get_url, cstr
from frappe... |
surligas/cs436-gnuradio | refs/heads/master | gr-filter/examples/synth_to_chan.py | 40 | #!/usr/bin/env python
#
# Copyright 2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... |
certik/cos-10-poster | refs/heads/master | graphs/hydrogen_pfem_uniform_init.py | 2 | R_x = {
0: [9, 11, 13, 15, 17, 19, 23, 27, 33, 39],
}
R_y = {
(1, 0): [0.34629090548783104, 0.20598776759902926, 0.083803156392419087, 0.018816315103317549, 0.0019781945906690024, 0.00010426021658926921, 3.1495432171735338e-06, 5.9057941981244255e-08, 7.2221517655179923e-10, 3.6831648841939568e-12],... |
malayaleecoder/servo | refs/heads/master | tests/wpt/web-platform-tests/old-tests/webdriver/base_test.py | 142 | import ConfigParser
import json
import os
import sys
import unittest
from network import get_lan_ip
repo_root = os.path.abspath(os.path.join(__file__, "../.."))
sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
sys.path.insert(1, os.path.join(repo_root, "tools", "wptserve"))
from wptserve import serve... |
tmm1/graphite | refs/heads/master | webapp/graphite/__init__.py | 161 | # Two wrongs don't make a right, but three lefts do.
|
servo/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/aioquic/tests/test_h0.py | 17 | from unittest import TestCase
from aioquic.h0.connection import H0_ALPN, H0Connection
from aioquic.h3.events import DataReceived, HeadersReceived
from .test_connection import client_and_server, transfer
def h0_client_and_server():
return client_and_server(
client_options={"alpn_protocols": H0_ALPN},
... |
ENjOyAbLE1991/scrapy | refs/heads/master | scrapy/utils/markup.py | 211 | """
Transitional module for moving to the w3lib library.
For new code, always import from w3lib.html instead of this module
"""
from w3lib.html import *
|
sivaramakrishnansr/ryu | refs/heads/master | ryu/tests/switch/run_mininet.py | 19 | #!/usr/bin/env python
import sys
from mininet.cli import CLI
from mininet.link import Link
from mininet.net import Mininet
from mininet.node import RemoteController
from mininet.node import OVSSwitch
from mininet.node import UserSwitch
from mininet.term import makeTerm
from oslo_config import cfg
from ryu import ver... |
blooparksystems/odoo | refs/heads/9.0 | addons/account/tests/test_bank_stmt_reconciliation_widget_ui.py | 47 | from openerp.tests import HttpCase
class TestUi(HttpCase):
post_install = True
at_install = False
def test_01_admin_bank_statement_reconciliation(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('bank_statement_reconciliation', 'test')", "odoo.__DEBUG__.services['web.Tour'].tou... |
skynjupt/net_dev | refs/heads/master | src/libxml2/python/setup.py | 1 | #!/usr/bin/python -u
#
# Setup script for libxml2 and libxslt if found
#
import sys, os
from distutils.core import setup, Extension
# Below ROOT, we expect to find include, include/libxml2, lib and bin.
# On *nix, it is not needed (but should not harm),
# on Windows, it is set by configure.js.
ROOT = r'/usr/local'
... |
pombredanne/mitmproxy | refs/heads/master | test/test_protocol_http.py | 8 | from io import BytesIO
from netlib.exceptions import HttpSyntaxException
from netlib.http import http1
from netlib.tutils import treq, raises
import tutils
import tservers
class TestHTTPResponse:
def test_read_from_stringio(self):
s = (
b"HTTP/1.1 200 OK\r\n"
b"Content-Length: 7\r... |
rex-xxx/mt6572_x201 | refs/heads/master | cts/tools/utils/rerun.py | 6 | #!/usr/bin/env python
#
# Copyright (C) 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... |
epa/sqlalchemy | refs/heads/master | test/sql/test_insert.py | 8 | #! coding:utf-8
from sqlalchemy import Column, Integer, MetaData, String, Table,\
bindparam, exc, func, insert, select, column, text
from sqlalchemy.dialects import mysql, postgresql
from sqlalchemy.engine import default
from sqlalchemy.testing import AssertsCompiledSQL,\
assert_raises_message, fixtures, eq_
f... |
CiscoSystems/project-config-third-party | refs/heads/master | tools/jenkins-projects-checks.py | 1 | #! /usr/bin/env python
# Copyright 2014 SUSE Linux Products 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 applica... |
rven/odoo | refs/heads/14.0-fix-partner-merge-mail-activity | addons/account_debit_note/wizard/__init__.py | 11 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import account_debit_note |
axbaretto/beam | refs/heads/master | sdks/python/.tox/lint/lib/python2.7/site-packages/pylint/test/unittest_checker_typecheck.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2014 Holger Peters <[email protected]>
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2014 LOGILAB S.A. (Paris, FRANCE) <[email protected]>
# Copyright (c) 2015-2016 Claudiu Popa <[email protected]>
# Copyright (c) 2015 Ionel Cristian Maries <[email protected]>
# Co... |
longmazhanfeng/interface_web | refs/heads/master | interface_platform/resource_manage.py | 1 | # -*- coding: UTF-8 -*-
from models import *
from account.models import Account
from django.contrib.auth.models import User
from django.shortcuts import render, get_object_or_404, redirect
from django.http import HttpResponse
from base_message import get_its
from django.views.generic import TemplateView
from model.type... |
facebook/FBSimulatorControl | refs/heads/master | idb/common/tar.py | 1 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import asyncio
import os
import sys
import tempfile
import uuid
from typing import AsyncContextManager, AsyncIterator, List, Optional
from idb.utils.contextlib import asynccontextmanager
from idb.utils.typing import none_th... |
dana-i2cat/felix | refs/heads/master | ofam/src/setup.py | 3 | from distutils.core import setup
import os.path
import os
import pprint
import glob
import fnmatch
def generatePluginFiles ():
pfiles = []
foamroot = "/opt/ofelia/ofam/local"
pdirs = os.listdir(os.getcwd() + "/plugins")
for pd in pdirs:
dl = []
for plgfile in os.listdir(os.getcwd() + "/plugins/%s/" % (... |
andrenatal/DeepSpeech | refs/heads/master | util/text.py | 1 | import numpy as np
import tensorflow as tf
# Constants
SPACE_TOKEN = '<space>'
SPACE_INDEX = 0
FIRST_INDEX = ord('a') - 1 # 0 is reserved to space
def text_to_char_array(original):
# Create list of sentence's words w/spaces replaced by ''
result = original.replace(" '", "") # TODO: Deal with this properly
... |
tgummerer/buck | refs/heads/master | scripts/verify-javadoc.py | 24 | #!/usr/bin/env python
#
# Examines the output from running Javadoc via Ant and checks to see if any
# warnings were emitted. If so, fail the build unless the warning is in the
# whitelist. When run in a CI build, Ant may not be able to reach external
# URLs, so warnings about errors fetching expected URLs should be ign... |
Yelp/pyes | refs/heads/master | pyes/fakettypes.py | 5 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
#
# Fake ttypes to use in http protocol to simulate thrift ones
#
class Method(object):
GET = 0
PUT = 1
POST = 2
DELETE = 3
HEAD = 4
OPTIONS = 5
_VALUES_TO_NAMES = {
0: "GET",
1: "PUT",
2: "POST",
... |
dongweiming/web_develop | refs/heads/master | chapter12/section4/config.py | 1 | # coding=utf-8
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'mysql://web:web@localhost:3306/r'
UPLOAD_FOLDER = 'permdir'
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
cstamm/PythonNetworking | refs/heads/master | python_course/base_module1.py | 1 | eq_break = "===================="
|
PeterWangIntel/chromium-crosswalk | refs/heads/master | build/android/pylib/device/commands/__init__.py | 1201 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
|
mdietrichc2c/OCB | refs/heads/8.0 | addons/hr_contract/__openerp__.py | 52 | # -*- 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... |
Tesi-Luca-Davide/ryu | refs/heads/master | ryu/tests/unit/cmd/dummy_app.py | 56 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.