code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
#author Matt Jacobsen
'''
This program will learn and predict words and sentences using a Hierarchical Hidden Markov Model (HHMM).
Implement a Baum-Welch algorithm (like EM?) to learn parameters
Implement a Viterbi algorithm to learn structure.
Implement a forward-backward algorithm (like BP) to do inference over the ... | GccX11/machine-learning | hmm.py | Python | mit | 3,184 |
from __future__ import absolute_import
from __future__ import print_function
import os
import numpy
import matplotlib.pyplot as plt
import datetime
import clawpack.visclaw.colormaps as colormap
import clawpack.visclaw.gaugetools as gaugetools
import clawpack.clawutil.data as clawutil
import clawpack.amrclaw.data as... | mandli/surge-examples | harvey/setplot.py | Python | mit | 12,304 |
"""
locally connected implimentation on the lip movement data.
Akm Ashiquzzaman
13101002@uap-bd.edu
Fall 2016
after 1 epoch , val_acc: 0.0926
"""
from __future__ import print_function, division
#random seed fixing for reproducibility
import numpy as np
np.random.seed(1337)
import time
#Data loading
X_train = np.... | zamanashiq3/code-DNN | dense_v1.py | Python | mit | 2,055 |
import datetime
import io
import boto3
import mock
import pytest
import requests
import testfixtures
from botocore.exceptions import ClientError
from opentracing.ext import tags
from opentracing_instrumentation.client_hooks import boto3 as boto3_hooks
DYNAMODB_ENDPOINT_URL = 'http://localhost:4569'
S3_ENDPOINT_URL... | uber-common/opentracing-python-instrumentation | tests/opentracing_instrumentation/test_boto3.py | Python | mit | 6,158 |
from .file_logger import FileLogger | philipperemy/tensorflow-phased-lstm | helpers/__init__.py | Python | mit | 35 |
"""Script to execute CPU and get a best move using Minimax algorithm"""
import copy
from common import board_full, win
OPP = [1, 0]
def eval_rc(board, player, glength, roc):
"""Returns row or column score"""
score_sum = 0
clone_board = board
if roc == "c":
clone_board = [[board[j][i] for j ... | sk364/N_by_N_Tic_Tac_Toe | cpu.py | Python | mit | 5,851 |
# Problem 19: Counting Sundays
# https://projecteuler.net/problem=19
def is_leapyear(year):
if year%4 == 0 and year%100 != 0 or year%400 == 0:
return 1
else:
return 0
month = [31, 28, 31, 30, 31, 30,
31, 31, 30, 31, 30, 31]
def days_of_month(m, y):
... | yehnan/project_euler_python | p019.py | Python | mit | 1,291 |
#!/usr/bin/env python3
# Copyright (c) 2016-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Encode and decode Bitcoin addresses.
- base58 P2PKH and P2SH addresses.
- bech32 segwit v0 P2WPKH and ... | syscoin/syscoin | test/functional/test_framework/address.py | Python | mit | 6,052 |
from textx.exceptions import TextXSemanticError
def query_processor(query):
if not query.condition is None:
query.condition.conditionName = adapter_for_query(query)
for query in query.parent.queries:
if (not hasattr(query, 'property')) and (query.sortBy not in query.parent.properties):
... | theshammy/GenAn | src/concepts/query.py | Python | mit | 1,811 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'User'
db.create_table(u'accounts_user', (
(u'id', self.gf('django.db.models.fiel... | luanfonceca/econet | econet/accounts/migrations/0001_initial.py | Python | mit | 5,920 |
# https://leetcode.com/problems/valid-parentheses/
class Solution(object):
def isValid(self, s):
"""
:type s: str
:rtype: bool
"""
if not s:
return True
stack = []
for i in xrange(len(s)):
# if its opening it, its getting deeper so add... | young-geng/leet_code | problems/20_valid-parentheses/main.py | Python | mit | 920 |
from .base import ScannerBase
class WhoisAtiTnScanner(ScannerBase):
def __init__(self, *args):
super(WhoisAtiTnScanner, self).__init__(*args)
self._tokenizer += [
'skip_empty_line',
'scan_available',
'scan_disclaimer',
'scan_keyvalue'
]
... | huyphan/pyyawhois | yawhois/scanner/whois_ati_tn.py | Python | mit | 674 |
import sys
from django.core.management.base import BaseCommand, CommandError
import nflgame
from terminaltables import AsciiTable
from ...models import Player, Team, Season, Week, WeeklyStats
class Command(BaseCommand):
help = 'takes option position, displays top players as table'
def add_arguments(self, ... | johnshiver/football_tools | football/core/management/commands/show_top_players.py | Python | mit | 607 |
from django.apps import AppConfig
class PerscriptionsConfig(AppConfig):
name = 'prescriptions'
| jimga150/HealthNet | HealthNet/prescriptions/apps.py | Python | mit | 101 |
from unittest import TestCase
from safeurl.core import getRealURL
class MainTestCase(TestCase):
def test_decodeUrl(self):
self.assertEqual(getRealURL('http://bit.ly/1gaiW96'),
'https://www.yandex.ru/')
def test_decodeUrlArray(self):
self.assertEqual(
getRe... | FrodoTheTrue/safeurl | tests/tests.py | Python | mit | 1,050 |
from django.core.management import call_command
import pytest
import septentrion
def test_showmigrations_command_override(mocker):
mock_django_handle = mocker.patch(
'django.core.management.commands.showmigrations.Command.handle')
mock_show_migrations = mocker.patch(
'septentrion.show_migrati... | novafloss/django-north | tests/test_showmigrations_command.py | Python | mit | 2,400 |
# pylint: disable=missing-docstring
import unittest
import numpy as np
# pylint bug on next line
from tensorflow.python.client import device_lib # pylint: disable=no-name-in-module
from cleverhans.devtools.checks import CleverHansTest
HAS_GPU = 'GPU' in {x.device_type for x in device_lib.list_local_devices()}
class ... | openai/cleverhans | tests_tf/test_mnist_tutorial_keras.py | Python | mit | 2,129 |
# https://canvas.instructure.com/doc/api/assignments.html
from datetime import datetime
from canvas.core.courses import get_courses, get_courses_whitelisted, get_course_people, get_courses_by_account_id
from canvas.core.io import write_xlsx_file, tada
from canvas.core.assignments import get_assignments
def... | dgrobani/py3-canvaslms-api | assignments/assignments_turnitin_msonline_list.py | Python | mit | 3,100 |
from django.conf.urls import patterns, include, url
from django.conf import settings
# Here, user contacts.profile will cause some 'mismatch' since contacts is also a module
from profile import ProfileView
from contacts import ContactsView
from authen import Authenticate
strid = settings.CONTACT_URL['strid']
user = s... | sharehub/DBRest | dbrest/contacts/urls.py | Python | mit | 858 |
#!/usr/bin/env python3
import logging
import os
import urllib.parse
import urllib.request
import tarfile
from tooldog import TMP_DIR
from .utils import *
LOGGER = logging.getLogger(__name__)
class CodeCollector(object):
"""
Class to download source code from a https://bio.tools entry
"""
ZIP_NAME ... | khillion/ToolDog | tooldog/analyse/code_collector.py | Python | mit | 2,950 |
import pytest
import os
from polyglotdb import CorpusContext
acoustic = pytest.mark.skipif(
pytest.config.getoption("--skipacoustics"),
reason="remove --skipacoustics option to run"
)
def test_to_csv(acoustic_utt_config, export_test_dir):
export_path = os.path.join(export_test_dir, 'results_export.csv')... | PhonologicalCorpusTools/PyAnnotationGraph | tests/test_io_csv.py | Python | mit | 4,206 |
import sys
import socket
import os
import os.path
from optparse import OptionParser
#import scipy as scp
import numpy as np
import matplotlib.pyplot as plt
import pylab
import genome_management.kg_file_handling as kgf
import math
def file_exists(ls,file):
for f in ls:
if(f==file):
return 1
... | EichlerLab/read_depth_genotyper | scripts/make_ml_output_summary.py | Python | mit | 15,332 |
#!/usr/bin/env python
# a script to delete the contents of an s3 buckets
# import the sys and boto3 modules
import sys
import boto3
# create an s3 resource
s3 = boto3.resource('s3')
# iterate over the script arguments as bucket names
for bucket_name in sys.argv[1:]:
# use the bucket name to create a bucket obje... | managedkaos/AWS-Python-Boto3 | s3/delete_contents.py | Python | mit | 599 |
from data import *
from draw import *
img, hiden_x = get_img_class()
print img.shape
print img
d_idx = np.random.randint(0, 50)
x_x, obs_x, obs_y, obs_tfs, new_ob_x, new_ob_y, new_ob_tf, imgs = gen_data()
print show_dim(x_x)
print show_dim(obs_x)
print show_dim(obs_y)
print show_dim(obs_tfs)
print show_dim(new_ob_... | evanthebouncy/nnhmm | mnist_haar/check_data.py | Python | mit | 735 |
#!/usr/bin/python
# Abbas (Ar:User:Elph), 2012
# -*- coding: utf-8 -*-
import catlib ,pagegenerators
import wikipedia,urllib,gzip,codecs,re
import MySQLdb as mysqldb
import config
pagetop=u"'''تاریخ آخری تجدید:''''': ~~~~~ '''بذریعہ:''' [[user:{{subst:Currentuser}}|{{subst:Currentuser}}]]''\n\n"
pagetop+=u'\nفہرست 10... | UrduWikipedia/DB_reports | EditCounterNoBots.py | Python | mit | 2,518 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
ZetCode PyQt5 tutorial
In this example, we create three toggle buttons.
They will control the background colour of a
QFrame.
author: Jan Bodnar
website: zetcode.com
last edited: January 2015
"""
import sys
from PyQt5.QtWidgets import (QWidget, QPushButton,
QF... | mskovacic/Projekti | raspberrypi/isprobavanje/pyqt5/Toggle_button.py | Python | mit | 1,988 |
from django.contrib.auth.models import User
from django.db import models
from .utils import create_slug
class BaseModel(models.Model):
created = models.DateTimeField(auto_now_add=True)
last_updated = models.DateTimeField(auto_now=True)
class Meta():
abstract = True
| makaimc/txt2react | core/models.py | Python | mit | 292 |
from django.views.generic import CreateView, DetailView
from .models import TestModel
class TestCreateView(CreateView):
template_name = 'test_tinymce/create.html'
fields = ('content',)
model = TestModel
class TestDisplayView(DetailView):
template_name = 'test_tinymce/display.html'
context_object... | romanvm/django-tinymce4-lite | test_tinymce/views.py | Python | mit | 363 |
from graph.graph_server import GraphServer
__all__ = ['GraphServer']
| AndreasMadsen/bachelor-code | visualizer/__init__.py | Python | mit | 71 |
import RPi.GPIO as GPIO
import time
# Configure the Pi to use the BCM (Broadcom) pin names, rather than the pin positions
GPIO.setmode(GPIO.BCM)
relay_pin = 18
GPIO.setup(relay_pin, GPIO.OUT)
try:
while True:
GPIO.output(relay_pin, True)
time.sleep(2)
GPIO.output(re... | simonmonk/hacking2 | pi/ch07_relay_click.py | Python | mit | 433 |
# import json
# import pandas as pd
import numpy as np
import os
from core.lda_engine import model_files
from pandas import DataFrame
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from core.keyword_db import keyword_dbs
def db_connect(base, model_name='dss'):
try:
path = 'sq... | conferency/find-my-reviewers | core/helper/tables.py | Python | mit | 3,572 |
import numpy as np
import pywt
from scipy.misc import imresize
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
X_L = 10
L = 14
N_BATCH = 50
OBS_SIZE = 30
# ---------------------------- helpers
def vectorize(coords):
retX, retY = np.zeros([L]... | evanthebouncy/nnhmm | mnist_haar/data.py | Python | mit | 2,672 |
import os
from sqlalchemy import create_engine, MetaData
from sqlalchemy.orm import scoped_session, sessionmaker
metadata = MetaData()
def get_sa_db_uri(driver='', username='', password='', host='', port='', database=''):
"""get SQLAlchemy DB URI: driver://username:password@host:port/database"""
assert driv... | schettino72/serveronduty | websod/database.py | Python | mit | 1,071 |
"""
Grade API v1 URL specification
"""
from django.conf.urls import url, patterns
import views
urlpatterns = patterns(
'',
url(r'^grades/courses/$', views.CourseGradeList.as_view()),
url(r'^grades/courses/(?P<org>[A-Za-z0-9_.-]+)[+](?P<name>[A-Za-z0-9_.-]+)[+](?P<run>[A-Za-z0-9_.-]+)/$', views.CourseGrade... | jaygoswami2303/course_dashboard_api | v2/GradeAPI/urls.py | Python | mit | 492 |
from OpenGLCffi.GLES1 import params
@params(api='gles1', prms=['target', 'numAttachments', 'attachments'])
def glDiscardFramebufferEXT(target, numAttachments, attachments):
pass
| cydenix/OpenGLCffi | OpenGLCffi/GLES1/EXT/EXT/discard_framebuffer.py | Python | mit | 181 |
# Quick script to calculate GPA given a class list file.
# Class list file should be a csv with COURSE_ID,NUM_UNITS,GRADE
# GRADE should be LETTER with potential modifiers after that
# registrar.mit.edu/classes-grades-evaluations/grades/calculating-gpa
import argparse
import pandas as pd
def get_parser():
# Get ... | kalyons11/kevin | kevin/playground/gpa.py | Python | mit | 2,017 |
# Create the data.
from numpy import pi, sin, cos, mgrid
dphi, dtheta = pi/250.0, pi/250.0
[phi,theta] = mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta]
m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4;
r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + sin(m4*theta)**m5 + cos(m6*theta)**m7
x = r*sin(phi)*cos(the... | Robbie1977/NRRDtools | test.py | Python | mit | 436 |
"""Bulk importer for manually-prepared tariff CSV.
This probably won't be used again following initial data load, so
could be deleted after that.
"""
import csv
import logging
from datetime import datetime
from django.core.management.base import BaseCommand
from django.db import transaction
from dmd.models import ... | annapowellsmith/openpresc | openprescribing/dmd/management/commands/bulk_import_drug_tariff.py | Python | mit | 2,479 |
import sublime, sublime_plugin
from .. import config
from .. import globals
from .. import logger
from ..debug_client import DebugClient
from ..clicks import Clicks
log = logger.get('cmd_attach_debugger')
def lookup_ref(id, refs):
for ref in refs:
if id == ref['handle']:
return ref
return None
def open_file(... | DeniSix/SublimeNodeStacktrace | node_debugger/commands/attach_debugger.py | Python | mit | 3,423 |
from bokeh.plotting import figure, output_file, show
p = figure(width=400, height=400)
p.circle(2, 3, radius=.5, alpha=0.5)
output_file('out.html')
show(p)
| Serulab/Py4Bio | code/ch14/basiccircle.py | Python | mit | 157 |
from django.conf import settings
PIPELINE = getattr(settings, 'PIPELINE', not settings.DEBUG)
PIPELINE_ROOT = getattr(settings, 'PIPELINE_ROOT', settings.STATIC_ROOT)
PIPELINE_URL = getattr(settings, 'PIPELINE_URL', settings.STATIC_URL)
PIPELINE_STORAGE = getattr(settings, 'PIPELINE_STORAGE',
'pipeline.storage.Pi... | fahhem/django-pipeline | pipeline/conf/settings.py | Python | mit | 3,228 |
#This is a cell with a custom comment as marker
x=10
y=11
print(x+y)
| HugoGuillen/nb2py | tutorial_files/custom.py | Python | mit | 70 |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | ReactiveX/RxPY | docs/conf.py | Python | mit | 5,837 |
from celery import shared_task
import sync
@shared_task
def auto_sync_app_models_task():
sync.auto_sync_app_models() | vittoriozamboni/django-data-sync | django_data_sync/tasks.py | Python | mit | 123 |
# Program to find the averge of numbers in a file
def main():
#Get the filename with the numbers
fileName = input("What file are the numbers in? ")
#var to contain all the content of the file
infile = open(fileName, 'r')
#var to keep track of the sum of those numbers
sum = 0.0
#var to keep track of the sum
cou... | src053/PythonComputerScience | chap8/average6.py | Python | cc0-1.0 | 727 |
#!/usr/bin/env python
import datetime
import logging
import os
from urllib.parse import urljoin
from utils import utils, inspector
# https://www.sigar.mil/
archive = 2008
# options:
# standard since/year options for a year range to fetch from.
#
# Notes for IG's web team:
#
SPOTLIGHT_REPORTS_URL = "https://www.s... | divergentdave/inspectors-general | inspectors/sigar.py | Python | cc0-1.0 | 5,811 |
#!/usr/bin/env python
import gtk, sys, string
class Socket:
def __init__(self):
window = gtk.Window()
window.set_default_size(200, 200)
socket = gtk.Socket()
window.add(socket)
print "Socket ID:", socket.get_id()
if len(sys.argv) == 2:
socket.add_id(lo... | Programmica/pygtk-tutorial | examples/socket.py | Python | cc0-1.0 | 572 |
# Copyright (C) 2016 Sysdig inc.
# All rights reserved
# Author: Luca Marturana (luca@sysdig.com)
import os
import traceback
from inspect import isfunction
import sys
import functools
# ensure file descriptor will be closed on execve
O_CLOEXEC = 524288 # cannot use octal because they have different syntax on python2... | draios/tracers-py | sysdig_tracers.py | Python | gpl-2.0 | 5,463 |
# -*- coding: UTF-8 -*-
#The sum of the squares of the first ten natural numbers is,
#1² + 2² + ... + 10² = 385
#The square of the sum of the first ten natural numbers is,
#(1 + 2 + ... + 10)² = 552 = 3025
#Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum... | eHanseJoerg/learning-machine-learning | 01 project euler/projecteuler6.py | Python | gpl-2.0 | 648 |
f = open('main_h.tex','w')
f.write("""\documentclass[a4paper,5pt,twocolumn,titlepage]{article}
\usepackage{mathpazo}
\usepackage{xeCJK}
\usepackage{pstricks,pst-node,pst-tree}
\usepackage{titlesec}
\\titleformat*{\section}{\sf}
\\titleformat*{\subsection}{\sf}
%\setsansfont{DejaVu Sans Mono}
\setsansfont... | himemeizhi/Code-Library | 2.py | Python | gpl-2.0 | 2,805 |
#!/usr/bin/env python
import os
import sys
import tempfile
import shutil
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
from avocado.utils import process
basedir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..')
basedir = os.path.abspath(basedir)
... | will-Do/avocado | selftests/functional/test_multiplex.py | Python | gpl-2.0 | 5,108 |
# -*- coding: utf-8 -*-
from rest_framework.routers import (Route,
DynamicDetailRoute,
SimpleRouter,
DynamicListRoute)
from app.api.account.views import AccountViewSet
from app.api.podcast.views import PodcastV... | Podcastor/podcastor-backend | src/app/api/urls.py | Python | gpl-2.0 | 1,923 |
'''
Created on Jun 15, 2014
@author: geraldine
'''
import socket
import fcntl
import struct
def get_ip_address(ifname):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
return socket.inet_ntoa(fcntl.ioctl(s.fileno(),0x8915,struct.pack('256s', ifname[:15]))[20:24]) | DeeDee22/nelliepi | src/ch/fluxkompensator/nelliepi/IPAddressFinder.py | Python | gpl-2.0 | 283 |
# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2019 EventGhost Project <http://www.eventghost.org/>
#
# EventGhost 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 versio... | topic2k/EventGhost | _build/builder/BuildImports.py | Python | gpl-2.0 | 9,896 |
from __future__ import print_function
num = 17
test = 2
while test < num:
if num % test == 0 and num != test:
print(num,'equals',test, '*', num/test)
print(num,'is not a prime number')
break
test = test + 1
else:
print(num,'is a prime number!')
| sjm-ec/cbt-python | Units/06-Loops/GoodExample3.py | Python | gpl-2.0 | 257 |
class check_privilege_dbadm():
"""
check_privilege_dbadm:
The DBADM (database administration) role grants the authority to a user to perform
administrative tasks on a specific database. It is recommended that dbadm role be granted
to authorized users only.
"""
# References:
# https://be... | foospidy/DbDat | plugins/db2/check_privilege_dbadm.py | Python | gpl-2.0 | 1,117 |
#
# xfce.py
#
# Copyright (C) 2010 Fabio Erculiani
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is... | Rogentos/rogentos-anaconda | installclasses/lxde.py | Python | gpl-2.0 | 2,674 |
import os
import select
fds = os.open("data", os.O_RDONLY)
while True:
reads, _, _ = select.select(fds, [], [], 2.0)
if 0 < len(reads):
d = os.read(reads[0], 10)
if d:
print "-> ", d
else:
break
else:
print "timeout"
| mrniranjan/python-scripts | reboot/system/system4.py | Python | gpl-2.0 | 288 |
"""
PaStA - Patch Stack Analysis
Copyright (c) OTH Regensburg, 2019
Author:
Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>
This work is licensed under the terms of the GNU GPL, version 2. See
the COPYING file in the top-level directory.
"""
import os
import sys
from fuzzywuzzy import fuzz
from logging import g... | lfd/PaStA | bin/pasta_check_mbox.py | Python | gpl-2.0 | 4,216 |
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
import smallsmilhandler
import sys
import os
class KaraokeLocal(smallsmilhandler.SmallSMILHandler):
def __init__(self, fich):
parser = make_parser()
sHandler = smallsmilhand... | calvarezpe/ptavi-p3 | karaoke.py | Python | gpl-2.0 | 1,492 |
#
# Extensible User Folder
#
# (C) Copyright 2000-2004 The Internet (Aust) Pty Ltd
# ACN: 082 081 472 ABN: 83 082 081 472
# All Rights Reserved
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MER... | denys-duchier/Scolar | ZopeProducts/exUserFolder/GroupSources/__init__.py | Python | gpl-2.0 | 1,150 |
# -*- coding: UTF-8 -*-
## Zap-History Browser by AliAbdul
from Components.ActionMap import ActionMap
from Components.config import config, ConfigInteger, ConfigSelection, ConfigSubsection, getConfigListEntry
from Components.ConfigList import ConfigListScreen
from Components.Label import Label
from Components.Language ... | popazerty/openhdf-enigma2 | lib/python/Plugins/Extensions/ZapHistoryBrowser/plugin.py | Python | gpl-2.0 | 9,376 |
# **********************************************************************
#
# Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# ***********************************************************... | ljx0305/ice | python/test/Ice/adapterDeactivation/AllTests.py | Python | gpl-2.0 | 2,229 |
import re
from jaglt import *
from jaglf import *
''' Regexes '''
JRE_Num = [
re.compile(r"[0-8]+o"), #Octal
re.compile(r"[\dA-F]+x"), #Hex
re.compile(r"(?:-?\d+(?:\.(?:\d+)?)?|\.\d+|-?\d+)e-?\d+"), #Scientific
re.compile(r"-?\d+(?:\.(?:\d+)?)?|-?\.\d+"), #Decimal
]
JRE_Str = re.compile(r... | globby/Jagl | jaglk.py | Python | gpl-2.0 | 3,653 |
# -*- coding: utf-8 -*-
import ctypes, os, sys, unittest
from PySide.QtCore import *
from PySide.QtGui import *
import ScintillaCallable
sys.path.append("..")
from bin import ScintillaEditPy
scintillaDirectory = ".."
scintillaIncludeDirectory = os.path.join(scintillaDirectory, "include")
sys.path.app... | Vinatorul/notepad-plus-plus | scintilla/test/XiteQt.py | Python | gpl-2.0 | 1,546 |
# -*- coding: utf-8 -*-
from functools import partial
from types import NoneType
from navmazing import NavigateToSibling, NavigateToAttribute
from cfme.exceptions import DestinationNotFound
from cfme.fixtures import pytest_selenium as sel
from cfme.provisioning import provisioning_form as request_form
from cfme.web_u... | rananda/cfme_tests | cfme/services/catalogs/catalog_item.py | Python | gpl-2.0 | 16,459 |
# A comment, this is so you can read your program later.
# Anything after the # is ignored by python.
print "I could have code like this." # and the comment after is ignored
# You can also use a comment to "disable" or comment out a piece of code:
# print "This won't run."
print "This will run."
# Adding another few... | estebanfallasf/python_training | ex2.py | Python | gpl-2.0 | 978 |
import MDAnalysis
import matplotlib.pyplot as plt
import numpy as np
from MDAnalysis.analysis.align import *
from MDAnalysis.analysis.rms import rmsd
def ligRMSD(u,ref):
"""
This function produces RMSD data and plots for ligand.
:input
1) Universe of Trajectory
2) reference universe
:... | mktumbi/SimAnaRep | SimRepAnaligRMSD.py | Python | gpl-2.0 | 2,124 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>).
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This progra... | syci/domsense-agilebg-addons | account_vat_on_payment/__openerp__.py | Python | gpl-2.0 | 2,244 |
# vim:ts=4:et
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This prog... | sketchfab/io_object_mu | import_mu.py | Python | gpl-2.0 | 15,783 |
def mysql_read():
mysql_info = {}
with open('/etc/openstack.cfg', 'r') as f:
for i in f.readlines():
if i.split('=', 1)[0] in ('DASHBOARD_HOST',
'DASHBOARD_PASS',
'DASHBOARD_NAME',
... | ChinaMassClouds/copenstack-server | openstack/src/horizon-2014.2/openstack_dashboard/openstack/common/utils.py | Python | gpl-2.0 | 515 |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
# import codecs
# import json
# class stokeScrapyPipeline(object):
# def __init__(self):
# self.file=codecs.open... | disappearedgod/stokeScrapy | stokeScrapy/pipelines.py | Python | gpl-2.0 | 1,353 |
"""
* Copyright (c) 2017 SUSE LLC
*
* openATTIC 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 package is distributed in the hope that it will be useful,
* but WITHOUT ANY W... | openattic/openattic | backend/ceph_radosgw/tests.py | Python | gpl-2.0 | 3,934 |
# -*- mode: python; indent-tabs-mode: nil; tab-width: 3 -*-
# vim: set tabstop=3 shiftwidth=3 expandtab:
#
# Copyright (C) 2001-2005 Ichiro Fujinaga, Michael Droettboom,
# and Karl MacMillan
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU ... | hsnr-gamera/gamera | gamera/gui/toolbar.py | Python | gpl-2.0 | 4,334 |
import json
import sys
import logging
import logging.handlers
def load_config():
'''Loads application configuration from a JSON file'''
try:
json_data = open('config.json')
config = json.load(json_data)
json_data.close()
return config
except Exception:
print """T... | svera/clouddump | tools.py | Python | gpl-2.0 | 1,226 |
'''
Created on 14 Jun 2016
@author: gjermund.vingerhagen
'''
import numpy as np
import scipy.interpolate as intp
import linecache
import utmconverter as utm
def splitHead(inp):
return inp
def lineToArr(l1):
arra = np.array(np.fromstring(l1[144:1024],dtype=int,sep=' '))
for i in ran... | gjermv/potato | sccs/gpx/dtmdata.py | Python | gpl-2.0 | 6,663 |
import os
from iconpacker import IconList
test_icon = "/media/hda7/Graphics/png/Classic_Truck/128.png"
icon_theme = IconList()
def initialization():
treestore = icon_theme.setup_treeview('data/legacy-icon-mapping.xml')
if treestore != None:
for i in icon_theme.icon_list:
icon_theme.set_item(i, test_icon)
ret... | tmahmood/iconpacker | test_iconpacker.py | Python | gpl-2.0 | 2,987 |
import os
import sys
import string
from SCons.Script import *
from utils import _make_path_relative
BuildOptions = {}
Projects = []
Rtt_Root = ''
Env = None
class Win32Spawn:
def spawn(self, sh, escape, cmd, args, env):
# deal with the cmd build-in commands which cannot be used in
# subprocess.Po... | DigFarmer/aircraft | tools/building.py | Python | gpl-2.0 | 23,177 |
#from: http://stackoverflow.com/questions/10361820/simple-twisted-echo-client
#and
#from: http://stackoverflow.com/questions/510357/python-read-a-single-character-from-the-user
from twisted.internet.threads import deferToThread as _deferToThread
from twisted.internet import reactor
class ConsoleInput(object):
de... | tpainter/df_everywhere | df_everywhere/util/consoleInput.py | Python | gpl-2.0 | 1,794 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 CERN.
#
# Invenio 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... | omelkonian/cds | cds/modules/deposit/receivers.py | Python | gpl-2.0 | 2,693 |
# coding=utf-8
#默认参数
# 定义默认参数要牢记一点:默认参数必须指向不变对象
# 默认值是列表、字典或大部分类的实例等易变的对象的时候又有所不同。例如,下面的函数在后续调用过程中会累积传给它的参数:
def f1(a, L=[]):
L.append(a)
return L
print(f1(1))
print(f1(2))
print(f1(3))
# 如果你不想默认值在随后的调用中共享,可以像这样编写函数:
def f2(a, L=None):
if L is None:
L = []
L.append(a)
return L
print(f2(... | youlangu/Study | Python/function.py | Python | gpl-2.0 | 1,887 |
# -*- coding: utf-8 -*-
#############################################################
# This file was automatically generated on 2022-01-18. #
# #
# Python Bindings Version 2.1.29 #
# ... | Tinkerforge/brickv | src/brickv/bindings/bricklet_accelerometer_v2.py | Python | gpl-2.0 | 22,844 |
from neolib.plots.Step import Step
from neolib.NST import NST
import time
class HealPetPet(Step):
_paths = {
'links': '//*[@id="content"]/table/tr/td[2]//a/@href',
'img': '//*[@id="content"]/table/tr/td[2]/div/img/@src',
'cert': '//area/@href',
}
_HEALS = {
'http://images... | jmgilman/neolib2 | neolib/plots/altador/steps/HealPetPet.py | Python | gpl-2.0 | 2,736 |
#!/usr/bin/env python
# coding: utf-8
"""
multiprocessTask.py
~~~~~~~~~~~~~~~~~~~
a multiprocess model of producer/consumer
task = Task(work_func, 1, 3, counter=0, a='', callback=cb)
results = task.run()
for i in xrange(26):
lines = ["%d" % i] * random.randint(10, 20)
task.put(l... | Vito2015/pyextend | pyextend/core/thread/multiprocessTask.py | Python | gpl-2.0 | 6,887 |
#!/usr/bin/env python
# -*- Mode: Python; tab-width: 4 -*-
#
# Netfarm Mail Archiver - release 2
#
# Copyright (C) 2005-2007 Gianluigi Tiesi <sherpya@netfarm.it>
# Copyright (C) 2005-2007 NetFarm S.r.l. [http://www.netfarm.it]
#
# This program is free software; you can redistribute it and/or modify
# it under the term... | sherpya/archiver | backend_xmlrpc.py | Python | gpl-2.0 | 2,693 |
# -*- coding:utf-8 -*-
# Made by Kei Choi(hanul93@gmail.com)
import os # ÆÄÀÏ »èÁ¦¸¦ À§ÇØ import
import kernel
#---------------------------------------------------------------------
# KavMain Ŭ·¡½º
# ŰÄÞ¹é½Å ¿£Áø ¸ðµâÀÓÀ» ³ªÅ¸³»´Â Ŭ·¡½ºÀÌ´Ù.
# ÀÌ Å¬·¡½º°¡ ¾øÀ¸¸é ¹é½Å ¿£Áø Ä¿³Î ¸ðµâ¿¡¼ ·ÎµùÇÏÁö ¾Ê´Â´Ù.
#----------... | yezune/kicomav | Engine/plugins/dummy.py | Python | gpl-2.0 | 5,530 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/yeison/Documentos/python/developing/pinguino/pinguino-ide/qtgui/gide/bloques/widgets/control_slider.ui'
#
# Created: Wed Mar 4 01:39:58 2015
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this fi... | emmanuelol/pinguino-ide | qtgui/gide/bloques/widgets/control_slider.py | Python | gpl-2.0 | 2,130 |
# Example import configuration.
import_templates = [{
'id': 'my_import',
'label': 'My Import (Trident)',
'defaults': [
('ds', '16607027920896001'),
('itt', '1'),
('mr', '1'),
('impstp', '1'),
('asa', '1'),
('impjun', '0'),
('dtd', '5'),
{
... | Open-Transport/synthese | legacy/projects/template/manager/imports_config.py | Python | gpl-2.0 | 784 |
from tablelist import *
| egaxegax/dbCarta | tablelist/__init__.py | Python | gpl-2.0 | 24 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('servicos', '0007_auto_20210416_0841'),
]
operations = [
migrations.AlterField(
model_name='servico',
... | interlegis/sigi | sigi/apps/servicos/migrations/0008_auto_20210519_1117.py | Python | gpl-2.0 | 2,103 |
# Copyright (C) 2013-2018 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Tris Wilson
#
# 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 v... | tjcsl/cslbot | cslbot/commands/acl.py | Python | gpl-2.0 | 2,213 |
"""Gets information about the mesh of a case. Makes no attempt to manipulate
the mesh, because this is better left to the OpenFOAM-utilities"""
from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
from PyFoam.RunDictionary.ListFile import ListFile
from PyFoam.Error import PyFoamException
from PyFoam.Ru... | Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam | PyFoam/RunDictionary/MeshInformation.py | Python | gpl-2.0 | 2,537 |
#!/usr/bin/python
import socket
import os
import time
import shutil
import sys
import re
import datetime
import argparse
# NCMD Libs
import ncmd_print as np
from ncmd_print import MessageLevel as MessageLevel
import ncmd_commands as ncmds
import ncmd_fileops as nfops
MAX_TRANSFER_BYTES=2048
QUIT_CMD = "quit now"
HOS... | nathankrueger/ncmd | ncmd_server.py | Python | gpl-2.0 | 4,429 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @first_date 20160129
# @date 20160129
# @version 0.0
"""auth for Users API
"""
from flask import abort
from flask.views import MethodView
from flask.ext.login import login_required, current_user
from sqlalchemy.exc import IntegrityError
from webargs... | pythonistas-tw/academy | web-api/tonypythoneer/db-exercise/v2/app/views/users/auth.py | Python | gpl-2.0 | 2,194 |
from console.main.command_handler.commands.command import Command
class SimpleCommand(Command):
pass
| lubokkanev/cloud-system | console/main/command_handler/commands/simple_command.py | Python | gpl-2.0 | 107 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2012-2013 Hector Martin "marcan" <hector@marcansoft.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 or vers... | yacoob/blitzloop | blitzloop/util.py | Python | gpl-2.0 | 1,930 |
#
# SPDX-License-Identifier: MIT
#
import glob
import os
import shutil
import tempfile
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import runCmd, bitbake, get_bb_vars
class oeGoToolchainSelfTest(OESelftestTestCase):
"""
Test cases for OE's Go toolchain
"""
@staticmetho... | schleichdi2/OPENNFR-6.3-CORE | opennfr-openembedded-core/meta/lib/oeqa/selftest/cases/gotoolchain.py | Python | gpl-2.0 | 2,594 |
#!/usr/bin/env python
# -*- coding: iso-8859-2 -*-
#
# Copyright (C) 2007 Adam Folmert <afolmert@gmail.com>
#
# This file 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)
#... | afolmert/mentor | src/models.py | Python | gpl-2.0 | 12,011 |
from django.forms import ModelForm
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
class UserLogin(ModelForm):
class Meta:
model = User
fields = ['username', 'password']
class UserRegister(UserCreationForm):
email = ... | GAngelov5/Sportvendor | sportvendor/sportvendor/users/forms.py | Python | gpl-2.0 | 1,164 |
import os
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
from matplotlib import cm
import atmath
# Define the observable
srcDir = '../runPlasim/postprocessor/indices/'
# SRng = np.array([1260, 1360, 1380, 1400, 1415, 1425, 1430, 1433,
# 1263, 1265, 1270, 1280, 1300, 1330, ... | atantet/transferPlasim | statistics/plotIndices.py | Python | gpl-2.0 | 4,841 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.