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) 2012-2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. import collections import json import re import sys import types from . import validators __version__ = "1.9.0" # constants for DeletionPolicy Delete = 'Delete' Retain = 'Retain' Snapshot = 'Snapshot'...
mnahm5/django-estore
Lib/site-packages/troposphere/__init__.py
Python
mit
18,785
import uuid from django.contrib.auth.models import User from django.db import models STATUS_CHOICES = ( ('atendido', 'Atendido'), ('no_atendido', 'No Atendido'), ('en_proceso', 'En Proceso'), ) class Municipio(models.Model): name = models.CharField(max_length=100, blank=False, null=False) def _...
fcopantoja/sips
sips/asuntos/models.py
Python
mit
2,019
import csv import json csvfile = open('su15.csv', 'r') jsonfile = open('output.json', 'w') output = {'name' : 'Summer 2015', 'children': []} gender = {'children' : []} i = 0 a = {'test' : []} for row in csv.DictReader(csvfile): a['test'].append({'name' : 'Male', 'size' : row['Male'] }) a['test'].append({'name' : '...
SudarshanGp/R_Test
test.py
Python
mit
1,088
import random import re import vsphere_inventory as vsphere from os.path import join, dirname try: import json except ImportError: import simplejson as json def readNamesFrom(filepath): with open(filepath) as f: return f.readlines() def randomName(lefts, rights): left = random.choice(lefts)....
lymingtonprecision/maat
ansible/name_generator.py
Python
mit
1,321
#!/usr/bin/env python import grp import os import pwd import sys from odkim_rotate.key_table import * from odkim_rotate.manager import * from odkim_rotate.utils import * def main(verbose): manager = Manager(verbose) manager.opendkim_conf = '/etc/opendkim.conf' manager.opendkim_keys_basedir = '/etc/dkimke...
tetsuo13/OpenDKIM-Rotate-Keys
rotate_opendkim_keys.py
Python
mit
1,054
from firehose.model import Issue, Message, File, Location, Point import re LINE_EXPR = re.compile(r"(?P<path>.*): (?P<severity>.*): (?P<msg>.*)") def parse_desktop_file_validate(lines): for line in lines: info = LINE_EXPR.match(line).groupdict() path = info['path'] message = info['msg'] ...
paultag/ethel
ethel/wrappers/desktop_file_validate.py
Python
mit
735
# Generated by Django 2.2.16 on 2020-10-01 18:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('projects', '0064_add_feature_future_default_true'), ] operations = [ migrations.AlterField( model_name='project', n...
rtfd/readthedocs.org
readthedocs/projects/migrations/0065_add_feature_future_default_true.py
Python
mit
594
# -*- coding: utf-8 -*- from bpy.types import PropertyGroup from bpy.props import StringProperty, IntProperty, BoolProperty, FloatProperty, FloatVectorProperty from mmd_tools.core.bone import FnBone def _updateMMDBoneAdditionalTransform(prop, context): prop['is_additional_transform_dirty'] = True p_bone = co...
lordscales91/blender_mmd_tools
mmd_tools/properties/bone.py
Python
mit
4,418
""" Django settings for mdwiki project. Generated by 'django-admin startproject' using Django 1.9.1. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os fro...
art-solopov/mdwiki
mdwiki/settings.py
Python
mit
4,303
"""Empty file. Might grow in the future.""" import didyoumean_api
SylvainDe/DidYouMean-Python
didyoumean/__init__.py
Python
mit
66
#!/usr/bin/env python import random import readline import cmd from sqlalchemy import * from dbtruck.infertypes import infer_col_type def err_wrapper(fn): def f(self, *args, **kwargs): if fn.__name__ != "do_connect" and not self.check_conn(): return try: return fn(self, *args, **kwargs) except E...
sirrice/dbtruck
bin/fixschema.py
Python
mit
17,548
# -*- coding: utf-8 -*- """ Tests for the audiotsm.utils.normalizebuffer package. """ import pytest from numpy.testing import assert_almost_equal from audiotsm.utils import NormalizeBuffer def generate_normalize_buffers(array): """Generate different NormalizeBuffers containing the same data as ``array``.""...
Muges/audiotsm
tests/unit/utils/test_normalizebuffer.py
Python
mit
2,381
# 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 ...
rjschwei/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py
Python
mit
7,735
__author__ = 'lucas' pi = 3.14159 raio = float(input()) area = pi * (raio * raio) print ("A=%.4f" % area)
lccp/URIJudgeProblemsPython
URIOnlineJudge_1002_AreaDoCirculo/area_do_circulo.py
Python
mit
109
from ..base import ShopifyResource class Location(ShopifyResource): pass
asiviero/shopify_python_api
shopify/resources/location.py
Python
mit
79
class BasePlugin(object): """ Extend this/copy its structure to create plugins. Your plugin class must be `Plugin` to be loaded. Can include commands (command_*), admin commands (admin_). Additionally, yaib will look functions for many of the connection events. Any commands with a docstr...
collingreen/yaib
plugins/baseplugin.py
Python
mit
5,580
# # pronounce.py # Record pronunciations for word entries # # Jonatan H Sundqvist # May 18 2015 # # TODO | - # - # SPEC | - # - import mozart import sqlite3 import queue import tkinter as tk class Pronounce(object): ''' Docstring goes here ''' def __init__(self): ''' Docstring goes ...
GrandmasterShadowMorgue/KerfuffleOfTheDandelions
pronounce.py
Python
mit
662
# Copyright (c) Jupyter Development Team. from jupyter_core.paths import jupyter_data_dir import subprocess import os PEM_FILE = os.path.join(jupyter_data_dir(), 'notebook.pem') c = get_config() c.NotebookApp.ip = os.getenv('INTERFACE', '') or '*' c.NotebookApp.port = int(os.getenv('PORT', '') or 8888) c.NotebookApp....
michigraber/neuralyzer
docker/jupyter_minimal/jupyter_notebook_config.py
Python
mit
1,000
l = [] for x in range(int(input())): l.append(int(input())) l.sort() print(' '.join(str(x) for x in l[::-1]))
NendoTaka/CodeForReference
Codingame/Python/Clash/SortHighLowReverse.py
Python
mit
112
import unittest from graph_search import Graph from graph_topological_ordering import find_topological_order class TestGraphTopologicalOrdering(unittest.TestCase): def check_labels(self, graph, smaller, larger): self.assertTrue(graph.get_node(smaller).label < graph.get_node(larger).label) def test_1(...
codebox/algorithms
test_graph_topological_ordering.py
Python
mit
943
import csv from openpyxl import load_workbook import io from dwarfsquad.lib.build.from_export import build_compound_methods, build_lots_and_levels from dwarfsquad.lib.build.from_export.build_assay_configuration import build_assay_configuration from dwarfsquad.lib.build.from_export.build_rulesettings import add_rules_to...
whereskenneth/Dwarfsquad
dwarfsquad/lib/build/from_xlsx/build_full_ac.py
Python
mit
1,706
import json from copy import copy from collections import OrderedDict # SSE "protocol" is described here: http://mzl.la/UPFyxY class ServerSentEvent(object): def __init__(self, data=None, event=None, retry=None, id=None): if data is None and event is None: raise ValueError('data and event can...
smithk86/flask-sse
flask_sse/server_sent_event.py
Python
mit
1,387
# -*- coding:utf_8 -*- import urllib2 from bs4 import BeautifulSoup from Bangumi import Bangumi class Youku(Bangumi): link = "http://comic.youku.com" name = u'优酷' def getBangumi(self): """Youku processing function""" # Get Youku bangumi HTML req = urllib2.Request(self.link) ...
MrWhoami/WhoamiBangumi
Youku.py
Python
mit
1,140
""" Telnets to devices to preform tasks""" import telnetlib from pydispatch import dispatcher from threading import Thread import datetime import subprocess # import serial # import io import time from dataclasses import dataclass, field @dataclass class MSEValues: report_time: datetime = datetime.datetime.now()...
AMXAUNZ/Magic-DXLink-Configurator
scripts/telnet_class.py
Python
mit
23,853
#!/usr/bin/env python2.6 #nknguyen soe ucsc edu #March 20 2012 #Input: input directory of fasta files #Output: fasta files of a sampled subset of the original files with a specific size import os, sys, re, random, copy import immunoseq.lib.immunoseqLib as iseqlib from sonLib.bioio import system from optparse import O...
ngannguyen/immunoseq
src/sampling.py
Python
mit
13,290
class Solution: # @param n, an integer # @return an integer def reverseBits(self, n): reverse = 0 r = n for i in range(32): bit = r % 2 reverse += bit << (32-i-1) r = r / 2 return reverse s = Solution() r = s.reverseBits(43261596) print(r)...
lutianming/leetcode
reverse_bits.py
Python
mit
321
# Support for building census bundles in Ambry __version__ = 0.8 __author__ = 'eric@civicknowledge.com' from .generator import * from .schema import * from .sources import * from .transforms import * import ambry.bundle class AcsBundle(ambry.bundle.Bundle, MakeTablesMixin, MakeSourcesMixin, JamValue...
CivicKnowledge/censuslib
censuslib/__init__.py
Python
mit
3,138
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import io import six import json from copy import deepcopy from .profile import Profile from .field import Field from . import exceptions from . i...
okfn/jsontableschema-py
tableschema/schema.py
Python
mit
10,197
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from datetime import date, datetime from ._checker import CheckerFactory, TypeCheckerBase, TypeCheckerDelegator from ._common import isstring class DateTimeTypeCheckerStrictLevel0(TypeCheckerBase): def is_instance(self): return isin...
thombashi/typepy
typepy/checker/_datetime.py
Python
mit
1,159
#! AFDKOPython import sys, pickle, os from mutatorMath.ufo.document import DesignSpaceDocumentWriter def main(): family = pickle.load(sys.stdin) generate_designspace(family, 'font.designspace') def generate_designspace(family, path): def normalize_path(path): return os.path.join(family['working_...
mooniak/hindkit
hindkit/AFDKOPython/generate_designspace.py
Python
mit
1,566
from django.db import models from django.db.models import Count from django.db.models.query import QuerySet from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from model_utils import Choices from observations.models import Observation from observations.utils import jd_now CONSTE...
zsiciarz/variablestars.net
stars/models.py
Python
mit
6,165
def solve(n, k): if k == 0: return 0 if (k >= n) and ((k+1) %(2**n) == 0): return 1 return 0 if __name__ == "__main__": t = int(input()) for ti in range(1, t + 1): n, k = map(int, input().split(" ")) sol = "ON" if solve(n, k) == 1 else "OFF" print("Case #{0}...
subhrm/google-code-jam-solutions
solutions/2010/Q/A/A.py
Python
mit
344
from __future__ import unicode_literals import operator import unittest try: from unittest import mock except ImportError: import mock import six import fs.copy import fs.mirror import fs.move import fs.wrap import fs.errors from fs import open_fs from fs.info import Info class TestWrapReadOnly(unittest.T...
PyFilesystem/pyfilesystem2
tests/test_wrap.py
Python
mit
7,991
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-08-02 20:55 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mindynode_nltk', '0009_auto_20170802_2046'), ] operations = [ migrations.AddFi...
josherich/mindynode-parsers
mindynode_nltk/migrations/0010_keywordsum_keyword_category.py
Python
mit
519
import os import sys import django import datetime from api.ecs_api import EcsApi import log.log as log from multiprocessing import Pool from time import sleep import subprocess BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0,BASE_DIR) os.environ.setdefault("DJANGO_SETTINGS_MOD...
hyperwd/hwcram
crontab/cron.py
Python
mit
1,727
import os import numpy as np from typing import List, Dict, Union, Optional import subprocess as sp import matplotlib import matplotlib.transforms import matplotlib.pyplot as plt import matplotlib.gridspec as gs import matplotlib.transforms as tf import matplotlib.cm as cm from matplotlib.axes import Axes from matplotl...
JoostHuizinga/ea-plotting-scripts
configure_plots.py
Python
mit
25,413
from django.db import models from django.utils import timezone from user.models import User from adminsortable.models import SortableMixin class Topic(SortableMixin): ''' Model to define the behaviour of a topic ''' class Meta: ''' Meta options for topic mod...
anehx/anonboard-backend
core/models.py
Python
mit
2,696
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from .models import Show, Episode, Category, ShowCategory # Create custom admins with inlines for categories class ShowCategoryInline(admin.TabularInline): model = Category.shows.through class EpisodeInline(admin.Ta...
KBIAnews/Podcasts
django-project/shows/admin.py
Python
mit
719
# Copyright (c) 2019 J. Alvarez-Jarreta and C.J. Brasher # # This file is part of the LipidFinder software tool and governed by the # 'MIT License'. Please see the LICENSE file that should have been # included as part of this software. """Set of methods focused on creating a summary of the dataset: > create_summary...
cjbrasher/LipidFinder
LipidFinder/PeakFilter/Summary.py
Python
mit
2,682
import pprint ### "import" from example.classes import Data ### "plugins" Data.plugins import example.classes2 Data.plugins ### "example-data" example_data = [{ "foo" : 123, "bar" : 456 }] ### "csv-example" csv_data = Data.create_instance('csv', example_data) csv_data.present() csv_data.update_settin...
dexy/cashew
example/usage2.py
Python
mit
581
from PyQt5.QtWidgets import * from PyQt5.QtGui import * from cairodrawing import CairoDrawing, PointType from structures import Point, HomogeneousPoint class ComplexView(QWidget): def __init__(self, parent=None, indent=20): super(ComplexView, self).__init__(parent) width = self.width() h...
NickolayStorm/usatu-learning
ComputerGraphic/Lab2/complexview.py
Python
mit
6,080
""" Utils module tests. """ import shutil from unittest import TestCase from microtbs_rl import envs from microtbs_rl.utils.exploration import LinearDecay from microtbs_rl.utils.record_policy_execution import record from microtbs_rl.utils.common_utils import get_test_logger, experiment_dir from microtbs_rl.algori...
alex-petrenko/hierarchical-rl
microtbs_rl/utils/tests/test_utils.py
Python
mit
1,981
from bisect import bisect_left, bisect_right class SortedCollection(object): '''Sequence sorted by a key function. SortedCollection() is much easier to work with than using bisect() directly. It supports key functions like those use in sorted(), min(), and max(). The result of the key function call is...
TigerND/dtx-core
src/utils/snippets/sorted_collection.py
Python
mit
11,282
import numpy, matplotlib, random, pylab, math def matrix_square_root(sigma) : eigen, vect = numpy.linalg.eig(sigma) dim = len(sigma) res = numpy.identity(dim) for i in range(0,dim) : res[i,i] = eigen[i]**0.5 return vect * res * vect.transpose() def chi2_level (alpha = 0.95) : N = 1...
sdpython/ensae_teaching_cs
_todo/pvalues/pvalues_sigma.py
Python
mit
2,697
from __future__ import unicode_literals # this must correspond to "atom_structures.h" knownStructures = [ "disordered", "FCC", "HCP", "BCC", "icosahedral", "sigma11_tilt1", "sigma11_tilt2", ]
chrisdjscott/Atoman
atoman/filtering/atomStructure.py
Python
mit
221
#pragma out #pragma repy restrictions.veryslownetsend def foo(ip,port,sock, mainch, ch): data = sock.recv(1000) print ip,port,data stopcomm(ch) stopcomm(mainch) if callfunc == 'initialize': ip = getmyip() waitforconn(ip,<connport>,foo) sleep(.1) csock = openconn(ip,<connport>) csock.send('Hello, thi...
sburnett/seattle
repy/tests/ut_repytests_veryslownetsend-testrecv.py
Python
mit
382
print(' Multiplication Table') print(" ", end = '') for j in range(1, 10): print(" ", j, end="") print() print('---------------------------------------') for i in range(1, 10): print(i, "|", end="") for j in range(1, 10): print(format(i * j, "3d"), end="") print()
vagabondize/MyDemo
python/Multiplication.py
Python
mit
300
import boto3 import datetime import json import logging import os import pytz import requests import structlog import transaction import urllib.parse from botocore.exceptions import ClientError from copy import deepcopy from pyramid.httpexceptions import ( HTTPForbidden, HTTPTemporaryRedirect, HTTPNotFound...
hms-dbmi/fourfront
src/encoded/types/file.py
Python
mit
77,254
from gpiozero import RGBLED from time import sleep led = RGBLED(red=17, green=18, blue=19) delay = 0.02 while True: for x in range(100): led.red = x/100 sleep(delay) for x in range(100, -1, -1): led.red = x/100 sleep(delay) for x in range(100): led.green = x/100 ...
claremacrae/raspi_code
hardware/raspio_pro_hat/pulse_rgbled.py
Python
mit
570
from population import Population from cell import Cell # Create population for the simulation p = Population(Cell(drug_resistance=2, can_divide=True)) # Start loop while True: action = raw_input('Enter action (tick/kill/quit): ') if(action == 'tick'): number_of_ticks = int(raw_input('Enter number o...
sabarjp/ClonalCellSimulation
simulate.py
Python
mit
715
# Copyright (C) 2010-2013 Claudio Guarnieri. # Copyright (C) 2014-2016 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. """Added failed statuses to tasks (from Cuckoo 1.1 to 1.2) Revision ID: 495d5a6edef3 Revises: 18eee46c6f8...
cuckoobox/cuckoo
cuckoo/private/db_migration/versions/from_1_1_to_1_2-added_states.py
Python
mit
7,228
try: from setuptools import setup except ImportError: from distutils.core import setup def main(): setup( name = 'transloader', packages=['transloader'], package_dir = {'transloader':'transloader'}, version = open('VERSION.txt').read().strip(), author='Mike Thornton...
six8/transloader
setup.py
Python
mit
1,083
#!python # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://www.mozilla.org/MPL/ #...
anisku11/sublimeku
Packages/CodeComplice/libs/codeintel2/udl.py
Python
mit
23,772
#!/usr/bin/env python import sys urllib_urlretrieve = None try: # Python 3.x or later import urllib.request urllib_urlretrieve = urllib.request.urlretrieve except ImportError: # Python 2.x import urllib urllib_urlretrieve = urllib.urlretrieve def download(url, target_path): urllib_urlre...
knimon-software/ffos-meets-closure
tools/sub/download.py
Python
mit
567
import json import pytest from sqlalchemy import and_ from tests.unit.dataactcore.factories.domain import CGACFactory, FRECFactory from dataactcore.models.lookups import FILE_TYPE_DICT_LETTER_ID, RULE_SEVERITY_DICT, RULE_IMPACT_DICT from dataactcore.models.validationModels import RuleSql, RuleSetting from dataactcore....
fedspendingtransparency/data-act-broker-backend
tests/unit/dataactbroker/test_settings_handler.py
Python
cc0-1.0
17,247
# ~/spark/bin/spark-submit --master local[*] wc.py "file:///home/oxclo/datafiles/books/*" from pyspark import SparkContext, SparkConf import sys conf = SparkConf().setAppName("wordCount") sc = SparkContext(conf=conf) books = sc.textFile(sys.argv[1]) split = books.flatMap(lambda line: line.split()) stripped = split...
pzfreo/ox-clo
code/wc/spark/wc.py
Python
cc0-1.0
532
# Copyright 2010 David Hwang # # 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. # """ These are some helper functions for tests. """ import shutil import os import os.path front = "....
ultima51x/shelltag
test/functions.py
Python
gpl-2.0
1,243
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
ATSTI/administra
open_myplace/crm_lead_to_opportunity.py
Python
gpl-2.0
2,980
#!/usr/bin/env python # -*- coding:utf-8 -*- # Created by xixijun # Date: 15-5-7 # Blog: morningchen.com def outer_foo(): a = 10 def inner_foo(): global a a = 20 print "inner_foo: a=", a # inner_foo() print "outer_foo: a=", a a = 30 outer_foo() print "a=", a
chen2aaron/SnirteneCodes
StarterLearningPython/208-namespaces-2.py
Python
gpl-2.0
303
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2012-2013 Zuza Software Foundation # # This file is part of Pootle. # # Pootle 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 th...
ttreeagency/PootleTypo3Org
pootle/apps/staticpages/views.py
Python
gpl-2.0
5,490
#!/usr/bin/env python # -*- coding:utf-8 -*- import sys import os import datetime import json import getopt import codecs from internal.trade_date import * from internal.url_dfcf.dc_hq_push import * def cmp_gn_bk(cmpList, bk_id): cmpLen = len(cmpList) for idx in range(0, cmpLen): if cmpList[idx]['f12']!=bk_id: ...
yudingding6197/fin_script
gainian_bk_change.py
Python
gpl-2.0
3,018
# Copyright (c) 2018 UPB # # 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 WARRANTY; without even ...
rlupu/ids-tools
botnet_synthesizer.py
Python
gpl-2.0
11,562
import unittest from dnfpy.model.fieldMap import FieldMap class TestFieldMap(unittest.TestCase): def setUp(self): self.uut = FieldMap("uut",size=1,dt=0.1,lat=1,aff=1,tau=0.8,h=0, th=0.64,model='cnft') def test_update(self): self.uut....
bchappet/dnfpy
src/test_dnfpy/model/testFieldMap.py
Python
gpl-2.0
1,305
#!/usr/bin/env python # -*- coding: UTF-8 -*- # 2015 - AdrXbmc import urllib,urllib2,re,xbmcplugin,xbmcgui,xbmc,xbmcaddon,HTMLParser,os,sys,time from resolvers import * addon_id = 'plugin.video.adrxbmctv' selfAddon = xbmcaddon.Addon(id=addon_id) addonfolder = selfAddon.getAddonInfo('path') artfolder = addonfolder + '...
adrxbmc/adrxbmc.repository
plugin.video.adrxbmctv/resources/lib/brazzers.py
Python
gpl-2.0
7,147
# -*-python-*- # GemRB - Infinity Engine Emulator # Copyright (C) 2011 The GemRB Project # # 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) ...
flaing/gemrb
gemrb/GUIScripts/Spellbook.py
Python
gpl-2.0
22,628
# -*- coding: utf-8 -*- """ HTCAP - beta 1 Author: filippo.cavallarin@wearesegment.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 of the License, or (at your option) any lat...
delvelabs/htcap
core/crawl/lib/shared.py
Python
gpl-2.0
778
from django.core.urlresolvers import reverse from django.contrib import messages from django.contrib.auth.mixins import PermissionRequiredMixin from django.db.models import Q from django.forms import ModelForm from django.shortcuts import render, get_object_or_404, redirect from django.views.generic import View, Templa...
Alaxe/judgeSystem
judge/views/testgroup.py
Python
gpl-2.0
4,074
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-02-01 09:00 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ...
monuszko/django-polls
polls/migrations/0004_auto_20160201_1000.py
Python
gpl-2.0
926
# ##### 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 program is distrib...
hdunderscore/hd-io_scene_fbx
__init__.py
Python
gpl-2.0
15,423
# -*- coding: utf-8 -*- """ ################################################ Plataforma ActivUFRJ ################################################ :Author: *Núcleo de Computação Eletrônica (NCE/UFRJ)* :Contact: carlo@nce.ufrj.br :Date: $Date: 2009-2010 $ :Status: This is a "work in progress" :Revision: $Revision: 0.0...
labase/activnce
main/question/database.py
Python
gpl-2.0
1,434
#!/bin/env python2 from alife.worlds.world import World, Point from alife.agents.UtilityAgent import SimpleAgent from alife.utils.utils import dumpToArray, zeros import math import sys import numpy from nupic.encoders.extras.utility import SimpleUtilityEncoder # common settings: items=None target=Point(4,9) agent=Non...
breznak/ALife
alife/experiments/behavior/random_walk_map.py
Python
gpl-2.0
6,062
from oeqa.runtime.case import OERuntimeTestCase from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.oeid import OETestID class DfTest(OERuntimeTestCase): @OETestID(234) @OETestDepends(['ssh.SSHTest.test_ssh']) def test_df(self): cmd = "df / | sed -n '2p' | awk '{print $4...
schleichdi2/OPENNFR-6.1-CORE
opennfr-openembedded-core/meta/lib/oeqa/runtime/cases/df.py
Python
gpl-2.0
493
#! /usr/bin/env python """This script runs calibration pre-processing steps including sky and PSF models. """ from __future__ import print_function from astrometry.util.fits import merge_tables from legacypipe.survey import run_calibs, LegacySurveyData def main(): """Main program. """ import argparse ...
legacysurvey/pipeline
py/legacyzpts/run-calib.py
Python
gpl-2.0
4,720
# # This file is only used in the Java (Jython) version # It serves as an entry point. # import sys import PyPlucker.Spider from java.lang import Runtime from java.util import Hashtable import org.plkr.distiller.API class InvokePluckerBuildFromJava (org.plkr.distiller.API.Invocation): def __init__(s...
arpruss/plucker
parser/python/InvokePluckerBuildFromJava.py
Python
gpl-2.0
1,742
from .types import InstallableFiles
FrodeSolheim/fs-uae-launcher
fsgamesys/files/installablefiles.py
Python
gpl-2.0
36
#!/usr/bin/python # # $Id: LISP-Sonar.py 18 2014-10-06 13:23:37Z ggx $ # # -------------------------------Important Marks------------------------------- # Surprisingly, we found that when manually executing the current Python script, # the point symbol in file path is recognized,but not recognized when called via NEPI...
hansomesong/First_LISP_measurement
LISP-Sonar.py
Python
gpl-2.0
9,113
def parse_cmip5_filename(filename): n_underscore = filename.count('_') args = [] for i in range(n_underscore): args.append(filename[0:filename.find('_')]) filename = filename[filename.find('_')+1:] args.append(int(filename[0:4])) args.append(int(filename[4:6])) args.append(int(...
ckoven/ckplotlib
cmip5_mod.py
Python
gpl-2.0
2,630
from PIL import Image import os from pylons import config def resize_image(filename, max_width=None, max_height=None, crop=False): """Given the filename of an image in the image dir, it resizes it""" im = Image.open(os.path.join(config['images_dir'], filename)) (width, height) = im.size # If ...
bitonic/troppotardi
troppotardi/lib/thumbnailer.py
Python
gpl-2.0
2,794
# -*- coding: utf-8 -*- ''' Created on 05.09.2015 @author: derChris ''' class ezDict(dict): def __missing__(self, key): self.update({key: ezDict()}) return self[key] def reduce(self): items = list(self.items()) for key, value in items: ...
ChrisCuts/fnode
src/ezClasses/ezClasses.py
Python
gpl-2.0
755
import logging # Disable logging in unit tests logging.disable(logging.CRITICAL)
bramfoo/solarstats
tests/__init__.py
Python
gpl-2.0
82
# -*- coding:utf-8 -*- from django.conf.urls import patterns, url from django.contrib import admin from views import AssertView admin.autodiscover() urlpatterns = patterns( '', url(r'^$', AssertView.as_view(), name='redirect'), )
Rondineli/django-sso
django_sso/sso_request/urls.py
Python
gpl-2.0
242
#!/usr/bin/env python import os import uuid import cgi import hashlib import webapp2 as webapp from google.appengine.ext.webapp import template from google.appengine.ext.webapp import util from google.appengine.ext import db from google.appengine.api import users import datetime from calendar import timegm import time ...
040medien/furnaceathome
furnace.py
Python
gpl-2.0
9,961
# vim: set fileencoding=utf-8 : # # (C) 2014 Guido Günther <agx@sigxcpu.org> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) an...
agx/git-buildpackage
gbp/format.py
Python
gpl-2.0
2,429
#!/usr/bin/python # # Usage: # sudo ./reproducer.py num_threads num_iterations_per_thread nfs_share # # Example: # sudo ./reproducer.py 5 10 IPADDRESS:/path/to/dir # Will run 5 threads, each with 10 iterations, writing to the NFS share at IPADDRESS:/path/to/dir # # Prerequisites: # 1. Install a base trusty cont...
jijianwen/Learn
Linux/linux_tests/nfs_network_load/test.py
Python
gpl-2.0
4,473
from tree import * from worker import * import multiprocessing import graph as graph import random # create a sample undirected graph g = graph.sampleUnDirectedGraph() # get list of all vertex in graph vertexList = g.getVertices() # initialize an empty tree object tree = Tree() # choose random node from graph, this wi...
abhipec/academicCodes
CS350M/main.py
Python
gpl-2.0
2,153
from Renderer import Renderer import unittest from collections import OrderedDict class TestRender(unittest.TestCase): def setUp(self): pass def test_stringConstructor(self): render = Renderer.newFromString("a = 1 + 2") def test_fileConstructor(self): render = Renderer.ne...
cpantel/codeMutator
modules/python/TestRender.py
Python
gpl-2.0
421
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-01-20 19:10 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('subjects', '0012_auto_20170112_1408'), ] operations = [ migrations.AlterField...
amadeusproject/amadeuslms
subjects/migrations/0013_auto_20170120_1610.py
Python
gpl-2.0
503
from flask import url_for from openatlas import app from openatlas.models.entity import Entity from tests.base import TestBaseCase class SearchTest(TestBaseCase): def test_search(self) -> None: with app.test_request_context(): app.preprocess_request() # type: ignore person = Ent...
craws/OpenAtlas-Python
tests/test_search.py
Python
gpl-2.0
1,697
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from sms.app import app if __name__ == '__main__': port = int(os.environ.get("PORT", 5000)) if port == 5000: app.debug = True app.run(host='0.0.0.0', port=port)
hirefrank/bowery-sms
app.py
Python
gpl-2.0
240
# Here you can create play commands that are specific to the module, and extend existing commands import os import os.path import shutil import time from play.utils import * MODULE = 'injection' # Commands that are specific to your module COMMANDS = ['injection:ec'] HELP = { 'injection:ec': 'Update eclipse...
marcoandreini/injection
commands.py
Python
gpl-2.0
5,661
"""Provides VM delete parser.""" # Copyright (c) 2018 - I.T. Dev Ltd # # This file is part of MCVirt. # # MCVirt 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 ...
ITDevLtd/MCVirt
source/mcvirt-daemon/usr/lib/python2.7/dist-packages/mcvirt/parser_modules/virtual_machine/delete_parser.py
Python
gpl-2.0
2,888
# -*- coding: utf-8 -*- """ Insert Trims (multi-line) based on the video frame bookmarks at the current cursor position of the Avisynth script in the current tab. Date: 2012-09-11 Latest version: https://github.com/vdcrim/avsp-macros Doom9 Forum thread: http://forum.doom9.org/showthread.php?t=163653 Changelog:...
vdcrim/AvsP-macros
Insert Trims from bookmarks (multi-line).py
Python
gpl-2.0
1,709
# coding: utf-8 # %save en ipython is wonderful. Cargar con ipython -i para continuar. from framework import pclases a = pclases.Obra.selectBy(nombre = "SU ALMACEN")[0] len(a.clientes) for c in a.clientes: print c.nombre vacidas = [o for o in pclases.Obra.select() if not o.clientes] len(vacidas) for o in vacid...
pacoqueen/ginn
extra/scripts/ipython_session_obra_su_almacen.py
Python
gpl-2.0
1,431
# ----------------------------------------------------------- # demonstrates the usage of a while loop with else condition #o # (C) 2017 Frank Hofmann, Berlin, Germany # Released under GNU Public License (GPL) # email frank.hofmann@efho.de # ----------------------------------------------------------- # define list sho...
hofmannedv/training-python
loops/while-else.py
Python
gpl-2.0
630
##################################################################### # -*- coding: iso-8859-1 -*- # # # # Frets on Fire # # Copyright (C) 2006 Sami Kyöstilä ...
mdsitton/fofix
fofix/core/Audio.py
Python
gpl-2.0
7,008
import maya.cmds as mc import os def vrayFrameBufferFix(): """ Fixes missing V-ray FrameBuffer It happens from time to time that the V-ray frame buffer just disappears and won't pop up. In that scenario it's probably the good old V-ray for Maya framebuffer bug striking again. When that ha...
BigRoy/mayaVrayCommandDocs
snippets/vrayFrameBufferFix.py
Python
gpl-2.0
2,703
from scrapy.spider import BaseSpider from scrapy.selector import Selector from ExchangeRate.items import ExchangerateItem import re class RaiffeisenSpider(BaseSpider): name = "Raiffeisen" allowed_domains = ["www.raiffeisen.ro"] start_urls = [ "http://www.raiffeisen.ro/curs-valutar", ] def parse(sel...
quamis/ExchangeRate
ExchangeRate/ExchangeRate/spiders/Raiffeisen.py
Python
gpl-2.0
1,581
# -*- coding: utf-8 -*- from os.path import join, abspath from apconf import Options from configurations import Settings opts = Options() def get(value, default): return opts.get(value, default, section='Filer') class FilerMixin(object): """Settings para django-filer y easy_thumbnails""" THUMBNAIL_PR...
eduherraiz/naniano
src/apconf/mixins/filerconf.py
Python
gpl-2.0
5,114
__author__ = 'ENG-5 USER' from numpy import * import numpy as np
Geekly/framepy
pump.py
Python
gpl-2.0
68
from __future__ import print_function, division, absolute_import # Copyright (c) 2016 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 FITNES...
Lorquas/subscription-manager
src/rhsmlib/facts/collector.py
Python
gpl-2.0
4,009