repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
tkaitchuck/nupic
refs/heads/master
external/common/lib/python2.6/site-packages/logilab/astng/test/unittest_builder.py
1
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # copyright 2003-2010 Sylvain Thenault, all rights reserved. # contact mailto:thenault@gmail.com # # This file is part of logilab-astng. # # logilab-astng is free software: you can redi...
strummerTFIU/TFG-IsometricMaps
refs/heads/master
LAStools/ArcGIS_toolbox/scripts_production/lasheightPro.py
1
# # lasheightPro.py # # (c) 2013, martin isenburg - http://rapidlasso.com # rapidlasso GmbH - fast tools to catch reality # # uses lasheight.exe to compute height of points above # ground for folders of LiDAR files. height is computed # relative to either the points classified as ground or # to an external...
hasanferit/trumpcrawler
refs/heads/master
crawlenv/lib/python3.5/site-packages/wheel/pkginfo.py
96
"""Tools for reading and writing PKG-INFO / METADATA without caring about the encoding.""" from email.parser import Parser try: unicode _PY3 = False except NameError: _PY3 = True if not _PY3: from email.generator import Generator def read_pkg_info_bytes(bytestr): return Parser().parsestr...
alxgu/ansible
refs/heads/devel
lib/ansible/modules/packaging/language/yarn.py
40
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017 David Gunter <david.gunter@tivix.com> # Copyright (c) 2017 Chris Hoffman <christopher.hoffman@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function _...
neuroidss/nupic.research
refs/heads/master
projects/sdr_paper/chart.py
17
#!/usr/bin/env python # ---------------------------------------------------------------------- # Copyright (C) 2015, Numenta Inc. All rights reserved. # # The information and source code contained herein is the # exclusive property of Numenta Inc. No part of this software # may be used, reproduced, stored or distribut...
kosgroup/odoo
refs/heads/10.0
odoo/addons/test_read_group/tests/test_empty.py
22
# -*- coding: utf-8 -*- from odoo.tests import common class TestEmptyDate(common.TransactionCase): """ Test what happens when grouping on date fields and getting a "false" grouping value """ def setUp(self): super(TestEmptyDate, self).setUp() self.Model = self.env['test_read_group.on_d...
koomik/CouchPotatoServer
refs/heads/develop
libs/suds/mx/literal.py
179
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
creativewild/ansible
refs/heads/devel
lib/ansible/vars/__init__.py
9
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
juhp/anitya
refs/heads/master
tests/test_distro.py
4
# -*- coding: utf-8 -*- # # Copyright © 2014 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 distributed in t...
MER-GROUP/intellij-community
refs/heads/master
python/testData/psi/NotClosedBraceDict.py
80
a = { 'b': 'c', ]
reeldba/nacent-domain
refs/heads/master
scaffold/tempSimulator.py
1
import math # plot a sinusoidal curve around 80 degrees F / 25.56 C # # 90 F = 32.2222222222 C # 85 F = 29.4444444444 C # 80 F = 26.6666666667 C # 75 F = 23.8888888889 C # 70 F = 21.1111111111 C def f2c(t): return (t-32.0)*(5.0/9.0) def c2f(t): return (t*9.0/5.0)+32.0 print f2c(72) TARGET_TEMPERATURE=26.67 LOW...
HuygensING/bioport-buildout
refs/heads/master
plone-buildout/src/inghist.bioportcontent/inghist/bioportcontent/tests.py
1
import unittest #from zope.testing import doctestunit #from zope.component import testing from Testing import ZopeTestCase as ztc from Products.Five import fiveconfigure from Products.PloneTestCase import PloneTestCase as ptc from Products.PloneTestCase.layer import PloneSite ptc.setupPloneSite() import inghist.biop...
peterlauri/django
refs/heads/master
tests/datatypes/tests.py
43
from __future__ import unicode_literals import datetime from django.test import TestCase, skipIfDBFeature from django.utils import six from django.utils.timezone import utc from .models import Donut, RumBaba class DataTypesTestCase(TestCase): def test_boolean_type(self): d = Donut(name='Apple Fritter'...
philanthropy-u/edx-platform
refs/heads/master
lms/djangoapps/onboarding/models.py
1
import logging import re import uuid from datetime import datetime from django.contrib.auth.models import User from django.core.validators import MaxValueValidator, URLValidator from django.db import models from django.utils.translation import ugettext_noop from model_utils.models import TimeStampedModel from multisel...
dpa-newslab/livebridge
refs/heads/master
tests/test_dynamo.py
1
# -*- coding: utf-8 -*- # # Copyright 2016 dpa-infocom GmbH # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
adamjmcgrath/glancydesign
refs/heads/master
src/django-nonrel/tests/regressiontests/model_regress/models.py
121
# coding: utf-8 from django.db import models CHOICES = ( (1, 'first'), (2, 'second'), ) class Article(models.Model): headline = models.CharField(max_length=100, default='Default headline') pub_date = models.DateTimeField() status = models.IntegerField(blank=True, null=True, choices=CHOICES) m...
williamfeng323/py-web
refs/heads/master
flask/lib/python3.6/site-packages/passlib/handlers/bcrypt.py
5
"""passlib.bcrypt -- implementation of OpenBSD's BCrypt algorithm. TODO: * support 2x and altered-2a hashes? http://www.openwall.com/lists/oss-security/2011/06/27/9 * deal with lack of PY3-compatibile c-ext implementation """ #============================================================================= # imports ...
stfc/artemis
refs/heads/master
artemis_store.py
2
#!/usr/bin/python # coding=utf8 # # Copyright Science and Technology Facilities Council, 2009-2012. # # This file is part of ARTEMIS. # # ARTEMIS 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 ve...
izonder/intellij-community
refs/heads/master
python/testData/intentions/afterReplaceExceptPart.py
83
try: pass except e as name: pass
archifix/settings
refs/heads/master
sublime/Packages/pymdownx/st3/pymdownx/snippets.py
5
""" Snippet ---8<---. pymdownx.snippet Inject snippets MIT license. Copyright (c) 2017 Isaac Muse <isaacmuse@gmail.com> 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 restri...
TheAlgorithms/Python
refs/heads/master
arithmetic_analysis/newton_method.py
1
"""Newton's Method.""" # Newton's Method - https://en.wikipedia.org/wiki/Newton%27s_method from typing import Callable RealFunc = Callable[[float], float] # type alias for a real -> real function # function is the f(x) and derivative is the f'(x) def newton( function: RealFunc, derivative: RealFunc, st...
siosio/intellij-community
refs/heads/master
python/testData/paramInfo/WithoutTypeButWithNoneDefaultValue.py
30
def foo(b=None): pass foo(<arg1>)
AtomLinter/linter-pylama
refs/heads/master
bin/deps/pylint/extensions/docparams.py
1
# -*- coding: utf-8 -*- # Copyright (c) 2014-2015 Bruno Daniel <bruno.daniel@blue-yonder.com> # Copyright (c) 2015-2017 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2016-2018 Ashley Whetter <ashley@awhetter.co.uk> # Copyright (c) 2016 Glenn Matthews <glenn@e-dad.net> # Copyright (c) 2016 Glenn Matthews <glmatth...
habibiefaried/ryu
refs/heads/master
ryu/tests/integrated/test_vrrp_linux_multi.py
49
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 Isaku Yamahata <yamahata 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://...
pexip/os-pyasn1
refs/heads/master
tests/type/test_opentype.py
6
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # import sys try: import unittest2 as unittest except ImportError: import unittest from tests.base import BaseTestCase from pyasn1.type import univ from ...
vperron/sentry
refs/heads/master
src/sentry/migrations/0163_auto__add_field_authidentity_last_synced.py
34
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'AuthIdentity.last_synced' db.add_column('sentry_authident...
40223246/2015cd_midterm2
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/linecache.py
785
"""Cache lines from files. This is intended to read lines from modules imported -- hence if a filename is not found, it will look down the module search path for a file by that name. """ import sys import os import tokenize __all__ = ["getline", "clearcache", "checkcache"] def getline(filename, lineno, module_globa...
open-nata/xdroid
refs/heads/master
myscripts/run_dyno.py
1
#!/usr/bin/python # called from run_dynodroid.sh import sys, os, subprocess, time, signal from threading import Timer currDir = os.getcwd() toolDir = sys.argv[1] resultDir = sys.argv[2] apkName = sys.argv[3] global pLogcat global pDumpCov global p global outFile global started started=False global finished finished=...
zentralopensource/zentral
refs/heads/main
zentral/utils/local_dir.py
1
import logging import os import tempfile from zentral.conf import settings logger = logging.getLogger("zentral.utils.local_storage") def get_and_create_local_dir(*args): media_root = settings['django'].get('MEDIA_ROOT', None) if not media_root: media_root = tempfile.gettempdir() logger.error(...
oinopion/django
refs/heads/master
django/template/__init__.py
15
""" Django's support for templates. The django.template namespace contains two independent subsystems: 1. Multiple Template Engines: support for pluggable template backends, built-in backends and backend-independent APIs 2. Django Template Language: Django's own template engine, including its built-in loaders, ...
hefen1/chromium
refs/heads/master
tools/telemetry/telemetry/unittest_util/simple_mock_unittest.py
21
# Copyright 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 unittest from telemetry.unittest_util import simple_mock _ = simple_mock.DONT_CARE class SimpleMockUnitTest(unittest.TestCase): def testBasic(self...
zaina/nova
refs/heads/master
nova/scheduler/weights/metrics.py
53
# Copyright (c) 2011 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 ...
drincruz/luigi
refs/heads/master
test/scheduler_test.py
45
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
lalitkumarj/NEXT
refs/heads/master
next/database_client/CacheStore/redis_data_structures/matrix-test2.py
6
import redismatrix import numpy import time import matplotlib.pyplot as plot from numpy import * from numpy.random import * from redismatrix import * from matplotlib.font_manager import FontProperties def main(): file2 = open('T[i][j].txt', 'w') file3 = open('test.txt', 'w') n = 100 # ...
tod31/pyload
refs/heads/stable
module/common/packagetools.py
41
#!/usr/bin/env python # JDownloader/src/jd/controlling/LinkGrabberPackager.java import re from urlparse import urlparse def matchFirst(string, *args): """ matches against list of regexp and returns first match""" for patternlist in args: for pattern in patternlist: r = pattern.search(stri...
BenoitZugmeyer/bank
refs/heads/master
bank/util.py
1
import re import datetime import collections import json import yaml import dateutil.parser def json_default(o): if hasattr(o, '__json__'): return o.__json__() return json.JSONEncoder.default(o) class YamlDumper(yaml.SafeDumper): pass YamlDumper.add_representer( collections.OrderedDict, ...
semonte/intellij-community
refs/heads/master
python/testData/intentions/replaceListComprehension2.py
83
t = [[3 for i in range(5)] for j<caret> in range(7)]
aaltinisik/OCBAltinkaya
refs/heads/8.0
openerp/addons/base/tests/test_func.py
379
# -*- coding: utf-8 -*- import functools import unittest2 from openerp.tools.func import compose class TestCompose(unittest2.TestCase): def test_basic(self): str_add = compose(str, lambda a, b: a + b) self.assertEqual( str_add(1, 2), "3") def test_decorator(self): ...
s4shahreyar/android_kernel_motorola_msm8610
refs/heads/lollipop
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
ycaihua/scikit-learn
refs/heads/master
benchmarks/bench_plot_omp_lars.py
31
"""Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle regression (:ref:`least_angle_regression`) The input data is mostly low rank but is a fat infinite tail. """ from __future__ import print_function import gc import sys from time import time import numpy as np from sklearn.linear_model impo...
ytjia/coding-practice
refs/heads/master
algorithms/python/leetcode/MaximumDepthofBinaryTree.py
2
#!/usr/bin python # -*- coding: utf-8 -*- """ Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. https://oj.leetcode.com/problems/maximum-depth-of-binary-tree/ """ # Definition for a binary tree node class Tr...
peterfpeterson/musings
refs/heads/master
docs/lotka_volterra/quiver.py
1
#!/usr/bin/env python3 from plotly import tools as toolsly from plotly.offline import plot import plotly.graph_objs as go import numpy as np ##### parameters for everything alpha = 10 # prey growth beta = 1 # predator eat delta = 10. # predator growth gamma = 1 # predator death # second fixed point (xfixed, yfixed)...
dsajkl/123
refs/heads/master
lms/djangoapps/branding/__init__.py
10
from xmodule.modulestore.django import modulestore from xmodule.course_module import CourseDescriptor from django.conf import settings from opaque_keys.edx.locations import SlashSeparatedCourseKey from microsite_configuration import microsite def get_visible_courses(): """ Return the set of CourseDescriptors...
tanglei528/ceilometer
refs/heads/master
ceilometer/storage/sqlalchemy/migrate_repo/versions/027_remove_alarm_fk_constraints.py
3
# -*- encoding: utf-8 -*- # # Copyright © 2014 Intel Crop. # # Author: Lianhao Lu <lianhao.lu@intel.com> # # 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/license...
vjmac15/Lyilis
refs/heads/master
lib/imgurpython/imgur/models/message (VJ Washington's conflicted copy 2017-08-29).py
22
class Message(object): def __init__(self, message_id, from_user, account_id, sender_id, body, conversation_id, datetime): self.id = message_id self.from_user = from_user self.account_id = account_id self.sender_id = sender_id self.body = body self.conversation_id = c...
vnsofthe/odoo
refs/heads/8.0
addons/crm_project_issue/__init__.py
386
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
Nick-OpusVL/odoo
refs/heads/8.0
addons/website_event/__openerp__.py
308
# -*- coding: utf-8 -*- { 'name': 'Online Events', 'category': 'Website', 'summary': 'Schedule, Promote and Sell Events', 'website': 'https://www.odoo.com/page/website-builder', 'version': '1.0', 'description': """ Online Events """, 'author': 'OpenERP SA', 'depends': ['website'...
drbild/boto
refs/heads/develop
boto/ec2/autoscale/__init__.py
8
# Copyright (c) 2009-2011 Reza Lotun http://reza.lotun.name/ # Copyright (c) 2011 Jann Kleen # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # 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 sof...
iamgroot42/braindump
refs/heads/master
app/__init__.py
1
from flask import Flask from flask.ext.bootstrap import Bootstrap from flask.ext.mail import Mail from flask.ext.moment import Moment from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager from config import config bootstrap = Bootstrap() mail = Mail() moment = Moment() db = SQLAlchemy()...
homework/nox
refs/heads/zaku
src/nox/lib/packet/t/tcp_parse_test.py
10
# Copyright 2008 (C) Nicira, Inc. # # This file is part of NOX. # # NOX 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. # # NOX is d...
celebdor/perryt
refs/heads/master
perryt.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from argparse import ArgumentParser from dateparser import parser as timedelta_parser from datetime import datetime import json import subprocess import ConfigParser def query(gerritURL, query): config = check_server() cmd = 'ssh -o StrictHostKeyChecking=no -o Us...
zentralopensource/zentral
refs/heads/main
zentral/contrib/mdm/__init__.py
1
default_app_config = "zentral.contrib.mdm.apps.ZentralMDMAppConfig"
arteria-project/arteria-delivery
refs/heads/master
alembic/versions/a6c738797ecb_store_staging_target_in_db.py
1
"""store staging target in db Revision ID: a6c738797ecb Revises: 7ef1e44e41b7 Create Date: 2016-11-07 14:33:10.929313 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'a6c738797ecb' down_revision = '7ef1e44e41b7' branch_labels = None depends_on = None def upgra...
Cuuuurzel/KiPyCalc
refs/heads/master
sympy/physics/optics/waves.py
14
""" This module has all the classes and functions related to waves in optics. **Contains** * TWave """ from __future__ import print_function, division __all__ = ['TWave'] from sympy import (sympify, pi, sin, cos, sqrt, simplify, Symbol, S, C, I, symbols, Derivative, atan2) from sympy.core.expr import Expr from...
Emergya/icm-openedx-educamadrid-platform-basic
refs/heads/ci
common/lib/xmodule/xmodule/tests/test_utils_escape_html_characters.py
118
"""Tests for methods defined in util/misc.py""" from xmodule.util.misc import escape_html_characters from unittest import TestCase class UtilHtmlEscapeTests(TestCase): """ Tests for methods exposed in util/misc """ final_content = " This is a paragraph. " def test_escape_html_comments(self): ...
KristianOellegaard/django-filer
refs/heads/develop
tests/project/settings.py
1
#-*- coding: utf-8 -*- import os DEBUG = True PACKAGE_ROOT = os.path.abspath( os.path.join(os.path.dirname(__file__), '../') ) PROJECT_ROOT = os.path.join(PACKAGE_ROOT, 'project') TMP_ROOT = os.path.abspath( os.path.join(PACKAGE_ROOT, 'tmp') ) DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = os.path.join(TMP_ROOT,'filer_tes...
Liyier/learning_log
refs/heads/master
env/Lib/site-packages/django/db/migrations/autodetector.py
58
from __future__ import unicode_literals import functools import re from itertools import chain from django.conf import settings from django.db import models from django.db.migrations import operations from django.db.migrations.migration import Migration from django.db.migrations.operations.models import AlterModelOpt...
jakobharlan/avango
refs/heads/master
avango-display/python/avango/display/setups/Wall.py
6
# -*- Mode:Python -*- ########################################################################## # # # This file is part of AVANGO. # # ...
interphx/noxboard
refs/heads/master
run.py
1
#! python3.4 import sys from app import application, config if __name__ == '__main__': application.run(debug=config['app']['debug'], host=config['flask']['HOST'], port=config['flask']['PORT'])
t-wissmann/qutebrowser
refs/heads/master
tests/unit/misc/test_editor.py
1
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
jagguli/intellij-community
refs/heads/master
python/helpers/pydev/_pydev_imps/_pydev_pkgutil_old.py
234
"""Utilities to support packages.""" # NOTE: This module must remain compatible with Python 2.3, as it is shared # by setuptools for distribution with Python 2.3 and up. import os import sys import imp import os.path from types import ModuleType __all__ = [ 'get_importer', 'iter_importers', 'get_loader', 'find_l...
huang4fstudio/django
refs/heads/master
tests/template_tests/broken_tag.py
580
from django import Xtemplate # NOQA
Samsung-MSM8916/android_kernel_samsung_msm8916
refs/heads/cm-12.1
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...
GammaGammaRay/three.js
refs/heads/master
utils/exporters/blender/addons/io_three/exporter/__init__.py
178
import os import sys import traceback from .. import constants, logger, exceptions, dialogs from . import scene, geometry, api, base_classes def _error_handler(func): def inner(filepath, options, *args, **kwargs): level = options.get(constants.LOGGING, constants.DEBUG) version = options.get('...
charbeljc/OCB
refs/heads/8.0
addons/website_certification/certification.py
385
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
b4oshany/Localstrorage-audio
refs/heads/master
server/lib/werkzeug/exceptions.py
316
# -*- coding: utf-8 -*- """ werkzeug.exceptions ~~~~~~~~~~~~~~~~~~~ This module implements a number of Python exceptions you can raise from within your views to trigger a standard non-200 response. Usage Example ------------- :: from werkzeug.wrappers import BaseRequest ...
leansoft/edx-platform
refs/heads/master
lms/djangoapps/courseware/grades.py
24
# Compute grades using real division, with no integer truncation from __future__ import division from collections import defaultdict from functools import partial import json import random import logging from contextlib import contextmanager from django.conf import settings from django.db import transaction from djang...
jreback/pandas
refs/heads/master
pandas/tests/io/json/test_compression.py
1
import pytest import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm def test_compression_roundtrip(compression): df = pd.DataFrame( [[0.123456, 0.234567, 0.567567], [12.32112, 123123.2, 321321.2]], index=["A", "B"], columns=["X", "Y", "Z"], ) ...
pantsbuild/pex
refs/heads/main
pex/vendor/_vendored/pip/pip/_vendor/chardet/enums.py
290
""" All of the Enums that are used throughout the chardet package. :author: Dan Blanchard (dan.blanchard@gmail.com) """ class InputState(object): """ This enum represents the different states a universal detector can be in. """ PURE_ASCII = 0 ESC_ASCII = 1 HIGH_BYTE = 2 class LanguageFilter...
vrenaville/OCB
refs/heads/8.0
addons/im_livechat/__openerp__.py
308
{ 'name' : 'Live Chat', 'author': 'OpenERP SA', 'version': '1.0', 'summary': 'Live Chat with Visitors/Customers', 'category': 'Tools', 'complexity': 'easy', 'website': 'https://www.odoo.com/page/live-chat', 'description': """ Live Chat Support ================= Allow to drop ins...
mrcaps/rain-workload-toolkit
refs/heads/master
utils/testplan.py
10
import sys import subprocess import time import re import os import simplejson as json import getopt from run_manager import RunManager, RainOutputParser ''' Example config { "profilesCreatorClass": "radlab.rain.workload.httptest.HttpTestProfileCreator", "profilesCreatorClassParams": { "baseHostIp": "1...
curtisblack/R2D2
refs/heads/master
HeadMotor.py
1
import time from I2C import I2C class HeadMotor(I2C): def __init__(self, relay=None): I2C.__init__(self, 9, relay) self.lastPing = 0 def SetSpeed(self, speed): #speed = speed * speed if speed >= 0 else -speed * speed speed = int(127 + 127 * speed) self.Send(6, [speed]) ...
midori1/midorinoblog
refs/heads/master
site-packages/django/contrib/sessions/backends/file.py
113
import datetime import errno import logging import os import shutil import tempfile from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError, VALID_KEY_CHARS from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured from django.utils import timezone...
danalec/dotfiles
refs/heads/master
sublime/.config/sublime-text-3/Packages/pygments/all/pygments/styles/rrt.py
50
# -*- coding: utf-8 -*- """ pygments.styles.rrt ~~~~~~~~~~~~~~~~~~~ pygments "rrt" theme, based on Zap and Emacs defaults. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Com...
brki/rpspot
refs/heads/master
rphistory/views.py
1
import datetime import re from urllib.parse import urlencode from django.core.management import call_command from django.core.urlresolvers import reverse from django.db.models import Q from django.http import HttpResponse from django.shortcuts import get_object_or_404, redirect, render from django.contrib.auth.decorat...
tsammons/SMART-GH
refs/heads/master
sensor_processing/sensor_readings/noise/transform_noisetube_to_heatmap.py
3
from collections import defaultdict import pickle import jsonpickle def expo_moving_average(data): """ Calculates the exponential moving average for every unique lat,lon combination. Assumes data is in the format: [ [lat1, lon1, val1], [lat2, lon2, val2], [lat1, lon1, val3] ...
ol-loginov/intellij-community
refs/heads/master
python/testData/stubs/VariableIndex.py
83
xyzzy = 1 __all__ = ['xyzzy'] def foo(): shazam = 2 class C: boohoo = 3
zooba/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py
70
from __future__ import division from datetime import datetime from pip._vendor.cachecontrol.cache import BaseCache class RedisCache(BaseCache): def __init__(self, conn): self.conn = conn def get(self, key): return self.conn.get(key) def set(self, key, value, expires=None): if n...
milwaukeegdi/milwaukeegdi.github.io
refs/heads/intro-slides
intro/node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/PRESUBMIT.py
1369
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Top-level presubmit script for GYP. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built...
demoforwork/public
refs/heads/master
SelfServiceProvisioning/lib/rsa/prime.py
81
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Un...
wanghaven/nupic
refs/heads/master
src/nupic/regions/RecordSensorFilters/AddNoise.py
40
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
edoddridge/MIM
refs/heads/master
aronnax/utils.py
2
from contextlib import contextmanager import os import subprocess as sub @contextmanager def working_directory(path): old_path = os.getcwd() sub.check_call(["mkdir", "-p", path]) os.chdir(path) try: yield finally: os.chdir(old_path)
EricCline/CEM_inc
refs/heads/master
env/lib/python2.7/site-packages/IPython/core/magics/display.py
17
"""Simple magics for display formats""" #----------------------------------------------------------------------------- # Copyright (c) 2012 The IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #----...
dragondjf/QMarkdowner
refs/heads/master
pkg/__init__.py
5
#!/usr/bin/env python # -*- coding: UTF8 -*- # UDP-based app level communication protocol import struct import dpkt import logging import v22 from utils import sensitivitycompound logger = logging.getLogger(__name__) #返回码 #成功 RETURN_SUCCESS = 0x00 #命令字未实现 RETURN_NO_ACHIEVE = 0x01 #消息长度错误 RETURN_L...
bngsudheer/pani
refs/heads/master
pani/__init__.py
1
# -*- coding: utf-8 -*- """ Pani ~~~~~ A mercurial manager. It's a glue application to put together various mercurial tools :copyright: (c) 2014 by Sudheera Satyanrayana. :license: BSD, see LICENSE for more details. """ __version__ = '0.1' from flask import Flask from flask import request, r...
hyc/HyperDex
refs/heads/master
test/python/DataTypeMapIntFloat.py
1
#!/usr/bin/env python import sys import hyperdex.client from hyperdex.client import LessEqual, GreaterEqual, Range, Regex, LengthEquals, LengthLessEqual, LengthGreaterEqual c = hyperdex.client.Client(sys.argv[1], int(sys.argv[2])) def to_objectset(xs): return set([frozenset(x.items()) for x in xs]) assert c.put('kv...
Philippe12/external_chromium_org
refs/heads/kitkat
media/tools/layout_tests/trend_graph_unittest.py
175
#!/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 unittest from trend_graph import TrendGraph class TestTrendGraph(unittest.TestCase): def testU...
mrinalabrol/magik
refs/heads/master
env/lib/python3.4/site-packages/pip/status_codes.py
1002
from __future__ import absolute_import SUCCESS = 0 ERROR = 1 UNKNOWN_ERROR = 2 VIRTUALENV_NOT_FOUND = 3 PREVIOUS_BUILD_DIR_ERROR = 4 NO_MATCHES_FOUND = 23
zhakui/python
refs/heads/master
renzongxian/0010/0010.py
40
# Source:https://github.com/Show-Me-the-Code/show-me-the-code # Author:renzongxian # Date:2014-12-21 # Python 3.4 """ 第 0010 题:使用 Python 生成字母验证码图片 """ from PIL import Image, ImageDraw, ImageFont import string import random def generate_authenticode(): # Generate random letters letters = ''.join([random.ch...
freevoid/yawf
refs/heads/master
yawf/serialize_utils.py
1
from datetime import datetime, date from operator import attrgetter from functools import partial from django.db import models from django.core.serializers.json import DjangoJSONEncoder from django.utils.functional import Promise from django.db.models.fields import FieldDoesNotExist from django.core import serializers...
thedrow/pytest-benchmark
refs/heads/master
src/pytest_benchmark/session.py
2
from __future__ import division from __future__ import print_function import pytest from .fixture import statistics from .fixture import statistics_error from .logger import Logger from .table import TableResults from .utils import NAME_FORMATTERS from .utils import SecondsDecimal from .utils import cached_property f...
komsas/OpenUpgrade
refs/heads/master
addons/account/wizard/account_tax_chart.py
385
# -*- 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...
ChromiumWebApps/chromium
refs/heads/master
native_client_sdk/src/build_tools/generate_make.py
3
# 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 json import os import sys import buildbot_common import build_version import getos from buildbot_common import ErrorExit from easy_template impor...
maleficarium/youtube-dl
refs/heads/master
youtube_dl/extractor/dreisat.py
10
from __future__ import unicode_literals import re from .zdf import ZDFIE class DreiSatIE(ZDFIE): IE_NAME = '3sat' _VALID_URL = r'(?:https?://)?(?:www\.)?3sat\.de/mediathek/(?:index\.php|mediathek\.php)?\?(?:(?:mode|display)=[^&]+&)*obj=(?P<id>[0-9]+)$' _TESTS = [ { 'url': 'http://www...
knossos-project/knossos_cuber
refs/heads/master
knossos_cuber/knossos_cuber_widgets.py
1
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'knossos_cuber_widgets.ui' # # Created by: PyQt5 UI code generator 5.7 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dialo...
tomacorp/thermapythia
refs/heads/master
thermpy/Mesh3D.py
2
import numpy as np class Mesh3D: def __init__(self): self.width= 1.0 self.height= 1.0 self.thickness= .059 self.layers= 2 def addLayer(self, layerName, fileName): """ Mesh3D: Square multilayer mesher class for multilayer planar thermal analysis Don't forget to order layer d...
anirudhSK/chromium
refs/heads/master
tools/cr/cr/fixups/arch.py
25
# 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. """A module for architecture output directory fixups.""" import cr class _ArchInitHookHelper(cr.InitHook): """Base class helper for CR_ARCH value fixups...
adarob/magenta
refs/heads/master
magenta/music/melodies_lib_test.py
2
# Copyright 2019 The Magenta Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
rjhunter8285/nsc-cloudproject-s22016
refs/heads/master
prototype/api/verify_oauth & blob/requests/packages/urllib3/contrib/ntlmpool.py
199
""" NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ from __future__ import absolute_import try: from http.client import HTTPSConnection except ImportError: from httplib import HTTPSConnection from logging import getLogger from nt...
aviciimaxwell/odoo
refs/heads/8.0
addons/l10n_fr/report/compute_resultant_report.py
374
# -*- coding: utf-8 -*- # # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential # consequences resulting from its eventual inadequacies and bugs # End users w...