repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
songmonit/CTTMSONLINE_V8
openerp/addons/test_new_api/tests/test_domain.py
87
1672
# -*- coding: utf-8 -*- from openerp.tests import common class test_domain(common.TransactionCase): def setUp(self): super(test_domain, self).setUp() self.bool = self.env['domain.bool'] def test_00_test_bool_undefined(self): """ Check that undefined/empty values in database i...
agpl-3.0
casparant/ali_kernel
scripts/gtp/add-ons/pe.py
4
19593
#!/usr/bin/python # This script is used to show the performance counters in graph mode # GPL # Copyright(C) Hui Zhu (teawater@gmail.com), 2011 pe_list = [] #0 type, 1 config, 2 name #typt and config can get from https://code.google.com/p/kgtp/wiki/HOWTO#How_to_use_performance_counters pe_list.append(["0","0", "CPU_C...
gpl-2.0
maohongyuan/kbengine
kbe/src/lib/python/Lib/test/test_popen.py
84
1967
"""Basic tests for os.popen() Particularly useful for platforms that fake popen. """ import unittest from test import support import os, sys # Test that command-lines get down as we expect. # To do this we execute: # python -c "import sys;print(sys.argv)" {rest_of_commandline} # This results in Python being spa...
lgpl-3.0
MycChiu/tensorflow
tensorflow/contrib/imperative/__init__.py
73
1657
# Copyright 2017 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...
apache-2.0
Jionglun/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/base.py
603
4652
#!/usr/bin/env python ## https://bitbucket.org/pygame/pygame/raw/2383b8ab0e2273bc83c545ab9c18fee1f3459c64/pygame/base.py '''Pygame core routines Contains the core routines that are used by the rest of the pygame modules. Its routines are merged directly into the pygame namespace. This mainly includes the auto-initia...
gpl-3.0
RobertWWong/WebDev
djangoApp/ENV/lib/python3.5/site-packages/django/contrib/redirects/migrations/0001_initial.py
308
1561
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ] operations = [ migrations.CreateModel( name='Redirect', fields=[ ...
mit
cassiopagnoncelli/r-packages
forinf/generator/strings.py
1
6829
import argparse import sys from copy import * # Output file. f = None # Syntactic tree is a tree whose nodes are either terminals or non-terminals. # # Terminals are essentially strings and are defined on the right-side, # lower-case of each production. # # Non-terminals, however, are defined on the left-side of each...
gpl-2.0
jounex/hue
desktop/core/ext-py/Django-1.6.10/tests/http_utils/tests.py
58
2238
from __future__ import unicode_literals import io import gzip from django.http import HttpRequest, HttpResponse, StreamingHttpResponse from django.http.utils import conditional_content_removal from django.test import TestCase # based on Python 3.3's gzip.compress def gzip_compress(data): buf = io.BytesIO() ...
apache-2.0
oliverlee/sympy
sympy/diffgeom/tests/test_class_structure.py
126
1124
from sympy.diffgeom import Manifold, Patch, CoordSystem, Point from sympy import symbols, Function m = Manifold('m', 2) p = Patch('p', m) cs = CoordSystem('cs', p, ['a', 'b']) cs_noname = CoordSystem('cs', p) x, y = symbols('x y') f = Function('f') s1, s2 = cs.coord_functions() v1, v2 = cs.base_vectors() f1, f2 = cs.b...
bsd-3-clause
utkbansal/kuma
kuma/search/tasks.py
26
2310
import logging from django.conf import settings from django.core.mail import mail_admins from celery.task import task log = logging.getLogger('kuma.search.tasks') @task def prepare_index(index_pk): """ Prepare a new index for indexing documents into. :arg index_pk: The `Index` ID to create an elastic...
mpl-2.0
moylop260/odoo-dev
openerp/addons/base/module/wizard/__init__.py
98
1276
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
puttarajubr/commcare-hq
corehq/apps/mach/forms.py
5
1187
from django.forms.fields import * from corehq.apps.sms.forms import BackendForm from dimagi.utils.django.fields import TrimmedCharField from django.core.exceptions import ValidationError from crispy_forms import layout as crispy from django.utils.translation import ugettext_lazy as _ class MachBackendForm(BackendForm...
bsd-3-clause
caseyrygt/osf.io
website/addons/dataverse/serializer.py
23
3754
from website.addons.base.serializer import OAuthAddonSerializer from website.addons.dataverse import client from website.addons.dataverse.settings import DEFAULT_HOSTS from website.util import api_url_for, web_url_for class DataverseSerializer(OAuthAddonSerializer): REQUIRED_URLS = [] # Include host informa...
apache-2.0
CTSRD-SOAAP/chromium-42.0.2311.135
third_party/webdriver/pylib/docs/source/conf.py
21
8939
# -*- coding: utf-8 -*- # # Selenium documentation build configuration file, created by # sphinx-quickstart on Thu May 12 10:57:00 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
bsd-3-clause
Jgarcia-IAS/Fidelizacion_odoo
openerp/addons/event/res_partner.py
329
1228
# -*- 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...
agpl-3.0
chaoling/test123
linux-2.6.39/Documentation/networking/cxacru-cf.py
14668
1626
#!/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...
gpl-2.0
vallihe/wizarddemo
node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py
1825
17014
# 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. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be importe...
mit
thaumos/ansible
test/units/executor/test_task_queue_manager_callbacks.py
29
4530
# (c) 2016, Steve Kuznetsov <skuznets@redhat.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) any later v...
gpl-3.0
justin8/portinus
portinus/service.py
1
2217
import subprocess import os import logging import systemd_unit import portinus log = logging.getLogger(__name__) class Service(object): def __init__(self, name, source=None): if not name: raise ValueError("Invalid value for 'name'") self.name = name self.service_name = "{}-{...
mit
caslei/TfModels
differential_privacy/multiple_teachers/aggregation.py
17
4912
# 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 required by applica...
apache-2.0
sundhaug92/binwalk
src/binwalk/plugins/dlromfsextract.py
1
6644
import os import struct import binwalk.core.plugin import binwalk.core.common try: import lzma except ImportError as e: pass class RomFSCommon(object): def _read_next_word(self): value = struct.unpack( "%sL" % self.endianess, self.data[self.index:self.index + 4])[0] self.index...
mit
romain-li/edx-platform
common/djangoapps/terrain/stubs/tests/test_http.py
172
3969
""" Unit tests for stub HTTP server base class. """ import unittest import requests import json from terrain.stubs.http import StubHttpService, StubHttpRequestHandler, require_params class StubHttpServiceTest(unittest.TestCase): def setUp(self): super(StubHttpServiceTest, self).setUp() self.serv...
agpl-3.0
marcelocure/django
django/contrib/gis/forms/fields.py
504
4316
from __future__ import unicode_literals from django import forms from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.utils.translation import ugettext_lazy as _ from .widgets import OpenLayersWidget class GeometryField(forms.Field): """ This is the basic form field for a Geometry. A...
bsd-3-clause
bcornwellmott/frappe
frappe/patches/v5_2/change_checks_to_not_null.py
58
1267
from __future__ import unicode_literals import frappe from frappe.utils import cint from frappe.model import default_fields def execute(): for table in frappe.db.get_tables(): doctype = table[3:] if frappe.db.exists("DocType", doctype): fieldnames = [df["fieldname"] for df in frappe.get_all("DocField", fie...
mit
Eksmo/calibre
src/calibre/gui2/convert/heuristics.py
9
4085
# -*- coding: utf-8 -*- __license__ = 'GPL 3' __copyright__ = '2011, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' from PyQt4.Qt import Qt from calibre.gui2 import gprefs from calibre.gui2.convert.heuristics_ui import Ui_Form from calibre.gui2.convert import Widget class HeuristicsWidg...
gpl-3.0
bdastur/os-shell
os_shell/resources.py
1
2696
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from os_shell.os_commandhelper import OSCommandHelper class Resource(object): def __init__(self): self.command_helper = OSCommandHelper(skip_cache=True) self.resource_outputfile = "/tmp/osresource.txt" self.images = None se...
mit
miniworld-project/miniworld_core
miniworld/management/serialization/ShellCommandExecutor.py
1
6703
import collections from collections import defaultdict from concurrent import futures from multiprocessing import cpu_count from ordered_set import OrderedSet from miniworld.model.singletons.Resetable import Resetable from miniworld.model.singletons.Singletons import singletons class ShellCommandSerializer(object, ...
mit
ptisserand/ansible
contrib/inventory/freeipa.py
67
3992
#!/usr/bin/env python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) import argparse from distutils.version import LooseVersion import json import os import sys from ipalib import api, errors, __version__ as IPA_VERSION from six import ...
gpl-3.0
40223202/test
static/Brython3.1.1-20150328-091302/Lib/csv.py
637
16166
""" csv.py - read/write/investigate CSV files """ import re from _csv import Error, __version__, writer, reader, register_dialect, \ unregister_dialect, get_dialect, list_dialects, \ field_size_limit, \ QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE, \ ...
agpl-3.0
ghedsouza/django
django/contrib/gis/db/backends/base/features.py
20
3345
import re from django.contrib.gis.db.models import aggregates class BaseSpatialFeatures: gis_enabled = True # Does the database contain a SpatialRefSys model to store SRID information? has_spatialrefsys_table = True # Does the backend support the django.contrib.gis.utils.add_srs_entry() utility? ...
bsd-3-clause
jostep/tensorflow
tensorflow/python/estimator/canned/dnn_linear_combined.py
11
21935
# Copyright 2017 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...
apache-2.0
stuartarchibald/numba
numba/cuda/tests/nocuda/test_import.py
4
1641
from numba.tests.support import run_in_subprocess import unittest class TestImport(unittest.TestCase): def test_no_impl_import(self): """ Tests that importing cuda doesn't trigger the import of modules containing lowering implementation that would likely install things in the built...
bsd-2-clause
skycucumber/restful
python/venv/lib/python2.7/site-packages/flup/server/fcgi_base.py
18
39423
# Copyright (c) 2002, 2003, 2005, 2006 Allan Saddi <allan@saddi.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # noti...
gpl-2.0
ossdemura/django-miniblog
src/Lib/site-packages/django/contrib/gis/db/models/query.py
46
32490
import warnings from django.contrib.gis.db.models.fields import ( GeometryField, LineStringField, PointField, get_srid_info, ) from django.contrib.gis.db.models.lookups import GISLookup from django.contrib.gis.db.models.sql import ( AreaField, DistanceField, GeomField, GMLField, ) from django.contrib.gis.geome...
mit
listamilton/supermilton.repository
plugin.video.traquinas/resources/lib/sources/__init__.py
7
39877
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
gpl-2.0
orione7/Italorione
lib/jsbeautifier/unpackers/evalbased.py
221
1171
# # Unpacker for eval() based packers, a part of javascript beautifier # by Einar Lielmanis <einar@jsbeautifier.org> # # written by Stefano Sanfilippo <a.little.coder@gmail.com> # # usage: # # if detect(some_string): # unpacked = unpack(some_string) # """Unpacker for eval() based packers: runs JS code and retu...
gpl-3.0
Antiun/odoo
addons/auth_openid/controllers/main.py
382
10399
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
yianni/rtd-dbg
qsr_lib/tests/cardir_tester.py
8
1491
#!/usr/bin/env python from __future__ import print_function, division import sys from abstractclass_unittest_dyadic import Abstractclass_Unittest_Dyadic class cardir_Test(Abstractclass_Unittest_Dyadic): def __init__(self, *args): super(cardir_Test, self).__init__(*args) self._unique_id = "cardir" ...
mit
lipro/linux-tqs
tools/perf/scripts/python/syscall-counts-by-pid.py
944
1744
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(...
gpl-2.0
dex2000/openrouteservice
build/tools/mergejs.py
73
8955
#!/usr/bin/env python # # Merge multiple JavaScript source code files into one. # # Usage: # This script requires source files to have dependencies specified in them. # # Dependencies are specified with a comment of the form: # # // @requires <file path> # # e.g. # # // @requires Geo/DataSource.js # # This scri...
mit
trevor/calendarserver
twistedcaldav/method/get.py
1
4579
## # Copyright (c) 2005-2014 Apple 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 l...
apache-2.0
anurag313/scikit-learn
sklearn/svm/tests/test_sparse.py
70
12992
from nose.tools import assert_raises, assert_true, assert_false import numpy as np from scipy import sparse from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_equal) from sklearn import datasets, svm, linear_model, base from sklearn.datasets import make_classif...
bsd-3-clause
LaoZhongGu/kbengine
kbe/src/lib/python/Lib/test/test_dummy_threading.py
182
1807
from test import support import unittest import dummy_threading as _threading import time class DummyThreadingTestCase(unittest.TestCase): class TestThread(_threading.Thread): def run(self): global running global sema global mutex # Uncomment if testing ano...
lgpl-3.0
flavour/ifrc_qa
modules/ClimateDataPortal/DSL/tests.py
53
9045
# -*- coding: utf-8 -*- ClimateDataPortal = local_import("ClimateDataPortal") Climate_DSL = local_import("ClimateDataPortal.DSL") Units = Climate_DSL.Units # tests --------------------------------------- # place/month # missing data for a key shouldn't cause misalignments - need to merge def compare(actual_units, e...
mit
mitocw/edx-platform
lms/djangoapps/instructor_task/tests/test_tasks.py
2
29965
""" Unit tests for LMS instructor-initiated background tasks. Runs tasks on answers to course problems to validate that code paths actually work. """ import json from functools import partial from uuid import uuid4 import ddt from celery.states import FAILURE, SUCCESS from django.utils.translation import ugettext_n...
agpl-3.0
tdtrask/ansible
test/units/modules/network/nxos/test_nxos_bgp_af.py
18
4175
# (c) 2016 Red Hat 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. # # Ansible is dis...
gpl-3.0
sharifmamun/ansible
v1/ansible/playbook/task.py
89
16588
# (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...
gpl-3.0
chenjun0210/tensorflow
tensorflow/python/kernel_tests/lrn_op_test.py
138
5675
# 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...
apache-2.0
Callwoola/tornado
tornado/options.py
53
20968
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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...
apache-2.0
savoirfairelinux/odoo
openerp/tools/translate.py
37
39489
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
dydek/django
tests/expressions_case/models.py
282
2853
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible try: from PIL import Image except ImportError: Image = None @python_2_unicode_compatible class CaseTestModel(models.Model): integer = models.IntegerField() integer2 = mo...
bsd-3-clause
ekiwi/tinyos-1.x
contrib/ucb/tools/jtag-usb/jtag/funclets/ihex2c.py
2
7008
#!/usr/bin/env python2.1 """ Convert Intel HEX files to C code to embed USAGE: ihex2c.py input.a43 outname [const] This generates a file named "outname.ci" which contains an array named "unsigned short funclet_outname[]". That array contains the machine code from the input file. The optional argument "const" changes...
bsd-3-clause
DavidNorman/tensorflow
tensorflow/python/eager/context.py
1
66370
# Copyright 2017 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...
apache-2.0
chutsu/robotics
prototype/tests/estimation/test_inverse_depth.py
1
1651
import unittest import numpy as np from prototype.estimation.inverse_depth import h_C from prototype.estimation.inverse_depth import feature_init from prototype.estimation.inverse_depth import camera_motion_model # from prototype.estimation.inverse_depth import linearity_index_inverse_depth # from prototype.estimatio...
gpl-3.0
initNirvana/Easyphotos
env/lib/python3.4/site-packages/pymongo/cursor.py
1
42736
# Copyright 2009-2014 MongoDB, 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 agreed to in writin...
mit
google-research/federated
dp_ftrl/training_loop.py
1
13558
# Copyright 2021, Google LLC. # # 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...
apache-2.0
Mistobaan/tensorflow
tensorflow/contrib/tensor_forest/python/tensor_forest.py
12
26438
# 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 required by applica...
apache-2.0
spblightadv/rethinkdb
test/rql_test/connections/http_support/flask/testsuite/config.py
556
11820
# -*- coding: utf-8 -*- """ flask.testsuite.config ~~~~~~~~~~~~~~~~~~~~~~ Configuration and instances. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys import flask import pkgutil import unittest from contextlib import contextmanager fr...
agpl-3.0
insomnia-lab/calibre
src/calibre/gui2/lrf_renderer/main.py
6
13501
__license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' import sys, logging, os, traceback, time from PyQt4.QtGui import QKeySequence, QPainter, QDialog, QSpinBox, QSlider, QIcon from PyQt4.QtCore import Qt, QObject, SIGNAL, QCoreApplication, QThread from calibre import __appname__, set...
gpl-3.0
quantumlib/ReCirq
recirq/quantum_chess/quantum_moves.py
1
6764
# Copyright 2020 Google # # 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 # # Unless required by applicable law or agreed to in writing, soft...
apache-2.0
Just-D/chromium-1
tools/telemetry/third_party/gsutilz/third_party/boto/boto/awslambda/__init__.py
113
1677
# Copyright (c) 2015 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 ...
bsd-3-clause
yashsharan/sympy
sympy/matrices/tests/test_matrices.py
2
89169
import collections import random from sympy import ( Abs, Add, E, Float, I, Integer, Max, Min, N, Poly, Pow, PurePoly, Rational, S, Symbol, cos, exp, oo, pi, signsimp, simplify, sin, sqrt, symbols, sympify, trigsimp, tan, sstr, diff) from sympy.matrices.matrices import (ShapeError, MatrixError, NonSqua...
bsd-3-clause
xylsxyls/xueyelingshuang
src/ScreenScript/scripts/rebuild_ScreenScript.py
1
14097
#!python3 # -*- coding:utf-8 -*- import os import sys import time import ctypes import shutil import subprocess IsPy3 = sys.version_info[0] >= 3 if IsPy3: import winreg else: import codecs import _winreg as winreg BuildType = 'Release' IsRebuild = True Build = 'Rebuild' Update = False Copy = False CleanAl...
mit
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/sysconfig.py
765
26958
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Access to Python's configuration information.""" import codecs import os import re import sys from os.path import pardir, realpath try: import configparser except ImportError: import Conf...
gpl-2.0
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/pandas/computation/ops.py
9
15234
"""Operator classes for eval. """ import operator as op from functools import partial from datetime import datetime import numpy as np import pandas as pd from pandas.compat import PY3, string_types, text_type import pandas.core.common as com from pandas.core.base import StringMixin from pandas.computation.common im...
gpl-2.0
dracos/django
tests/extra_regress/tests.py
38
16053
import datetime from collections import OrderedDict from django.contrib.auth.models import User from django.test import TestCase from .models import Order, RevisionableModel, TestObject class ExtraRegressTests(TestCase): def setUp(self): self.u = User.objects.create_user( username="fred", ...
bsd-3-clause
noplay/aiohttp
examples/web_srv.py
13
1679
#!/usr/bin/env python3 """Example for aiohttp.web basic server """ import asyncio import textwrap from aiohttp.web import Application, Response, StreamResponse def intro(request): txt = textwrap.dedent("""\ Type {url}/hello/John {url}/simple or {url}/change_body in browser url bar """).forma...
apache-2.0
benhowell/pycsw
pycsw/plugins/repository/geonode/geonode_.py
2
6233
# -*- coding: iso-8859-15 -*- # ================================================================= # # Authors: Tom Kralidis <tomkralidis@gmail.com> # # Copyright (c) 2015 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files...
mit
vrbagalkote/avocado-misc-tests-1
memory/memtester.py
1
3039
#!/usr/bin/env python # 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 is distributed in the hope that i...
gpl-2.0
xujb/odoo
addons/mrp_operations/report/mrp_workorder_analysis.py
312
3336
# -*- 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...
agpl-3.0
dronzer1010/flipflop
node_modules/nodeunit/node_modules/tap/node_modules/yamlish/yamlish-py/test/test_writer.py
140
3309
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import unittest import test import yamlish test_data_list = [ { "name": 'Simple scalar', "in": 1, "out": """\ --- 1 ... """, }, { "name": 'Undef', "in": None, "out": """\ --- ~...
gpl-2.0
SuperPichu/trumpBot
index.py
1
1026
#!/usr/bin/python3 import io import random import json import urllib import urllib2 import re def application(req,resp): # Json String of format { # "group_id":"bot_id" # } botstr = '' bots = json.loads(botstr) data = json.loads(req['wsgi.input'].read(int(req.get('CONTENT_LENGTH',0)))) tex...
gpl-3.0
perwin/imfit
python/diff_printouts.py
1
2385
#!/usr/bin/env python # Python script for comparing two text files (e.g., save output from running imfit), # with options for how many lines to skip at beginning or end. # Prints " OK." if they match, or prints trimmed diff if they don't. # # The script uses sys.exit() to return either 0 for success or 1 for some kind...
gpl-3.0
miptliot/edx-platform
openedx/core/djangoapps/user_api/verification_api/tests/test_views.py
11
4207
""" Tests for API endpoints. """ from __future__ import unicode_literals import datetime import freezegun import json from django.conf import settings from django.core.urlresolvers import reverse from django.test import TestCase from django.test.utils import override_settings from lms.djangoapps.verify_student.model...
agpl-3.0
nelmiux/CarnotKE
jyhton/lib-python/2.7/idlelib/TreeWidget.py
89
15231
# XXX TO DO: # - popup menu # - support partial or total redisplay # - key bindings (instead of quick-n-dirty bindings on Canvas): # - up/down arrow keys to move focus around # - ditto for page up/down, home/end # - left/right arrows to expand/collapse & move out/in # - more doc strings # - add icons for "file", ...
apache-2.0
LostItem/roundware-server
roundware/rw/migrations/0003_uimode_to_choice.py
9
1907
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def ui_mode_foreign_to_char(apps, schema_editor): """ Convert all MasterUI.ui_mode foreign key data to char values so the UIMode Table can be dropped. Original database table: mysql> select * ...
lgpl-3.0
Maximilian-Reuter/SickRage-1
lib/hachoir_core/field/field.py
84
8646
""" Parent of all (field) classes in Hachoir: Field. """ from hachoir_core.compatibility import reversed from hachoir_core.stream import InputFieldStream from hachoir_core.error import HachoirError, HACHOIR_ERRORS from hachoir_core.log import Logger from hachoir_core.i18n import _ from hachoir_core.tools import makePr...
gpl-3.0
strongcoins/strongcoin
contrib/pyminer/pyminer.py
1257
6438
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file license.txt or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib im...
mit
ewdurbin/httpbin
httpbin/filters.py
33
1789
# -*- coding: utf-8 -*- """ httpbin.filters ~~~~~~~~~~~~~~~ This module provides response filter decorators. """ import gzip as gzip2 import zlib from six import BytesIO from decimal import Decimal from time import time as now from decorator import decorator from flask import Flask, Response app = Flask(__name__...
isc
leisir2017/dyp
app/tools/volume.py
1
4253
#! /usr/bin/env python3 ''' VOLUME CALCULATION STL binary MODELS Author: Mar Canet (mar.canet@gmail.com) - september 2012 Description: useful to calculate cost in a 3D printing ABS or PLA usage Modified by: Author: Saijin_Naib (Synper311@aol.com) Date: 2016-06-26 03:55:13.879187 Description: Added input call for print...
apache-2.0
edx/edx-notes-api
notesserver/docker_gunicorn_configuration.py
1
1487
""" gunicorn configuration file: http://docs.gunicorn.org/en/develop/configure.html """ import multiprocessing preload_app = True timeout = 300 bind = "0.0.0.0:8120" workers = 2 def pre_request(worker, req): worker.log.info("%s %s" % (req.method, req.path)) def close_all_caches(): # Close the cache so that...
agpl-3.0
v-iam/azure-sdk-for-python
azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/container_registry_management_client.py
2
3693
# 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 ...
mit
onoga/wm
src/gnue/forms/uidrivers/_base/rpc/RemoteHive.py
1
2991
from __future__ import with_statement #import weakref import sys import thread from collections import deque from outconv import outconv class RemoteHive(object): _debug = False def __init__(self, id): self.__id = id self.__objects = {} #weakref.WeakValueDictionary() self.__calls = deque() self.__callsLoc...
gpl-2.0
PongPi/isl-odoo
addons/google_calendar/__openerp__.py
299
1671
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
miladh/lgn-simulator
apps/edog/run_edog.py
1
2806
from subprocess import call from shutil import copyfile import os, os.path import yaml import numpy as np import sys current_path = os.path.dirname(os.path.realpath(__file__)) sys.path.append(os.path.abspath(os.path.join(current_path,"../../tools"))) import sumatra_tracking.run_simulator as st def modify_num_spatial...
gpl-3.0
DavidAndreev/indico
indico/MaKaC/services/implementation/base.py
1
14124
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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...
gpl-3.0
eltonsantos/django
django/contrib/staticfiles/views.py
10
1596
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ import os import posixpath try: from urllib.parse import unquote except ImportError: # Python 2 from urllib import unquote from django.conf import settings fr...
bsd-3-clause
junmin-zhu/chromium-rivertrail
native_client_sdk/src/tools/oshelpers.py
2
14787
#!/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 fnmatch import glob import optparse import os import posixpath import shutil import sys import time import zipfile def Inc...
bsd-3-clause
scenarios/tensorflow
tensorflow/python/kernel_tests/control_flow_ops_py_test.py
15
95035
# 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...
apache-2.0
ChrisAntaki/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/gtk.py
113
8060
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
stuarteberg/numpy
numpy/linalg/setup.py
78
1735
from __future__ import division, print_function import os import sys def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info config = Configuration('linalg', parent_package, top_path) config.add_data_dir...
bsd-3-clause
fangxingli/hue
desktop/core/ext-py/simplejson/simplejson/tests/test_scanstring.py
125
3835
import sys import decimal from unittest import TestCase import simplejson as json import simplejson.decoder class TestScanString(TestCase): def test_py_scanstring(self): self._test_scanstring(simplejson.decoder.py_scanstring) def test_c_scanstring(self): if not simplejson.decoder.c_scanstring...
apache-2.0
pajlada/tyggbot
pajbot/web/utils.py
2
6573
import datetime import json import logging import urllib.parse from functools import update_wrapper from functools import wraps from flask import abort from flask import make_response from flask import request from flask import session from flask_restful import reqparse import pajbot.exc import pajbot.managers from p...
mit
francesco-mannella/dmp-esn
parametric/parametric_dmp/bin/tr_datasets/e_cursive_curves/data/results/plot.py
18
1043
#!/usr/bin/env python import glob import numpy as np import matplotlib.pyplot as plt import os import sys pathname = os.path.dirname(sys.argv[0]) if pathname: os.chdir(pathname) n_dim = None trains = [] for fname in glob.glob("tl*"): t = np.loadtxt(fname) trains.append(t) tests = [] for fname in glob...
gpl-2.0
Simran-B/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/lib2to3/main.py
49
4921
""" Main program for 2to3. """ import sys import os import logging import shutil import optparse from . import refactor class StdoutRefactoringTool(refactor.RefactoringTool): """ Prints output to stdout. """ def __init__(self, fixers, options, explicit, nobackups): self.nobackups = nobackup...
apache-2.0
jlnaudin/x-drone
MissionPlanner-master/packages/IronPython.StdLib.2.7.4/content/Lib/smtpd.py
76
18543
#! /usr/bin/env python """An RFC 2821 smtp proxy. Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]] Options: --nosetuid -n This program generally tries to setuid `nobody', unless this flag is set. The setuid call will fail if this program is not run as root (in ...
gpl-3.0
googleapis/python-pubsub
google/pubsub_v1/services/schema_service/transports/grpc_asyncio.py
1
20603
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
apache-2.0
randomshinichi/QRL
src/qrl/generated/qrlwallet_pb2_grpc.py
1
24662
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc import qrl.generated.qrlwallet_pb2 as qrlwallet__pb2 class WalletAPIStub(object): """////////////////////////// ////////////////////////// ////////////////////////// //// API /////// ////////////////////////// ///...
mit
ekadhanda/bin
python/velfix-ispec.py
1
6257
#! /usr/bin/env python # Written by Vasaant S/O Krishnan. Wednesday, 27 September 2017. # Run without arguments for instructions. import re import sys from pylab import * usrFile = sys.argv[1:] if len(usrFile) == 0: print "# velfix-ispec.py converts the freqency from the output of ISPEC to" print "# velocit...
mit
lowitty/server
libsLinux/twisted/protocols/gps/nmea.py
11
8016
# -*- test-case-name: twisted.test.test_nmea -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ NMEA 0183 implementation Maintainer: Bob Ippolito The following NMEA 0183 sentences are currently understood:: GPGGA (fix) GPGLL (position) GPRMC (position and time) GPGSA (act...
mit