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
mastbaum/rat-pac
python/SCons/Scanner/RC.py
19
2060
"""SCons.Scanner.RC This module implements the depenency scanner for RC (Interface Definition Language) files. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associ...
bsd-3-clause
jptomo/rpython-lang-scheme
rpython/translator/backendopt/test/test_inline.py
1
18891
# XXX clean up these tests to use more uniform helpers import py from rpython.flowspace.model import Variable, Constant, checkgraph from rpython.translator.backendopt import canraise from rpython.translator.backendopt.inline import (simple_inline_function, CannotInline, auto_inlining, Inliner, collect_called_graphs...
mit
noseka1/ansible-modules-core
cloud/amazon/ec2_facts.py
110
6444
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
gpl-3.0
yjmade/odoo
addons/product/product.py
2
64153
# -*- 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
salvacarrion/orange3-recommendation
doc/source/conf.py
1
9746
# -*- coding: utf-8 -*- # # Orange3-Recommendation documentation build configuration file, created by # sphinx-quickstart on Tue Jun 14 15:50:45 2016. # # 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 # autogenera...
bsd-2-clause
deepsrijit1105/edx-platform
lms/djangoapps/badges/tests/test_models.py
17
11642
""" Tests for the Badges app models. """ from django.core.exceptions import ValidationError from django.core.files.images import ImageFile from django.core.files.storage import default_storage from django.db.utils import IntegrityError from django.test import TestCase from django.test.utils import override_settings fro...
agpl-3.0
matthew-tucker/mne-python
mne/stats/permutations.py
28
5474
"""T-test with permutations """ # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Fernando Perez (bin_perm_rep function) # # License: Simplified BSD from math import sqrt import numpy as np from ..parallel import parallel_func from .. import verbose def bin_perm_rep(ndim, a=0, b=1)...
bsd-3-clause
ferabra/edx-platform
openedx/core/djangoapps/content/course_structures/api/v0/serializers.py
65
1313
""" API Serializers """ from rest_framework import serializers class GradingPolicySerializer(serializers.Serializer): """ Serializer for course grading policy. """ assignment_type = serializers.CharField(source='type') count = serializers.IntegerField(source='min_count') dropped = serializers.IntegerF...
agpl-3.0
ininex/geofire-python
resource/lib/python2.7/site-packages/gcloud/datastore/key.py
7
13622
# Copyright 2014 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...
mit
leture/sorl-thumbnail
sorl/thumbnail/kvstores/cached_db_kvstore.py
10
2035
from django.core.cache import cache, InvalidCacheBackendError from sorl.thumbnail.compat import get_cache from sorl.thumbnail.kvstores.base import KVStoreBase from sorl.thumbnail.conf import settings from sorl.thumbnail.models import KVStore as KVStoreModel class EMPTY_VALUE(object): pass class KVStore(KVStoreB...
bsd-3-clause
dermoth/gramps
gramps/gen/filters/rules/repository/_allrepos.py
6
1602
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # 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 you...
gpl-2.0
johnnyliu27/openmc
tests/unit_tests/test_lattice.py
2
10647
from math import sqrt import xml.etree.ElementTree as ET import openmc import pytest @pytest.fixture(scope='module') def pincell1(uo2, water): cyl = openmc.ZCylinder(R=0.35) fuel = openmc.Cell(fill=uo2, region=-cyl) moderator = openmc.Cell(fill=water, region=+cyl) univ = openmc.Universe(cells=[fuel,...
mit
uclaros/QGIS
tests/src/python/test_qgsnumericformat.py
30
45541
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsNumericFormat .. 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, or (at your option) any later version. """ _...
gpl-2.0
waile23/todo
models/pdtodo.py
1
4441
#!/usr/bin/env python # coding: utf-8 from basemodel import * import math from datetime import datetime class PDtodo(BaseModel): table_name="pd_todo" db_name = web.config.write_db_name def get_by_id(self, id): s = self.reader().select(self.table_name, where='t_id=$id', vars={'id':id}) ...
mit
cliffe/SecGen
modules/utilities/unix/ctf/metactf/files/repository/src_angr/07_angr_symbolic_file/scaffold07.py
7
5656
# This challenge could, in theory, be solved in multiple ways. However, for the # sake of learning how to simulate an alternate filesystem, please solve this # challenge according to structure provided below. As a challenge, once you have # an initial solution, try solving this in an alternate way. # # Problem descript...
gpl-3.0
ericmckean/syzygy
third_party/numpy/files/numpy/distutils/command/config_compiler.py
101
4288
from distutils.core import Command from numpy.distutils import log #XXX: Linker flags def show_fortran_compilers(_cache=[]): # Using cache to prevent infinite recursion if _cache: return _cache.append(1) from numpy.distutils.fcompiler import show_fcompilers import distutils.core dist = distuti...
apache-2.0
wetek-enigma/enigma2
lib/python/Screens/InputBox.py
29
5008
from enigma import getPrevAsciiCode from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.ActionMap import NumberActionMap from Components.Label import Label from Components.Input import Input from Components.config import config from Tools.BoundFunction import boundFunction from T...
gpl-2.0
jjmleiro/hue
desktop/core/ext-py/Paste-2.0.1/paste/reloader.py
33
6046
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ A file monitor and server restarter. Use this like: ..code-block:: Python import reloader reloader.install() Then make sure your server...
apache-2.0
mohierf/shinken
shinken/brok.py
15
2026
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can r...
agpl-3.0
JoshRosen/spark
python/pyspark/sql/functions.py
10
79330
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
david415/magic-wormhole
src/wormhole/servers/transit_server.py
1
5023
from __future__ import print_function import re from twisted.internet import protocol from twisted.application import service SECONDS = 1.0 MINUTE = 60*SECONDS HOUR = 60*MINUTE DAY = 24*HOUR MB = 1000*1000 class TransitConnection(protocol.Protocol): def __init__(self): self.got_token = False self....
mit
jm-begon/scikit-learn
examples/linear_model/plot_lasso_lars.py
363
1080
#!/usr/bin/env python """ ===================== Lasso path using LARS ===================== Computes Lasso Path along the regularization parameter using the LARS algorithm on the diabetes dataset. Each color represents a different feature of the coefficient vector, and this is displayed as a function of the regulariza...
bsd-3-clause
Stavitsky/nova
nova/cmd/api_os_compute.py
27
1497
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a ...
apache-2.0
ChronoMonochrome/android_external_chromium_org
tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
23
15916
# 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. import logging import os import re import subprocess import sys import time from telemetry.core import exceptions from telemetry.core import util from telem...
bsd-3-clause
akhan7/servo
tests/wpt/css-tests/css-text-decor-3_dev/xhtml1/support/generate-text-emphasis-style-property-tests.py
841
3434
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-style-property-011 ~ 020 which cover all possible values of text-emphasis-style property, except none and <string>, with horizontal writing mode. It outputs a list of all tests it generated in the format of Mozilla reftest....
mpl-2.0
x2nie/odoo
addons/base_iban/__openerp__.py
52
1766
# -*- 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
omnirom/android_external_chromium-org
tools/telemetry/telemetry/timeline/empty_timeline_data_importer_unittest.py
43
1376
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry.timeline import empty_timeline_data_importer from telemetry.timeline import tracing_timeline_data class EmptyTimelineDataIm...
bsd-3-clause
2013Commons/hue
desktop/core/ext-py/lxml/doc/mkhtml.py
29
5344
from docstructure import SITE_STRUCTURE, HREF_MAP, BASENAME_MAP from lxml.etree import (parse, fromstring, ElementTree, Element, SubElement, XPath) import os, shutil, re, sys, copy, time RST2HTML_OPTIONS = " ".join([ '--no-toc-backlinks', '--strip-comments', '--language en', '--...
apache-2.0
titasakgm/brc-stock
openerp/addons/account/wizard/account_move_line_reconcile_select.py
56
2399
# -*- 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
deeplook/bokeh
bokeh/sphinxext/bokeh_gallery.py
51
3370
""" Generate a gallery of Bokeh plots from a configuration file. """ from __future__ import absolute_import import json from os import makedirs from os.path import abspath, dirname, exists, join from docutils import nodes from docutils.parsers.rst.directives import unchanged from docutils.statemachine import ViewLis...
bsd-3-clause
badloop/SickRage
lib/hachoir_core/field/basic_field_set.py
74
4776
from hachoir_core.field import Field, FieldError from hachoir_core.stream import InputStream from hachoir_core.endian import BIG_ENDIAN, LITTLE_ENDIAN, MIDDLE_ENDIAN from hachoir_core.event_handler import EventHandler class ParserError(FieldError): """ Error raised by a field set. @see: L{FieldError} ...
gpl-3.0
longmen21/edx-platform
openedx/core/djangoapps/programs/utils.py
2
15972
# -*- coding: utf-8 -*- """Helper functions for working with Programs.""" import datetime import logging from urlparse import urljoin from django.conf import settings from django.core.urlresolvers import reverse from django.utils import timezone from django.utils.text import slugify from opaque_keys.edx.keys import Co...
agpl-3.0
lshain-android-source/external-chromium_org
content/browser/gpu/generate_webgl_conformance_test_list.py
38
3326
#!/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. """Auto-generates the WebGL conformance test list header file. Parses the WebGL conformance test *.txt file, which contains a list...
bsd-3-clause
mcclatchy/lunchbox
app.py
10
1982
#!/usr/bin/env python """ Example application views. Note that `render_template` is wrapped with `make_response` in all application routes. While not necessary for most Flask apps, it is required in the App Template for static publishing. """ from datetime import datetime import app_config import json import static ...
mit
andrewyoung1991/abjad
abjad/tools/timespantools/test/test_timespantools_Timespan_starts_at_or_after_offset.py
2
1066
# -*- encoding: utf-8 -*- from abjad import * def test_timespantools_Timespan_starts_at_or_after_offset_01(): timespan = timespantools.Timespan(0, 10) offset = durationtools.Offset(-5) assert timespan.starts_at_or_after_offset(offset) def test_timespantools_Timespan_starts_at_or_after_offset_02(): ti...
gpl-3.0
janusnic/youtube-dl-GUI
youtube_dl/extractor/naver.py
31
3100
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, ) from ..utils import ( ExtractorError, clean_html, ) class NaverIE(InfoExtractor): _VALID_URL = r'https?://(?:m\.)?tvcast\.naver\.com/v/(?P<id>\d+)' ...
mit
perryjrandall/arsenalsuite
cpp/lib/sip/custom/mkcustom.py
11
2673
"""This Python script uses the SIP build system to create a Makefile for building a custom Python interpreter. The script doesn't take any command line flags - just edit it to suit your needs. You will also need to edit custom.c or customw.c. """ import sys import sipconfig # Get the SIP configuration. cfg = sipc...
gpl-2.0
youprofit/ansible
lib/ansible/plugins/lookup/__init__.py
79
1905
# (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
ArtezGDA/MappingTheCity-Data
CitiesAndPopulations/scrape_wiki_cities.py
1
4162
#!/usr/bin/python # scrape_wiki_cities.py import wikipedia from bs4 import BeautifulSoup import urllib import json from tqdm import tqdm def appendLinkToCities(link, cityNameList, cityDictList): if link and link.has_attr('title'): cityName = link['title'] # remove duplicates and broken pages if cityName and n...
mit
google-code-export/pyglet
pyglet/canvas/__init__.py
23
4900
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * R...
bsd-3-clause
caphrim007/ansible
test/units/modules/cloud/amazon/test_aws_s3.py
67
1100
import pytest import unittest try: import ansible.modules.cloud.amazon.aws_s3 as s3 except ImportError: pytestmark = pytest.mark.skip("This test requires the s3 Python libraries") from ansible.module_utils.six.moves.urllib.parse import urlparse boto3 = pytest.importorskip("boto3") class TestUrlparse(unitt...
gpl-3.0
sirkubax/ansible
lib/ansible/plugins/action/fetch.py
22
7416
# (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
azunite/chrome_build
third_party/gsutil/gslib/addlhelp/naming.py
51
8316
# Copyright 2012 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...
bsd-3-clause
bniemczyk/distorm
examples/tests/test_distorm3.py
35
70565
# # Gil Dabah 2006, http://ragestorm.net/distorm # Tests for diStorm3 # import os import distorm3 from distorm3 import * import struct import unittest import random REG_NONE = 255 _REGISTERS = ["RAX", "RCX", "RDX", "RBX", "RSP", "RBP", "RSI", "RDI", "R8", "R9", "R10", "R11", "R12", "R13", "R14", "R15", ...
gpl-3.0
drougge/carrot_tower
game/main.py
1
22642
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- import pygame from pygame.locals import * from operator import add, sub, mul, div from math import hypot, atan2, degrees, ceil from time import sleep WIDTH, HEIGHT = 1280, 720 # damn projector SCALE = 32 SCALE2 = (SCALE, SCALE) MIDDLE = (SCALE // 2 - 1, SCALE // 2 - ...
mit
bregman-arie/ansible
lib/ansible/modules/windows/win_say.py
24
4031
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE...
gpl-3.0
codeworldprodigy/lab4
lib/werkzeug/testapp.py
303
9398
# -*- coding: utf-8 -*- """ werkzeug.testapp ~~~~~~~~~~~~~~~~ Provide a small test application that can be used to test a WSGI server and check it for WSGI compliance. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ impo...
apache-2.0
Smarsh/django
django/db/models/manager.py
306
7872
from django.utils import copycompat as copy from django.conf import settings from django.db import router from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet from django.db.models import signals from django.db.models.fields import FieldDoesNotExist def ensure_default_manager(sender, ...
bsd-3-clause
gaddman/ansible
test/units/modules/network/f5/test_bigip_gtm_topology_region.py
17
4038
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # 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 import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
javierTerry/odoo
addons/auth_ldap/users_ldap.py
133
10812
############################################################################## # # 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 Affero General Publ...
agpl-3.0
kevalds51/sympy
sympy/series/series_class.py
89
3031
""" Contains the base class for series Made using sequences in mind """ from __future__ import print_function, division from sympy.core.expr import Expr from sympy.core.singleton import S from sympy.core.cache import cacheit from sympy.core.compatibility import integer_types class SeriesBase(Expr): """Base Clas...
bsd-3-clause
ltilve/ChromiumGStreamerBackend
tools/telemetry/telemetry/internal/platform/tracing_controller_backend.py
9
3062
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from telemetry.core import discover from telemetry.core import util from telemetry.internal.platform import tracing_agent from telemetry.internal....
bsd-3-clause
AlertaDengue/AlertaDengue
AlertaDengue/dados/tests/test_view.py
1
4288
# coding=utf-8 from django.conf import settings from django.test import TestCase import unittest from unittest import skip from django.urls import reverse import json import os class TestAlertaStaticPageView(TestCase): def test_about(self): response = self.client.get(reverse('dados:about')) self...
gpl-3.0
ocervell/flask-flash
flask_flash/flask_sqlalchemy_patch.py
1
3149
""" flask_sqlalchemy_patch.py ~ Maintainer: Olivier Cervello. Description: This Flask-SQLAlchemy patch adds the ability to add 'Base' db models using the Flask-SQLAlchemy `db` object: Example use: ``` from sqlalchemy.ext.declarative import declarative_base from flask_flash import db Base = declarati...
mit
ArthurVal/RIDDLE_naoqi_bridge
naoqi_tools/scripts/blender/io_export_visual.py
6
2743
#! /usr/bin/env python # Copyright (C) 2014 Aldebaran # # 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 ...
bsd-3-clause
tomaszroszko/rsfab
rsfab/git_deploy.py
1
3273
""" Helper functions to setup project using git Requires project helper functions Requires env.git_branch or env.git_tag Requires env.git_url """ import os, re from fabric.api import sudo, run, env from fabric.operations import get from project import in_project GIT_COMMIT_FIELDS = ['id', 'author_nam...
bsd-3-clause
spblightadv/rethinkdb
external/v8_3.30.33.16/tools/ll_prof.py
52
34087
#!/usr/bin/env python # # Copyright 2012 the V8 project authors. 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 # noti...
agpl-3.0
adamlerer/examples
mnist_hogwild/main.py
1
2407
from __future__ import print_function import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.multiprocessing as mp from train import train # Training settings parser = argparse.ArgumentParser(description='PyTorch MNIST Example') parser.add_argument('--batch-size', type=int, de...
bsd-3-clause
nabsboss/CouchPotatoServer
libs/guessit/hash_mpc.py
150
1884
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2011 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
xujun10110/kombu
kombu/tests/transport/virtual/test_scheduling.py
38
1835
from __future__ import absolute_import from kombu.transport.virtual.scheduling import FairCycle from kombu.tests.case import Case class MyEmpty(Exception): pass def consume(fun, n): r = [] for i in range(n): r.append(fun()) return r class test_FairCycle(Case): def test_cycle(self): ...
bsd-3-clause
joshua2352-cmis/joshua2352-cmis-cs2
wakeup.py
1
1142
import math def begin(): print "This will find the average of stuuff" def main(n1,n2,n3,n4,n5): n1=raw_input("what is the 1st number 0-10:") if float(n1)> 10 or float(n1) <= 0: return"that is not within range" zero1() n2=raw_input("what is the 2nd number 0-10:") if float(n2)> 10 or fl...
cc0-1.0
lmallin/coverage_test
python_venv/lib/python2.7/site-packages/numpy/polynomial/tests/test_polyutils.py
202
3094
"""Tests for polyutils module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.polyutils as pu from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_module_suite) class TestMisc(TestCase): def...
mit
ufal/lindat-kontext
lib/plugins/default_taghelper/fetchers/positional.py
2
1181
# Copyright (c) 2019 Charles University, Faculty of Arts, # Institute of the Czech National Corpus # Copyright (c) 2019 Martin Zimandl <martin.zimandl@gmail.com> # Copyright (c) 2019 Tomas Machalek <tomas.machalek@gmail.com> # # This program is free software; you can redistribute it and/or # modify i...
gpl-2.0
stevehuang/GarageEye
classifier/predict_NN.py
2
5619
import common.log as logging import common.config as Conf import os #signal, errno import predict from time import localtime from datetime import time from re import match #from os import listdir, path, makedirs from exceptions import RuntimeWarning from warnings import simplefilter from scipy import io #from shutil i...
apache-2.0
heeraj123/oh-mainline
vendor/packages/gdata/src/gdata/tlslite/SessionCache.py
358
3470
"""Class for caching TLS sessions.""" import thread import time class SessionCache: """This class is used by the server to cache TLS sessions. Caching sessions allows the client to use TLS session resumption and avoid the expense of a full handshake. To use this class, simply pass a SessionCache ins...
agpl-3.0
xiaoyaozi5566/DiamondCache
src/python/m5/SimObject.py
6
42197
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
KanoComputing/kano-apps
kano_apps/AppManage.py
1
6269
# AppManage.py # # Copyright (C) 2014-2016 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2 # # Download, install and remove apps import os import json import time import requests from kano_apps.utils import get_dpkg_dict from kano.utils import run_cmd, download_url, has_min_performa...
gpl-2.0
k3nnyfr/s2a_fr-nsis
s2a/Python/Lib/encodings/cp720.py
417
13694
"""Python Character Mapping Codec cp720 generated on Windows: Vista 6.0.6002 SP2 Multiprocessor Free with the command: python Tools/unicode/genwincodec.py 720 """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,error...
gpl-3.0
anthonysandrin/kafka-utils
tests/acceptance/steps/offset_advance.py
1
2358
# -*- coding: utf-8 -*- # Copyright 2016 Yelp 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 ...
apache-2.0
jiangwei1221/django-virtualenv-demo
env/lib/python2.7/site-packages/django/contrib/auth/tests/urls.py
105
4961
from django.conf.urls import patterns, url from django.contrib.auth import context_processors from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.urls import urlpatterns from django.contrib.auth.views import password_reset, login from django.contrib.auth.decorators import login_required fr...
unlicense
anisku11/sublimeku
Packages/CodeComplice/libs/codeintel2/oop/driver.py
8
41438
#!/usr/bin/env python2 try: # codeintel will attempt to import xpcom; make sure that's working by # explicitly importing xpcom._xpcom, otherwise xpcom.xpt will fail to # import import xpcom import xpcom._xpcom except ImportError: pass import codeintel2.accessor import codeintel2.buffer import ...
mit
Kast0rTr0y/ansible
lib/ansible/modules/system/setup.py
16
5737
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, 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...
gpl-3.0
tensorflow/datasets
tensorflow_datasets/proto/waymo_dataset_generated_pb2.py
1
63691
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets 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 appl...
apache-2.0
yencarnacion/jaikuengine
.google_appengine/lib/django-1.2/django/contrib/localflavor/in_/in_states.py
296
1859
""" A mapping of state misspellings/abbreviations to normalized abbreviations, and an alphabetical list of states for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ STATE_CHOICES = ( ('KA', 'Karnataka'), ('AP', 'Andhra Pr...
apache-2.0
jeremiahyan/lammps
tools/python/neb_final.py
51
1761
#!/usr/bin/env python # make new dump file from final snapshots from multiple NEB replica dumps # Syntax: neb_final.py -switch arg(s) -switch arg(s) ... # -o outfile = new dump file # snapshots numbered 1 to M = # of replicas # -r dump1 dump2 ... = replica dump files of NEB atoms # ...
gpl-2.0
EBII/account-invoicing
sale_order_partial_invoice/__init__.py
34
1024
# -*- coding: utf-8 -*- ############################################################################## # # Author: Alexandre Fayolle # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # p...
agpl-3.0
cccfran/sympy
bin/coverage_doctest.py
14
21445
#!/usr/bin/env python """ Program to test that all methods/functions have at least one example doctest. Also checks if docstrings are imported into Sphinx. For this to work, the Sphinx docs need to be built first. Use "cd doc; make html" to build the Sphinx docs. Usage: ./bin/coverage_doctest.py sympy/core or ./...
bsd-3-clause
overtherain/scriptfile
software/googleAppEngine/lib/simplejson/simplejson/jsonfilter.py
178
1662
import simplejson import cgi class JSONFilter(object): def __init__(self, app, mime_type='text/x-json'): self.app = app self.mime_type = mime_type def __call__(self, environ, start_response): # Read JSON POST input to jsonfilter.json if matching mime type response = {'status': ...
mit
xianggong/m2c_unit_test
test/relational/bitselect_uint16uint16uint16/compile.py
1861
4430
#!/usr/bin/python import os import subprocess import re def runCommand(command): p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) p.wait() return iter(p.stdout.readline, b'') def dumpRunCommand(command,...
gpl-2.0
google-code-export/pymssql
tests/test_config.py
8
3687
from __future__ import with_statement from os import path, makedirs, environ import shutil from nose.plugins.skip import SkipTest import _mssql from .helpers import tmpdir config_dump_path = path.join(tmpdir, 'freetds-config-dump.txt') def setup_module(): if not path.isdir(tmpdir): makedirs(tmpdir) cla...
lgpl-2.1
kojiagile/CLAtoolkit
clatoolkit_project/dataintegration/plugins/blogrss/cladi_plugin.py
4
8386
from dataintegration.core.plugins import registry from dataintegration.core.plugins.base import DIBasePlugin, DIPluginDashboardMixin from dataintegration.core.importer import * from dataintegration.core.di_utils import * #Formerly dataintegration.core.recipepermissions from xapi.statement.builder import * #Formerly da...
gpl-3.0
atzengin/OCC
occ/occ_ocvc/blks2/__init__.py
37
1115
# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. ...
gpl-3.0
ntu-dsi-dcn/ntu-dsi-dcn
src/flow-monitor/bindings/modulegen__gcc_ILP32.py
14
334507
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
ljnutal6/media-recommend
app/virtualenvs/recommedia/lib/python2.7/site-packages/werkzeug/testsuite/http.py
89
18911
# -*- coding: utf-8 -*- """ werkzeug.testsuite.http ~~~~~~~~~~~~~~~~~~~~~~~ HTTP parsing utilities. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest from datetime import datetime from werkzeug.testsuite import WerkzeugTestCase from werkzeug....
gpl-2.0
aarchiba/scipy
scipy/optimize/tests/test_constraints.py
6
6606
from __future__ import division, print_function, absolute_import import pytest import numpy as np from numpy.testing import TestCase, assert_array_equal import scipy.sparse as sps from scipy.optimize._constraints import ( Bounds, LinearConstraint, NonlinearConstraint, PreparedConstraint, new_bounds_to_old, old_...
bsd-3-clause
larroy/mxnet
example/quantization/imagenet_gen_qsym.py
5
10748
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
HyperBaton/ansible
test/units/modules/network/f5/test_bigip_trunk.py
22
4247
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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 import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
rapilabs/django
django/db/migrations/state.py
94
25662
from __future__ import unicode_literals import copy from collections import OrderedDict from contextlib import contextmanager from django.apps import AppConfig from django.apps.registry import Apps, apps as global_apps from django.conf import settings from django.db import models from django.db.models.fields.proxy im...
bsd-3-clause
ebar0n/django
django/db/backends/postgresql/schema.py
15
6402
import psycopg2 from django.db.backends.base.schema import BaseDatabaseSchemaEditor class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_alter_column_type = "ALTER COLUMN %(column)s TYPE %(type)s USING %(column)s::%(type)s" sql_create_sequence = "CREATE SEQUENCE %(sequence)s" sql_delete_sequence =...
bsd-3-clause
jlspyaozhongkai/Uter
third_party_backup/Python-2.7.9/Lib/ctypes/test/test_win32.py
23
4353
# Windows specific tests from ctypes import * from ctypes.test import requires import unittest, sys from test import test_support as support import _ctypes_test # Only windows 32-bit has different calling conventions. @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') @unittest.skipUnless(sizeof(...
gpl-3.0
NewpTone/stacklab-nova
nova/tests/monkey_patch_example/__init__.py
29
1151
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/...
apache-2.0
hyperborea/python-sampler
tests/test_fields.py
1
1830
import unittest from datetime import datetime, date from sampler import * class TestSamplerFields(unittest.TestCase): def assertField(self, field, value): class G(Sampler): pass setattr(G, 'field', field) self.assertEqual(G().seed(1337).generate()['field'], value) def te...
mit
anuyens/robotframework-selenium2library
build_dist.py
66
2390
#!/usr/bin/env python import os, sys, shutil, subprocess, argparse THIS_DIR = os.path.dirname(os.path.abspath(__file__)) DIST_DIR = os.path.join(THIS_DIR, "dist") sys.path.append(os.path.join(THIS_DIR, "src", "Selenium2Library")) sys.path.append(os.path.join(THIS_DIR, "doc")) sys.path.append(os.path.join(THIS_DIR, "d...
apache-2.0
TRESCLOUD/odoopub
extra-addons/report_geraldo/__openerp__.py
6
3231
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
lewiskan/heron
heron/tools/tracker/src/python/topology_helpers.py
8
11702
# Copyright 2016 Twitter. 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 agree...
apache-2.0
kirca/OpenUpgrade
addons/website_event/controllers/main.py
88
11555
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
asherkhb/coge
bin/last_wrapper/Bio/PDB/Dice.py
3
1992
# Copyright (C) 2002, Thomas Hamelryck (thamelry@binf.ku.dk) # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. import re import warnings from Bio.PDB.PDBIO import PDBIO _hydrogen=re.compile("[123 ]*...
bsd-2-clause
okuta/chainer
tests/chainer_tests/functions_tests/math_tests/test_sign.py
8
1375
import numpy from chainer import functions from chainer import testing from chainer import utils @testing.parameterize(*testing.product({ 'shape': [(3, 2), ()], 'dtype': [numpy.float16, numpy.float32, numpy.float64], })) @testing.fix_random() @testing.inject_backend_tests( None, # CPU tests [ ...
mit
jakevdp/scipy
scipy/linalg/tests/test_decomp_polar.py
126
2797
from __future__ import division, print_function, absolute_import import numpy as np from numpy.linalg import norm from numpy.testing import (assert_, assert_allclose, assert_equal, run_module_suite) from scipy.linalg import polar, eigh diag2 = np.array([[2, 0], [0, 3]]) a13 = np.array([[1, 2, 2]]) precomputed_c...
bsd-3-clause
neuroidss/nupic.research
projects/capybara/sandbox/classification/plot_raw_sensortag_data.py
9
2428
#!/usr/bin/env python # ---------------------------------------------------------------------- # 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 ...
agpl-3.0