code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# Copyright (c) 2014 Kyle Gorman <gormanky@ohsu.edu>
#
# 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, mer... | totalgood/sbd | sbd/__init__.py | Python | mit | 1,325 |
# Copyright (c) 2016-2022 Martin Donath <martin.donath@squidfunk.com>
# 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, c... | squidfunk/mkdocs-material | setup.py | Python | mit | 2,933 |
#!/usr/bin/env python
"""
swiftnbd. tests for the cache module
Copyright (C) 2013-2016 by Juan J. Martinez <jjm@usebox.net>
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, inc... | reidrac/swift-nbd-server | tests/test_cache.py | Python | mit | 2,800 |
"""This module holds a class that manages access to plugin settings.
Attributes:
log (logging.Logger): logger for current module
"""
import sublime
import logging
import copy
from ..tools import PKG_NAME
from .settings_storage import SettingsStorage
log = logging.getLogger("ECC")
class SettingsManager:
""... | kgizdov/EasyClangComplete | plugin/settings/settings_manager.py | Python | mit | 4,882 |
"""
The MIT License (MIT)
Copyright (c) 2016 Stratos Goudelis
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, me... | sgoudelis/mybitbank | mybitbank/libs/entities/cointransaction.py | Python | mit | 9,317 |
class Player():
"""Object to represent a user"""
def __init__(self, name):
self.name = name
self.wins = 0
self.losses = 0
| kanepenley/vegas-picks | modules/Player.py | Python | mit | 154 |
"""Color util methods."""
import math
# pylint: disable=unused-import
from webcolors import html5_parse_legacy_color as color_name_to_rgb # noqa
HASS_COLOR_MAX = 500 # mireds (inverted)
HASS_COLOR_MIN = 154
# Taken from:
# http://www.developers.meethue.com/documentation/color-conversions-rgb-xy
# License: Code is ... | sffjunkie/home-assistant | homeassistant/util/color.py | Python | mit | 4,984 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hwtLib.amba.axi_comp.lsu.store_queue_write_propagating import AxiStoreQueueWritePropagating
from hwtLib.amba.axi_comp.lsu.write_aggregator_test import AxiWriteAggregator_1word_per_cachelineTC
from hwtLib.amba.axi_comp.sim.ram import AxiSimRam
from hwtLib.amba.constan... | Nic30/hwtLib | hwtLib/amba/axi_comp/lsu/store_queue_write_propagating_test.py | Python | mit | 5,779 |
import datetime, collections, json, logging, os, re, sys, inspect
import cherrypy as cp
logger = logging.getLogger(__name__)
def sqlite_str_to_date(sqlite_str):
if sqlite_str is None: return None
return datetime.date(year = int(sqlite_str[:4]),
month = int(sqlite_str[5:7]),
day = int(... | gtzampanakis/gnubg | webutil.py | Python | mit | 5,210 |
x = int(input())
for i in xrange(x):
i,j = map(int,raw_input().split())
m = int(input())
for i in xrange(m):
z,y = map(int,raw_input().split())
print -1,1,2 | linux-devil/codechef | maylong/may_r.py | Python | mit | 158 |
from django import forms
from .models import Rbllist
class AddrForm(forms.Form):
address = forms.GenericIPAddressField(label='IPv4 or IPv6 Address ')
def clean_address(self):
address = self.cleaned_data['address']
return address
| speedlight/rblmonitor | src/rbls/forms.py | Python | mit | 265 |
from os import makedirs, path
from undine.server.driver.base_driver import BaseDriver
from undine.server.information import ConfigInfo, WorkerInfo, InputInfo
from undine.server.information import TaskInfo
from undine.utils.exception import UndineException
class FileDriver(BaseDriver):
_DEFAULT_RESULT_DIR = 'resul... | Sungup/Undine | undine/server/driver/file.py | Python | mit | 5,462 |
#!/usr/bin/python
# Simple python script for capturing webcam images from a raspberry PI
# Produces image files with the currrent sytem time as the file name
import os
import datetime
import requests
from subprocess import call, check_output
RPI_CONFIGS = [
{
'savename': 'rpi1',
'resolution': '1392... | de1ux/raspberry-ring | creator.py | Python | mit | 1,925 |
#input
# 54
+++[>++<-]>[<+++>-]<[>+++<-]>: | Xzya/CodeAbbeySolutions | TrickyPrinting.py | Python | mit | 43 |
from __future__ import division
import cv2
import numpy as np
import csv
import os
import pandas as pd
import glob
from matplotlib import pyplot as plt
path="/home/ahmed/Downloads/training_data/train/"
path_output="/home/ahmed/Downloads/training_data/train_scaled"
os.chdir(path)
WIDTH=[]
HEIGHT=[]
images_name = glob... | ahmedmazariML/Re-Implementation-of-Convolutional-Recurrent-Neural-Network-for-Sequence-Text-Recognition | size.py | Python | mit | 628 |
metadata = dict( name= 'gufm1',
version = '0.1',
description='Functions to calculate historial magnetic field for the Earth using GUFM1',
url='https://github.com/nknezek/gufm1',
author='Nicholas Knezek',
author_email='nknezek@gmail.com... | nknezek/gufm1 | setup.py | Python | mit | 784 |
import os, sys
import yaml
from utils import *
def fetch_genome(reference_name):
"""
Downloads a reference genome and prepares for aligment
"""
from utils import script_dir
genome_list = yaml.load(open(script_dir + "/utils/genomes.yaml","r"))
makedir("genomes")
if reference_name not in ... | AndersenLab/pyPipeline | utils/genomes.py | Python | mit | 1,678 |
"""
importfrom
"""
from time import time, clock
print time(), clock()
for i in xrange(100000):
i *= 2
print time(), clock()
| kmod/icbd | icbd/compiler/tests/57.py | Python | mit | 129 |
"""Implementation of a Dakota uniform uncertain variable."""
from .base import VariablesBase
from ..utils import to_iterable
classname = "UniformUncertain"
class UniformUncertain(VariablesBase):
"""Define attributes for Dakota uniform uncertain variables.
The distribution lower and upper bounds are requi... | csdms/dakota | dakotathon/variables/uniform_uncertain.py | Python | mit | 4,447 |
from yoconfigurator.dicts import merge_dicts
def update(config):
new = {
'myapp': {
'secret': 'sauce',
'hello': 'world',
'some': {
'deeply': {
'nested': {
'value': 'Stefano likes beer'
},
... | yola/yoconfigurator | yoconfigurator/tests/samples/public-config/deploy/configuration/myapp-default.py | Python | mit | 566 |
class Indicator_Image_Control(object):
""" Handle update logic for animations """
def update(self, indicator_image):
pass
class Image_Pause_Control(Indicator_Image_Control):
""" Handle pauses """
def __init__(self, frames):
self.frames = frames
self._current_frame = 0
de... | mattgrogan/ledmatrix | ledmatrix/components/indicator_image_control.py | Python | mit | 1,494 |
from itertools import chain
from pipetools.compat import map, dict_items
def set_name(name, f):
try:
f.__pipetools__name__ = name
except (AttributeError, UnicodeEncodeError):
pass
return f
def get_name(f):
from pipetools.main import Pipe
pipetools_name = getattr(f, '__pipetools_... | 0101/pipetools | pipetools/debug.py | Python | mit | 710 |
import subprocess
from subprocess import call
import sys
assert (len(sys.argv) == 2)
#folder = "clips/rock"
folder = sys.argv[1]
audio_links = ['audioA.mp3', 'audioB.mp3', 'audioC.mp3', 'audioD.mp3', 'audioE.mp3']
call(["rm"] + audio_links)
p = subprocess.Popen(['ls', folder], stdout=subprocess.PIPE, stderr=subproces... | tbelaire/order_to_play | link_folder.py | Python | mit | 492 |
import hashlib
import hmac
from datetime import datetime, timezone
from typing import Generator, Union
from httpx import Auth, Request, Response
from httpx._utils import to_bytes, to_str
class AuthBase(Auth):
...
class UploadcareSimpleAuth(AuthBase):
def __init__(
self,
public_key: Union[st... | uploadcare/pyuploadcare | pyuploadcare/api/auth.py | Python | mit | 2,901 |
import importlib
import os
from .printer import printer
def abs_path(path, format_kwargs={}, relative_to=None, keep_slash=False):
"""Get abs. path for ``path``.
``path`` may be a relative or absolute file system path or an asset
path. If ``path`` is already an abs. path, it will be returned as
is. O... | wylee/runcommands | src/runcommands/util/path.py | Python | mit | 5,088 |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import asyncio
import os
from azure.keyvault.keys import KeyType
import pytest
from _shared.test_case_async import KeyVaultTestCase
from _test_case import client_setup... | Azure/azure-sdk-for-python | sdk/keyvault/azure-keyvault-keys/tests/test_samples_keys_async.py | Python | mit | 8,210 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Generates fingerprints of text document.
"""
import string
import sys
__author__ = 'kailash.buki@gmail.com (Kailash Budhathoki)'
__all__ = [
'Fingerprint',
'FingerprintException',
]
guid = lambda x: ord(x)
class FingerprintException(Exception):
def __ini... | kailashbuki/fingerprint | fingerprint/fingerprint.py | Python | mit | 5,338 |
from time import time
mx = 5500 # this is the max I could reach with my computer...
t = time() # start time for the for loop
dmloop = []
for a in range(1, mx):
for b in range(a, mx):
dmloop.append(divmod(a, b))
print('for loop: {:.4f} s'.format(time() - t)) # elapsed time
t = time() # start time for ... | mkhuthir/learnPython | Book_learning-python-r1.1/ch5/performances.py | Python | mit | 776 |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from pylab import *
from netCDF4 import Dataset
import datetime
import os
__author__ = 'Trond Kristiansen'
__email__ = 'trond.kristiansen@imr.no'
__created__ = datetime.datetime(2012, 8, 20)
__modified__ = datetime.datet... | trondkr/romstools | ConvertGrid/plotRectangular.py | Python | mit | 3,058 |
def isPrime(number):
#Check if even.
if number % 2 == 0:
return False
i = 3
while i < int(math.sqrt(number)):
if number % i == 0:
return False
i += 2
return True
| Chuck8521/LunchtimeBoredom | UtilityMethods.py | Python | mit | 190 |
#!python
#Bradley Sadowsky, MIT License
#11/3/2016
# Writes Brian Raiter's tiny.asm binary to a file <www.muppetlabs.com/~breadbox/software/tiny/teensy.html>
# 32 Bit ELF format
# Both tiny.asm and the tiny binary belong to Brian Raiter
print "Creates Brian Raiter's tiny.asm binary. 32 BIT ELF Format."
tiny = open("t... | bbsadowsky/bbsadowsky | tiny.py | Python | mit | 859 |
import unittest
from conans.test.utils.tools import TestClient, TestServer,\
create_local_git_repo
from conans.paths import CONANFILE, BUILD_INFO
from conans.util.files import load, save
import os
from conans.test.utils.test_files import temp_folder
from conans.model.info import ConanInfo
conanfile = """from cona... | luckielordie/conan | conans/test/integration/python_build_test.py | Python | mit | 20,228 |
__all__ = ['biotek']
from .biotek import calibration_data, \
calibration_data_df, \
raw_to_uM, \
tidy_biotek_data, \
background_subtract, \
endpoint_averages, \
window_averages, \
... | sclamons/murraylab_tools | murraylab_tools/biotek/__init__.py | Python | mit | 807 |
from haystack.indexes import CharField, Indexable, SearchIndex
from .models import Artist, Album, Song
class ArtistIndex(SearchIndex, Indexable):
text = CharField(document=True, use_template=True)
def get_model(self):
return Artist
class AlbumIndex(SearchIndex, Indexable):
text = CharField(doc... | rafikdraoui/vortex | library/search_indexes.py | Python | mit | 679 |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 20 18:53:05 2015
@author: Manuel Pasieka , manuel.pasieka@csf.ac.at
Homework Assignment from https://work.caltech.edu/telecourse.html
Simple Perceptron Linear Classifier
"""
import numpy as np
import matplotlib.pyplot as plt
def randomLine(seed=None):
"""
Gen... | mapa17/LearningFromData | HW1/PLA.py | Python | mit | 5,392 |
import time
import typing as tp
from satella.coding.decorators.decorators import wraps
from satella.coding.typing import ExceptionList
from satella.coding.concurrent.thread import Condition
from .measure import measure
from ..exceptions import WouldWaitMore
class ExponentialBackoff:
"""
A class that will s... | piotrmaslanka/satella | satella/time/backoff.py | Python | mit | 6,222 |
# -*- coding: utf-8 -*-
#
# gspread documentation build configuration file, created by
# sphinx-quickstart on Thu Dec 15 14:44:32 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | nateyoder/gspread | docs/conf.py | Python | mit | 9,406 |
import abstract_request_strategy
from ..errors import InvalidRequestError
class MockRequestStrategy(abstract_request_strategy.AbstractRequestStrategy):
def __init__(self, request):
try:
self.request = request
self.session = request.session
self.path = request.path
... | Project-EPIC/crowdrouter | crowdrouter/context/mock_request_strategy.py | Python | mit | 669 |
#!/usr/bin/env python2
# Waldo / Version 0.1.2
# Red|Team|Labs - Top-Hat-Sec
# By: R4v3N & s0lst1ce
import sys
import requests
import re
import json
from socket import gaierror, gethostbyname
from argparse import ArgumentParser
from Queue import Queue
from threading import Thread
from datetime import datetime
__ver... | red-team-labs/waldo | waldo.py | Python | mit | 9,456 |
# -*- coding: utf-8 -*-
import numpy as np
import collections
import matplotlib.colors as pltcolors
import matplotlib.transforms as plttransforms
import matplotlib.patches as pltpatches
import mpl_toolkits.axisartist as plta
import mpl_toolkits.axisartist.grid_helper_curvelinear as pltahelper
CartesianCoordinates = c... | woutdenolf/spectrocrunch | spectrocrunch/visualization/ternary_diagram.py | Python | mit | 8,694 |
"""Contains the Command base classes that depend on PipSession.
The classes in this module are in a separate module so the commands not
needing download / PackageFinder capability don't unnecessarily import the
PackageFinder machinery and all its vendored dependencies, etc.
"""
import logging
import os
from functools... | kennethreitz/pipenv | pipenv/patched/notpip/_internal/cli/req_command.py | Python | mit | 12,787 |
from collections import Counter
from collections.abc import MutableSet as AbcMutableSet
from dataclasses import Field
from enum import Enum
from functools import lru_cache
from typing import Any, Callable, Dict, Optional, Tuple, Type, TypeVar, Union
from attr import Attribute
from attr import has as attrs_has
from att... | Tinche/cattrs | src/cattr/converters.py | Python | mit | 27,515 |
from devices.bpm.models import Bpm
from devices.models import Device
from rest_framework import serializers
class BpmSerializer(serializers.ModelSerializer):
# timestamp = serializers.IntegerField()
# bpm = serializers.IntegerField()
class Meta:
model = Bpm
fields = ('timestamp', 'bpm', ... | easyCZ/SLIP-A-2015 | api/wsgi/src/devices/bpm/serializers.py | Python | mit | 330 |
# all the imports
import os
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
# create our little application :)
app = Flask(__name__)
app.config.from_object(__name__)
# Load default config and override config from an environment variable
app.config.up... | wcmckee/brobeur-web | brobeur.py | Python | mit | 733 |
class URLShortener:
def __init__(self):
self.id_counter = 0
self.links = {}
def getURL(self, short_id):
return self.links.get(short_id)
def shorten(self, url):
short_id = self.getNextId()
self.links.update({short_id: url})
return short_id
def getNextId... | felixbade/minimal-url-shortener | app/urlshortener.py | Python | mit | 517 |
import pytest
def test_expect_length(should):
[] | should.have.length.of(0)
'foo' | should.have.length.of(3) | should.have.length(3)
'foo' | should.not_have.length.of(4)
'foo' | should.not_have.length.of(0) | should.not_have.length.of(2)
with pytest.raises(AssertionError):
'foo' | should.... | grappa-py/grappa | tests/operators/length_test.py | Python | mit | 605 |
#!/usr/bin/env python
import unittest
import threading
import SocketServer
import socket
import echo_socketserver
class TestEchoServer(unittest.TestCase):
def setUp(self):
print "\nStart Echo Server"
self.server = SocketServer.UDPServer(('', 4080), echo_socketserver.MyUDPHandler)
server_thread = thread... | SteffenBauer/mia_elixir | python/echo_servertests.py | Python | mit | 1,317 |
import numpy as np
class LSTM_state:
''' Class holding all the states of LSTM unit '''
def __init__(self, input_dim, output_dim, num_mem_cells):
'''At time t=0 initialize the states to zeros'''
self.xc = np.zeros(input_dim)
self.g = np.zeros(num_mem_cells)
self.i = np.zeros(n... | nrupatunga/multi-layer-lstm | lstm/state.py | Python | mit | 577 |
# !/usr/bin/env python
# coding=utf-8
try:
# For Spark >= 2.0
from pyspark.sql import SparkSession
FLAG = True
except ImportError:
# For Spark < 2.0
FLAG = False
from pyspark import SparkContext
import math
from operator import add
import re
import sys
if __name__ == '__main__':
if len(sys... | qiyuangong/analyzing_weibo_data_with_spark | time_distribution.py | Python | mit | 1,334 |
# -*- coding: utf8 -*-
import arrow
from collections import defaultdict
from functools import lru_cache
class TranslateBurpuiAPI:
"""
Translate data from burpui_api to burp_reports
"""
def __init__(self, clients):
"""
Initialize vars
:param: clients list of clients coming from... | pablodav/burp_server_reports | burp_reports/interfaces/burpui_api_translate.py | Python | mit | 4,310 |
from django.conf.urls import url
from main import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^login$', views.user_login, name='user_login'),
url(r'^logout$', views.user_logout, name='user_logout'),
url(r'^signup$', views.user_signup, name='user_signup'),
url(r'^user/(?P<id>\... | mingkim/QuesCheetah | main/urls.py | Python | mit | 761 |
'''
Created on Jun 7, 2014
@author: CJ
This is a more generalized version of the CDF.py module. Here, we are able to
deal with any normal distribution, instead of just the standard normal dist.
The generalized formula is given below:
f(x, mu, sigma) = k * e^[-((x-mu)^2)/(2*sigma^2)]
where k = 1/(sigma * sqr... | cj2009/statslab | CDF2.py | Python | mit | 3,207 |
# 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 ... | SUSE/azure-sdk-for-python | azure-mgmt-monitor/azure/mgmt/monitor/operations/autoscale_settings_operations.py | Python | mit | 16,831 |
import OOMP
newPart = OOMP.oompItem(8897)
newPart.addTag("oompType", "CRHO")
newPart.addTag("oompSize", "I01")
newPart.addTag("oompColor", "B")
newPart.addTag("oompDesc", "PI10")
newPart.addTag("oompIndex", "01")
OOMP.parts.append(newPart)
| oomlout/oomlout-OOMP | old/OOMPpart_CRHO_I01_B_PI10_01.py | Python | cc0-1.0 | 242 |
import sys
from dtcov.dt_file_utils import DictContains
DEBUG_TRACE_LEVEL = 2
WARN_ONCE_MAP = {}
def debug(message):
if DEBUG_TRACE_LEVEL>2:
sys.stderr.write(message)
def warn(message):
if DEBUG_TRACE_LEVEL>1:
sys.stderr.write(message)
def info(message):
sys.stderr.write(message)
def e... | traff/dtcov | dtcov/dt_log.py | Python | epl-1.0 | 502 |
#===islucyplugin===
# -*- coding: utf-8 -*-
# fatal plugin
# wtf_plugin.py
# Copyright © 1998-2009 wd/lotusfeet <dao/yoga>
# 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... | XtremeTeam/Lucy-bot | brain/plugins/wtf.py | Python | gpl-2.0 | 34,611 |
# -*- coding: utf-8 -*-
#
# gerbera documentation build configuration file, created by
# sphinx-quickstart on Sat Dec 23 17:22:17 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | gburca/mediatomb | doc/conf.py | Python | gpl-2.0 | 5,337 |
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Copyright (C) 2020 Stoq Tecnologia <http://www.stoq.com.br>
# All rights reserved
#
# 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 Free Software Foundation;... | stoq/stoq-server | stoqserver/app.py | Python | gpl-2.0 | 6,385 |
import RPi.GPIO as GPIO
from lib_nrf24 import NRF24
from math import *
import time
import spidev
import sys
import os.path
import numpy as np
import pickle
import sqlite3
import mat4py as m4p
import os
import lzw
def compress(uncompressed):
"""Compress a string to a list of output symbols."""
# Build the dictionar... | AdriaGS/MTP-Group-C | Single Mode/deviceTX_wC_2.py | Python | gpl-2.0 | 7,573 |
from django.contrib import admin
from .models import Publication, Page
admin.site.register(Publication)
admin.site.register(Page)
| ascii1011/basecat | apps/mediacenter/admin.py | Python | gpl-2.0 | 132 |
#
# Katello Organization actions
# Copyright (c) 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You... | iNecas/katello | cli/src/katello/client/core/activation_key.py | Python | gpl-2.0 | 14,046 |
#! /usr/bin/env python
from distutils.core import setup
import os, sys
def locale_enum(ext):
ret_val = []
for lang in os.listdir('locale'):
path = os.path.join('locale', lang, 'methlab' + ext)
if not os.path.exists(path):
continue
ret_val.append((lang, path))
return ret_val
def compile_po_fil... | eLvErDe/methlab | setup.py | Python | gpl-2.0 | 1,348 |
# coding=utf-8
# -*- coding: utf-8 -*-
import codecs
import numpy as np
from codecs import decode
import string
import theano
class CorpusReader:
def __init__(self, minDocSentenceNum, minSentenceWordNum, dataset="data/split", labelset="data/traindataset2zgb"):
self.minDocSentenceNum = minDocSentenceNum
... | jiafeimaowudi/KnowlegeableCNN | knoweagebleClassifyPadding.py | Python | gpl-2.0 | 6,565 |
#coding:utf-8
import sms,html,hive,time,json,sys
params = {"UserName":"suchao","Domain":"@ganji.com","Password":"hFuT8141553561307"}
url = "http://sso.ganji.com/Account/LogOn"
stat = html.Html()
stat.post(url,params,"")
stat.headerConf({'X-Requested-With':'XMLHttpRequest'})
sourceURL = 'http://stat.corp.... | hfutsuchao/Python2.6 | mysite/mysite/qd.py | Python | gpl-2.0 | 7,582 |
#thanghl
# modlue doc file zip
import os
import zipfile
def giainen(read,listname):
#read=raw_input(' Nhap file zip chua dic :')
if (os.access(read, os.R_OK) and os.path.isfile(read)):
print 'File exists and access OK'
with zipfile.ZipFile(read, 'r') as zf:
print zf.namelist()[0]
listname=zf.namelist()[0]
... | pythonvietnam/pbc082015 | thanghl/bai 9/xylyfilezipv2.py | Python | gpl-2.0 | 796 |
################################################################################
# centroid1.py
#
# Post Processor for the centroid M40 machine
#
#
# Dan Falck, 7th March 2010
from . import nc
from . import iso_modal
import math
import datetime
now = datetime.datetime.now()
#######################################... | vilemnovak/blendercam | scripts/addons/cam/nc/centroid1.py | Python | gpl-2.0 | 4,915 |
# pylint: disable=too-few-public-methods, useless-object-inheritance
"""test access to __name__ gives undefined member on new/old class instances
but not on new/old class object
"""
from __future__ import print_function
class Aaaa:
"""old class"""
def __init__(self):
print(self.__name__) # [no-member... | PyCQA/pylint | tests/functional/a/access/access_to__name__.py | Python | gpl-2.0 | 610 |
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of ... | andysim/psi4 | psi4/driver/procrouting/interface_cfour.py | Python | gpl-2.0 | 19,001 |
class rectangle:
def __init__(self, x, y, w, h, color):
self.x = x
self.y = y
self.w = w
self.h = h
self.c = color
def top(self):
return self.y
def bottom(self):
return self.y + self.h
def left(self):
return self.x
def ... | martflu/adaptive-audio | src/rectangle.py | Python | gpl-2.0 | 363 |
#pylint: disable=C0103,R0904,R0903,W0201
"""
This module demonstrates a possible problem of pyLint with calling __init__ s
from inherited classes.
Initializations done there are not considered, which results in Error E0203 for
self.cookedq.
"""
__revision__ = 'yo'
import telnetlib
class SeeTelnet(telnetlib.Telnet):
... | godfryd/pylint | test/input/func_noerror_access_attr_before_def_false_positive.py | Python | gpl-2.0 | 2,445 |
import os
import logging
import threading
import time
from autotest.client.shared import error
from autotest.client.shared import utils
from autotest.client.shared import ssh_key
from virttest import utils_test
from virttest import virsh
from virttest import utils_misc
from virttest import libvirt_vm
from virttest impo... | PandaWei/tp-libvirt | libvirt/tests/src/virsh_cmd/domain/virsh_migrate_virtio_scsi.py | Python | gpl-2.0 | 13,886 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Constrained Nonnegative Matrix Factorization
A similar CNMF class that will output data that are not usually present in the regular CNMF process
Created on Fri Aug 26 15:44:32 2016
@author: agiovann
"""
from builtins import str
from builtins import object
from pa... | simonsfoundation/CaImAn | caiman/source_extraction/cnmf/cnmf_optional_outputs.py | Python | gpl-2.0 | 10,068 |
"""Survival script for testing Optosketch without graphical tablet.
Running the development test:
$ PYTHONPATH=. python test/dev.py
"""
import numpy as N
from optosketch import Application
import backend as BCK
app = Application([])
frt = app.window.ui.canvasview.scene().frontend
bck = app.engine
baseline = BCK... | pgervais/optosketch | test/dev.py | Python | gpl-2.0 | 573 |
# Brachyprint -- 3D printing brachytherapy moulds
# Copyright (C) 2013-14 James Cranch, Martin Green and Oliver Madge
#
# 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 ve... | brachyprint/brachyprint | src/gui/mesh_canvas.py | Python | gpl-2.0 | 17,214 |
import requests
from requests import exceptions
import cPickle
import sys
class Object(object):
def __init__(self, **response):
for k, v in response.iteritems():
if isinstance(v, dict):
self.__dict__[k] = Object(**v)
else:
self.__dict__[k... | apanimesh061/hmh-client | hmh-client/ApplicationToken.py | Python | gpl-2.0 | 2,096 |
"""
Contains agent management classes
"""
from uuid import uuid4
import sys
from pulp.common import tags
from pulp.plugins.conduits.profiler import ProfilerConduit
from pulp.plugins.loader import api as plugin_api, exceptions as plugin_exceptions
from pulp.plugins.model import Consumer as ProfiledConsumer
from pulp.p... | beav/pulp | server/pulp/server/managers/consumer/agent.py | Python | gpl-2.0 | 14,938 |
# -*- Mode: Python; -*-
# /*
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation;
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WA... | Gabrielcarvfer/NS3 | examples/tutorial/third.py | Python | gpl-2.0 | 5,692 |
from shortcuts import load_and_train_model, load_dataset, per_item_cross_entropy
from pymuco.lhl.models import PCFGModel
from pymuco.lhl.representations import Grid, Meter
from pymuco.temperley.models import HierarchicalPositionModel, MetricalPositionModel
from pymuco.povel_essens import stimuli, complexity_ratings
f... | bjvanderweij/pymuco | scripts/syncopation_complexity/phase.py | Python | gpl-2.0 | 2,525 |
#!/usr/bin/env python
'''
This is the HadopPyTester analyer
'''
import sys
import argparse
import re
def extractor(input_program):
program_content = [line for line in input_program]
return [s for i, s in enumerate(program_content) if " import " in s], program_content[[i for i, s in enumerate(program_content) if "... | QubitPi/HadooPyTester | src/analyzer.py | Python | gpl-2.0 | 4,312 |
from pyramid.config import Configurator
from pyramid.response import Response
from pyramid.view import view_config
from pyramid.renderers import render_to_response
from paste.httpserver import serve
from models import Bibitex
from forms import BibitexForm
import deform
import couchdbkit
def new(request):
bibitex... | bireme/isisdm | examples/bibitex/bibitex.py | Python | gpl-2.0 | 1,917 |
#Copyright (C) 2003-2006 Douglas Bagnall (douglas * paradise-net-nz)
#
#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.
#
#Th... | foobarlab/UpStage-Video-Hack | server/src/upstage/globalmedia.py | Python | gpl-2.0 | 41,512 |
__author__ = 'saurabh'
try:
from django.conf.urls import patterns, url
except ImportError:
from django.conf.urls.defaults import patterns, url
from sample import views
urlpatterns = patterns('sample.views',
url(r'^$', views.main_page, name='main'),
url(r'^rooms/', views.rooms, name='rooms'),
... | saurabh1e/beaglebone_control | sample/urls.py | Python | gpl-2.0 | 520 |
"""
Django settings for cargo project.
Generated by 'django-admin startproject' using Django 1.11.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
... | freightliner/cargo | cargo/cargo/settings.py | Python | gpl-2.0 | 3,241 |
# Create your views here.
from django.template.context import RequestContext
from django.shortcuts import render, render_to_response
import sys
def pagina_nao_encontrada(request):
return render(request, "core/excecao/pagina_nao_encontrada.html")
def permissao_negada(request):
return render(request, "core/exce... | waldenilson/TerraLegal | project/core/views_excecoes.py | Python | gpl-2.0 | 797 |
import scipy
import numpy
import pyfits
import VLTTools
hostname = "aortc3"
username = "spacimgr"
aortc = VLTTools.VLTConnection(hostname=hostname, username=username)
aortc.make_TT_unscr()
| soylentdeen/BlurryApple | Tools/DM/makemap.py | Python | gpl-2.0 | 193 |
import wx
import invesalius.constants as const
from wx.lib.pubsub import pub as Publisher
import invesalius.session as ses
from invesalius.gui.language_dialog import ComboBoxLanguage
ID = wx.NewId()
try:
from agw import flatnotebook as fnb
AGW = 1
except ImportError: # if it's not there locally, try the wxPyth... | fabio-otsuka/invesalius3 | invesalius/gui/preferences.py | Python | gpl-2.0 | 6,764 |
from __future__ import absolute_import, unicode_literals
import unittest
from binascii import unhexlify
from cinnabar.git import NULL_NODE_ID
from cinnabar.hg.changegroup import (
RawRevChunk01,
RawRevChunk02,
)
from cinnabar.hg.objects import (
Authorship,
Changeset,
File,
Manifest,
)
class T... | glandium/git-cinnabar | tests/hg_objects.py | Python | gpl-2.0 | 16,082 |
#
# Exctraction script for MC d02Kpi
#
script = 'mcfindtracksFinal.py'
t = JobTemplate( application = Bender( version = "v25r3", module = script ))
t.name = "MCFT07"
j = Job( t, backend = Dirac() )
#j = Job( t, backend = Local() )
bkquery = BKQuery('/MC/2011/Beam3500GeV-2011-MagDown-Nu2-EmNoCuts/Sim05/Trig0x40760... | particleist/PromptSecondaryLTUnb | dataExtraction/gangaMcfindtracks.py | Python | gpl-2.0 | 701 |
'''
Created on 08-09-2012
@author: Maciej Wasilak
'''
import sys
from twisted.internet import defer
from twisted.internet import reactor
from twisted.python import log
import txthings.resource as resource
import txthings.coap as coap
from common import utils
class CounterResource (resource.CoAPResource):
"""
... | dan-cristian/haiot | transport/coap/server.py | Python | gpl-2.0 | 5,667 |
import os
class EX:
def __init__(self):
fn='exclude'
if os.path.exists(fn):
with open(fn,'r') as f:
self.pat=[p.strip() for p in f.readlines()[0].split('|')]
else: self.pat=[]
def chk(self,fn):
for pat in self.pat:
i=fn.find(pat)
... | bitboulder/hashbackup | py/ex.py | Python | gpl-2.0 | 491 |
# Generated by Django 2.0.2 on 2018-03-19 12:09
from django.conf import settings
from django.db import migrations, models
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('funds', '0031_labtype_reviewers'),
]
operations = [
migrations.AlterField(
... | OpenTechFund/WebApp | opentech/apply/funds/migrations/0032_make_reviewers_optional_in_all_instances.py | Python | gpl-2.0 | 1,455 |
#!/usr/bin/python2
# -*- coding=utf-8 -*-
#************************************************************************
# $Id: conjugate.py,v 0.7 2009/06/02 01:10:00 Taha Zerrouki $
#
# ------------
# Description:
# ------------
# Copyright (c) 2009, Arabtechies, Arabeyes Taha Zerrouki
#
# This file is the main file to e... | linuxscout/arramooz | scripts/verbs/conjugateToSpell.py | Python | gpl-2.0 | 9,398 |
# windows.py - Windows utility function implementations for Mercurial
#
# Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.
from i18n import _
import osutil... | dkrisman/Traipse | mercurial/windows.py | Python | gpl-2.0 | 9,026 |
"""
Initialize the module.
Author:
Panagiotis Tsilifis
Date:
5/22/2014
"""
from _forward_model import *
from _forward_model_dmnless import *
from _forward_full_model import *
from _forward_model_dmnl_y0 import * | ebilionis/variational-reformulation-of-inverse-problems | demos/catalysis/__init__.py | Python | gpl-2.0 | 223 |
import pickle
import xml.etree.ElementTree as ET
import nsb_steam
def entryIndex(xml):
for index, value in enumerate(xml):
if value.tag == 'entries':
return index
raise Exception('no index tag in xml')
def convertIfPossible(data):
try:
return int(data)
except (ValueError, ... | h00701350103/necro_score_bot | nsb_database.py | Python | gpl-2.0 | 1,769 |
# Copyright 2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
import errno
import shutil
import warnings
import portage
from portage import os, _encodings, _unicode_decode, _unicode_encode
from portage.data import portage_gid, portage_uid
... | fastinetserver/portage-idfetch | pym/portage/_deprecated.py | Python | gpl-2.0 | 6,645 |
import os.path, re, urllib, time, cgi
import simplejson
from twisted.application import service
from twisted.trial import unittest
from twisted.internet import defer, reactor
from twisted.internet.task import Clock
from twisted.web import client, error, http
from twisted.python import failure, log
from nevow.util imp... | david415/tahoe-lafs | src/allmydata/test/web/test_web.py | Python | gpl-2.0 | 211,052 |
import requests
from nose.tools import assert_equals
import ujson
#RESET ALL DATA IN THE SERVER
requests.get('http://localhost:8081/v1.0/reset')
#MAKE A REQUEST TO PUBLISH A MESSAGE TO THE FORUM
'''
The URL is http://localhost:8081/v1.0/forum
THE BODY SHOULD HAVE THE FOLLOWING MANDATORY PARAMETERS: theme, subject and... | twiindan/forum | test/exercices/exercice_1.py | Python | gpl-2.0 | 962 |
"""
loader.py
Jose Guzman, sjm.guzman@gmail.com
Claudia Espinoza, claudia.espinoza@ist.ac.at
Created: Wed Jul 19 01:45:16 CEST 2017
Contains a class to load ASCII files with connectivities and
distances between neurons recorded in an simultaneous whole-cell
patch clamp recording.
Example:
>>> from loader import D... | ClaudiaEsp/inet | inet/loader.py | Python | gpl-2.0 | 8,475 |
# -*- test-case-name: beah.test.test_config -*-
# Beah - Test harness. Part of Beaker project.
#
# Copyright (C) 2009 Red Hat, 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 vers... | beaker-project/beah | beah/config.py | Python | gpl-2.0 | 25,374 |