repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
beiko-lab/gengis | bin/Lib/site-packages/scipy/interpolate/setup.py | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('interpolate', parent_package, top_path)
fitpack_src ... |
e-democracy/edem.content.layout | version.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
#-----------------------------------------------------------------------------#
version = '2.0.5'
release = False
#-----------------------------------------------------------------------------#
import sys
if (sys.version_info < (3, )):... |
jaisato/frikr-django | photos/migrations/0002_auto_20171014_1444.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-14 14:44
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depende... |
prophittcorey/Artificial-Intelligence | assign6/minconflicts.py | #!/usr/bin/env python -O
'''
File: schedule.py
Author: Corey Prophitt
License: GPLv3, see license.txt for more details.
Description:
Homework assignment 6 for CSU's CS440. A number of functions taken from
class notes provided by Chuck Anderson.
http://www.cs.colostate.edu/~... |
AncientSwordRage/gAnttlr | gAnttlr/settings/base.py | """
Django settings for gAnttlr project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
im... |
gburkle/Stalker | Intel_Feeds/open_source_lists.py | import sys, os
import urllib.request
import urllib.parse
import re, csv
import datetime
#from Intel_Feeds.plain_list import isitadomain
#from smtplib import line
#from progressbar import ProgressBar
#import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
###### ADD A NEW FEED ##################... |
DIRACGrid/DIRAC | src/DIRAC/Core/Utilities/SiteSEMapping.py | """ The SiteSEMapping module performs the necessary CS gymnastics to
resolve site and SE combinations. These manipulations are necessary
in several components.
Assumes CS structure of: /Resources/Sites/<GRIDNAME>/<SITENAME>
"""
from DIRAC import gLogger, S_OK
from DIRAC.DataManagementSystem.Utilities.... |
anthraxx/diffoscope | tests/comparators/test_cbfs.py | # -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2015 Jérémy Bobbio <lunar@debian.org>
#
# diffoscope 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 Foundati... |
kleinfeld/medpy | medpy/utilities/argparseu.py | """
@package medpy.utilities.arsparseu
Holds additional functionality for the argparse commandline parser package.
@author Oskar Maier
@version r0.1.1
@since 2013-07-02
@status Release
"""
# build-in modules
import argparse
import itertools
# third-party modules
# own modules
# code
def sequenceOfIntegersGeAscendi... |
fako/datascope | src/wiki_scope/migrations/0002_auto_20190402_0928.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-04-02 09:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wiki_scope', '0001_initial'),
]
operations = [
migrations.RemoveField(
... |
Vutshi/qutip | qutip/random_objects.py | # This file is part of QuTiP.
#
# QuTiP 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.
#
# QuTiP is distributed in the ... |
KevinOConnor/klipper | klippy/queuelogger.py | # Code to implement asynchronous logging from a background thread
#
# Copyright (C) 2016-2019 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import logging, logging.handlers, threading, Queue as queue, time
# Class to forward all messages through a queue... |
zenwalker/django-roxyfileman | roxyfileman/views.py | from roxyfileman.utils import Upload, json_response, safepath, ok, err
from django.views.decorators.csrf import csrf_exempt
from roxyfileman.settings import default_settings
from django.http import HttpResponse, FileResponse
from django.shortcuts import render
from django.conf import settings
from PIL import Image
impo... |
simonspa/django-datacollect | datacollect/survey/migrations/0008_auto_20160529_1619.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-29 16:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('survey', '0007_auto_20160529_1612'),
]
operations = [
migrations.AlterField(... |
Openandgit/2014cpb_final_project- | std/b40323219.py | #@+leo-ver=5-thin
#@+node:lee.20141223114246.40: * @file example2.py
#@@language python
#@@tabwidth -4
import cherrypy
import random
from std.asciisymbol import asciiImage
#@+others
#@+node:lee.20141223114246.41: ** class Application
class Application(object):
#@+others
#@+node:lee.20141223114246.42: *3* def i... |
Naereen/mazhe | phystricksLLVMooWOkvAB.py | # -*- coding: utf8 -*-
from phystricks import *
def LLVMooWOkvAB():
pspict,fig = SinglePicture("LLVMooWOkvAB")
x=var('x')
f1=phyFunction(x)
f2=phyFunction(x**2)
surface=SurfaceBetweenFunctions(f1,f2,mx=0,Mx=1)
surface.parameters.color="green"
surface.curve2.put_arrow(0.5)
surface.curve1... |
yulbryn/armory-leap | python/lib/ws4py/client/__init__.py | # -*- coding: utf-8 -*-
from base64 import b64encode
from hashlib import sha1
import os
import socket
import ssl
from ws4py import WS_KEY, WS_VERSION
from ws4py.exc import HandshakeError
from ws4py.websocket import WebSocket
from ws4py.compat import urlsplit
__all__ = ['WebSocketBaseClient']
class WebSocketBaseClien... |
YuxuanLing/trunk | trunk/code/study/python/core_python_appilication/ch15/plus_a.py | #!/usr/bin/env python
# http://oscon.com/oscon2012/public/schedule/detail/24416
# plus_a.py (by Wesley Chun under CC-SA3.0 license)
import os
import httplib2
from apiclient import discovery
from oauth2client import file as storage, client, tools
store = storage.Storage(settings.AUTH_FILE)
credz = store.get(... |
hzlf/openbroadcast.ch | app/base/models/mixins.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import uuid
from django.db import models
class TimestampedModelMixin(models.Model):
""" TimestampedModelMixin
An abstract base class model that provides self-managed "created" and
"updated" fields.
"""
created = models.DateTimeField(a... |
EternityForest/mdNotes | pyscrapbook/util.py | # COPYRIGHT (c) 2016 Daniel DUnn
#
# GNU GENERAL PUBLIC LICENSE
# Version 3, 29 June 2007
#
# 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 opti... |
dtrckd/pymake | pymake/util/algo.py | from collections import defaultdict
import numpy as np
import scipy as sp
#from pymake.frontend.frontend import Object
from .utils import *
from .math import *
from pymake import logger
lgg = logger
# Optimize Algothim (cython, etc) ?
# frontend -- data copy -- integration ?
class Algo(object):
def __init__(s... |
pavpanchekha/pylisp | pylisp/lisp.py | import sexp as parser
import inheritdict
import builtin
import specialforms
import info
import importer
import sys
sys.setrecursionlimit(100000) # It's lisp! It must recurse!
debug = -1
def debugging(name, level=2):
def decorator(f):
def func(self, tree):
if debug >= level:
pr... |
PhotonX-Networks/OfdPy | examples/Ryu/ping.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module contains an example how to use the ofdpy use cases in combination
with an ODL controller.
@author: Karel van de Plassche
@licence: GPLv3
"""
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DIS... |
piantado/LOTlib | LOTlib/Hypotheses/StochasticSimulation.py |
from LOTlib.Miscellaneous import attrmem
from LOTlib.Hypotheses.Hypothesis import Hypothesis
from collections import Counter
class StochasticSimulation(Hypothesis):
"""
If you inherit this, you get a function called simulate that returns the output of many function calls
"""
@attrmem('simulation_coun... |
yadavpooja/practice | level1/end_other.py | def end_other(a,b):
x = len(a)
y = len(b)
if x < y:
if b[-x:] == a:
return True
if y < x:
if a[-y:] == b:
return True
return False
# if x < y and b[-x:] == a:
# return True
#elif y < x and a[-y:] == b:
# return True
#return False
pr... |
sciunto/meniscus | profile.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Francois Boulogne
# License: GPLv3
__version__ = '0.1'
import numpy as np
from scipy.integrate import odeint
from scipy.optimize import bisect
def meniscus_pin_ode(r, z):
"""
returns ODE (dr/dz and d2r/dz2) for a meniscus on a pin
:param r: dista... |
rowinggolfer/openmolar2 | src/lib_openmolar/client/db_orm/client_address.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
## ##
## Copyright 2010-2012, Neil Wallace <neil@openmolar.com> ##
## ... |
caronc/newsreap | newsreap/codecs/CodecFile.py | # -*- coding: utf-8 -*-
#
# A Base Codec Class for deciphering data that is requiring an external file
#
# Copyright (C) 2016 Chris Caron <lead2gold@gmail.com>
#
# This program 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 Fre... |
sitexa/foobnix | foobnix/helpers/pref_widgets.py | '''
Created on Nov 5, 2010
@author: ivan
'''
import logging
from gi.repository import Gtk
from gi.repository import GObject
from foobnix.fc.fc import FC
from foobnix.helpers.dialog_entry import file_chooser_dialog
from foobnix.util.pix_buffer import create_pixbuf_from_resource
from foobnix.helpers.window import Chi... |
plilja/adventofcode | common/math_util.py | from collections import namedtuple
def gcd(a, b):
while b != 0:
t = b
b = a % b
a = t
return a
def lcd(a, b):
return a * b // gcd(a, b)
def extended_gcd(a, b):
s = 0
t = 1
r = b
old_s = 1
old_t = 0
old_r = a
while r != 0:
q = old_r // r
... |
Lana-B/Pheno4T | madanalysis/interpreter/interpreter.py | ################################################################################
#
# Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks
# The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr>
#
# This file is part of MadAnalysis 5.
# Official website: <https://launchpad.net/madanalysis5>
#
# MadAnal... |
erudit/eruditorg | eruditorg/core/editor/migrations/0002_issuesubmissionstatustrack_comment.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("editor", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="issuesubmissionstatustrack",
... |
OpenPathView/DirectoryManager | opv_directorymanager/storage_service/ftp.py | # coding: utf-8
# Copyright (C) 2017 Open Path View
# 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 d... |
sportorg/pysport | sportorg/modules/sportident/sireader.py | import datetime
import logging
import os
import platform
import re
import time
from queue import Empty, Queue
from threading import Event, main_thread
import serial
from PySide2.QtCore import QThread, Signal
from sportident import (
SIReader,
SIReaderCardChanged,
SIReaderControl,
SIReaderException,
... |
dciabrin/ra-tester | ra/dummy/scenarios.py | #!/usr/bin/env python
'''Resource Agents Tester
Template scenarios definition for resource agent
'''
__copyright__ = '''
Copyright (C) 2018-2020 Damien Ciabrini <dciabrin@redhat.com>
Licensed under the GNU GPL.
'''
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the... |
gdgupta11/small_scripts | get_mp3/get_mp3.py | from bs4 import BeautifulSoup
import requests
import os
import sys
import argparse
import subprocess
import time
# todo: make this multithreaded
def download_mp3(valid_link, movie_name, folder_path):
for link in valid_link:
print "Sleeping for 60 seconds before downloading next songs"
time.sleep(6... |
sanacl/GrimoireELK | grimoire/utils.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Grimoire general utils
#
# Copyright (C) 2015 Bitergia
#
# 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 ... |
tompecina/legal | legal/udn/apps.py | # -*- coding: utf-8 -*-
#
# udn/apps.py
#
# Copyright (C) 2011-19 Tomáš Pecina <tomas@pecina.cz>
#
# This file is part of legal.pecina.cz, a web-based toolbox for lawyers.
#
# This application is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published b... |
nagyistoce/netzob | src/netzob/UI/Vocabulary/Views/EnvironmentDependenciesSearcherView.py | # -*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocol... |
Arcanemagus/SickRage | sickbeard/name_cache.py | # coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sick-rage.github.io
# Git: https://github.com/Sick-Rage/Sick-Rage.git
#
# 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 F... |
xbuf/blender_io_xbuf | modules/xbuf/skeletons_pb2.py | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: xbuf/skeletons.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 reflection as... |
jmcjacob/EmotionalExpressionClassifier | run.py | import cv2
import dlib
import main
import time
import threading
import websocket
import numpy as np
import frontalization
from classifier import Classifier
class MyThread(threading.Thread):
def __init__(self, id, args):
threading.Thread.__init__(self)
self.id = id
self.args = args
def run(self):
if self.id... |
matthieu-lapeyre/pypot | pypot/utils/stoppablethread.py | import threading
import pypot_time as time
class StoppableThread(object):
""" Stoppable version of python Thread.
This class provides the following mechanism on top of "classical" python Thread:
* you can stop the thread (if you defined your run method accordingly).
* you can restart a threa... |
404d/Bones-IRCBot | bones/modules/utilities.py | # -*- encoding: utf8 -*-
import json
import re
import urllib
import bones.event
from bones.bot import Module
class NickFix(Module):
def __init__(self, *args, **kwargs):
Module.__init__(self, *args, **kwargs)
self.nickIWant = None
self.isRecovering = False
@bones.event.handler(event=b... |
enavarromo/X-Serv-Practica-Hoteles | alojamientos/views.py | # -*- coding: utf-8 -*-
from models import Pages
# Plantillas:
from django.template.loader import get_template
from django.template import Context
# Nuevo
from datetime import datetime
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from models import Usuario
from models import... |
hkoof/mm | colorcodestats.py | #!/usr/bin/env python
# Solve mastermind by reading a (partly finished) game from
# simple text file using Donald Knuth's five-guess algorithm.
# (see: http://www.dcc.fc.up.pt/~sssousa/RM09101.pdf)
#
# License: GPL
# (c) Heiko Noordhof
import sys
import itertools
codelen = 5
colors = frozenset(['w', 'k', 'b', 'r', '... |
tgymartin/green-fingers-2d | client.py | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 12 07:50:10 2017
@author: Mok Jun Neng
"""
#
# Hello World client in Python
# Connects REQ socket to tcp://localhost:5555
# Sends "Hello" to server, expects "World" back
#
import zmq
context = zmq.Context()
a = 1.23
# Socket to talk to server
print("Connecting to ... |
alanschiemenz/specfem_FWI_workflow | inversion/visualization/plot_well_log.py | import numpy as np
import matplotlib.pyplot as plt
from glob import glob
import array
import sys
import pprocess
import os
def read_bin_file(filename, data_types):
num_objects = len(data_types)
f = open(filename,'rb')
file_out=list()
for n in range(num_objects):
binlength = array.array('i')
... |
kg-bot/SupyBot | plugins/ESim/test.py | ###
# Copyright (c) 2013, KG-Bot
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions, and t... |
febert/DeepRL | q_learning_sarsa/q_learning_function_approx_multenv_nn_evaluation.py | from __future__ import print_function
import numpy as np
np.set_printoptions(threshold=np.inf)
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import axes3d
import time
import math
import cPickle
import gym as gym
import qnn
class q_learning():
def __init__(self,
... |
commonsense/divisi2 | divisi2/operators.py | """
Mathematical operators that support various kinds of Divisi matrices.
"""
import numpy as np
from divisi2.sparse import SparseMatrix, SparseVector, AbstractSparseArray
from divisi2.dense import DenseMatrix, DenseVector, AbstractDenseArray, from_ndarray
from divisi2.ordered_set import OrderedSet
def multiply(arg1, ... |
Emergen/zivios-agent | modules/zvlinuxcomputer.py | """
* Copyright (c) 2008 Zivios, LLC.
*
* This file is part of Zivios.
*
* Zivios 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 versio... |
mekanix/flask-bootstrap-sql-rest | freenit/api/role.py | from flask import current_app
from flask_smorest import Blueprint, abort
from ..schemas.paging import PageInSchema, paginate
from ..schemas.role import RolePageOutSchema, RoleSchema, UserAssignSchema
from .methodviews import ProtectedMethodView
blueprint = Blueprint('roles', 'role')
@blueprint.route('', endpoint='l... |
levelrf/level_basestation | grc/gui/BlockTreeWindow.py | """
Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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... |
buchuki/programming_lab | programming_lab/project/migrations/0005_files_to_folder.py | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
import os.path, errno
from django.conf import settings
orm.Shar... |
TAMU-CPT/galaxy-tools | tools/gbk/renumber.py | #!/usr/bin/env python
import BIO_FIX_TOPO # NOQA
import argparse
import sys # noqa
from Bio import SeqIO
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger()
# gene and RBS features are also included in the tagged features list, but are dealt with specifically elsewhere.
# This is used ... |
dianshen/github | newstart/newstart/urls.py | """newstart URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... |
erudit/eruditorg | eruditorg/erudit/migrations/0062_issue_is_published.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-12 21:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("erudit", "0061_auto_20170112_1048"),
]
operations = [
migrations.AddField(
... |
LabOnNonDemocraticPolitics/NigerianObserver | NigerianObserverScrape.py | # Theodore Chu
# March 4, 2017
# For the USC Lab on Non-Democratic Politics under the direction of Erin Baggott Carter and Brett Logan Carter
# Scrapes the Nigerian Observer
# Encodes in UTF-8
# The Nigerian Observer archive uses years and months (not days)
# Waits 5-10 minutes every 100 pages to avoid crashing... |
kragniz/pylatform | main.py | #!/usr/bin/python -O
from __future__ import division
from sys import stdout
from math import pi
from pyglet import app, clock
from pyglet.window import key, Window, mouse
from pyglet.window.key import symbol_string
from pyglet.gl import *
from camera import Camera
import pyglet
import pymunk
import alone
import ran... |
m-jahn/ShinyMC | gas_measurement.py | # author: Michael Jahn
# date: 2018-10-18
# coding=utf-8
"""
Connect to all gas sensors and take one measurement
"""
# loading libraries
import sys
import serial
import re
import os
import datetime as time
# GLOBAL PARAMETERS
# define output file path
if len(sys.argv) == 2 and isinstance(sys.argv[1], basestring):
... |
MesserLab/SLiM | treerec/tests/recipe_specs.py | """specify which tests to run on each of the recipes in ./test_recipes"""
import os
# Possible attributes to simulation scripts are
# mutations/marked_mutations: does the recipe source init.slim or init_marked_mutations.slim?
# individuals: records individuals
#
# All files are of the form `tests/test_recipes/{ke... |
edudobay/mingus | mingus/midi/MidiFileOut.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
================================================================================
mingus - Music theory Python package, MIDI File Out
Copyright (C) 2008-2009, Bart Spaans
This program is free software: you can redistribute it and/or modify
it under the ter... |
h3biomed/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# 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
ANS... |
Thraxis/pymedusa | sickbeard/clients/generic.py | # coding=utf-8
from __future__ import unicode_literals
import re
import time
from hashlib import sha1
from base64 import b16encode, b32decode
import traceback
from six.moves.http_cookiejar import CookieJar
import requests
from bencode import bencode, bdecode
from bencode.BTL import BTFailure
import sickbeard
from s... |
apex-project/pyApex | pyApex.tab/Misc.panel/utils3.stack/LinkDWGsite.pushbutton/script.py | # -*- coding: utf-8 -*-
__doc__ = """Create DWG link and orient it to Shared Site Point. As if this DWG had shared coordinates.
Useful for placing General Plan dwg files with absolute coordinates.
Shift+Click - enable/disable rotation manually
Создает DWG связь и размещает ее в Точке Съемки проекта. Как если бы dwg им... |
rahenry/nonHexact | main.py | import numpy, scipy, math, cmath, random, scipy.sparse, scipy.sparse.linalg, scipy.special, sys, struct, os, operator
import matplotlib.pyplot as plt
import solver, data_processing, writer, measure, plotting
OUTPUT_SCHEME_DEFAULT = writer.OUTPUT_SCHEME_DEFAULT
SORTING_SCHEME_DEFAULT = writer.SORTING_SCHEME_DEFAULT
da... |
Wonfee/pymobiledevice | notification_proxy.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
#
# $Id$
#
# Copyright (c) 2012-2014 "dark[-at-]gotohack.org"
#
# This file is part of pymobiledevice
#
# pymobiledevice 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 Foundat... |
bbfamily/abu | abupy/MarketBu/ABuSymbol.py | # coding=utf-8
"""
symbol模块
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from fnmatch import fnmatch
import numpy as np
from ..CoreBu.ABuEnv import EMarketTargetType, EMarketSubType
from ..CoreBu.ABuFixes import six
from ..UtilBu.ABuStrUtil impo... |
bio-tools/biotoolsregistry | backend/elixir/issues/url_link.py | import requests
from elixir.models import IssueType
from . import IssueBaseClass
class URLLinkIssue(IssueBaseClass):
def __init__(self, qset, user):
super(
URLLinkIssue,
self
).__init__(
_qset=qset,
_type=IssueType.objects.get(
type='invalid_url',
attribute='link',
field_name='url'
)... |
enormandeau/Scripts | fasta_extract_wo_indel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Extract sequences from a fasta file if their name is in a 'wanted' file.
Wanted file contains one sequence name per line.
Insertions, represented by '*' are removed from the sequences.
Usage:
%program <input_file> <wanted_file> <output_file>"""
import sys
import ... |
whitmo/charmhelpers | charmhelpers/contrib/benchmark/__init__.py | # Copyright 2014-2015 Canonical Limited.
#
# This file is part of charm-helpers.
#
# charm-helpers is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# charm-helpers is distributed in the hope ... |
ssato/sos-analyzer | sos_analyzer/cli.py | #
# Author: Satoru SATOH <ssato redhat.com>
# License: GPLv3+
#
import anyconfig
import logging
import optparse
import os
import os.path
import sys
from sos_analyzer.globals import DATA_SUBDIR
import sos_analyzer.archive
import sos_analyzer.runner
import sos_analyzer.utils
LOGGER = logging.getLogger(__name__)
DEFA... |
erudit/zenon | tests/unit/core/authorization/test_predicates.py | import pytest
from django.contrib.auth.models import AnonymousUser
from django.contrib.contenttypes.models import ContentType
from base.test.factories import GroupFactory, UserFactory
from erudit.test.factories import JournalFactory
from core.authorization.defaults import AuthorizationConfig as AC
from core.authorizat... |
lucaclivio/HEAVyBASE | hub/HeavyBaseService_updates.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Name: HeavyBaseService_updates.py
# Purpose: Updater component for HeavyBase
#
# Project: HeavyBase.py
# Purpose: Hybrid Online-Offline multiplatform P2P data entry engine
#... |
mdavidsaver/spicetools | spicetools/view/plotarea.py | # -*- coding: utf-8 -*-
"""
Copyright (C) 2014 Michael Davidsaver
License is GPL3+, see file LICENSE for details
"""
from PyQt4 import QtGui as gui
from matplotlib.backends.backend_qt4agg import (FigureCanvasQTAgg as FigureCanvas,
NavigationToolbar2QTAgg as NavigationTo... |
fontanon/udev-discover | udevdiscover/device/input/tablet.py | # -*- coding: utf-8 -*-
# vim: ts=4
###
#
# Copyright (c) 2010 J. Félix Ontañón
#
# 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 the hope that it wi... |
dontnod/weblate | weblate/trans/autofixes/html.py | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2019 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, eith... |
grimoirelab/GrimoireELK | grimoire_elk/raw/discourse.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2019 Bitergia
#
# 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 ... |
miyataken999/weblate | weblate/accounts/management/commands/importuserdata.py | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 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, eith... |
LukeCSmith0/hyperspeed-tester | Server-Script/switch_information_check.py | import MySQLdb
import requests
##Connect to the database
conn = MySQLdb.connect(host= "db-address",
user="db-user",
passwd="db-pass",
db="db-name")
x = conn.cursor()
x.execute("SELECT * FROM switch_information")
returned_info = x.fetchall()
for info_line in returned... |
atarax82/lotto-project | project/apps/lotto/views.py | from django.contrib import messages
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.shortcuts import get_object_or_404
from django.contrib.auth import authenticate, login, logout
from django.core.urlresolvers import reverse
from django.contrib.auth.forms import Authenticatio... |
kike28XD/twofor | funciones/gmail.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from options import opciones
import smtplib, sys, time, os
from terminaltables import DoubleTable
#--------------------------------------------------------------------#
# Este archivo hace parte de twofor. #
# Twofor es un software libre: Puedes redistrib... |
botswana-harvard/bcpp-subject | bcpp_subject/tests/models.py | from django.db import models
from edc_base.model_mixins.base_uuid_model import BaseUuidModel
from edc_base.utils import get_utcnow
from edc_constants.constants import YES
from django.db.models.deletion import PROTECT
from member.models import HouseholdMember
class MySubjectConsent(BaseUuidModel):
subject_identif... |
Sonal10/Python | profanity_alert.py | #This method read_text() shows how to raed from files
def read_text():
quotes = open("C:\Users\Sonal Somani\Desktop\Personal\upstur_derrick.txt")
contents_of_file = quotes.read()
print(contents_of_file)
length = len(contents_of_file[0:10])
print(length)
quotes.close()
#Profanity checker fr... |
astronewts/Flight1 | misc/allaloft/groundstation/python/imap_stuff.py |
#v+
#!/usr/bin/env python
import imaplib
import email
import imaplib
def checkMessages(incoming_server, user, password):
has_data = False
subject = ''
obj = imaplib.IMAP4_SSL(incoming_server, '993')
obj.login(user, password)
obj.select('Inbox')
typ ,data = obj.search(None,'UnSeen')
stri... |
mkawalec/home-old | cal/__init__.py | from __future__ import division
from flask import (Flask, request, redirect, url_for, abort,
render_template, flash, jsonify, send_file, g,
Response, session)
from werkzeug import secure_filename
from functools import wraps
from contextlib import closing
import psycopg2
from ha... |
cemsbr/expyrimenter-cloudstack | expyrimenter/plugins/cloudstack/statemonitor.py | from .api import API
from multiprocessing import Manager, Process
from time import sleep
import signal
from expyrimenter.core import ExpyLogger
class StateMonitor:
_stop = False
def __init__(self, states_proxy):
self._states_proxy = states_proxy
self._local_states = {}
self._api = API... |
DIRACGrid/DIRAC | src/DIRAC/ProductionSystem/Utilities/StateMachine.py | """
This module defines the state machine for the Productions
"""
from DIRAC.Core.Utilities.StateMachine import State, StateMachine
class ProductionsStateMachine(StateMachine):
"""Production Management System implementation of the state machine"""
def __init__(self, state):
"""c'tor
Defines... |
tangrs/synthesiavid2midi | main.py | # synthesiavid2midi
# Copyright (C) 2012 Daniel Tang
#
# 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 v... |
zozo123/buildbot | master/buildbot/test/unit/test_db_migrate_versions_028_sourcestamps_refactor.py | # This file is part of Buildbot. Buildbot 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
DmitryYurov/BornAgain | Examples/python/fitting/ex03_ExtendedExamples/specular/RealLifeReflectometryFitting.py | """
Real life example:
Fitting data from an X-ray reflectometer
The sample is composed of a thin
silver nano-particle layer on a silicon
substrate. The substrate is covered with
SiO2 layer. The nano-particle layer has negligible density
and does not considerably affect
the observed reflectometry picture.
The followin... |
odicraig/kodi2odi | addons/plugin.video.salts/scrapers/watch5s_scraper.py | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... |
pablo33/quodlibet-filesorter | readtag.py | #!/usr/bin/python3
# -*- coding: utf_8 -*-
import logging
import eyed3, re
framedict = {
"""
Declared ID3v2 frames
https://id3.org/id3v2.4.0-frames
"""
"AENC" : "Audio encryption",
"APIC" : "Attached picture",
"ASPI" : "Audio seek point index",
"COMM" : "Comments",
"COMR" : "Commercial frame",
"ENCR" : "Encryption m... |
balle/chaosmap | chaosmap.py | #!/usr/bin/python2
#
# Chaosmap
#
# Chaosmap is an information gathering tool and
# dns / whois / web server scanner.
# For wider description and example usages see the README
#
# Coded by Balle
# http://www.datenterrorist.de
# License GPLv3
version = "1.2"
###[ Import modules
import sys
import getopt
import re
imp... |
ziima/pyvmd | setup.py | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from pyvmd import __version__ as version
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Operating System :: OS Independ... |
Iconoclasteinc/tgit | tgit/version.py | # -*- coding: utf-8 -*-
#
# TGiT, Music Tagger for Professionals
# Copyright (C) 2013 Iconoclaste Musique Inc.
#
# 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... |
labhackercd/colab-wikilegis-plugin | src/colab_wikilegis/search_indexes.py | from haystack import indexes
from colab_wikilegis import models
class WikilegisBillIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document=True, use_template=True,
stored=False)
type = indexes.EdgeNgramField()
# Model fields
title = inde... |
UKTradeInvestment/export-wins-data | sso/tests/test_oauth.py | from unittest.mock import patch
from datetime import timedelta, datetime
from django.conf import settings
from django.utils.timezone import now
from freezegun import freeze_time
from django.urls import reverse
from django.test import TestCase, override_settings, tag
from alice.tests.client import AliceClient
from ss... |
gauthiier/nettime | report.py | import sys, os, json, logging
from optparse import OptionParser
reload(sys)
sys.setdefaultencoding('utf8')
# matplot view/windows
import matplotlib
matplotlib.interactive(True)
# pd display
import pandas as pd
pd.set_option('display.max_colwidth', 100)
import nettime.archive
import nettime.query
import nettime.repo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.