repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
opencolorado/OpenColorado-Tools-and-Utilities
Scripts/Harvest/Drcog/ckanclient/__init__.py
4
21170
__version__ = '0.9' __description__ = 'The CKAN client Python package.' __long_description__ = \ '''The CKAN client software may be used to make requests on the Comprehensive Knowledge Archive Network (CKAN) API including its REST interface to all primary objects (packages, groups, tags) and its search interface. Syno...
apache-2.0
afrendeiro/pipelines
lib/fix_bedfile_genome_boundaries.py
1
1086
#!/usr/bin/env python import csv import sys def getChrSizes(chrmFile): """ Reads tab-delimiter file with two rows describing the chromossomes and its lengths. Returns dictionary of chr:sizes. """ with open(chrmFile, 'r') as f: chrmSizes = {} for line in enumerate(f): ro...
gpl-2.0
hgrif/incubator-airflow
airflow/www/validators.py
28
1875
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
mysql/mysql-utilities
mysql/utilities/common/charsets.py
4
4465
# # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. # # 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; version 2 of the License. # # This program is distributed in the hope...
gpl-2.0
tsai1993/aisixiang
01.download_1.py
1
2415
#!/usr/bin/python3 import os from urllib.request import urlopen from bs4 import BeautifulSoup import pandas import time # 读取 00.get_metadata.R 获取的相关目录信息 D0 = pandas.read_csv("all_aisixiang_2017-05-24.csv") # 意外中断时,可以修改 j 的值 j = 0 D = D0[j:] for i in D['ID']: Url = "http://www.aisixiang.com/data/" + str(i) + ".h...
mpl-2.0
rvalyi/l10n-brazil
l10n_br_account_service/models/res_company.py
1
2477
# -*- coding: utf-8 -*- # Copyright (C) 2009 Renato Lima - Akretion # # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, fields, api from openerp.addons.l10n_br_account.models.l10n_br_account import ( L10nBrTaxDefinition ) class ResComp...
agpl-3.0
rossasa/server-tools
sql_export/sql_export.py
9
2103
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 Akretion (<http://www.akretion.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
znoland3/zachdemo
venvdir/lib/python3.4/site-packages/setuptools/command/alias.py
455
2426
from distutils.errors import DistutilsOptionError from setuptools.extern.six.moves import map from setuptools.command.setopt import edit_config, option_base, config_file def shquote(arg): """Quote an argument for later parsing by shlex.split()""" for c in '"', "'", "\\", "#": if c in arg: ...
mit
VitalPet/odoo
addons/hr_expense/report/hr_expense_report.py
52
6694
# -*- 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
slightperturbation/Cobalt
ext/emsdk_portable/emscripten/tag-1.34.1/tools/jsrun.py
2
3613
import time, os, sys, logging from subprocess import Popen, PIPE, STDOUT TRACK_PROCESS_SPAWNS = True if (os.getenv('EM_BUILD_VERBOSE') and int(os.getenv('EM_BUILD_VERBOSE')) >= 3) else False def timeout_run(proc, timeout=None, note='unnamed process', full_output=False): start = time.time() if timeout is not None:...
apache-2.0
grzes/djangae
djangae/db/backends/appengine/compiler.py
7
3820
#LIBRARIES import django from django.db.models.sql import compiler from django.db.models.expressions import Value, OrderBy from django.db.models.sql.query import get_order_dir #DJANGAE from .commands import ( SelectCommand, InsertCommand, UpdateCommand, DeleteCommand ) class SQLCompiler(compiler.SQL...
bsd-3-clause
jasonflorack/OS-tweets
app/UserInterface.py
1
13307
import os import webbrowser import json from app.ListenerInterface import ListenerInterface from app.SearcherInterface import SearcherInterface class UserInterface: def __init__(self): super(UserInterface, self).__init__() self._auth = None self._search_terms = '' self._num_tweets ...
mit
invitu/odoomrp-wip
account_treasury_forecast/wizard/wiz_create_invoice.py
31
2577
# -*- encoding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the...
agpl-3.0
weimingtom/python-for-android
python3-alpha/extra_modules/gdata/apps/adminsettings/service.py
48
13680
#!/usr/bin/python # # Copyright (C) 2008 Google, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
OpenMined/PySyft
packages/grid/apps/domain/src/main/core/model_centric/tasks/cycle.py
1
1084
# stdlib import logging import traceback # grid relative from ....utils.executor import executor def run_task_once(name, func, *args): future = executor.futures._futures.get(name) logging.info("future: %s" % str(future)) logging.info("futures count: %d" % len(executor.futures._futures)) # prevent run...
apache-2.0
petrutlucian94/cinder
cinder/tests/unit/test_backup_ceph.py
19
49997
# Copyright 2013 Canonical Ltd. # 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 b...
apache-2.0
Lh4cKg/brython
www/src/Lib/unittest/test/test_break.py
785
8138
import gc import io import os import sys import signal import weakref import unittest @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 " "if threa...
bsd-3-clause
maxolasersquad/ninja-ide
ninja_ide/core/file_handling/filesystem_notifications/linux.py
8
5070
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE 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 # any later version. # # NIN...
gpl-3.0
konstruktoid/ansible-upstream
lib/ansible/parsing/vault/__init__.py
3
57055
# (c) 2014, James Tanner <tanner.jc@gmail.com> # (c) 2016, Adrian Likins <alikins@redhat.com> # (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com> # # 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, eith...
gpl-3.0
markhamstra/spark
examples/src/main/python/ml/train_validation_split.py
56
2841
# # 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
synth3tk/the-blue-alliance
models/award.py
4
3235
import json from google.appengine.ext import ndb from models.event import Event from models.team import Team class Award(ndb.Model): """ Awards represent FIRST Robotics Competition awards given out at an event. key_name is formatted as: <event_key_name>_<award_type_enum> If multiple recipients win t...
mit
ticosax/django
django/core/cache/backends/locmem.py
586
4287
"Thread-safe in-memory cache backend." import time from contextlib import contextmanager from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.utils.synch import RWLock try: from django.utils.six.moves import cPickle as pickle except ImportError: import pickle # Global in-memor...
bsd-3-clause
wooga/airflow
airflow/migrations/versions/4446e08588_dagrun_start_end.py
7
1372
# # 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...
apache-2.0
nburn42/tensorflow
tensorflow/python/ops/io_ops.py
14
16185
# 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
adaussy/eclipse-monkey-revival
plugins/python/org.eclipse.eclipsemonkey.lang.python/Lib/test/test_copy_reg.py
129
4256
import copy_reg import unittest from test import test_support from test.pickletester import ExtensionSaver class C: pass class WithoutSlots(object): pass class WithWeakref(object): __slots__ = ('__weakref__',) class WithPrivate(object): __slots__ = ('__spam',) class WithSingleString(object): ...
epl-1.0
guorendong/iridium-browser-ubuntu
third_party/chromite/lib/graphite_lib/statsd_mock_unittest.py
2
1605
# Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unittest for statsd mock.""" from __future__ import print_function import unittest from chromite.lib.graphite_lib import statsd_mock as statsd clas...
bsd-3-clause
duyet-website/api.duyet.net
api/clean_datetime.py
1
1037
# Clean import datetime as dt import time import datetime from utils import * def is_present(date_text): return date_text.upper() == 'NOW' def get_current(): return dt.datetime.now().date() def clean_datetime(date_text): if not isinstance(date_text, basestring): return None # Parse from text date...
mit
Backflipz/plugin.video.excubed
resources/lib/js2py/prototypes/jsregexp.py
54
1252
class RegExpPrototype: def toString(): flags = u'' if this.glob: flags += u'g' if this.ignore_case: flags += u'i' if this.multiline: flags += u'm' v = this.value if this.value else '(?:)' return u'/%s/'%v + flags def test(stri...
gpl-2.0
chirilo/remo
vendor-local/lib/python/unidecode/x0a4.py
252
4437
data = ( 'qiet', # 0x00 'qiex', # 0x01 'qie', # 0x02 'qiep', # 0x03 'quot', # 0x04 'quox', # 0x05 'quo', # 0x06 'quop', # 0x07 'qot', # 0x08 'qox', # 0x09 'qo', # 0x0a 'qop', # 0x0b 'qut', # 0x0c 'qux', # 0x0d 'qu', # 0x0e 'qup', # 0x0f 'qurx', # 0x10 'qur', # 0x11 ...
bsd-3-clause
unnikrishnankgs/va
venv/lib/python3.5/site-packages/google/protobuf/wrappers_pb2.py
8
11378
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/wrappers.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import ref...
bsd-2-clause
yunqu/PYNQ
pynq/lib/pmod/pmod_grove_ledbar.py
4
6752
# Copyright (c) 2016, Xilinx, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of ...
bsd-3-clause
pdebuyl/lammps
doc/utils/converters/lammpsdoc/rst_anchor_check.py
4
2189
#! /usr/bin/env python3 # LAMMPS Documentation Utilities # # Scan for duplicate anchor labels in documentation files # # Copyright (C) 2017 Richard Berger # # 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 F...
gpl-2.0
BT-ojossen/l10n-switzerland
l10n_ch_account_statement_base_import/parsers/postfinance_file_parser.py
1
12859
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, David Wulliamoz # 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 ...
agpl-3.0
redhawkci/omniEvents
examples/python/pullsupp.py
2
8708
# Package : omniEvents # pullsupp.py Created : 16/11/2003 # Author : Alex Tingle # # Copyright (C) 2003-2004 Alex Tingle. # # This file is part of the omniEvents application. # # omniEvents is free software; you can redistribute it and...
lgpl-2.1
Venturi/oldcms
env/lib/python2.7/site-packages/PIL/ImageFilter.py
87
6618
# # The Python Imaging Library. # $Id$ # # standard filters # # History: # 1995-11-27 fl Created # 2002-06-08 fl Added rank and mode filters # 2003-09-15 fl Fixed rank calculation in rank filter; added expand call # # Copyright (c) 1997-2003 by Secret Labs AB. # Copyright (c) 1995-2002 by Fredrik Lundh. # # See t...
apache-2.0
SlimRemix/android_external_chromium_org
tools/telemetry/telemetry/core/platform/profiler/monsoon.py
29
10196
# 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. """Interface for a USB-connected Monsoon power meter. http://msoon.com/LabEquipment/PowerMonitor/ Currently Unix-only. Relies on fcntl, /dev, and /tmp. """ ...
bsd-3-clause
jashandeep-sohi/python-blowfish
blowfish.py
1
49719
# vim: filetype=python3 tabstop=2 expandtab fileencoding=utf-8 # blowfish # Copyright (C) 2015 Jashandeep Sohi <jashandeep.s.sohi@gmail.com> # # 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, ei...
gpl-3.0
mkennedy04/knodj
env/Lib/site-packages/django/db/migrations/topological_sort.py
538
1129
def topological_sort_as_sets(dependency_graph): """Variation of Kahn's algorithm (1962) that returns sets. Takes a dependency graph as a dictionary of node => dependencies. Yields sets of items in topological order, where the first set contains all nodes without dependencies, and each following set co...
mit
bkirui/odoo
addons/lunch/wizard/lunch_validation.py
440
1296
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
giserh/SFrame
oss_src/unity/python/sframe/meta/asttools/mutators/remove_trivial.py
15
4065
''' Created on Aug 3, 2011 @author: sean ''' from __future__ import print_function import _ast import ast from ...asttools.visitors.graph_visitor import GraphGen from ...asttools import Visitor, dont_visit, visit_children from ...asttools.mutators.replace_mutator import replace_nodes from ...asttools.visitors.symbol_...
bsd-3-clause
ahkscript/sjBot
commands/##monsterhunter/help.py
1
1542
#!/usr/bin/env python3 import inspect owner = False aliases = ['helpmeplz'] def help(con, sjBot, commands, trigger, host, channel, command=None): """Shows information about commands.""" if command is None: output = [] output.append('Here is a list of commands: {}.'.format(', '.join( ...
gpl-3.0
mccheung/kbengine
kbe/res/scripts/common/Lib/ctypes/test/test_keeprefs.py
105
4058
from ctypes import * import unittest class SimpleTestCase(unittest.TestCase): def test_cint(self): x = c_int() self.assertEqual(x._objects, None) x.value = 42 self.assertEqual(x._objects, None) x = c_int(99) self.assertEqual(x._objects, None) def test_ccharp(sel...
lgpl-3.0
kangkot/arangodb
3rdParty/V8-4.3.61/build/gyp/test/errors/gyptest-errors.py
117
1722
#!/usr/bin/env python # 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. """ Test that two targets with the same name generates an error. """ import TestGyp import TestCmd # TODO(sbc): Remove the use of match_re...
apache-2.0
cbenhagen/buildozer
buildozer/target.py
5
3157
from sys import exit def no_config(f): f.__no_config = True return f class Target(object): def __init__(self, buildozer): super(Target, self).__init__() self.buildozer = buildozer self.build_mode = 'debug' self.platform_update = False def check_requirements(self): ...
mit
benschmaus/catapult
third_party/gsutil/third_party/rsa/rsa/randnum.py
194
2414
# -*- 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
bsd-3-clause
zhanqxun/cv_fish
win32/lib/winnt.py
9
40681
# Generated by h2py from \mssdk\include\winnt.h APPLICATION_ERROR_MASK = 536870912 ERROR_SEVERITY_SUCCESS = 0 ERROR_SEVERITY_INFORMATIONAL = 1073741824 ERROR_SEVERITY_WARNING = -2147483648 ERROR_SEVERITY_ERROR = -1073741824 MINCHAR = 128 MAXCHAR = 127 MINSHORT = 32768 MAXSHORT = 32767 MINLONG = -2147483648 ...
apache-2.0
alephu5/Soundbyte
environment/lib/python3.3/site-packages/IPython/parallel/apps/iploggerapp.py
14
2907
#!/usr/bin/env python # encoding: utf-8 """ A simple IPython logger application Authors: * MinRK """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the ...
gpl-3.0
amondnet/gitinspector
gitinspector/timeline.py
47
8918
# coding: utf-8 # # Copyright © 2012-2013 Ejwa Software. All rights reserved. # # This file is part of gitinspector. # # gitinspector 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 Lic...
gpl-3.0
civisanalytics/ansible
lib/ansible/modules/cloud/docker/docker_login.py
26
10928
#!/usr/bin/python # # (c) 2016 Olaf Kilian <olaf.kilian@symanex.com> # Chris Houseknecht, <house@redhat.com> # James Tanner, <jtanner@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 ...
gpl-3.0
varunarya10/nova_test_latest
nova/tests/unit/objects/test_pci_device.py
22
11196
# Copyright (c) 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
lehinevych/cfme_tests
utils/tests/test_wait.py
2
2434
# -*- coding: utf-8 -*- # pylint: disable=W0621 import pytest import time from functools import partial from utils.wait import wait_for, TimedOutError pytestmark = [ pytest.mark.nondestructive, pytest.mark.skip_selenium, ] class Incrementor(): value = 0 def i_sleep_a_lot(self): time.sleep(.1...
gpl-2.0
mszewczy/odoo
addons/l10n_lu/scripts/tax2csv.py
257
7763
from collections import OrderedDict import csv import xlrd def _e(s): if type(s) is unicode: return s.encode('utf8') elif s is None: return '' else: return str(s) def _is_true(s): return s not in ('F', 'False', 0, '', None, False) class LuxTaxGenerator: def __init__(s...
agpl-3.0
lduarte1991/edx-platform
openedx/core/djangoapps/content/block_structure/api.py
25
1921
""" Higher order functions built on the BlockStructureManager to interact with a django cache. """ from django.core.cache import cache from xmodule.modulestore.django import modulestore from .manager import BlockStructureManager def get_course_in_cache(course_key): """ A higher order function implemented on ...
agpl-3.0
chanceraine/nupic
tests/swarming/nupic/swarming/experiments/field_threshold_temporal/permutations.py
38
5399
# ---------------------------------------------------------------------- # 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...
agpl-3.0
40223114/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/numbers.py
883
10398
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for numbers, according to PEP 3141. TODO: Fill out more detailed documentation on the operators.""" from abc import ABCMeta, abstractmethod __all__ = ["Number", "Complex", "Real", "Rat...
gpl-3.0
rwl/PyCIM
CIM15/IEC61970/Informative/InfWork/TypeMaterial.py
1
7646
# Copyright (C) 2010-2011 Richard Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish...
mit
teslaji/homebase
venv/HomeBase/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py
1004
9544
# The default socket timeout, used by httplib to indicate that no timeout was # specified by the user from socket import _GLOBAL_DEFAULT_TIMEOUT import time from ..exceptions import TimeoutStateError # A sentinel value to indicate that no timeout was specified by the user in # urllib3 _Default = object() def current...
gpl-3.0
avanov/django
tests/gis_tests/test_measure.py
325
7363
""" Distance and Area objects to allow for sensible and convenient calculation and conversions. Here are some tests. """ import unittest from django.contrib.gis.measure import A, D, Area, Distance class DistanceTest(unittest.TestCase): "Testing the Distance object" def testInit(self): "Testing init...
bsd-3-clause
TeutoNet-Netzdienste/ansible
v2/ansible/inventory/expand_hosts.py
148
4326
# (c) 2012, Zettar Inc. # Written by Chin Fang <fangchin@zettar.com> # # This file is part of Ansible # # This module 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 y...
gpl-3.0
mhnatiuk/phd_sociology_of_religion
scrapper/build/Twisted/twisted/scripts/htmlizer.py
53
1787
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # """HTML pretty-printing for Python source code.""" __version__ = '$Revision: 1.8 $'[11:-2] from twisted.python import htmlizer, usage from twisted import copyright import os, sys header = '''<html><head> <title>%(title)s</title> <meta name=...
gpl-2.0
petrvanblokland/Xierpa3
xierpa3/components/logo.py
1
3750
# -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # xierpa server # Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com # # X I E R P A 3 # Distribution by the MIT License. # # -----------------------------------------------------------...
mit
ambikeshwar1991/sandhi-2
module/gr36/gr-filter/examples/interpolate.py
13
8584
#!/usr/bin/env python # # Copyright 2009,2012 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 optio...
gpl-3.0
adrn/TwoFace
twoface/data.py
1
1645
# Third-party import astropy.units as u from astropy.time import Time import numpy as np from thejoker.data import RVData def star_to_apogeervdata(star, clean=False): """Return a `twoface.data.APOGEERVData` instance for this star. Parameters ---------- """ jd = [] rv = [] rv_rand_err = [...
mit
robdennis/sideboard
tests/plugins/manypackages/multi/env/lib/python2.7/site-packages/paver/svn.py
13
2061
"""Convenience functions for working with svn. This module does not include any tasks, only functions. At this point, these functions do not use any kind of library. They require the svn binary on the path.""" from paver.easy import sh, Bunch, path def _format_revision(revision): if revision: revision =...
bsd-3-clause
dharamgollapudi/jaikuengine
common/templatetags/test/format.py
30
3368
# -*- coding: utf-8 -*- # Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
nkgilley/home-assistant
homeassistant/components/avri/sensor.py
2
2931
"""Support for Avri waste curbside collection pickup.""" import logging from avri.api import Avri, AvriException from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_ID, DEVICE_CLASS_TIMESTAMP from homeassistant.exceptions import PlatformNotReady from homeassistant.helpers.entity ...
apache-2.0
PhloxAR/PhloxAR-dc1394
dc1394/frame.py
1
6790
# ----------------------------------------------------------------------------- # # -*- coding: utf-8 -*- # # phlox-libdc1394/phloxar-dc1394/frame.py # # Copyright (C) 2016, by Matthias Yang Chen <matthias_cy@outlook.com> # All rights reserved. # # phlox-libdc1394 is free software: you can redistribute it and/or modify...
gpl-3.0
sudheesh001/oh-mainline
vendor/packages/requests/requests/packages/urllib3/fields.py
1007
5833
import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Cont...
agpl-3.0
vladmm/intellij-community
python/helpers/pycharm/lettuce_runner.py
43
8795
# coding=utf-8 """ BDD lettuce framework runner TODO: Support other params (like tags) as well. Supports only 2 params now: folder to search "features" for or file and "-s scenario_index" """ import inspect import optparse import os import _bdd_utils __author__ = 'Ilya.Kazakevich' from lettuce.exceptions import Reason...
apache-2.0
hectoruelo/scrapy
scrapy/commands/runspider.py
109
3523
import sys import os from importlib import import_module from scrapy.utils.spider import iter_spider_classes from scrapy.commands import ScrapyCommand from scrapy.exceptions import UsageError from scrapy.utils.conf import arglist_to_dict def _import_file(filepath): abspath = os.path.abspath(filepath) dirname...
bsd-3-clause
lhotchkiss/mousetrap
src/mousetrap/ocvfw/_ocv.py
1
16960
# # Copyright 2009 Flavio Percoco Premoli # # This file is part of Ocvfw. # # Ocvfw is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License v2 as published # by the Free Software Foundation. # # Ocvfw is distributed in the hope that it will be useful, # but WITHOUT...
gpl-2.0
justyns/emacs-for-python
python-libs/ropemacs/__init__.py
10
19234
"""ropemacs, an emacs mode for using rope refactoring library""" import sys import ropemode.decorators import ropemode.environment import ropemode.interface from Pymacs import lisp from rope.base import utils class LispUtils(ropemode.environment.Environment): def ask(self, prompt, default=None, starting=None): ...
gpl-3.0
jamiejackherer/pyFilm
pyfilm/GoogleScraper/caching.py
2
20407
# -*- coding: utf-8 -*- import os import time import hashlib import gzip import bz2 import re from sqlalchemy.orm.exc import NoResultFound from GoogleScraper.database import SearchEngineResultsPage from GoogleScraper.parsing import parse_serp from GoogleScraper.output_converter import store_serp_result import logging ...
mit
xzturn/tensorflow
tensorflow/python/keras/applications/mobilenet.py
2
20221
# 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
lakewik/storj-gui-client
UI/__init__.py
1
2608
# -*- coding: utf-8 -*- from __future__ import absolute_import import sys import os import click import logging import logging.config as config from logging import handlers APP_NAME = 'storj-gui' """(str): the application name.""" def setup_logging(): """Reads the Storj GUI logging configuration from logg...
mit
FinalAngel/django-cms
cms/tests/test_signals.py
4
4334
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth import get_user_model from django.test import TestCase from django.test.utils import override_settings from cms.api import create_page from cms.models import UrlconfRevision from cms.signals import urls_need_reloading from cms.test_utils...
bsd-3-clause
sensepost/Snoopy
snoopy/server/transforms/fetchAllDomains.py
4
2606
#!/usr/bin/python # -*- coding: utf-8 -*- # glenn@sensepost.com # Snoopy // 2012 # By using this code you agree to abide by the supplied LICENSE.txt import sys import os from Maltego import * import stawk_db import logging import datetime from common import * logging.basicConfig(level=logging.DEBUG,filename='/tmp/m...
mit
dntt1/youtube-dl
youtube_dl/extractor/lynda.py
2
9214
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_str, compat_urlparse, ) from ..utils import ( ExtractorError, int_or_none, urlencode_postdata, ) class LyndaBaseIE(InfoExtractor): _SIGNIN_URL = 'https://ww...
unlicense
evansd/django
tests/template_tests/syntax_tests/test_invalid_string.py
440
2310
from django.test import SimpleTestCase from ..utils import setup class InvalidStringTests(SimpleTestCase): libraries = {'i18n': 'django.templatetags.i18n'} @setup({'invalidstr01': '{{ var|default:"Foo" }}'}) def test_invalidstr01(self): output = self.engine.render_to_string('invalidstr01') ...
bsd-3-clause
SerialShadow/SickRage
tests/tv_tests.py
7
3699
# coding=UTF-8 # Author: Dennis Lutter <lad1337@gmail.com> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either vers...
gpl-3.0
WangYueFt/jieba
test/parallel/test2.py
65
4527
#encoding=utf-8 from __future__ import print_function import sys sys.path.append("../../") import jieba jieba.enable_parallel(4) def cuttest(test_sent): result = jieba.cut(test_sent,cut_all=True) for word in result: print(word, "/", end=' ') print("") if __name__ == "__main__": cuttest("这是一个...
mit
thiagopnts/servo
components/script/dom/bindings/codegen/ply/ply/lex.py
344
40739
# ----------------------------------------------------------------------------- # ply: lex.py # # Copyright (C) 2001-2009, # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ar...
mpl-2.0
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/django/conf/locale/pl/formats.py
115
1147
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y' TIME_FORMAT = 'H:i' DATETI...
bsd-3-clause
hybrideagle/django
django/db/backends/base/operations.py
192
22514
import datetime import decimal import warnings from importlib import import_module from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends import utils from django.utils import six, timezone from django.utils.dateparse import parse_duration from django.utils.dep...
bsd-3-clause
niranjan94/open-event-orga-server
app/helpers/request_context_task.py
17
3427
""" Celery task wrapper to set request context vars and global vars when a task is executed Based on http://xion.io/post/code/celery-include-flask-request-context.html """ from celery import Task from flask import has_request_context, request, g from app import current_app as app __all__ = ['RequestContextTask'] cl...
gpl-3.0
chengdh/openerp-ktv
openerp/addons/auction/report/catalog2.py
9
6984
# -*- 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
bhairavmehta95/flashcard-helper-alexa-skill
pymysql/constants/CR.py
27
2228
# flake8: noqa # errmsg.h CR_ERROR_FIRST = 2000 CR_UNKNOWN_ERROR = 2000 CR_SOCKET_CREATE_ERROR = 2001 CR_CONNECTION_ERROR = 2002 CR_CONN_HOST_ERROR = 2003 CR_IPSOCK_ERROR = 2004 CR_UNKNOWN_HOST = 2005 CR_SERVER_GONE_ERROR = 2006 CR_VERSION_ERROR = 2007 CR_OUT_OF_MEMORY = 2008 CR_WRONG_HOST_INFO = 2009 CR_LOCALHOST_...
mit
morristech/POSTMan-Chrome-Extension
tests/selenium/pmtests/postman_tests_history.py
104
3459
from optparse import OptionParser from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.select import Select from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.keys import Keys import selenium.webdriver.chrome....
apache-2.0
junzis/py-adsb-decoder
setup.py
1
4319
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject Steps for deploying a new verison: 1. Increase the version number 2. remove the old deployment under [dist] folder 3. run: python setup.py sdist run: python setup.py bdist_wheel -...
mit
sdague/home-assistant
homeassistant/components/blueprint/importer.py
2
4760
"""Import logic for blueprint.""" from dataclasses import dataclass import re from typing import Optional import voluptuous as vol import yarl from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import aiohttp_client, config_validation as cv ...
apache-2.0
arameshkumar/base-nuxeo-drive
nuxeo-drive-client/nxdrive/tests/test_conflicts.py
2
12533
import time import shutil from nxdrive.tests.common import OS_STAT_MTIME_RESOLUTION from nxdrive.tests.common_unit_test import UnitTestCase from nxdrive.osi import AbstractOSIntegration from nose.plugins.skip import SkipTest class TestConflicts(UnitTestCase): def setUp(self): super(TestConflicts, self)....
lgpl-2.1
tdmsinc/three.js
utils/exporters/blender/addons/io_three/exporter/geometry.py
11
12378
import os from .. import constants, logger from . import base_classes, io, api FORMAT_VERSION = 3 class Geometry(base_classes.BaseNode): def __init__(self, node, parent=None): logger.debug('Geometry().__init__(%s)', node) #@TODO: maybe better to have `three` constants for # ...
mit
LuxoftAKutsan/sdl_core
src/3rd_party-static/jsoncpp/amalgamate.py
20
6606
"""Amalgate json-cpp library sources into a single source and header file. Requires Python 2.6 Example of invocation (must be invoked from json-cpp top directory): python amalgate.py """ import os import os.path import sys class AmalgamationFile: def __init__( self, top_dir ): self.top_dir = top_dir ...
bsd-3-clause
simonwydooghe/ansible
lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_info.py
13
7153
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
benjystanton/F2D-Prototype
node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/ninja.py
372
89149
# Copyright (c) 2013 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. import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import gyp import gyp.common impo...
mit
pjbriggs/tools-iuc
tools/ncbi_entrez_eutils/ecitmatch.py
10
2254
#!/usr/bin/env python from __future__ import print_function import argparse import eutils if __name__ == '__main__': parser = argparse.ArgumentParser(description='ECitMatch', epilog='') parser.add_argument('--file', type=argparse.FileType('r'), help='Tabular file containing citations to search') parser...
mit
lgarren/spack
var/spack/repos/builtin/packages/py-iminuit/package.py
3
1800
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
wangzw/tushare
test/ref_test.py
36
1507
# -*- coding:utf-8 -*- ''' Created on 2015/3/14 @author: Jimmy Liu ''' import unittest from tushare.stock import reference as fd class Test(unittest.TestCase): def set_data(self): self.code = '600848' self.start = '2015-01-03' self.end = '2015-04-07' self.year = 2014...
bsd-3-clause
enkiv2/popcorn_maker
vendor-local/lib/python/easy_thumbnails/tests/files.py
4
5945
from os import path from easy_thumbnails import files, utils, signals from easy_thumbnails.tests import utils as test_utils from easy_thumbnails.conf import settings try: from PIL import Image except ImportError: import Image class FilesTest(test_utils.BaseTest): def setUp(self): super(FilesTest...
bsd-3-clause
appuio/ansible-role-openshift-zabbix-monitoring
vendor/openshift-tools/ansible/roles/lib_openshift_3.2/library/oc_version.py
2
33688
#!/usr/bin/env python # pylint: disable=too-many-lines # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| # | |) | (_) ...
apache-2.0