code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.
#
# This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA.
#
# SIPPY is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | hgascon/pulsar | pulsar/core/sippy/SipAlso.py | Python | bsd-3-clause | 1,219 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/xs/NonNegativeIntegerType.py | Python | gpl-3.0 | 1,045 |
from __future__ import division
import time, csv, os.path
from math import log, exp
#from mpmath import loggamma
from operator import itemgetter, gt, ge
from functools import partial
from itertools import imap, starmap, repeat, groupby, ifilter, tee, izip, islice
from random import shuffle
from Code.AlignUtils import p... | JudoWill/ResearchNotebooks | StatUtils.py | Python | mit | 6,489 |
#!/usr/bin/python
# Copyright 2014 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
# Test the handling of toolset.add-requirements
import BoostBuild
t = BoostBuild.Tester(pass_toolset=0, ignore_toolset_requi... | davehorton/drachtio-server | deps/boost_1_77_0/tools/build/test/toolset_requirements.py | Python | mit | 933 |
'''
Rearrange a given array so that Arr[i] becomes Arr[Arr[i]] with O(1) extra space.
Example:
array = {1, 0} after rearrange array = {0, 1}
4, 0, 2, 1, 3 -> [3, 4, 2, 0, 1]
Lets say N = size of the array. Then, following holds true :
* All elements in the array are in the range [0, N-1]
* N * N does not overfl... | timotheus/python-patterns | algo/exercise/rearrange.py | Python | unlicense | 649 |
DFITCSECRspInfoField = {
"requestID": "int",
"sessionID": "int",
"accountID": "string",
"errorID": "int",
"localOrderID": "int",
"spdOrderID": "int",
"errorMsg": "string",
}
DFITCSECRspNoticeField = {
"noticeMsg": "string",
}
DFITCSECReqUserLoginField = {
"requestID": "int",
"a... | bigdig/vnpy | vnpy/api/sec/generator/DFITC_struct.py | Python | mit | 49,441 |
#!/usr/bin/python
#----------------------------------------------------------------------
# Copyright (c) 2013-2016 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without rest... | GENI-NSF/gram | src/gram/am/gram/consistency.py | Python | mit | 6,258 |
# Generated by Django 2.2.6 on 2019-11-15 11:23
from django.db import migrations
import olympia.hero.models
from . import blank_featured_images
class Migration(migrations.Migration):
dependencies = [
('hero', '0004_auto_20191021_0831'),
]
operations = [
migrations.RunPython(blank_featu... | eviljeff/olympia | src/olympia/hero/migrations/0005_auto_20191115_1123.py | Python | bsd-3-clause | 1,070 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Event matching
"""
def bipartite_match(graph):
"""
Find maximum cardinality matching of a bipartite graph (U,V,E).
Function is borrowed from mir_eval toolbox (https://github.com/craffel/mir_eval).
The input format is a dictionary mapping members of U t... | TUT-ARG/sed_eval | sed_eval/util/event_matching.py | Python | mit | 3,690 |
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2001-2006 Donald N. Allingham
# Copyright (C) 2008 Gary Burton
# Copyright (C) 2010 Nick Hall
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU G... | SNoiraud/gramps | gramps/plugins/lib/libplaceview.py | Python | gpl-2.0 | 22,039 |
class List(object):
def __init__(self, l=[]):
self._list = list(l)
def append(self, x):
self._list.append(x)
def remove(self, x):
self._list.remove(x)
def __str__(self):
return str(self._list)
class A(List):
def my_append(self, a):
self.append(a)
a = A(... | naitoh/py2rb | tests/lists/subclass2.py | Python | mit | 394 |
import codecs
__memory_storage = {}
def file_read(path):
with codecs.open(path, 'r', 'utf-8') as f:
return f.read()
def file_write(path, text):
with codecs.open(path, 'w', 'utf-8') as f:
return f.write(text)
def memory_write(key, data):
__memory_storage[key] = data
STORAGES = {
'fil... | antfu/biconfigs | biconfigs/storages.py | Python | mit | 489 |
# -*- coding: utf-8 -*-
"""
This uses Galileo's data on a falling ball.
See: http://www.amstat.org/publications/jse/v3n1/datasets.dickey.html
See also: Jeffreys, W. H., and Berger, J. O. (1992), "Ockham's Razor and Bayesian Analysis," American
Scientist, 80, 64-72 (Erratum, p. 116).
"""
from LOTlib.Hypotheses.Gau... | moverlan/LOTlib | LOTlib/Examples/SymbolicRegression/Galileo/Run.py | Python | gpl-3.0 | 1,312 |
"""
On an 8 x 8 chessboard, there is one white rook. There also may be empty squares, white bishops, and black pawns. These are given as characters 'R', '.', 'B', and 'p' respectively. Uppercase characters represent white pieces, and lowercase characters represent black pieces.
The rook moves as in the rules of Ches... | franklingu/leetcode-solutions | questions/available-captures-for-rook/Solution.py | Python | mit | 2,954 |
from django.conf import settings
from django.contrib.auth.models import User
import requests
def create_consumer(user):
"""
curl -X POST http://docker.local:8001/consumers/ \
--data "username=user123" \
--data "custom_id=1"
"""
data = {
"username": user.username,
"custom_id": us... | toast38coza/docker-kong-oauth | userservice/oauth/kong.py | Python | mit | 3,686 |
from __future__ import unicode_literals
from django.db import models
class Person(models.Model):
""" Person model """
gender_choices = (
('male', 'Male'),
('female', 'Female')
)
firstName = models.CharField(max_length=50, blank=True, null=True)
surname = models.CharField(max_lengt... | mirzadelic/django-social-example | django_social_example/person/models.py | Python | unlicense | 1,534 |
# file: pdfdiff.py
# vim:fileencoding=utf-8:fdm=marker:ft=python
#
# Copyright © 2019 R.F. Smith <rsmith@xs4all.nl>
# SPDX-License-Identifier: MIT
# Created: 2019-07-11T00:22:30+0200
# Last modified: 2020-04-23T19:03:32+0200
"""
Script to try and show a diff between two PDF files.
Requires pdftotext from the poppler u... | rsmith-nl/scripts | pdfdiff.py | Python | mit | 2,441 |
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | DataONEorg/d1_python | test_utilities/src/d1_test/mock_api/tests/test_util.py | Python | apache-2.0 | 2,343 |
import random
import time
from pathmap.tree import Tree
class Timer():
def __init__(self):
self.start = time.time()
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
end = time.time()
runtime = end - self.start
msg = 'The function... | codecov/pathmap | tests/benchmarks.py | Python | apache-2.0 | 1,028 |
# -*- coding: utf-8 -*-
import sys
import logging
from PyQt5.QtWidgets import QApplication
from p2c.app import P2CDaemon
from gui.desktop.mainwindow import MainWindow
logging.basicConfig(level=logging.DEBUG)
def main():
app = QApplication(sys.argv)
ui = MainWindow()
ui.setupUi(ui)
logic = P2CDaemon(... | rafallo/p2c | gui/desktop/main.py | Python | mit | 428 |
#
# This file is part of GNU Enterprise.
#
# GNU Enterprise 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, or (at your option) any later version.
#
# GNU Enterprise is distributed ... | fxia22/ASM_xf | PythonD/lib/python2.4/site-packages/display/cursing/FocusedLabel.py | Python | gpl-2.0 | 2,916 |
# testing json comparison
# NEW reading in multiple JSON files from a sourceFolder
# AND reading in after making changes all JSON files from a targerFolder
#read in two json files and compare to see if any changes made
#print out any changes in files
import glob
import os, json
import sys
#sourcefolder = '/Users/ar... | The-3-rkteers/fs-snapshot | compareSnapshots.py | Python | gpl-3.0 | 4,357 |
from django.contrib import admin
from .models import ReportResponse, Suspicious, Question
admin.site.register(Question)
admin.site.register(Suspicious)
admin.site.register(ReportResponse)
| alzeih/ava | ava_core/report/admin.py | Python | gpl-3.0 | 190 |
# Copyright (c) 2014 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 ... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/boto/rds2/layer1.py | Python | agpl-3.0 | 159,622 |
"""
Integer factorization
"""
import random
import math
from sympy.core.evalf import bitcount
from sympy.core.numbers import igcd
from sympy.core.power import integer_nthroot, Pow
from sympy.core.mul import Mul
from sympy.core.compatibility import as_int, SYMPY_INTS
from primetest import isprime
from generate import s... | amitjamadagni/sympy | sympy/ntheory/factor_.py | Python | bsd-3-clause | 40,615 |
# -*- coding: utf-8 -*-
import numpy as np
from pandas import Series, DataFrame
print("## hierarchical index exchange:")
frame = DataFrame(np.arange(12).reshape((4, 3)),
index = [['a', 'a', 'b', 'b'], [1, 2, 1, 2]],
columns = [['Ohio', 'Ohio', 'Colorado'], ['Green', 'Red', 'Green']])
frame.ind... | lamontu/data-analysis | pandas/reordering_and_sorting_levels.py | Python | gpl-3.0 | 564 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foun... | hivesolutions/netius | src/netius/base/__init__.py | Python | apache-2.0 | 3,509 |
# -*- coding: utf-8 -*-
from argparse import ArgumentParser
from ansible_playbook_wrapper.command.play import PlayCommand
def main():
parser = ArgumentParser()
sub_parsers = parser.add_subparsers(help='commands')
play_parser = sub_parsers.add_parser('play', help='play playbook')
for arg_info in P... | succhiello/ansible-playbook-wrapper | ansible_playbook_wrapper/__init__.py | Python | mit | 556 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Course.name'
db.alter_column(u'courses_course', 'name'... | HackBulgaria/Odin | courses/south_migrations/0002_auto__chg_field_course_name.py | Python | agpl-3.0 | 1,095 |
"""
Support for running multiple SQL scripts against an HP Vertica database in a deterministic fashion.
"""
import logging
from os import path
import luigi.configuration
import yaml
from edx.analytics.tasks.util.url import ExternalURL
from edx.analytics.tasks.warehouse.run_vertica_sql_script import BaseVerticaSqlScr... | Stanford-Online/edx-analytics-pipeline | edx/analytics/tasks/warehouse/run_vertica_sql_scripts.py | Python | agpl-3.0 | 4,092 |
from .{{cookiecutter.short_name|lower}} import {{cookiecutter.class_name}}
| open-craft/xblock-sdk | prototype/{{cookiecutter.short_name|lower}}/{{cookiecutter.short_name|lower}}/__init__.py | Python | agpl-3.0 | 75 |
# Author: Jacob Schofield <jacob@helpsocial.com>
# Copyright (c) 2017 HelpSocial, Inc.
# See LICENSE for details
from requests.auth import AuthBase
class TokenAuth(AuthBase):
"""Base HelpSocial implementation for :class:`requests.auth.AuthBase <AuthBase>`
which provides token based authentication for api req... | helpsocial/py-client | helpsocial/auth.py | Python | mit | 3,212 |
# -*- coding: utf-8 -*-
#
# Bagel documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 17 17:47:29 2014.
#
# 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.
#
# All... | alex/bagel | docs/conf.py | Python | bsd-3-clause | 7,796 |
import cgi
import datetime
import urllib
import urlparse
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
from django.template import defaultfilters
from django.utils.encoding import smart_str
from django.utils.html import strip_tags
from jingo import register
import... | hfeeki/djfactory | djfactory/helpers.py | Python | bsd-3-clause | 2,066 |
from time import sleep, clock
import numpy as np
import cv2
class Ball(object):
"""
The position of the ball, and methods to get it
The theoricall falling point of the ball and methods to get it
"""
positions = []
MAX_GET_POS_RETRIES = 20
_video_source = None
_video_capture = None
... | ingegus/tipe-corbeillator | tracking/ball.py | Python | mit | 8,749 |
#!/usr/bin/env python
from distutils.core import setup
setup(
name="glab-common-py",
version="0.0.1",
description="shared code for common lab functions, analyses, etc",
author="Justin Kiggins",
author_email="justin.kiggins@gmail.com",
packages=["glab_common"],
)
| gentnerlab/glab-common-py | setup.py | Python | bsd-3-clause | 289 |
"""
Conda environments and packages
================================
This module provides high-level tools for using conda environments.
"""
from fabtools.conda import (
is_conda_installed,
install_miniconda,
create_env,
env_exists,
install,
)
def conda(prefix='~/miniconda', use_sudo=False):
... | AMOSoft/fabtools | fabtools/require/conda.py | Python | bsd-2-clause | 1,599 |
"""
Tests for Discovery.
"""
from __future__ import absolute_import
from builtins import range
from builtins import object
from unittest import TestCase
from json import dumps
from uuid import uuid4
from hypothesis.stateful import GenericStateMachine
from hypothesis import strategies as st
from .common import fake_... | datawire/mdk | unittests/test_discovery.py | Python | apache-2.0 | 35,450 |
#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 Licens... | nijel/weblate | weblate/trans/discovery.py | Python | gpl-3.0 | 10,822 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import os
import sys
import six
import platform
SYSTEM_ENCODING = 'gbk' if os.name == 'nt' else 'utf-8'
# if platform.system() in ('Linux', 'Darwin') an... | codeskyblue/AutomatorX | atx/strutils.py | Python | apache-2.0 | 1,586 |
__all__ = ['Clue']
| BrandonYates/sherlock | Python/__init__.py | Python | gpl-3.0 | 19 |
"""Subpackage where each product is defined. Each product is created by adding a
a .py file containing a __wptrunner__ variable in the global scope. This must be
a dictionary with the fields
"product": Name of the product, assumed to be unique.
"browser": String indicating the Browser implementation used to launch tha... | CJ8664/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/__init__.py | Python | mpl-2.0 | 1,408 |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Joao Mesquita <jmesquita@sangoma.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase
from salt import fileserver
class MapDiffTestCase(TestCase):
def test_diff_with_diffent_keys(se... | stephane-martin/salt-debian-packaging | salt-2016.3.3/tests/unit/fileserver/map.py | Python | apache-2.0 | 792 |
'''
Created on Oct 7, 2012
@author: stefanotranquillini
'''
from models import UserProfile
from crowdcomputer import settings
#this for having userProfile always in the session
#this is called before rendering the template, so forget about the session.
def addProfile(request):
try:
userProfile = UserProfi... | Crowdcomputer/CC | general/context_processors.py | Python | apache-2.0 | 870 |
# -*- coding: utf-8 -*-
import sys
import json
from collections import OrderedDict
fname = sys.argv[1]
with open(fname) as f:
spec = json.load(f, object_pairs_hook=OrderedDict)
f.close()
campos = spec.get('campos')
for campo in list(campos.values()):
campo_nome = campo.get('nome')
ca... | wpensar/cnab240 | cnab240/bancos/santander/specs/spec_to_doc.py | Python | mit | 744 |
import json
import time
from tornado.ioloop import IOLoop
from tornado import gen
from tornado.websocket import websocket_connect
from node.db_store import Obdb
def ip_address(i):
return '127.0.0.%s' % str(i + 1)
def nickname(i):
return ''
def get_db_path(i):
return 'db/ob-test-%s.db' % i
def node... | kordless/OpenBazaar | features/test_util.py | Python | mit | 2,109 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('groups', '00... | incuna/incuna-groups | groups/migrations/0016_attachedfile.py | Python | bsd-2-clause | 997 |
import os
from datetime import datetime
from HinetPy import Client
username = os.environ["HINET_USERNAME"]
password = os.environ["HINET_PASSWORD"]
client = Client(username, password)
starttime = datetime(2017, 1, 1, 0, 0)
client.get_continuous_waveform("0101", starttime, 20, threads=4)
| seisman/HinetPy | tests/localtest_client_multi_threads.py | Python | mit | 289 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/usage.py | Python | mit | 1,627 |
try:
import dill as cPickle
except ImportError:
import pickle as cPickle
import functools
import logging
import os
import sys
import time
import numpy as np
from . import pyll
from .utils import coarse_utcnow
from . import base
logger = logging.getLogger(__name__)
def fmin_pass_expr_memo_ctrl(f):
"""
... | dudalev/hyperopt | hyperopt/fmin.py | Python | bsd-3-clause | 12,175 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2016 CERN.
#
# INSPIRE 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... | jacenkow/inspire-next | inspirehep/utils/url.py | Python | gpl-2.0 | 1,406 |
import _plotly_utils.basevalidators
class CountsValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="counts", parent_name="parcats", **kwargs):
super(CountsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
a... | plotly/plotly.py | packages/python/plotly/plotly/validators/parcats/_counts.py | Python | mit | 482 |
from odoo import models, api
class MrpStockReport(models.TransientModel):
_inherit = 'stock.traceability.report'
@api.model
def _get_reference(self, move_line):
res_model, res_id, ref = super(MrpStockReport, self)._get_reference(move_line)
if move_line.move_id.production_id and not move_li... | t3dev/odoo | addons/mrp/models/stock_traceability.py | Python | gpl-3.0 | 1,764 |
###########################################################################
#
# 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
#
# https://www.apache.org/l... | google/starthinker | cloud_function/main.py | Python | apache-2.0 | 1,752 |
# vim: set et nosi ai ts=2 sts=2 sw=2:
# coding: utf-8
"""
Manual testing of the Writer. Some hand-written serialisations of various
situations.
"""
from __future__ import absolute_import, print_function, unicode_literals
import unittest
from schwa import dr
import six
class DocWithField(dr.Doc):
name = dr.Field()... | schwa-lab/libschwa-python | tests/test_writer.py | Python | mit | 11,981 |
from hashlib import sha1
import os
from caliendo import config
if config.should_use_caliendo():
from caliendo.db.flatfiles import insert_test, select_test
__counters = { }
def get_from_trace_for_ev(trace):
if os.environ.get('CALIENDO_DISABLE_EV_COUNTER', False) == 'True':
return 0
return get_fro... | buzzfeed/caliendo | caliendo/counter.py | Python | mit | 1,182 |
# -*- coding: utf-8 -*-
# This code is part of Amoco
# Copyright (C) 2015 Axel Tillequin (bdcht3@gmail.com)
# published under GPLv2 license
"""
cas/smt.py
==========
The smt module defines the amoco interface to the SMT solver.
Currently, only z3 is supported. This module allows to translate
any amoco expression int... | LRGH/amoco | amoco/cas/smt.py | Python | gpl-2.0 | 9,247 |
# -*- coding: utf-8 -*-
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('chained_selects.views',
url(r'^(?P<app_name>[\w\-]+)/(?P<model_name>[\w\-]+)/(?P<method_name>[\w\-]+)/(?P<pk>[\w\-]+)/$', 'filterchain_all', name='filter_all'),
)
| RaD/django-chained-selects | src/urls.py | Python | mit | 270 |
# -*- coding: utf-8 -*-
# code for console Encoding difference. Dont' mind on it
import sys
import imp
import random
imp.reload(sys)
try:
sys.setdefaultencoding('UTF8')
except Exception as E:
pass
try:
import unittest2 as unittest
except ImportError:
import unittest
from popbill import *
class HTCas... | linkhub-sdk/popbill.py | htCashbilltests.py | Python | mit | 9,986 |
# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | obulpathi/poppy | poppy/openstack/common/importutils.py | Python | apache-2.0 | 2,360 |
# flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | huggingface/pytorch-transformers | src/transformers/models/herbert/__init__.py | Python | apache-2.0 | 1,766 |
from blueman.Functions import *
from blueman.plugins.AppletPlugin import AppletPlugin
import blueman.bluez as Bluez
from blueman.bluez.errors import BluezDBusException
from blueman.main.SignalTracker import SignalTracker
import dbus
import types
class PowerManager(AppletPlugin):
__depends__ = ["StatusIcon", "Menu... | hamonikr-root/blueman | blueman/plugins/applet/PowerManager.py | Python | gpl-3.0 | 7,895 |
import re
dir="/scratch/cluster/monthly/ecabello/Wareed/"
inputfiles=["gDNA5_S1", "gDNA-T75_S2" , "gDNA-TQ5_S3","Telo5_S4","Telo-T75_S5","Telo-TQ5_S6", "Telo-EV40_S7", "Telo-T740_S8", "Telo-TQ40_S9"]
#output = open("/scratch/cluster/monthly/ecabello/Wareed/new_sequencing/output_mutatio
strand="f"#raw_input("Strand? f/r... | elecabfer/Diverse | find_mutation.py | Python | mit | 3,342 |
from unittest import TestCase
from versions import operators
class TestOperator(TestCase):
def test_parse_eq(self):
self.assertEqual(operators.Operator.parse('=='),
operators.eq)
def test_parse_ne(self):
self.assertEqual(operators.Operator.parse('!='),
... | pmuller/versions | tests/test_operators.py | Python | mit | 1,506 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: IEEE 802.15.4 Transceiver using CSS PHY
# Description: IEEE 802.15.4 Transceiver using CSS PHY
# Generated: Wed Jun 15 20:35:27 2016
##################################################... | AdrieleD/gr-mac1 | examples/transceiver_CSS_loopback.py | Python | gpl-3.0 | 16,526 |
#!/usr/bin/env python
#
# Copyright 2011-2015 Splunk, 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... | splunk/splunk-sdk-python | examples/event_types.py | Python | apache-2.0 | 1,480 |
# coding: utf-8
"""
Vericred API
Vericred's API allows you to search for Health Plans that a specific doctor
accepts.
## Getting Started
Visit our [Developer Portal](https://developers.vericred.com) to
create an account.
Once you have created an account, you can create one Application for
Production and an... | vericred/vericred-python | test/test_rx_cui_identifier_search_response.py | Python | apache-2.0 | 10,147 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "teora.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| aleCastanheira/teora_old | manage.py | Python | gpl-2.0 | 248 |
import socket
WIDTH = 480 #2592 # max
HEIGHT = 360 #1944 # max
ZFILL = 7
ENCODEFPS = 25
PORT = 8080 # here should be change dynamically
HOST = socket.gethostname() # here also
if not HOST.count('.local'):
HOST += '.local' # for my environment (local)
| ami-GS/Timelapse_RPi | settings.py | Python | mit | 256 |
# -*- coding:utf-8 -*-
# @Script: main.py
# @Author: Zhiwei.Yang
# @Email: tencrance@gmail.com
# @Create At: 2018-08-26 02:11:48
# @Last Modified By: Zhiwei.Yang
# @Last Modified At: 2018-08-26 02:17:16
# @Description: This is description.
import requests
from bs4 import Tag
from bs4 import BeautifulSoup
def get... | tencrance/cool-config | web_crawl/tianya/main.py | Python | mit | 1,097 |
# -*- coding: utf-8 -*-
'''
Modified on 2017-03-28
@author: javacardos@gmail.com
@organization: https://www.javacardos.com/
@copyright: JavaCardOS Technologies. All rights reserved.
'''
from pyResMan.BaseDialogs.pyResManCommandDialogBase_MifareLoadKey import CommandDialogBase_MifareLoadKey
from pyResMan.Util import ... | JavaCardOS/pyResMan | pyResMan/Dialogs/pyResManCommandDialog_MifareLoadKey.py | Python | gpl-2.0 | 2,518 |
import os
import shutil
from pyDEA.main import main
from pyDEA.core.data_processing.parameters import parse_parameters_from_file
from pyDEA.core.utils.dea_utils import auto_name_if_needed
def test_main_correct_params():
filename = 'tests/params_new_format.txt'
params = parse_parameters_from_file(filename)
... | araith/pyDEA | tests/test_main.py | Python | mit | 1,640 |
from django.http import HttpResponse
def hello_world(request):
return HttpResponse("Hello, world.") | xyloeric/pi | piExp/pi/views.py | Python | bsd-3-clause | 101 |
#!/usr/bin/python
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way wi... | Southpaw-TACTIC/TACTIC | src/pyasm/application/houdini/__init__.py | Python | epl-1.0 | 471 |
"""
The number, 197, is called a circular prime because all rotations of the digits:
197, 971, and 719, are themselves prime.
There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.
How many circular primes are there below one million?
"""
from collections import deque
import pr... | pgrm/project-euler | 0001-0050/35-Circular_primes.py | Python | apache-2.0 | 831 |
from unittest import TestCase
from brainiak.utils.config_parser import ConfigParserNoSectionError, parse_section
class ConfigParserTestCase(TestCase):
def test_parse_default_config_file_and_default_section(self):
response = parse_section()
expected_response = {
'url': 'http://localhos... | bmentges/brainiak_api | tests/unit/test_utils_config_parser.py | Python | gpl-2.0 | 1,136 |
# -*- coding: utf-8 -*-
import os
import sys
from . import compat
from .config.data import DJANGO_VERSION_MATRIX, CMS_VERSION_MATRIX, VERSION_MATRIX
def query_yes_no(question, default=None): # pragma: no cover
"""
Ask a yes/no question via `raw_input()` and return their answer.
:param question: A strin... | FinalAngel/djangocms-installer | djangocms_installer/utils.py | Python | bsd-3-clause | 3,160 |
# coding=utf-8
#
# Copyright 2016 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | F5Networks/f5-openstack-heat-plugins | f5_heat/resources/f5_cm_sync.py | Python | apache-2.0 | 3,169 |
import json
from collections import OrderedDict
from typing import Union, Sequence, List, Tuple, Dict, Mapping, Callable, Any
from unittest import TestCase
from cate.core.types import DictLike
from cate.util.opmetainf import OpMetaInfo
from cate.util.opmetainf import is_instance_of
from cate.util.misc import object_to... | CCI-Tools/cate-core | tests/util/test_opmetainfo.py | Python | mit | 11,096 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | ikargis/horizon_fod | horizon/templatetags/sizeformat.py | Python | apache-2.0 | 2,802 |
# -*- coding:utf-8 -*-
from decimal import Decimal
from django.db import models
from django.utils.translation import ugettext_lazy as _
from satchless.product.models import Product
from satchless.pricing import PriceRange
class DiscountGroup(models.Model):
name = models.CharField(_("group name"), max_length=100)
... | fusionbox/satchless | examples/demo/sale/models.py | Python | bsd-3-clause | 1,601 |
import datetime
import warnings
import weakref
import unittest
from itertools import product
class Test_Assertions(unittest.TestCase):
def test_AlmostEqual(self):
self.assertAlmostEqual(1.00000001, 1.0)
self.assertNotAlmostEqual(1.0000001, 1.0)
self.assertRaises(self.failureExce... | Orav/kbengine | kbe/src/lib/python/Lib/unittest/test/test_assertions.py | Python | lgpl-3.0 | 16,868 |
#This python file uses the following encoding: utf-8
import nltk
import os
import filetolist
fp1=open("flsk_app/malayalam_lesk/stemmer_morphems")
#fp2=open("secpass_morpheme")
def qtypefn(fname):
lq=[]
pat=[]
while 1:
k1=fname.read()
#dic1[k1]=0
if not k1:
break;
else:
pat.append((k1.split()... | omrehman/padam | flsk_app/malayalam_lesk/stemmerr21.py | Python | gpl-3.0 | 9,800 |
import cookielib
import urllib2
import urllib
import json
import time
#Default Settings for a system to keep cookies, please add it before testing
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)
# Let the single cookie system override the current... | lanking520/Digital_China | backup1.py | Python | mit | 22,145 |
from __future__ import absolute_import, print_function, unicode_literals
from django.test import TestCase
from ..models import FacilityUser, DeviceOwner, Facility
from ..backends import DeviceOwnerBackend, FacilityUserBackend
class DeviceOwnerBackendTestCase(TestCase):
def setUp(self):
self.facility = ... | MCGallaspy/kolibri | kolibri/auth/test/test_backend.py | Python | mit | 3,118 |
#各組分別在各自的 .py 程式中建立應用程式 (第1步/總共3步)
from flask import Blueprint, render_template
# 利用 Blueprint建立 ag1, 並且 url 前綴為 /ag1, 並設定 template 存放目錄
scrum3_task40323236 = Blueprint('scrum3_task40323236', __name__, url_prefix='/bg7', template_folder='templates')
# scrum1_task1 為完整可以單獨執行的繪圖程式
@scrum3_task40323236.route('/scrum3_ta... | 2015fallhw/cdw2 | users/s2b/g7/scrum3_task40323236.py | Python | agpl-3.0 | 3,889 |
# Copyright 2014 Rustici Software
#
# 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... | RusticiSoftware/TinCanPython | tincan/statement.py | Python | apache-2.0 | 7,342 |
print reduce(lambda x, y: int(x) + int(y), raw_input().split()) | toksaitov/most | samples/problems/sum_of_numbers/python/main.py | Python | gpl-3.0 | 63 |
'''
Module containig bogus module and actuator template
created on Tue Jul 29 10:12:58 2014
@author: mcollado
'''
import time
import datetime
from random import randint
import logging
import sys
logger = logging.getLogger('PSENSv0.1')
def bogus(d, *o):
"""Bogus Function"""
l = list()
try:
if o:
... | SensSolutions/sens_platform | psens/actuators/bogus_act.py | Python | gpl-3.0 | 1,128 |
import asyncio
import binascii
import base64
import json
import io
import mimetypes
import os
import re
import uuid
import warnings
import zlib
from urllib.parse import quote, unquote, urlencode, parse_qsl
from collections import Mapping, Sequence
from .helpers import parse_mimetype
from .multidict import CIMultiDict
... | lfblogs/aiopy | aiopy/required/aiohttp/multipart.py | Python | gpl-3.0 | 28,470 |
# coding: utf-8
# # plot a ugrid mesh
# In[1]:
get_ipython().magic(u'matplotlib inline')
# In[2]:
import matplotlib.tri as tri
import netCDF4
# In[3]:
#url = 'http://www.smast.umassd.edu:8080/thredds/dodsC/fvcom/mwra/fvcom'
url = 'http://geoport.whoi.edu/thredds/dodsC/usgs/vault0/models/tides/vdatum_fl_sab/ad... | rsignell-usgs/notebook | UGRID/plot_mesh-Copy1.py | Python | mit | 2,320 |
# 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, software
# distributed under t... | datacommonsorg/tools | stat_var_renaming/stat_var_renaming_constants.py | Python | apache-2.0 | 13,060 |
""" Check all newly written functions for the Neotoma postgres DB against
the old functions written in SQL Server T-SQL.
by: Simon Goring """
from sys import argv
from re import sub
from colorama import Fore
from colorama import Style
import requests
tilia_uri = 'http://tilia.neotomadb.org/Retrieve/'
dev_uri... | NeotomaDB/Neotoma_SQL | tilia_check.py | Python | mit | 2,487 |
#! /usr/bin/env python3
from functools import wraps
from flask import request, session
from config import AUTH_COOKIE
from odie import ClientError
from db.fsmi import Cookie
def unauthorized():
raise ClientError("unauthorized", status=401)
def get_user():
# kiosk Mode is *never* logged in.
if is_kiosk... | Kha/odie-server | login.py | Python | mit | 878 |
#!/usr/bin/env python
import json
import optparse
class AcreDoc:
"""produces a flattened doc from acre json.
the acre json was derived from our acreassist code
but we are now forking that data and checking it in.
./api_acre.json
that will be the seed data for producing docs for
the time being. For ... | gagoel/acre | utilities/docs/acre_doc.py | Python | apache-2.0 | 6,059 |
#!/usr/bin/env python
#_*_ coding:utf-8 _*_
import os
serversdir='/usr/local/nagios/etc/servers'
logsdir='/usr/local/nagios/var/archives'
serverip=[]
totally={}
log201503=[]
log201504=[]
log201505=[]
for root,dirs,files in os.walk('%s'%serversdir):
for f in files:
serverip.append(f.split('.')[0])
serv... | linlife/Nagios | sms_statistic_monthly/note.py | Python | apache-2.0 | 2,487 |
# from ete3 import Tree, TreeStyle, TextFace, faces, AttrFace
# from ete3.parser import newick
import base64
import os
import shutil
import tempfile
from PIL import Image, ImageChops
from Bio import Phylo
from Bio import Nexus
from TreeImage import TreeImage
import re
class TreeRenderer:
"""Render a tree from new... | fredericlemoine/lsd-web | lsd_web/lsd/controlers/TreeRenderer.py | Python | gpl-2.0 | 5,634 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def gen_checksums(apps, schema_editor):
WooeyFile = apps.get_model('wooey', 'WooeyFile')
from ..backend.utils import get_checksum
for obj in WooeyFile.objects.all():
try:
obj.checksum = get... | wooey/Wooey | wooey/migrations/0017_wooeyfile_generate_checksums.py | Python | bsd-3-clause | 632 |
import operator
from typing import Any
import warnings
import numpy as np
from pandas._config import get_option
from pandas._libs import index as libindex
import pandas.compat as compat
from pandas.compat.numpy import function as nv
from pandas.util._decorators import Appender, cache_readonly
from pandas.core.dtype... | cbertinato/pandas | pandas/core/indexes/category.py | Python | bsd-3-clause | 32,234 |
# coding: utf-8
{
'!langcode!': 'zh-tw',
'!langname!': '中文',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"更新" 是選擇性的條件式, 格式就像 "欄位1=\'值\'". 但是 JOIN 的資料不可以使用 update 或是 delete"',
'%s %%{row} deleted': '已刪除 %s 筆',
'%s %%{row} updated': '已更新 %s 筆',
'%s ... | angelverde/evadoc | languages/zh.py | Python | gpl-3.0 | 10,649 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.