repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
lm-tools/situational
situational/apps/travel_report/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone import jsonfield.fields import model_utils.fields class Migration(migrations.Migration): dependencies = [ ('travel_times', '0002_auto_20150717_1221'), ] operatio...
chromium2014/src
tools/telemetry/telemetry/util/find_dependencies.py
# 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 fnmatch import imp import logging import modulefinder import optparse import os import sys import zipfile from telemetry import benchmark from teleme...
robinson96/GRAPE
stashy/stashy/admin/users.py
from ..helpers import ResourceBase, FilteredIterableResource from ..errors import ok_or_error, response_or_error from ..compat import update_doc class Users(ResourceBase, FilteredIterableResource): @response_or_error def add(self, name, password, displayName, emailAddress, addToDefaultGroup=True): """ ...
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractWwwNovicetranslationsCom.py
def extractWwwNovicetranslationsCom(item): ''' Parser for 'www.novicetranslations.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), (...
chevah/brink
brink/pavement_commons.py
# Copyright (c) 2011 Adi Roiban. # See LICENSE for details. """ Shared pavement methods used in Chevah project. This file is copied into the root of each repo as pavement_lib.py Brace yoursef for watching how wheels are reinvented. Do not modify this file inside the branch. A `product` is a repository delived to c...
w495/python-video-shot-detector
shot_detector/filters/dsl/dsl_filter_mixin.py
# -*- coding: utf8 -*- """ This is part of shot detector. Produced by w495 at 2017.05.04 04:18:27 """ from __future__ import absolute_import, division, print_function import collections import itertools import logging from shot_detector.utils.dsl import DslOperatorMixin from shot_detector.utils.dsl.dsl_kwarg...
barrabinfc/django-templatesadmin
templatesadmin/views.py
import os import codecs from datetime import datetime from stat import ST_MTIME, ST_CTIME from re import search from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponseForbidden from django.utils.translation import ugettext as _ from django.shortcuts import render_to_resp...
JordanReiter/sorl-thumbnail
sorl/thumbnail/engines/convert_engine.py
from __future__ import unicode_literals, with_statement import re import os import subprocess from collections import OrderedDict from django.utils.encoding import smart_str from django.core.files.temp import NamedTemporaryFile from sorl.thumbnail.base import EXTENSIONS from sorl.thumbnail.compat import b from sorl.t...
severin-lemaignan/dialogs
src/dialogs/timescale_manager_test.py
# coding=utf-8 """ Created by Chouayakh Mahdi 26/08/2010 The package contains the unit test of timescale_manager function unit_tests : to perform un...
celiafish/scikit-xray
skxray/core/utils.py
#! encoding: utf-8 # ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # Redistr...
fotinakis/sentry
src/sentry/conf/server.py
""" sentry.conf.server ~~~~~~~~~~~~~~~~~~ These settings act as the default (base) settings for the Sentry-provided web-server :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from django.conf.global_se...
Aurelien1609/Computational-model
frequency_model.py
#! /usr/bin/env python # -*- coding: utf-8 -*- import sys import numpy as np from scipy.spatial.distance import cdist import matplotlib.pyplot as plt from math import sqrt import matplotlib.animation as animation from dana import * ''' Spikes model in computational neuroscience with Brian library. ''' # -------------...
Goldmund-Wyldebeast-Wunderliebe/raven-python
tests/contrib/zerorpc/tests.py
import os import pytest import random import shutil import tempfile from raven.utils.testutils import TestCase from raven.base import Client from raven.contrib.zerorpc import SentryMiddleware zerorpc = pytest.importorskip("zerorpc") gevent = pytest.importorskip("gevent") class TempStoreClient(Client): def __ini...
kouritron/uvs
libuvs/uvsconst.py
# this module tries to implement a replacement for python's lack of language enforced constants. class _UVSConst(object): # ------------------------------------------------------------------------------------------------------------------ # save the constants here def _PASSWORD_PROMPT(self): re...
vsajip/django
tests/regressiontests/test_client_regress/session.py
from django.contrib.sessions.backends.base import SessionBase class SessionStore(SessionBase): """ A simple cookie-based session storage implementation. The session key is actually the session data, pickled and encoded. This means that saving the session will change the session key. """ def __...
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractSixtranslationTumblrCom.py
def extractSixtranslationTumblrCom(item): ''' Parser for 'sixtranslation.tumblr.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), ('L...
weijia/djangoautoconf
djangoautoconf/auto_detection/routing_auto_detection.py
from importlib import import_module from djangoautoconf.auto_conf_urls import enum_app_names from djangoautoconf.auto_conf_utils import is_at_least_one_sub_filesystem_item_exists, get_module_path from ufs_tools.short_decorator.ignore_exception import ignore_exc_with_result def autodiscover(): from django.conf im...
mwolff44/yawd-admin
yawdadmin/utils.py
# -*- coding: utf-8 -*- import datetime import json import time from oauth2client.client import AccessTokenRefreshError from django.core.cache import cache from django.utils.translation import get_language from django.utils.encoding import force_str from yawdadmin.resources import admin_site from conf import settings a...
AssembleSoftware/IoTPy
examples/op/map_element_examples.py
""" This module contains examples of agents created using the map_element wrapper. See IoTPy/IoTPy/tests/element_test.py for more examples. map_element is a function in IoTPy/IoTPy/agents_types/op.py The call to map_element is: map_element(func, in_stream, out_stream, state, name, **kwargs) where func is a funct...
w0pke/oppgavegenerator
oppgavegen/view_logic/rating.py
"""Functions related to rating change.""" from oppgavegen.models import User, UserLevelProgress, Level, Template from oppgavegen.utility.decorators import Debugger def change_elo(template, user, user_won, type): """Changes the elo of both user and task depending on who won.""" u = User.objects.get(username=u...
mfcovington/django-lab-members
lab_members/migrations/0012_scientist_email.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('lab_members', '0011_auto_20141130_2335'), ] operations = [ migrations.AddField( model_name='scientist', ...
evanhenri/RNN-Trading-Bot
pyTrader/file_check.py
import os, sqlite3 from sys import exit missing_auth_dir = ' neural-network-trading-bot/pyTrader/auth not found.\n' \ ' auth directory has been created' missing_data_dir = ' neural-network-trading-bot/pyTrader/data not found.\n' \ ' data directory has been created' missing...
Diaoul/subliminal
tests/test_score.py
# -*- coding: utf-8 -*- from __future__ import division from babelfish import Language from subliminal.providers.addic7ed import Addic7edSubtitle from subliminal.providers.opensubtitles import OpenSubtitlesSubtitle from subliminal.providers.podnapisi import PodnapisiSubtitle from subliminal.score import compute_score...
adsabs/mission-control
mc/config.py
GITHUB_SIGNATURE_HEADER = 'X-Hub-Signature' GITHUB_SECRET = 'redacted' GITHUB_COMMIT_API = 'https://api.github.com/repos/adsabs/{repo}/git/commits/{hash}' GITHUB_TAG_FIND_API = 'https://api.github.com/repos/adsabs/{repo}/git/refs/tags/{tag}' GITHUB_TAG_GET_API = 'https://api.github.com/repos/adsabs/{repo}/git/tags/{has...
pepincho/Python101-and-Algo1-Courses
Algo-1/Application/1-Palindromes.py
def is_palindrome(obj): obj = str(obj) obj_list = list(obj) obj_list_reversed = obj_list[::-1] return obj_list == obj_list_reversed def generate_rotations(word): letters = list(word) string_rotations = [] counter = len(letters) temp = letters while counter != 0: current_l...
herove/dotfiles
sublime/Packages/Package Control/package_control/upgraders/hg_upgrader.py
import os from ..cache import set_cache, get_cache from ..show_error import show_error from .vcs_upgrader import VcsUpgrader class HgUpgrader(VcsUpgrader): """ Allows upgrading a local mercurial-repository-based package """ cli_name = 'hg' def retrieve_binary(self): """ Returns...
oghm2/hackdayoxford
cellcounter/main/management/commands/loadcsv.py
from django.core.management.base import BaseCommand, CommandError from cellcounter.main.models import CellImage, SimilarLookingGroup, CellType import csv class dialect(csv.Dialect): pass class Command(BaseCommand): args = '<csvfile1 csvfile2 ...>' help = 'Loads images and descriptions from specified csv f...
mitdbg/mdindex
scripts/fabfile/utils.py
from fabric.api import * from fabric.contrib.files import exists import fabric counter = 0 @roles('master') def start_spark(): run('/home/mdindex/scripts/startSystems.sh') @roles('master') def stop_spark(): run('/home/mdindex/scripts/stopSystems.sh') @roles('master') def start_zookeeper(): run('/home/md...
gmarciani/pyprof
profile/parser_profiler.py
from control.profile.base.baseprofiler import baseprofiler from output.__init__ import OUTPUT_DIR from exception.exceptions import UnsupportedParserError from control.parse.c_element_tree import cElementTreeParser as cElementTree from control.parse.element_tree import ElementTreeParser as ElementTree from control.parse...
holys/ledis-py
ledis/_compat.py
"""Internal module for Python 2 backwards compatibility.""" import sys if sys.version_info[0] < 3: from urlparse import parse_qs, urlparse from itertools import imap, izip from string import letters as ascii_letters from Queue import Queue try: from cStringIO import StringIO as BytesIO ...
jjas0nn/solvem
tensorflow/lib/python2.7/site-packages/tensorflow/python/debug/lib/stepper_test.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
danking/hail
hail/python/hailtop/hailctl/dataproc/diagnose.py
import re import json from subprocess import call, Popen, PIPE def init_parser(parser): parser.add_argument('name', type=str, help='Cluster name.') parser.add_argument('--dest', '-d', required=True, type=str, help="Directory for diagnose output -- must be local.") parser.add_argument('--hail-log', '-l', r...
pchavanne/dl
tests/test_layers.py
# -*- coding: UTF-8 -*- import pytest from mock import MagicMock as mock import numpy as np from numpy.testing import assert_allclose class TestLayer: @pytest.fixture def layer(self): from yadll.layers import Layer return Layer(mock()) @pytest.fixture def layer2(self): from ya...
domguard/django-admin-tools
admin_tools/menu/views.py
from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from django.contrib import messages try: from django.views.decorators.csrf import csrf_e...
ryanolson/cookiecutter-webapp
{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/api/v1/__init__.py
# -*- coding: utf-8 -*- """ {{ cookiecutter.app_name }}.api.v1 {{ "~" * (cookiecutter.app_name ~ ".api.v1")|count }} :author: {{ cookiecutter.author }} :copyright: © {{ cookiecutter.copyright }} :license: {{ cookiecutter.license }}, see LICENSE for more details. templated from https://github.c...
simpletrain/pybingwallpaper
src/ntlmauth/des_data.py
# This file is part of 'NTLM Authorization Proxy Server' http://sourceforge.net/projects/ntlmaps/ # Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru> # # This library is free software: you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Soft...
TGITS/programming-workouts
exercism/python/isbn-verifier/isbn_verifier_test.py
import unittest from isbn_verifier import is_valid # Tests adapted from `problem-specifications//canonical-data.json` class IsbnVerifierTest(unittest.TestCase): def test_valid_isbn(self): self.assertIs(is_valid("3-598-21508-8"), True) def test_invalid_isbn_check_digit(self): self.assertIs(i...
kingctan/django-health-check
health_check/__init__.py
# This file is heavily inspired from the django admin autodiscover __version_info__ = { 'major': 1, 'minor': 0, 'micro': 2, 'releaselevel': 'final', 'serial': 0 } def autodiscover(): """ Auto-discover INSTALLED_APPS admin.py modules and fail silently when not present. This forces an i...
tshrinivasan/open-tamil
examples/solpattiyal.py
# -*- coding: utf-8 -*- # # This file is distributed under MIT License or default open-tamil license. # (C) 2013-2015 Muthiah Annamalai # # This file is part of 'open-tamil' examples # It can be used to identify patterns in a Tamil text files; # e.g. it has been used to identify patterns in Tamil Wikipedia # article...
akshayaurora/kivy
kivy/uix/splitter.py
'''Splitter ====== .. versionadded:: 1.5.0 .. image:: images/splitter.jpg :align: right The :class:`Splitter` is a widget that helps you re-size its child widget/layout by letting you re-size it via dragging the boundary or double tapping the boundary. This widget is similar to the :class:`~kivy.uix.scrollview.S...
MingoDynasty/FoscamSort
EmailController.py
import logging # Provides access to logging api. import smtplib class EmailController: def __init__(self, username, password, server, port, sender_name): self.logger = logging.getLogger(__name__) self.username = username self.password = password self.server = server self.p...
e1ven/Waymoot
libs/tornado-2.2/build/lib/tornado/test/process_test.py
#!/usr/bin/env python import logging import os import signal import sys from tornado.httpclient import HTTPClient, HTTPError from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop from tornado.netutil import bind_sockets from tornado.process import fork_processes, task_id from tornado.simple_httpc...
samabhi/pstHealth
venv/lib/python2.7/site-packages/gunicorn/workers/geventlet.py
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. from __future__ import with_statement import os try: import eventlet except ImportError: raise RuntimeError("You need eventlet installed to use this worker.") from eventlet import hu...
babyliynfg/cross
tools/project-creator/Python2.6.6/Lib/logging/config.py
# Copyright 2001-2007 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this perm...
holmes-app/holmes-api
holmes/validators/title.py
#!/usr/bin/python # -*- coding: utf-8 -*- from holmes.validators.base import Validator from holmes.utils import _ class TitleValidator(Validator): @classmethod def get_violation_definitions(cls): return { 'page.title.not_found': { 'title': _('Page title not found'), ...
mariano/snakefire
snakefire/pxss.py
#!/usr/bin/env python # Copyright 2009 Yu-Jie Lin # Copyright 2003 David McClosky # # This code is licensed under the GPLv3 # # This Python code does not require any Python binding library, such as # python-xlib or PyXSS. It directly accesses libXss via ctypes. # # It was written with intention of using PyXSS' IdleTrac...
rishabhsixfeet/Dock-
MessagesApp/models.py
from django.db import models from django.contrib.auth.models import User from helper_functions import my_strftime # Create your models here. #This only contains metadata about this thread (i.e. just the subject for now) #It is used in a Many-to-Many relationship with User, with a through object that contains the has_...
olivergs/evodjango
setup.py
# -*- coding: utf-8 -*- """ EVODjango Django extensions for development aid =============================================== .. module:: pyevo :platform: Unix, Windows :synopsis: EVODjango Django extensions for development aid .. moduleauthor:: (C) 2013 Oliver Gutiérrez """ # Python imports import os from setu...
imre-kerr/swarm-epuck
controllers/swarm_controller_accelerometer/imagepro.py
# For simple image-processing operations on python "Image" objects import Image import ImageFilter import math import kd_array # These fetch the red, green or blue components of an RGB triple. A normal Image # pixel is an RGB triple, whereas the black-white and grayscale images have scalar pixels. def get_red(imag...
feigaochn/leetcode
p435_non_overlapping_intervals.py
# Definition for an interval. class Interval: def __init__(self, s=0, e=0): self.start = s self.end = e class Solution: def eraseOverlapIntervals(self, intervals): """ :type intervals: List[Interval] :rtype: int """ if not intervals: return 0...
cuttlefishh/papers
vibrio-fischeri-transcriptomics/code/python/totalannotation_v1-1.py
#!/usr/bin/env python import urllib import sys import os ##### totalannotation.py by DJ Barshis ##### This script takes an input fasta file of sequence names and sequences, and blast results files of blasts against ##### nr (parsed .txt with 1 hit per line) and swissprot and tremble (in -outfmt 7) uniprot databases ...
jomyhuang/sdwle
SDWLE/cards_copy/minions/warlock.py
from SDWLE.cards.base import MinionCard from SDWLE.cards.heroes import Jaraxxus from SDWLE.cards.weapons.warlock import BloodFury from SDWLE.constants import CHARACTER_CLASS, CARD_RARITY, MINION_TYPE from SDWLE.game_objects import Minion from SDWLE.tags.action import Summon, Kill, Damage, Discard, DestroyManaCrystal, G...
crs4/ProMort
promort/reviews_manager/management/commands/build_prediction_reviews_worklist.py
# Copyright (c) 2021, CRS4 # # 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, distribu...
wyxpku/pkucourier
user/easemobSendMessage.py
# -*- coding: UTF-8 -*- from urllib import request import json def send_message(user, message): # get token, do not change url_gettoken = "https://a1.easemob.com/ziyuanliu/pkucarrier/token" header = {"Content-Type":"application/json"} body = '{"grant_type": "client_credentials","client_id": "YXA6OlYUg...
goirijo/thermoplotting
old/testing/dataset/rough_cooling_nuke_0/cool.py
import glob import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt #plt.style.use('ggplot') dirlist=glob.glob("./mu-*.*") fig=plt.figure() ax=fig.add_subplot(111) for run in dirlist: rundata=np.loadtxt(run+"/debugout/tabulated_averages.txt") x=rundata[:,4]/(rundata[:,3]+r...
cripplet/practice
hackerrank/quora/skeleton.py
import fileinput def str_to_int(s): return([ int(x) for x in s.split() ]) # args = [ 'line 1', 'line 2', ... ] def proc_input(args): pass def solve(args, verbose=False): r = proc_input(args) def test(): assert(str_to_int('1 2 3') == [ 1, 2, 3 ]) if __name__ == '__main__': from sys import argv if argv.pop() =...
bvernoux/micropython
tools/mpremote/mpremote/main.py
""" MicroPython Remote - Interaction and automation tool for MicroPython MIT license; Copyright (c) 2019-2021 Damien P. George This program provides a set of utilities to interact with and automate a MicroPython device over a serial connection. Commands supported are: mpremote -- auto-det...
atagar/ReviewBoard
reviewboard/accounts/tests.py
from django.contrib.auth.models import User from djblets.testing.decorators import add_fixtures from djblets.testing.testcases import TestCase from reviewboard.accounts.models import LocalSiteProfile from reviewboard.reviews.models import ReviewRequest class ProfileTests(TestCase): """Testing the Profile model."...
claman/apollo
apollo.py
#!/usr/bin/env python import argparse import datetime class Book: def __init__(self, title, author, owned, start, end, physical, date): self.title = title self.author = author self.owned = owned self.start = start self.end = end self.physical = physical self.date = date def readTime(sel...
emencia/emencia_paste_djangocms_3
emencia_paste_djangocms_3/django_buildout/project/accounts/urls.py
""" URLconf for registration and activation, using django-registration's default mods backend. If the default behavior of these views is acceptable to you, simply use a line like this in your root URLconf to set up the default URLs for registration:: (r'^accounts/', include('project.registration.urls')), This wi...
rec/BiblioPixel
bibliopixel/control/rest/decorator.py
import flask, functools, traceback, urllib from .. import editor NO_PROJECT_ERROR = 'No Project is currently loaded' BAD_ADDRESS_ERROR = 'Bad address {address}' BAD_GETTER_ERROR = 'Couldn\'t get address {address}' BAD_SETTER_ERROR = 'Couldn\'t set value {value} at address {address}' def single(method): """Decora...
SUSE/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension_profile.py
# 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 ...
kaskr/CppAD
bin/proj_desc.py
#! /bin/python3 # $Id # ----------------------------------------------------------------------------- # CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell # # CppAD is distributed under multiple licenses. This distribution is under # the terms of the # Eclipse Public Licen...
VoIP-co-uk/sftf
UserAgentBasicTestSuite/case202.py
# # Copyright (C) 2004 SIPfoundry Inc. # Licensed by SIPfoundry under the GPL license. # # Copyright (C) 2004 SIP Forum # Licensed to SIPfoundry under a Contributor Agreement. # # # This file is part of SIP Forum User Agent Basic Test Suite which # belongs to the SIP Forum Test Framework. # # SIP Forum User Agent Basic...
anyweez/regis
face/management/commands/personalize.py
from django.core.management.base import BaseCommand, CommandError from django.db import transaction from operator import itemgetter import face.models.models as regis import random, math class Command(BaseCommand): args = 'none' help = 'Analyze user performance and modify individual question orderings.' ...
melviso/phycpp
beatle/activity/models/ui/dlg/cc/Member.py
"""Subclass of NewMember, which is generated by wxFormBuilder.""" import copy import wx from beatle import model from beatle.lib import wxx from beatle.activity.models.ui import ui as ui # Implementing NewMember class MemberDialog(ui.NewMember): """ This dialog allows to setup data member of class or s...
arkem/pyflag
src/pyflag/tests.py
#!/usr/bin/env python # Michael Cohen <scudette@users.sourceforge.net> # # ****************************************************** # Version: FLAG $Version: 0.87-pre1 Date: Thu Jun 12 00:48:38 EST 2008$ # ****************************************************** # # * This program is free software; you can redistribute it...
68foxboris/enigma2-openpli-vuplus
lib/python/Components/About.py
# -*- coding: utf-8 -*- import sys, os, time from Tools.HardwareInfo import HardwareInfo def getVersionString(): return getImageVersionString() def getImageVersionString(): try: if os.path.isfile('/var/lib/opkg/status'): st = os.stat('/var/lib/opkg/status') else: st = os.stat('/usr/lib/ipkg/status') tm ...
ckundo/nvda
source/updateCheck.py
#updateCheck.py #A part of NonVisual Desktop Access (NVDA) #This file is covered by the GNU General Public License. #See the file COPYING for more details. #Copyright (C) 2012 NV Access Limited """Update checking functionality. @note: This module may raise C{RuntimeError} on import if update checking for this b...
carvalhomb/tsmells
guess/src/Lib/encodings/iso8859_7.py
""" Python Character Mapping Codec generated from '8859-7.TXT' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(...
kalev/anaconda
scripts/getlangnames.py
# # getlangnames.py # # Copyright (C) 2007 Red Hat, Inc. 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; either version 2 of the License, or # (at your option) any later...
brotchie/keepnote
keepnote/notebook/connection/__init__.py
""" KeepNote Low-level Create-Read-Update-Delete (CRUD) interface for notebooks. """ # # KeepNote # Copyright (c) 2008-2011 Matt Rasmussen # Author: Matt Rasmussen <rasmus@alum.mit.edu> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Genera...
jpelias/pyTelegramBotAPI
tests/test_telebot.py
# -*- coding: utf-8 -*- import sys sys.path.append('../') import time import pytest import os import telebot from telebot import types from telebot import util should_skip = 'TOKEN' and 'CHAT_ID' not in os.environ if not should_skip: TOKEN = os.environ['TOKEN'] CHAT_ID = os.environ['CHAT_ID'] @pytest.mar...
ivyl/patchwork
patchwork/views/xmlrpc.py
# Patchwork - automated patch tracking system # Copyright (C) 2008 Jeremy Kerr <jk@ozlabs.org> # # This file is part of the Patchwork package. # # Patchwork 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...
SoftwareEngineeringToolDemos/ICSE-2011-Checker-Framework
release/release_push.py
#!/usr/bin/env python # encoding: utf-8 """ release_push.py Created by Jonathan Burke on 2013-12-30. Copyright (c) 2015 University of Washington. All rights reserved. """ #See README-maintainers.html for more information from release_vars import * from release_utils import * from sanity_checks import * import urll...
didzis/CAMR
graphstate.py
#!/usr/bin/python # parsing state representing a subgraph # initialized with dependency graph # from __future__ import absolute_import import copy,sys,re import cPickle from parser import * from common.util import * from constants import * from common.SpanGraph import SpanGraph from common.AMRGraph import * import num...
graitanto21/UniboQuad
Tools/autotest/apmrover2.py
# drive APMrover2 in SITL from __future__ import print_function import os import shutil import pexpect from pymavlink import mavutil from common import * from pysim import util from pysim import vehicleinfo # get location of scripts testdir = os.path.dirname(os.path.realpath(__file__)) # HOME=mavutil.location(-35....
lidavidm/mathics-heroku
venv/lib/python2.7/site-packages/sympy/functions/special/tests/test_gamma_functions.py
from sympy import ( Symbol, gamma, I, oo, nan, zoo, factorial, sqrt, Rational, log, polygamma, EulerGamma, pi, uppergamma, S, expand_func, loggamma, sin, cos, O, cancel, lowergamma, exp, erf, beta, exp_polar, harmonic, zeta, factorial) from sympy.core.function import ArgumentIndexError from sympy.utilit...
knxd/pKNyX
pyknyx/stack/cemi/cemiFactory.py
# -*- coding: utf-8 -*- """ Python KNX framework License ======= - B{PyKNyX} (U{https://github.com/knxd/pyknyx}) is Copyright: - © 2016-2017 Matthias Urlichs - PyKNyX is a fork of pKNyX - © 2013-2015 Frédéric Mantegazza This program is free software; you can redistribute it and/or modify it under the terms ...
kenorb/BitTorrent
auto-update/sign_file.py
#!/usr/bin/env python # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that ...
certsocietegenerale/FIR
fir_artifacts_enrichment/tasks.py
from abuse_finder import domain_abuse, ip_abuse, email_abuse, url_abuse from fir_artifacts.models import Artifact from fir_celery.celeryconf import celery_app ENRICHMENT_FUNCTIONS = { 'hostname': domain_abuse, 'ip': ip_abuse, 'email': email_abuse, 'url': url_abuse } @celery_app.task def enrich_arti...
garnertb/rogue_geonode
geoshape/firestation/managers.py
from django.contrib.gis.db import models from django.db.models import Q import operator class PriorityDepartmentsManager(models.Manager): DEPARTMENTS = { 'Austin': {'state': 'TX', 'fdid': 'WP801'}, 'Arlington': {'state': 'VA', 'fdid': '01300'}, 'Chicago': {'state': 'IL', 'fdid': 'CS931'},...
FrozenPigs/Taigabot
core/reload.py
import collections import glob import os import re import sys import traceback if 'mtimes' not in globals(): mtimes = {} if 'lastfiles' not in globals(): lastfiles = set() def make_signature(f): return f.func_code.co_filename, f.func_name, f.func_code.co_firstlineno def format_plug(plug, kind='', lpa...
qtproject/qt-creator
tests/system/tools/toolfunctions.py
############################################################################ # # Copyright (C) 2016 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Qt licenses may use this file in # accordance with the co...
jamesiter/jimauth
views/user_mgmt.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from flask import Blueprint, request import jimit as ji from models import UidOpenidMapping from models import Utils, Rules, User __author__ = 'James Iter' __date__ = '16/6/8' __contact__ = 'james.iter.cn@gmail.com' __copyright__ = '(c) 2016 by James Iter.'...
kabooom/plugin.video.xstream
resources/lib/download.py
# -- coding: utf-8 -- from resources.lib.gui.gui import cGui from resources.lib.config import cConfig from resources.lib import common import urllib2 import xbmc import xbmcgui import string import logger import time import os import sys class cDownload: def __createProcessDialog(self): oDialog = xbmcgui....
zhuangjun1981/retinotopic_mapping
retinotopic_mapping/examples/signmap_analysis/scripts/script_analysis.py
__author__ = 'junz' import os import matplotlib.pyplot as plt import retinotopic_mapping.RetinotopicMapping as rm from tools import FileTools as ft trialName = "160211_M214522_Trial1.pkl" isSave = True params = {'phaseMapFilterSigma': 1., 'signMapFilterSigma': 9., 'signMapThr': 0.3, 'e...
HeinerTholen/Varial
varial/test/test_histotoolsbase.py
from ROOT import TH1I, gROOT, kRed, kBlue import unittest import tempfile import shutil import os from varial.extensions.cmsrun import Sample from varial.wrappers import HistoWrapper from varial.history import History from varial import analysis from varial import settings from varial import diskio class TestHistoTo...
shrinidhi666/rbhus
tests/sockTest.py
#!/usr/bin/python import socket import sys print "pass1" clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) print "pass2" try: print "pass3" clientSocket.settimeout(4) print "pass4" clientSocket.connect(("192.168.1.7",6660)) print "pass5" print("Connected to client") sockstatus = 1 except:...
orchidinfosys/odoo
addons/payment/models/res_config.py
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class AccountPaymentConfig(osv.TransientModel): _inherit = 'account.config.settings' _columns = { 'module_payment_transfer': fields.boolean( 'Wire Transfer', help='-This installs the module payment_transfer.'), ...
immenz/pyload
module/plugins/hooks/RealdebridCom.py
# -*- coding: utf-8 -*- from module.plugins.internal.MultiHook import MultiHook class RealdebridCom(MultiHook): __name__ = "RealdebridCom" __type__ = "hook" __version__ = "0.46" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ...
capoe/espressopp.soap
src/analysis/Test.py
# Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it and/or modify # it under the terms of t...
jrha/artemis
tools/artemis-plot.py
#!/usr/bin/env python # # Copyright Science and Technology Facilities Council, 2009-2012. # # This file is part of ARTEMIS. # # ARTEMIS is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of ...
squilter/MAVProxy
MAVProxy/modules/mavproxy_smartcamera/__init__.py
#!/usr/bin/env python #*************************************************************************** # Copyright Jaime Machuca #*************************************************************************** # Title : mavproxy_smartcamera.py # # Description : This file is intended to be added as ...
solus-cold-storage/evopop-gtk-theme
src/render-gtk3-assets.py
#!/usr/bin/python3 # Thanks to the GNOME theme nerds for the original source of this script import os import sys import xml.sax import subprocess INKSCAPE = '/usr/bin/inkscape' OPTIPNG = '/usr/bin/optipng' MAINDIR = '../EvoPop' SRC = os.path.join('.', 'gtk3') inkscape_process = None def optimize_png(png_file): ...
wrouesnel/ansible
lib/ansible/modules/network/aci/aci_epg_monitoring_policy.py
#!/usr/bin/python # -*- coding: utf-8 -*- # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
pymedusa/Medusa
ext/github/UserKey.py
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
rplevka/robottelo
tests/foreman/cli/test_katello_agent.py
"""CLI tests for ``katello-agent``. :Requirement: Host :CaseAutomation: Automated :CaseLevel: Component :CaseComponent: Katello-agent :Assignee: gtalreja :TestType: Functional :CaseImportance: High :Upstream: No """ import time import pytest from broker import VMBroker from robottelo.api.utils import wait_for...
jocave/snapcraft
snapcraft/plugins/nodejs.py
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
catmaid/CATMAID
scripts/experiment/remove_concepts_after.py
# -*- coding: utf-8 -*- # An entirely untested jython script to delete all the concepts in the # CATMAID database for a particular project. # # Mark Longair 2010 # # flake8: noqa import os, re, sys, ij from jarray import array from java.sql import DriverManager, Connection, SQLException, Types # Set up the JDBC con...