repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
sajeeshcs/nested_projects_keystone | refs/heads/master | keystone/common/validation/__init__.py | 14 | # 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
# distributed under the Li... |
saurabh6790/-aimobilize-lib | refs/heads/master | webnotes/modules/export_file.py | 34 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes, os
import webnotes.model.doc
from webnotes.modules import scrub, get_module_path, lower_case_files_for, scrub_dt_dn
from webnotes.plugins import get_plugin_p... |
KujawinskiLaboratory/NB_Distribution | refs/heads/master | nClustersRequired.py | 2 | ##gathering up code for the testing of number of clusters in Kmeans
#K Longnecker, 18 November 2015
#The files come from this web site:
#http://www.turingfinance.com/clustering-countries-real-gdp-growth-part2/
#I just gathered them into a single .py file and run that file before
#doing using the code in here
import ... |
lucychambers/pepperrage | refs/heads/gh-pages | .bundle/ruby/2.0.0/gems/pygments.rb-0.6.0/vendor/pygments-main/pygments/formatters/latex.py | 49 | # -*- coding: utf-8 -*-
"""
pygments.formatters.latex
~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for LaTeX fancyvrb output.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division
from pygments.formatter import Forma... |
floydkots/tweetme | refs/heads/master | tweets/models.py | 1 | from django.db import models
from django.conf import settings
from .validators import validate_content
from django.urls import reverse
# Create your models here.
class Tweet(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL)
content = models.CharField(max_length=140, validators=[validate_conte... |
mathcamp/steward_web | refs/heads/master | steward_web/login.py | 1 | """ Views for basic username/password auth """
from pyramid.httpexceptions import HTTPFound, HTTPForbidden
from pyramid.security import NO_PERMISSION_REQUIRED, forget, remember
from pyramid.view import view_config
@view_config(route_name='logout')
def do_logout(request):
""" Delete the user's auth cookie """
... |
juventudproductivabicentenaria/odoo | refs/heads/master | direccion_venezuela/partner_venezuela.py | 1 | # -*- 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... |
simalytics/askbot-devel | refs/heads/master | askbot/tests/email_alert_tests.py | 1 | import bs4
import copy
import datetime
import functools
import time
from django.conf import settings as django_settings
from django.core import management
from django.core import serializers
import django.core.mail
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client imp... |
overtherain/scriptfile | refs/heads/master | software/googleAppEngine/lib/django_1_2/django/contrib/gis/db/backends/spatialite/base.py | 244 | from ctypes.util import find_library
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.sqlite3.base import *
from django.db.backends.sqlite3.base import DatabaseWrapper as SqliteDatabaseWrapper, \
_sqlite_extract, _sqlite_date_trunc, _sqlite_regexp
fro... |
plotly/python-api | refs/heads/master | packages/python/plotly/plotly/validators/volume/hoverlabel/_bordercolorsrc.py | 1 | import _plotly_utils.basevalidators
class BordercolorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="bordercolorsrc", parent_name="volume.hoverlabel", **kwargs
):
super(BordercolorsrcValidator, self).__init__(
plotly_name=plotly_name,
... |
annegentle/wadl2rst | refs/heads/master | wadl2rst/nodes/parameters.py | 1 |
from wadl2rst import table
from wadl2rst.nodes.base import BaseNode
class ParametersNode(BaseNode):
def to_keypairs(self, style=None):
params = self.get_params(style)
if not params:
return u''
output = u''
for param in params:
output += " - %s: %s\n" % ... |
Meriipu/quodlibet | refs/heads/master | quodlibet/ext/events/animosd/osdwindow.py | 4 | # Copyright (C) 2012-13 Thomas Vogt
# Copyright (C) 2012-17 Nick Boultbee
# Copyright (C) 2008 Andreas Bombe
# Copyright (C) 2005 Michael Urman
# Based on osd.py (C) 2005 Ton van den Heuvel, Joe Wreshnig
# (C) 2004 Gustavo J. A. M. Carneiro
#
# This program is free software; you can redistribute it and... |
ctrlaltdel/neutrinator | refs/heads/master | vendor/openstack/tests/unit/cloud/test_identity_roles.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
# distributed under the... |
wolfram74/numerical_methods_iserles_notes | refs/heads/master | venv/lib/python2.7/site-packages/sympy/printing/tests/test_fcode.py | 14 | from sympy import sin, cos, atan2, log, exp, gamma, conjugate, sqrt, \
factorial, Integral, Piecewise, Add, diff, symbols, S, Float, Dummy, Eq
from sympy import Catalan, EulerGamma, E, GoldenRatio, I, pi
from sympy import Function, Rational, Integer, Lambda
from sympy.core.relational import Relational
from sympy.l... |
ylando2/pysol-with-easy-gaps | refs/heads/master | pysollib/tk/menubar.py | 2 | #!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
##---------------------------------------------------------------------------##
##
## Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
## Copyright (C) 2003 Mt. Hood Playing Card Co.
## Copyright (C) 2005-2009 Skomoroh
##
## This program is free ... |
bratsche/Neutron-Drive | refs/heads/master | google_appengine/lib/google-api-python-client/runtests.py | 18 | #!/usr/bin/env python
import glob
import imp
import logging
import os
import sys
import unittest
from trace import fullmodname
APP_ENGINE_PATH='../google_appengine'
# Conditional import of cleanup function
try:
from tests.utils import cleanup
except:
def cleanup():
pass
# Ensure current working directory is ... |
Timesys/linux-timesys | refs/heads/3.0-mvf | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 later version.
#
# This program i... |
m0ppers/arangodb | refs/heads/devel | 3rdParty/V8/V8-5.0.71.39/tools/swarming_client/third_party/oauth2client/util.py | 174 | #!/usr/bin/env python
#
# Copyright 2010 Google 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 o... |
s40523242/2016fallcp_hw | refs/heads/gh-pages | plugin/liquid_tags/soundcloud.py | 273 | """
Soundcloud Tag
--------------
This implements a Liquid-style soundcloud tag for Pelican.
It asks the official Soundcloud-API for the widget html code.
Syntax
------
`{% soundcloud track_url %}`
Example
-------
`{% soundcloud https://soundcloud.com/luftmentsh/hakotel %}`
Output
------
`<iframe width="100%" heigh... |
zhangxq5012/sky_engine | refs/heads/master | build/android/pylib/monkey/test_runner.py | 33 | # Copyright 2013 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.
"""Runs a monkey test on a single device."""
import logging
import random
from pylib import constants
from pylib.base import base_test_result
from pylib.ba... |
sauloal/cnidaria | refs/heads/master | scripts/venv/lib/python2.7/site-packages/cogent/db/ensembl/region.py | 1 | import sys
import sqlalchemy as sql
from cogent import DNA
from cogent.core.annotation import Feature
from cogent.core.location import Map
from cogent.util.table import Table
from cogent.db.ensembl.util import LazyRecord, asserted_one, DisplayString, \
NoItemError
from cogent.db.ens... |
flavour/tldrmp | refs/heads/master | tests/unit/orgAuthTest.py | 40 | """
run as -
$ python web2py.py -S vita -M -R applications/vita/tests/unit/orgAuthTest.py
"""
import sys
import glob
import unittest
from gluon.globals import Request
# Pre-requisites & settings
# -----------------------------------------------------------------------------
APP_NAME=request.application
sys.pa... |
SUSE-Cloud/glance | refs/heads/stable/havana | glance/api/v2/images.py | 1 | # Copyright 2012 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 req... |
znoland3/zachdemo | refs/heads/master | venvdir/lib/python3.4/site-packages/sqlalchemy/engine/__init__.py | 20 | # engine/__init__.py
# Copyright (C) 2005-2016 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
"""SQL connections, SQL execution and high-level DB-API interface.
The engine pa... |
grhawk/ASE | refs/heads/master | tools/doc/tutorials/lattice_constant.py | 6 | # creates: lattice_constant.csv
import numpy as np
a0 = 3.52 / np.sqrt(2)
c0 = np.sqrt(8 / 3.0) * a0
from ase.io import PickleTrajectory
traj = PickleTrajectory('Ni.traj', 'w')
from ase.lattice import bulk
from ase.calculators.emt import EMT
eps = 0.01
for a in a0 * np.linspace(1 - eps, 1 + eps, 3):
for c in c0 ... |
philippj/python-burningseries | refs/heads/master | yowsup/layers/protocol_messages/__init__.py | 70 | from .layer import YowMessagesProtocolLayer
|
ravibhure/ansible | refs/heads/devel | test/runner/lib/sanity/sanity_docs.py | 48 | """Sanity test for documentation of sanity tests."""
from __future__ import absolute_import, print_function
import os
from lib.sanity import (
SanitySingleVersion,
SanityMessage,
SanityFailure,
SanitySuccess,
sanity_get_tests,
)
from lib.config import (
SanityConfig,
)
class SanityDocsTest(... |
hpparvi/PyTransit | refs/heads/master | pytransit/orbits/__init__.py | 1 | # PyTransit: fast and easy exoplanet transit modelling in Python.
# Copyright (C) 2010-2019 Hannu Parviainen
#
# 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 Licen... |
EBI-Metagenomics/emgapi | refs/heads/master | emgapianns/management/commands/import_study_summary.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2019 EMBL - European Bioinformatics Institute
#
# 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/LICEN... |
natefoo/pulsar | refs/heads/master | pulsar/client/job_directory.py | 2 | """
"""
import os.path
import posixpath
from collections import deque
from logging import getLogger
from galaxy.util import in_directory
from .util import PathHelper
log = getLogger(__name__)
TYPES_TO_METHOD = dict(
input="inputs_directory",
unstructured="unstructured_files_directory",
config="configs_... |
YongseopKim/crosswalk-test-suite | refs/heads/master | webapi/tct-webaudio-w3c-tests/inst.wgt.py | 294 | #!/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=... |
enthought/etsproxy | refs/heads/master | enthought/mayavi/tools/helper_functions.py | 1 | # proxy module
from __future__ import absolute_import
from mayavi.tools.helper_functions import *
|
joopert/home-assistant | refs/heads/dev | homeassistant/components/abode/camera.py | 3 | """Support for Abode Security System cameras."""
from datetime import timedelta
import logging
import abodepy.helpers.constants as CONST
import abodepy.helpers.timeline as TIMELINE
import requests
from homeassistant.components.camera import Camera
from homeassistant.helpers.dispatcher import async_dispatcher_connect
... |
zengenti/ansible | refs/heads/devel | test/units/plugins/lookup/test_password.py | 32 | # -*- coding: utf-8 -*-
# (c) 2015, 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
# (a... |
GenericStudent/home-assistant | refs/heads/dev | homeassistant/components/statistics/__init__.py | 16 | """The statistics component."""
DOMAIN = "statistics"
PLATFORMS = ["sensor"]
|
sanjeevtripurari/HiBench | refs/heads/master | src/sparkbench/src/main/python/IOCommon/__init__.py | 16 | from IOCommon import IOCommon |
liyi193328/seq2seq | refs/heads/master | seq2seq/contrib/learn/preprocessing/tests/categorical_vocabulary_test.py | 137 | # encoding: utf-8
# 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 r... |
vitaly4uk/django | refs/heads/master | tests/force_insert_update/models.py | 581 | """
Tests for forcing insert and update queries (instead of Django's normal
automatic behavior).
"""
from django.db import models
class Counter(models.Model):
name = models.CharField(max_length=10)
value = models.IntegerField()
class InheritedCounter(Counter):
tag = models.CharField(max_length=10)
cla... |
ESS-LLP/erpnext-medical | refs/heads/develop | erpnext/config/website.py | 44 | from frappe import _
def get_data():
return [
{
"label": _("Portal"),
"items": [
{
"type": "doctype",
"name": "Homepage",
"description": _("Settings for website homepage"),
},
{
"type": "doctype",
"name": "Shopping Cart Settings",
"label": _("Shopping Cart Settings"),... |
AdamWill/anaconda | refs/heads/master | pyanaconda/ui/categories/user_settings.py | 2 | # User settings category classes
#
# Copyright (C) 2011, 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is ... |
leki75/ansible | refs/heads/devel | lib/ansible/modules/network/lenovo/cnos_vlag.py | 59 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... |
klenks/jobsportal | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py | 355 | # -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from collections import Mapping
from datetime import datetime
from .auth import _basic_auth_str
from .compat import cookielib, Ord... |
MyAOSP/external_skia | refs/heads/kk-4.4 | tools/merge_static_libs.py | 219 | #!/usr/bin/env python
# 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 os
import shutil
import subprocess
import sys
import tempfile
def _Usage():
print 'Usage: merge_static_libs OUTPUT_LIB IN... |
AMOboxTV/AMOBox.LegoBuild | refs/heads/master | script.module.requests/lib/requests/models.py | 187 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
... |
memo/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/decode_raw_op_test.py | 10 | # 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... |
Jimmy-Morzaria/scikit-learn | refs/heads/master | examples/cluster/plot_dict_face_patches.py | 337 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... |
BondAnthony/ansible | refs/heads/devel | test/integration/targets/shell/connection_plugins/test_connection_override.py | 36 | # Copyright (c) 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
connection: test_connection_override
short_description: test connection plugin u... |
Cojacfar/Maker | refs/heads/master | comm/lib/python2.7/site-packages/django/contrib/flatpages/urls.py | 383 | from django.conf.urls import patterns
urlpatterns = patterns('django.contrib.flatpages.views',
(r'^(?P<url>.*)$', 'flatpage'),
)
|
Balachan27/django | refs/heads/master | django/utils/log.py | 51 | from __future__ import unicode_literals
import logging
import logging.config # needed when logging_config doesn't start with logging.config
import sys
import warnings
from copy import copy
from django.conf import settings
from django.core import mail
from django.core.mail import get_connection
from django.utils.depr... |
KAMI911/loec | refs/heads/master | examples/Sharpen/binaries-windows-python23/XpmImagePlugin.py | 3 | #
# The Python Imaging Library.
# $Id: XpmImagePlugin.py 2134 2004-10-06 08:55:20Z fredrik $
#
# XPM File handling
#
# History:
# 1996-12-29 fl Created
# 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.7)
#
# Copyright (c) Secret Labs AB 1997-2001.
# Copyright (c) Fredrik Lundh 1996-2001.
#
#... |
emijrp/youtube-dl | refs/heads/master | youtube_dl/extractor/twentytwotracks.py | 178 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none
# 22Tracks regularly replace the audio tracks that can be streamed on their
# site. The tracks usually expire after 1 months, so we can't add tests.
class TwentyTwoTracksIE(InfoExtractor):
_VALID... |
FireElementalNE/gw2t6mats | refs/heads/master | t6mats.py | 1 | #!/usr/bin/python
import sys
import urllib
import json
def checkBounds(passedArg):
if int(passedArg) > 250 or int(passedArg) < 0:
return False
return True
def priceFormat(price):
gold=0
silver=0
if price >= 10000:
gold = price / 10000
price = price % 10000
if price >= 100:
silver=price / 100
price = p... |
MarcosCommunity/odoo | refs/heads/marcos-8.0 | addons/crm/crm_lead.py | 64 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
greyhwndz/rethinkdb | refs/heads/next | test/rql_test/connections/http_support/flask/templating.py | 783 | # -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... |
r2t2sdr/r2t2 | refs/heads/master | linux/trunk/linux-4.0-adi/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# 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.
import errno, os
FUTEX_WAIT = 0... |
saurabh6790/aimobilize | refs/heads/develop | utilities/doctype/sms_control/sms_control.py | 19 | # 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 webnotes
from webnotes.utils import load_json, nowdate, cstr
from webnotes.model.code import get_obj
from webnotes.model.doc import Document
... |
hoosteeno/fjord | refs/heads/master | vendor/packages/ordereddict/setup.py | 46 | # -*- coding: utf-8 -*-
# setup.py
from distutils.core import setup
setup(
name="ordereddict",
version="1.1",
py_modules=['ordereddict']
)
|
resync/resync | refs/heads/develop | tests/test_resource_list_builder.py | 1 | import unittest
import re
import os
from testfixtures import LogCapture
import time
from resync.resource_list_builder import ResourceListBuilder
from resync.resource_list import ResourceList
from resync.resource import Resource
from resync.mapper import Mapper, MapperError
class TestResourceListBuilder(unittest.Test... |
saurabh6790/aimobilize-app-backup | refs/heads/master | buying/doctype/purchase_receipt_item_supplied/__init__.py | 37694 | from __future__ import unicode_literals
|
PhenixI/machine-learning | refs/heads/master | 2_supervised_regression/1-Linear Regression/linear_regression/scikit-LinearRegression.py | 1 | #线性回归,预测
#数据导入
import numpy as np
from sklearn import datasets
diabetes = datasets.load_diabetes()
diabetes_X_train = diabetes.data[: -20]
diabetes_X_test = diabetes.data[-20 :]
diabetes_Y_train = diabetes.target[: -20]
diabetes_Y_test = diabetes.target[-20 :]
#Linear Regression
from sklearn import linear_model
r... |
Eric89GXL/scikit-learn | refs/heads/master | sklearn/feature_selection/tests/test_chi2.py | 33 | """
Tests for chi2, currently the only feature selection function designed
specifically to work with sparse matrices.
"""
import numpy as np
from scipy.sparse import coo_matrix, csr_matrix
import scipy.stats
from .. import SelectKBest, chi2
from ..univariate_selection import _chisquare
from nose.tools import assert_... |
umich-dbgroup/foofah | refs/heads/master | foofah_libs/foofah_node.py | 1 | import editdistance
from timeit import default_timer as timer
from operators import add_extract
from prune_rules import invalid_node, unlikely_introduce_symbols
from collections import defaultdict
import Levenshtein
from collections import Counter
import numpy as np
import string
import itertools
from foofah_table_gra... |
pySTEPS/pysteps | refs/heads/master | pysteps/tests/test_motion.py | 1 | # coding: utf-8
"""
Test the convergence of the optical flow methods available in
pySTEPS using idealized motion fields.
To test the convergence, using an example precipitation field we will:
- Read precipitation field from a file
- Morph the precipitation field using a given motion field (linear or rotor) to
gene... |
garbled1/ansible | refs/heads/devel | lib/ansible/module_utils/infinibox.py | 135 | # -*- coding: utf-8 -*-
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own lic... |
yaqiyang/autorest | refs/heads/master | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/models/usage_list_result.py | 4 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
ajdawson/iris | refs/heads/master | lib/iris/tests/test_merge.py | 11 | # (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... |
bitcoin/bitcoin | refs/heads/master | test/functional/p2p_leak.py | 10 | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test message sending before handshake completion.
Before receiving a VERACK, a node should not send an... |
BaconPancakes/valor | refs/heads/master | lib/youtube_dl/extractor/azubu.py | 10 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
sanitized_Request,
)
class AzubuIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?azubu\.(?:tv|uol.com.br)/[^/]+#!/play/(?P<id>\d+)'
_TESTS = [
{
... |
proversity-org/edx-platform | refs/heads/master | openedx/core/djangoapps/bookmarks/apps.py | 16 | """
Configuration for bookmarks Django app
"""
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType, PluginURLs, PluginSettings
class BookmarksConfig(AppConfig):
"""
Configuration class for boo... |
gugu/python-oauth2 | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
from setuptools import setup, find_packages
import os, re
PKG='oauth2'
VERSIONFILE = os.path.join('oauth2', '_version.py')
verstr = "unknown"
try:
verstrline = open(VERSIONFILE, "rt").read()
except EnvironmentError:
pass # Okay, there is no version file.
else:
MVSRE = r"^manual_verstr... |
elrama-/VZcomp | refs/heads/master | VZcomp/tests/test_bellstate.py | 1 | import numpy as np
import os
from unittest import TestCase
import VZcomp.utils as utils
import VZcomp
from subprocess import call
from VZcomp import representations as rep
class Quantum_definitions(TestCase):
@classmethod
def setUpClass(self):
pass
def test_compilation_call(self):
compile... |
truongduy134/DNA-Word-Design | refs/heads/master | src/check_constraint.py | 1 | # Author: Nguyen Truong Duy
# Email: truongduy134@gmail.com
"""
This module is for testing purpose. For example, it contains various function to check if a given list of DNA words satisfies a subset of constraints.
"""
# Self-written python modules
import helper
import algo_subroutine
import free_energy_routine
# St... |
bigswitch/snac-nox-zaku | refs/heads/zaku | src/scripts/nox-send-cmd.py | 14 | #!/usr/bin/python
import os
import sys
import getopt
import nox.coreapps.messenger.messenger as msg
## \ingroup utility
# @class nox_send_cmd
# Sends a string command to NOX.
# Uses \ref messenger to proxy commands.
# Individual components will execute the commands accordingly.
#
# This can only be run in the source di... |
Krossom/python-for-android | refs/heads/master | python-build/python-libs/gdata/build/lib/gdata/Crypto/Protocol/AllOrNothing.py | 226 | """This file implements all-or-nothing package transformations.
An all-or-nothing package transformation is one in which some text is
transformed into message blocks, such that all blocks must be obtained before
the reverse transformation can be applied. Thus, if any blocks are corrupted
or lost, the original message... |
vveerava/Openstack | refs/heads/master | neutron/tests/functional/agent/linux/test_ovsdb_monitor.py | 5 | # Copyright 2013 Red Hat, 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 agre... |
cytec/Sick-Beard | refs/heads/master | lib/hachoir_parser/image/exif.py | 90 | """
EXIF metadata parser (can be found in a JPEG picture for example)
Author: Victor Stinner
"""
from lib.hachoir_core.field import (FieldSet, ParserError,
UInt8, UInt16, UInt32,
Int32, Enum, String,
Bytes, SubFile,
NullBytes, createPaddingField)
from lib.hachoir_core.endian import LITTLE_ENDIAN, BIG_... |
xaxa89/mitmproxy | refs/heads/master | test/mitmproxy/proxy/test_server.py | 1 | import os
import socket
import time
import pytest
from unittest import mock
from mitmproxy.test import tutils
from mitmproxy import options
from mitmproxy.addons import script
from mitmproxy.addons import proxyauth
from mitmproxy import http
from mitmproxy.proxy.config import HostMatcher
import mitmproxy.net.http
from... |
fernandojunior/searching-techniques | refs/heads/master | python/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py | 484 | from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning
SSLContext = None
HAS_SNI = False
create_default_context = None
import errno
import warnings
try: # Test for SSL features
import ssl
from ssl import wrap_socket, CERT_NO... |
cloudera/hue | refs/heads/master | desktop/core/ext-py/dnspython-1.15.0/dns/rdtypes/ANY/RRSIG.py | 18 | # Copyright (C) 2004-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... |
steventimberman/masterDebater | refs/heads/master | venv/lib/python2.7/site-packages/django/views/decorators/http.py | 51 | """
Decorators for views based on HTTP headers.
"""
import logging
from calendar import timegm
from functools import wraps
from django.http import HttpResponseNotAllowed
from django.middleware.http import ConditionalGetMiddleware
from django.utils.cache import get_conditional_response
from django.utils.decorators imp... |
ykalchevskiy/habra-favorites | refs/heads/master | habra_favorites/settings.py | 1 | # Scrapy settings
BOT_NAME = 'favorites'
FEED_EXPORTERS = {
'html': 'habra_favorites.exporters.HtmlItemExporter',
}
ITEM_PIPELINES = {
'habra_favorites.pipelines.FavoriteItemPipeline': 100,
}
SPIDER_MODULES = ['habra_favorites.spiders']
# Project settings
HABRA_FAVORITES_DOMAINS = ['habrahabr.ru', 'geektime... |
ctriegg/governor | refs/heads/master | helpers/errors.py | 12 | class CurrentLeaderError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class HealthiestMemberError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
|
Kabele/ZCR-Shellcoder | refs/heads/master | lib/encoder/osx/inc.py | 40 | #!/usr/bin/env python
'''
ZCR Shellcoder
ZeroDay Cyber Research
Z3r0D4y.Com
Ali Razmjoo
'''
def start(shellcode,job):
if 'chmod(' in job:
shellcode = 'N' + shellcode
if 'dir_create(' in job:
shellcode = 'N' + shellcode
if 'download_execute(' in job:
shellcode = 'N' + shellcode
if 'download(' in job:
shell... |
piyushkant/Spam-Filter-Machine-Learning | refs/heads/master | spamfilter/main.py | 1 | #####################################################
# Copyright (c) 2012 Piyush Kant #
# See the file license.txt for copying permission #
#####################################################
import spamfilter
import classifier
import naivebayes
import fisher
############################Debugg... |
alexryndin/ambari | refs/heads/branch-adh-1.5 | ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py | 1 | #!/usr/bin/env python
'''
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")... |
exaile/exaile | refs/heads/master | xlgui/main.py | 1 | # Copyright (C) 2008-2010 Adam Olsen
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... |
rikima/spark | refs/heads/master | python/pyspark/sql/window.py | 16 | #
# 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... |
s-garbuzov/pybvc | refs/heads/master | samples/samplenetconf/demos/vr_demo7.py | 4 | #!/usr/bin/python
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, 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:
# 1. Redistributions of source code must retain the above copyright n... |
shubhdev/edx-platform | refs/heads/master | lms/djangoapps/courseware/migrations/0011_add_model_StudentFieldOverride.py | 94 | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name, missing-docstring, unused-argument, unused-import, line-too-long
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'St... |
antepsis/anteplahmacun | refs/heads/master | sympy/series/tests/test_limits.py | 1 | from itertools import product as cartes
from sympy import (
limit, exp, oo, log, sqrt, Limit, sin, floor, cos, ceiling,
atan, gamma, Symbol, S, pi, Integral, Rational, I, EulerGamma,
tan, cot, integrate, Sum, sign, Function, subfactorial, symbols,
binomial, simplify, frac, Float)
from sympy.calculus.u... |
proxysh/Safejumper-for-Mac | refs/heads/master | buildlinux/env32/lib/python2.7/site-packages/yaml/reader.py | 425 | # This module contains abstractions for the input stream. You don't have to
# looks further, there are no pretty code.
#
# We define two classes here.
#
# Mark(source, line, column)
# It's just a record and its only use is producing nice error messages.
# Parser does not use it for any other purposes.
#
# Reader(so... |
yland/coala-bears | refs/heads/master | bears/c_languages/codeclone_detection/CountVector.py | 3 | from math import sqrt
from coalib.misc.Decorators import generate_repr
@generate_repr()
class CountVector:
class Category:
"""
Iternal class to specify the type of the variable in the original code
"""
reference = 0
literal = 1
def __init__(self, name, category=None,... |
reddymeghraj/showroom | refs/heads/master | erpnext/stock/doctype/item_supplier/__init__.py | 37694 | from __future__ import unicode_literals
|
mrGeen/eden | refs/heads/master | modules/eden/fire.py | 1 | # -*- coding: utf-8 -*-
""" Sahana Eden Fire Station Model
@copyright: 2009-2012 (c) Sahana Software Foundation
@license: MIT
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 ... |
philanthropy-u/edx-platform | refs/heads/master | cms/djangoapps/contentstore/management/commands/reindex_course.py | 18 | """ Management command to update courses' search index """
import logging
from textwrap import dedent
from django.core.management import BaseCommand, CommandError
from elasticsearch import exceptions
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locator import ... |
grengojbo/grappelli-admin-tools-trunk | refs/heads/master | admin_tools/dashboard/management/commands/customdashboard.py | 4 | import os
from django.core.management.base import BaseCommand, CommandError
from django.template.loader import render_to_string
DEFAULT_FILE = 'dashboard.py'
class Command(BaseCommand):
help = ('Creates a template file containing the base code to get you '
'started with your custom dashboard.')
ar... |
windyuuy/opera | refs/heads/master | chromium/src/third_party/python_26/Tools/scripts/lfcr.py | 100 | #! /usr/bin/env python
"Replace LF with CRLF in argument files. Print names of changed files."
import sys, re, os
def main():
for filename in sys.argv[1:]:
if os.path.isdir(filename):
print filename, "Directory!"
continue
data = open(filename, "rb").read()
if '\0'... |
mchristopher/PokemonGo-DesktopMap | refs/heads/master | app/pywin/Lib/dis.py | 270 | """Disassembler of Python byte code into mnemonics."""
import sys
import types
from opcode import *
from opcode import __all__ as _opcodes_all
__all__ = ["dis", "disassemble", "distb", "disco",
"findlinestarts", "findlabels"] + _opcodes_all
del _opcodes_all
_have_code = (types.MethodType, types.FunctionT... |
ORTI3D/ORTI3D_code | refs/heads/master | iliblast/qtDialogs.py | 1 | # -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
def onMessage(gui,text): QMessageBox.information(gui,"Info",text)
def onQuestion(gui,text): QMessageBox.information(gui,"Info",text)
class textDialog(QDialog):
def __init__(self,gui, title, tsize, text):
QDialog.__init__(self)... |
shs96c/buck | refs/heads/master | test/com/facebook/buck/features/python/testdata/python_test/test_setup_class_failure.py | 10 | import unittest
class Test(unittest.TestCase):
@classmethod
def setUpClass(cls):
raise Exception("setup failure!")
def test_that_passes(self):
pass
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.