repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
MiracleWong/PythonBasic
refs/heads/master
Chapter10/hello.py
1
import sys, pprint pprint.pprint(sys.path) print("Hello World!") ## pprint 是个相当好的打印函数,能够提供更加智能的打印输出
hexlism/css_platform
refs/heads/master
sleepyenv/lib/python2.7/site-packages/boto-2.38.0-py2.7.egg/boto/ec2/spotinstancerequest.py
170
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # # 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 # w...
harshilasu/LinkurApp
refs/heads/master
y/google-cloud-sdk/platform/gsutil/third_party/boto/tests/unit/s3/test_lifecycle.py
115
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
chiotlune/ext
refs/heads/master
gnuradio-3.7.0.1/gr-digital/python/digital/ofdm.py
41
#!/usr/bin/env python # # Copyright 2006-2008,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 you...
willprice/arduino-sphere-project
refs/heads/master
scripts/example_direction_finder/temboo/Library/Zendesk/UserIdentities/DeleteUserIdentity.py
5
# -*- coding: utf-8 -*- ############################################################################### # # DeleteUserIdentity # Deletes the user identity for a user/ # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use...
nkysg/Asenal
refs/heads/master
script/python/quote.py
1
#!/usr/bin/env python string = '''Yes!", It is heis''' s1 = "chenzongzhi" print s1[4:7]
alexwidener/flask
refs/heads/master
scripts/flaskext_migrate.py
146
# Script which modifies source code away from the deprecated "flask.ext" # format. # # Run in the terminal by typing: `python flaskext_migrate.py <source_file.py>` # # Author: Keyan Pishdadian 2015 from redbaron import RedBaron import sys def read_source(input_file): """Parses the input_file into a RedBaron FST....
mglukhikh/intellij-community
refs/heads/master
python/testData/quickFixes/PyMakeFunctionReturnTypeQuickFixTest/py3OneReturn_after.py
34
def f(x) -> int: return 42
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-3.5.0/Lib/test/test_pkgutil.py
7
from test.support import run_unittest, unload, check_warnings, CleanImport import unittest import sys import importlib from importlib.util import spec_from_file_location import pkgutil import os import os.path import tempfile import types import shutil import zipfile # Note: pkgutil.walk_packages is currently tested i...
sunlianqiang/kbengine
refs/heads/master
kbe/src/lib/python/Tools/freeze/winmakemakefile.py
89
import sys, os # Template used then the program is a GUI program WINMAINTEMPLATE = """ #include <windows.h> int WINAPI WinMain( HINSTANCE hInstance, // handle to current instance HINSTANCE hPrevInstance, // handle to previous instance LPSTR lpCmdLine, // pointer to command line int nCmd...
tom-heimbrodt/oeplatform
refs/heads/develop
base/urls.py
1
from django.conf.urls import url from base import views urlpatterns = [ url(r'^robots.txt$', views.robot), url(r'^$', views.Welcome.as_view(), name='index'), url(r'^about/$', views.redir, {'target': 'about'}, name='index'), url(r'^faq/$', views.redir, {'target': 'faq'}, name='index'), url(r'^discu...
vgupta6/Project-2
refs/heads/master
controllers/doc.py
5
# -*- coding: utf-8 -*- """ Document Library - Controllers """ module = request.controller if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # ============================================================================= def index(): "Module's Home Page" modul...
major/rpc-openstack
refs/heads/master
scripts/update-yaml.py
5
#!/usr/bin/env python # Copyright 2015, Rackspace US, 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 ...
SatoshiNXSimudrone/sl4a-damon-clone
refs/heads/master
python/src/Demo/tkinter/guido/electrons.py
47
#! /usr/bin/env python # Simulate "electrons" migrating across the screen. # An optional bitmap file in can be in the background. # # Usage: electrons [n [bitmapfile]] # # n is the number of electrons to animate; default is 30. # # The bitmap file can be any X11 bitmap file (look in # /usr/include/X11/bitmaps for samp...
memnonila/django-cms
refs/heads/develop
cms/admin/dialog/views.py
16
# -*- coding: utf-8 -*- from django.contrib.admin.views.decorators import staff_member_required from django.http import Http404, HttpResponse from django.shortcuts import get_object_or_404, render from cms.models import Page from cms.utils import get_cms_setting from cms.admin.dialog.forms import PermissionForm @st...
lancezlin/pylearn2
refs/heads/master
pylearn2/sandbox/cuda_convnet/tests/test_weight_acts.py
44
from __future__ import print_function __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" from pylearn2.testing.skip import skip_if_no_gpu skip_if_n...
nzlosh/st2
refs/heads/master
st2common/tests/unit/test_register_internal_trigger.py
3
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
hydroshare/hydroshare2
refs/heads/master
ga_resources/drivers/kmz.py
2
from zipfile import ZipFile from cStringIO import StringIO from django.contrib.gis.geos import Polygon from lxml import etree from . import Driver from osgeo import osr import re from PIL import Image class KmzDriver(Driver): @classmethod def supports_multiple_layers(cls): return False # should chang...
direvus/ansible
refs/heads/devel
lib/ansible/modules/network/onyx/onyx_lldp_interface.py
118
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
grimfang/panda3d
refs/heads/master
direct/src/showbase/MessengerGlobal.py
11
"""instantiate global Messenger object""" __all__ = ['messenger'] from . import Messenger messenger = Messenger.Messenger()
pepeportela/edx-platform
refs/heads/master
lms/djangoapps/commerce/utils.py
5
"""Utilities to assist with commerce tasks.""" from urllib import urlencode from urlparse import urljoin import waffle from django.conf import settings from commerce.models import CommerceConfiguration from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers def is_account_activation_...
snakeleon/YouCompleteMe-x86
refs/heads/master
python/ycm/client/ycmd_keepalive.py
1
# 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 your option) any later vers...
fusioneng/gif2html5-app
refs/heads/master
tests/test_server.py
1
import server import unittest import requests from unittest.mock import MagicMock, ANY, patch from flask import json from gif2html5.config_parser import get_config from gif2html5.s3_manager import S3Manager from tests.test_context import TestContext class JsonPayloadAttachmentIdMatcher(object): def __init__(sel...
Pragmatismo/Pigrow
refs/heads/master
scripts/cron/looped_capture.py
1
#!/usr/bin/python import os import sys import time homedir = os.getenv("HOME") camcap_path = os.path.join(homedir, "Pigrow/scripts/cron/camcap.py") cappath = "" delay = 0 for argu in sys.argv[1:]: if argu == '-h' or argu == '--help': print("Script for running camcap.py on a delayed loop ") print("...
hazelnusse/sympy-old
refs/heads/master
sympy/matrices/tests/test_matrices.py
2
from sympy import symbols, Matrix, eye, I, Symbol, Rational, wronskian, cos, \ sin, exp, hessian, sqrt, zeros, ones, randMatrix, Poly, S, pi, \ integrate, oo, raises, trigsimp, Integer from sympy.matrices.matrices import ShapeError, MatrixError from sympy.printing import srepr from sympy.utilities.pytes...
benoitsteiner/tensorflow-opencl
refs/heads/master
tensorflow/python/kernel_tests/variable_ops_test.py
113
# 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...
orbitfp7/nova
refs/heads/master
nova/tests/unit/scheduler/filters/test_disk_filters.py
11
# 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...
kisel/trex-core
refs/heads/master
scripts/external_libs/pyzmq-14.5.0/python3/ucs4/32bit/zmq/tests/test_security.py
30
"""Test libzmq security (libzmq >= 3.3.0)""" # -*- coding: utf8 -*- # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import os from threading import Thread import zmq from zmq.tests import ( BaseZMQTestCase, SkipTest, PYPY ) from zmq.utils import z85 USER = b"admin" P...
CS-SI/QGIS
refs/heads/master
tests/src/python/test_qgsmetadatawidget.py
13
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsMetadataWidget. Run with: ctest -V -R QgsMetadataWidget .. note:: 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, o...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/mobile/ep3/ep3_rryatt_trail_guild_f_02.py
85615
import sys def setup(core, object): return
Jorge-Rodriguez/ansible
refs/heads/devel
lib/ansible/modules/network/eos/eos_vlan.py
36
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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...
astrobin/astrobin
refs/heads/master
astrobin/migrations/0067_add_display_wip_images_on_public_gallery.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2020-09-30 06:11 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('astrobin', '0066_add_never_activated_account_reminder_sent'), ] operations = [ ...
renhaocui/adPlatform
refs/heads/master
modelUtility.py
2
__author__ = 'rencui' import numpy import json from textstat.textstat import textstat import utilities from sklearn.feature_extraction.text import * from sklearn import svm from tokenizer import simpleTokenize import logging from scipy.sparse import hstack, csr_matrix from sklearn.externals import joblib import pickle ...
davidsminor/cortex
refs/heads/master
python/IECore/SubstitutedDict.py
12
########################################################################## # # Copyright (c) 2009-2010, Image Engine Design 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: # # * Redis...
bplancher/odoo
refs/heads/9.0
addons/website_crm_partner_assign/__init__.py
3964
import controllers import models
konstruktoid/ansible-upstream
refs/heads/devel
test/units/modules/network/slxos/test_slxos_vlan.py
19
# # (c) 2018 Extreme Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ans...
igboyes/virtool
refs/heads/master
tests/analyses/test_utils.py
2
import pytest import virtool.analyses.utils @pytest.mark.parametrize("coverage,expected", [ ( [0, 0, 1, 1, 2, 3, 3, 3, 4, 4, 3, 2], [(0, 0), (1, 0), (2, 1), (3, 1), (4, 2), (5, 3), (7, 3), (8, 4), (9, 4), (10, 3), (11, 2)] ), ( [0, 0, 1, 1, 2, 3, 3, 3, 4, 4, 3, 2, 1, 1], [...
jnmbk/dervis
refs/heads/master
tests/test_dervis.py
1
# -*- coding: utf-8 -*- """ Copyright (C) 2013 Uğur Çetin 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 progr...
cirrusone/phantom2
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/w3c/test_parser.py
135
#!/usr/bin/env python # Copyright (C) 2013 Adobe Systems Incorporated. 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...
niktre/espressopp
refs/heads/master
contrib/mpi4py/mpi4py-2.0.0/test/test_rma_nb.py
7
from mpi4py import MPI import mpiunittest as unittest import arrayimpl def mkzeros(n): import sys if not hasattr(sys, 'pypy_version_info'): return bytearray(n) return b'\0' * n def memzero(m): n = len(m) if n == 0: return try: zero = b'\0' m[0] = zero except TypeErr...
kensonman/webframe
refs/heads/master
templatetags/concat.py
1
from django import template register=template.Library() @register.filter def concat(str1, str2): ''' Concat two object in string ''' str1=str(str1) str2=str(str2) return '%s%s'%(str1, str2)
da1z/intellij-community
refs/heads/master
python/testData/refactoring/move/moveNamespacePackage1/after/src/nssubpkg/a.py
961
VAR = 42
c-benko/HHG_Phasematching
refs/heads/master
test/w_scan.py
1
# w_scan.py import sys, os here = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.normpath(os.path.join(here, '../src'))) from phasematching import * import matplotlib matplotlib.rcParams.update({'font.size': 20}) from matplotlib import pyplot as plt num = 100 wscan = np.linspace(10e-6, 30e-6, ...
bsipocz/glue
refs/heads/master
glue/external/wcsaxes/six.py
153
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2013 Benjamin Peterson # # 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 with...
emakis/erpnext
refs/heads/develop
erpnext/hr/doctype/leave_allocation/__init__.py
37694
from __future__ import unicode_literals
CouchPotato/CouchPotatoServer
refs/heads/master
libs/axl/axel.py
65
# axel.py # # Copyright (C) 2010 Adrian Cristea adrian dot cristea at gmail dotcom # Edits by Ruud Burger # # Based on an idea by Peter Thatcher, found on # http://www.valuedlessons.com/2008/04/events-in-python.html # # This module is part of Axel and is released under # the MIT License: http://www.opensource.org/licen...
Curious72/sympy
refs/heads/master
sympy/integrals/benchmarks/bench_trigintegrate.py
121
from __future__ import print_function, division from sympy import Symbol, sin from sympy.integrals.trigonometry import trigintegrate x = Symbol('x') def timeit_trigintegrate_sin3x(): trigintegrate(sin(x)**3, x) def timeit_trigintegrate_x2(): trigintegrate(x**2, x) # -> None
alexandrucoman/vbox-nova-driver
refs/heads/master
nova/cells/opts.py
13
# Copyright (c) 2012 Rackspace Hosting # # 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...
Plantain/sms-mailinglist
refs/heads/master
lib/googlecloudsdk/core/workspaces.py
5
# Copyright 2013 Google Inc. All Rights Reserved. """Manage gcloud workspaces. A gcloud workspace is a directory that contains a .gcloud folder. This module does manipulations of the gcloud workspace, including creation and component importing. """ import errno import os import os.path import re import subprocess im...
SummerLW/Perf-Insight-Report
refs/heads/test
telemetry/telemetry/web_perf/metrics/memory_timeline_unittest.py
1
# 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 collections import unittest from telemetry.internal.results import page_test_results from telemetry.page import page import mock from telemetry.timel...
srsman/odoo
refs/heads/8.0
addons/l10n_br/__openerp__.py
430
# -*- encoding: utf-8 -*- ############################################################################### # # Copyright (C) 2009 Renato Lima - Akretion # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by th...
liaorubei/depot_tools
refs/heads/master
third_party/gsutil/gslib/util.py
45
# Copyright 2010 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
vrenaville/OCB
refs/heads/8.0
openerp/report/render/rml2html/rml2html.py
438
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2005, Fabien Pinckaers, UCL, FSA # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesse...
suttond/MODOI
refs/heads/master
ase/test/dependency_gtk.py
2
from __future__ import print_function import sys msg = "\nThe gtk python module is missing or not installed properly.\n" msg += "Is the PYTHONPATH environment variable set correctly?\n" msg += "Please verify your installation by running on the command line:\n" msg += "python -c 'import gtk'\n" msg += "\n" msg += "This...
yatinkumbhare/openstack-nova
refs/heads/master
nova/console/__init__.py
112
# 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...
gskielian/SimpleCV
refs/heads/master
SimpleCV/__init__.py
12
__version__ = '1.3.0' from SimpleCV.base import * from SimpleCV.Camera import * from SimpleCV.Color import * from SimpleCV.Display import * from SimpleCV.Features import * from SimpleCV.ImageClass import * from SimpleCV.Stream import * from SimpleCV.Font import * from SimpleCV.ColorModel import * from SimpleCV.Drawing...
DasIch/django
refs/heads/master
django/contrib/gis/utils/ogrinspect.py
391
""" This module is for inspecting OGR data sources and generating either models for GeoDjango and/or mapping dictionaries for use with the `LayerMapping` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.field import ( OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, O...
christophlsa/odoo
refs/heads/8.0
addons/stock/wizard/orderpoint_procurement.py
326
# -*- 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...
haxoza/django
refs/heads/master
django/contrib/auth/tests/custom_user.py
463
from django.contrib.auth.models import ( AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission, PermissionsMixin, UserManager, ) from django.db import models # The custom User uses email as the unique identifier, and requires # that every user provide a date of birth. This lets us test # changes ...
ArcherSys/ArcherSys
refs/heads/master
Lib/test/test_unittest.py
2
<<<<<<< HEAD <<<<<<< HEAD import unittest.test from test import support def test_main(): # used by regrtest support.run_unittest(unittest.test.suite()) support.reap_children() def load_tests(*_): # used by unittest return unittest.test.suite() if __name__ == "__main__": test_main() ======= ...
aimas/TuniErp-8.0
refs/heads/master
addons/marketing_campaign/report/campaign_analysis.py
379
# -*- 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...
felipebetancur/metagoofil
refs/heads/master
hachoir_parser/archive/mozilla_ar.py
74
"""MAR (Mozilla ARchive) parser Author: Robert Xiao Creation date: July 10, 2007 """ from hachoir_core.endian import BIG_ENDIAN from hachoir_core.field import (RootSeekableFieldSet, FieldSet, String, CString, UInt32, RawBytes) from hachoir_core.text_handler import displayHandler, filesizeHandler from hachoir_cor...
fhaoquan/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/_osx_support.py
86
"""Shared OS X support functions.""" import os import re import sys __all__ = [ 'compiler_fixup', 'customize_config_vars', 'customize_compiler', 'get_platform_osx', ] # configuration variables that may contain universal build flags, # like "-arch" or "-isdkroot", that may need customization for # the...
Lujeni/ansible
refs/heads/devel
hacking/build_library/build_ansible/command_plugins/dump_config.py
28
# coding: utf-8 # Copyright: (c) 2019, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import os.path import pathlib import yam...
Designist/sympy
refs/heads/master
sympy/ntheory/continued_fraction.py
75
from sympy.core.numbers import Integer, Rational def continued_fraction_periodic(p, q, d=0): r""" Find the periodic continued fraction expansion of a quadratic irrational. Compute the continued fraction expansion of a rational or a quadratic irrational number, i.e. `\frac{p + \sqrt{d}}{q}`, where ...
redglory/plugin.video.slbenfica.pt
refs/heads/master
calendar.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2013 redglory # # 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 versi...
videntity/python-omhe
refs/heads/master
omhe/core/validators/pbf_validator.py
1
import re,sys from validator_errors import * def pbf_validator(omhe_value,DEFAULT_MIN_VALUE=1,DEFAULT_MAX_VALUE=95,DEFAULT_DEFAULT_VALUE=1,DEFAULT_BLANK_VALID=False,DEFAULT_STRING_VALID=False): """validate percent body fat""" valdict={} print omhe_value try: x=float(omhe_value,) exc...
endlessm/chromium-browser
refs/heads/master
third_party/logilab/logilab/astroid/rebuilder.py
56
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of astroid. # # astroid 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 #...
jimmymunoz/jeuxdemots
refs/heads/master
public/package/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py
1835
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """These functions are executed via gyp-flock-tool when using the Makefile generator. Used on systems that don't have a built-in flock.""" ...
markrawlingson/SickRage
refs/heads/master
lib/sqlalchemy/testing/suite/test_types.py
75
# coding: utf-8 from .. import fixtures, config from ..assertions import eq_ from ..config import requirements from sqlalchemy import Integer, Unicode, UnicodeText, select from sqlalchemy import Date, DateTime, Time, MetaData, String, \ Text, Numeric, Float, literal, Boolean from ..schema import Table, Col...
joshuajan/odoo
refs/heads/master
addons/hw_scanner/__init__.py
1894
# -*- 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...
dwaynebailey/poedit
refs/heads/master
deps/boost/libs/python/test/map_indexing_suite.py
45
# Copyright Joel de Guzman 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ''' ##################################################################### # Check an object that we will use as container element #####...
ajdawson/numpy
refs/heads/master
numpy/distutils/system_info.py
3
#!/bin/env python """ This file defines a set of system_info classes for getting information about various resources (libraries, library directories, include directories, etc.) in the system. Currently, the following classes are available: atlas_info atlas_threads_info atlas_blas_info atlas_blas_threads_info ...
srtab/alexandriadocs
refs/heads/master
alexandriadocs/accounts/models.py
2
# -*- coding: utf-8 -*- from django.contrib.auth.models import AbstractUser from django.db import models from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from autoslug import AutoSlugField class AccessLevel: READER = 0 ADMIN = 1 OWNER = 2 choices = ( (R...
HadiOfBBG/pegasusrises
refs/heads/master
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...
luogangyi/bcec-nova
refs/heads/stable/icehouse
nova/loadables.py
57
# Copyright (c) 2011-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 # # Un...
turbomanage/training-data-analyst
refs/heads/master
courses/machine_learning/deepdive2/structured/labs/application/main.py
3
import os from flask import Flask from flask import render_template from flask import request from googleapiclient import discovery from oauth2client.client import GoogleCredentials credentials = GoogleCredentials.get_application_default() api = discovery.build("ml", "v1", credentials=credentials) app = Flask(__nam...
Azure/azure-sdk-for-python
refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline
sdk/testbase/azure-mgmt-testbase/azure/mgmt/testbase/aio/_configuration.py
1
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
srluge/SickRage
refs/heads/master
sickbeard/dailysearcher.py
2
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: https://sickrage.tv # Git: https://github.com/SiCKRAGETV/SickRage.git # # This file is part of SickRage. # # SickRage 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...
jdar/phantomjs-modified
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py
122
#!/usr/bin/env python # # Copyright 2012, 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...
wreckJ/intellij-community
refs/heads/master
python/testData/refactoring/introduceParameter/simple.after.py
83
def f(x, a="test"): return a
robotis/lesscpy
refs/heads/master
lesscpy/__init__.py
1
__version_info__ = ('0', '10', '1') __version__ = '.'.join(__version_info__)
Ricardo666666/flasky
refs/heads/master
migrations/versions/2356a38169ea_followers.py
114
"""followers Revision ID: 2356a38169ea Revises: 288cd3dc5a8 Create Date: 2013-12-31 16:10:34.500006 """ # revision identifiers, used by Alembic. revision = '2356a38169ea' down_revision = '288cd3dc5a8' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please...
PaddlePaddle/Paddle
refs/heads/develop
tools/CrossStackProfiler/CspReporter.py
1
# Copyright (c) 2021 PaddlePaddle 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 applic...
huyphan/pyyawhois
refs/heads/master
test/record/parser/test_response_whois_afilias_grs_info_gi_status_registered.py
1
# This file is autogenerated. Do not edit it manually. # If you want change the content of this file, edit # # spec/fixtures/responses/whois.afilias-grs.info/gi/status_registered # # and regenerate the tests with the following script # # $ scripts/generate_tests.py # from nose.tools import * from dateutil.parser ...
kingmotley/SickRage
refs/heads/master
lib/sqlalchemy/ext/__init__.py
79
# ext/__init__.py # Copyright (C) 2005-2014 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
sijis/err
refs/heads/master
tests/backend_manager_test.py
5
import logging import pytest from errbot.core import ErrBot from errbot.bootstrap import CORE_BACKENDS from errbot.backend_plugin_manager import BackendPluginManager logging.basicConfig(level=logging.DEBUG) backends_to_check = ['Text', 'Test', 'Null'] @pytest.mark.parametrize('backend_name', backends_to_check) def...
9hao/shadowsocks
refs/heads/master
shadowsocks/lru_cache.py
8
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2014 clowwindy # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to u...
liangazhou/django-rdp
refs/heads/master
packages/Django-1.8.6/tests/migrations/test_migrations_run_before/0001_initial.py
427
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): operations = [ migrations.CreateModel( "Salamander", [ ("id", models.AutoField(primary_key=True)), ("si...
totto82/opm-common
refs/heads/master
python/tests/test_erft.py
6
import unittest import sys import numpy as np import datetime from opm.io.ecl import ERft, eclArrType try: from tests.utils import test_path except ImportError: from utils import test_path class TestEclFile(unittest.TestCase): def test_content(self): refContent = [ ('PROD', (2015, 1, 1), 0.0),...
unicampi/unicampi
refs/heads/master
tests/__init__.py
8
"""Tests"""
TheFadeliskOrganization/fadelisk
refs/heads/master
lib/python/fadelisk/resource/site_not_found.py
1
from twisted.web import http, resource class SiteNotFoundResource(resource.ErrorPage): def __init__(self, app): self.app = app resource.ErrorPage.__init__(self, http.FORBIDDEN, "No Such Site", "Your request does not correspond to a known site.") def render(self, re...
abdelouahabb/python-react
refs/heads/master
react/render.py
3
import os from optional_django import staticfiles from .exceptions import ComponentSourceFileNotFound from .render_server import render_server def render_component(path, props=None, to_static_markup=False, renderer=render_server): if not os.path.isabs(path): abs_path = staticfiles.find(path) if no...
UKPLab/sentence-transformers
refs/heads/master
sentence_transformers/losses/CosineSimilarityLoss.py
1
import torch from torch import nn, Tensor from typing import Iterable, Dict from ..SentenceTransformer import SentenceTransformer class CosineSimilarityLoss(nn.Module): """ CosineSimilarityLoss expects, that the InputExamples consists of two texts and a float label. It computes the vectors u = model(inpu...
yograterol/django
refs/heads/master
tests/reserved_names/models.py
409
""" Using SQL reserved names Need to use a reserved SQL name as a column name or table name? Need to include a hyphen in a column or table name? No problem. Django quotes names appropriately behind the scenes, so your database won't complain about reserved-name usage. """ from django.db import models from django.util...
tobegit3hub/cinder_docker
refs/heads/master
cinder/tests/unit/test_san.py
34
# Copyright 2015 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
impowski/servo
refs/heads/master
tests/wpt/css-tests/tools/wptserve/wptserve/ranges.py
329
from utils import HTTPException class RangeParser(object): def __call__(self, header, file_size): prefix = "bytes=" if not header.startswith(prefix): raise HTTPException(416, message="Unrecognised range type %s" % (header,)) parts = header[len(prefix):].split(",") rang...
lcdb/lcdblib
refs/heads/master
lcdblib/pandas/utils.py
1
import pandas as pd from itertools import product def tidy_dataframe(df, column, sep='|'): """ Given a dataframe with a delimiter-separated string, create a new dataframe with separate rows for each value in each corresponding string. E.g.:: gene score 0 g1|g2 1 ...
LtKije/fooNelnet
refs/heads/master
fooNelnet/appendToCSV.py
1
import sys import os.path import time import string from userInfo import CSV_FILE_NAME from userInfo import PAYMENT_CSV_FILE_NAME def appendToCSV(loan_data): """Appends received loan data to a CSV file Args: loan_data (list): A list of dictionaries containing the following keys: - acc...
salguarnieri/intellij-community
refs/heads/master
python/testData/inspections/PyNumpyType/ReturnTuple.py
69
def unique(ar, return_index=False, return_inverse=False, return_counts=False): """ Find the unique elements of an array. Returns the sorted unique elements of an array. There are two optional outputs in addition to the unique elements: the indices of the input array that give the unique values, and...