code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-01-16 05:59
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('polls', '0075_response_active'),
]
operations = [
... | PrefPy/opra | compsocsite/polls/migrations/0076_auto_20170116_0059.py | Python | mit | 1,153 |
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------
# strptime.py - This is the Freevo module
# -----------------------------------------------------------------------
# $Id$
#
# Notes:
# Todo:
#
# -----------------------------------------------------------------------... | freevo/freevo1 | src/tv/strptime.py | Python | gpl-2.0 | 21,418 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 cagayakemiracl All Rights Reserved.
# $Mail: <cagayakemiracl@gmail.com>
from abc import ABCMeta, abstractmethod
class BaseFactory:
__metaclass__ = ABCMeta
def make(self, n):
return [self.new_instance() for _ in range(n)]
@abstractmethod
def new_... | cagayakemiracl/ec | ec/director/manager/factory/base/base_factory.py | Python | gpl-3.0 | 349 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Read from https://www.datacamp.com/community/tutorials/markov-chains-python-tutorial
import numpy as np
import random as rm
# The statespace
states = ["Sleep","Icecream","Run"]
# Possible sequences of events
transitionName = [["SS","SR","SI"],["RS","RR","RI"],["IS","IR","... | davidam/python-examples | statistics/markov-chain.py | Python | gpl-3.0 | 3,215 |
input = """
1 2 0 0
1 3 0 0
1 4 0 0
1 5 0 0
1 6 0 0
1 7 0 0
1 8 0 0
1 9 0 0
1 10 0 0
1 11 0 0
1 12 0 0
1 13 0 0
1 14 0 0
1 15 0 0
1 16 0 0
1 17 0 0
1 18 0 0
1 19 0 0
1 20 0 0
1 21 0 0
1 22 0 0
1 23 0 0
1 24 0 0
1 25 0 0
1 26 0 0
1 27 0 0
1 28 0 0
1 29 0 0
1 30 0 0
1 31 0 0
1 32 0 0
1 33 0 0
1 34 0 0
1 35 0 0
1 36 0 0
1... | alviano/wasp | tests/asp/cautious/solitaire14.cautious.asp.test.py | Python | apache-2.0 | 40,390 |
import mock
from unittest import TestCase
from chroma_api.related_field import dehydrate_related
class TestRelated(TestCase):
def setUp(self):
self.mock_related_field = mock.Mock()
self.mock_related_resource = mock.Mock()
self.mock_bundle = mock.Mock()
self.mock_related_bundle = m... | intel-hpdd/intel-manager-for-lustre | tests/unit/chroma_api/test_related.py | Python | mit | 4,198 |
# -*- coding: utf-8 -*-
#
# Base model of HMM Aligner
# Simon Fraser University
# NLP Lab
#
# This is the base model for all models. It is recommanded that one uses an
# AlignmentModelBase as the parent class of their own model. The base model
# here provides the function to export and load existing models.
#
import o... | sfu-natlang/HMM-Aligner | src/models/modelBase.py | Python | mit | 25,366 |
# -*- coding: utf-8 -*-
import os
import Tkinter as tk
import tkMessageBox
import tkColorChooser
import tkFileDialog
import ctypes
import shutil
import struct
import re
import time
import sys
import windowswitcher
import _winreg
import Image
import ImageGrab
import ImageChops
from nircmd import screenshot
from ConfigP... | i-ghost/hlmv-autopaint | autopaint.py | Python | bsd-3-clause | 20,368 |
from __future__ import unicode_literals
from ..phone_number import Provider as PhoneNumberProvider
class Provider(PhoneNumberProvider):
formats = (
'+7 ### ### ####',
'+7 ### ### ## ##',
'+7 (###) ###-##-##',
'+7 (###) ###-####'
)
| DonHilborn/DataGenerator | faker/providers/ru_RU/phone_number.py | Python | mit | 273 |
from . import (
receive
)
| blockchain/api-v1-client-python | blockchain/v2/__init__.py | Python | mit | 30 |
import json
import time
from gevent import Greenlet
import pytest
from inbox.test.util.base import add_fake_message
from inbox.util.url import url_concat
from inbox.test.api.base import api_client
GEVENT_EPSILON = .5 # Greenlet switching time. VMs on Macs suck :()
LONGPOLL_EPSILON = 2 + GEVENT_EPSILON # API impleme... | nylas/sync-engine | inbox/test/api/test_streaming.py | Python | agpl-3.0 | 6,715 |
#!/usr/bin/env python
"""
addvimmodule [git repository] [folder name]
Adds a git repository as a submodule in the bundle directory.
"""
import sys
import os
repo = sys.argv[1]
foldername = sys.argv[2]
os.system('git submodule add ' + repo + ' vim/bundle/' + foldername)
| mayl/dotfiles | addvimmodule.py | Python | gpl-3.0 | 275 |
from setuptools import setup, Extension
from os.path import join as pjoin
from os.path import dirname
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in bel... | ds0nt/or-tools | tools/setup.py | Python | apache-2.0 | 2,462 |
# -*- coding: utf-8 -*-
"""
@author: casimp
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import re
import h5py
import numpy as np
from pyxe.data_io import dimension_fill, dim_fill
from pyxe.peak_anal... | casimp/edi12 | pyxe/energy_dispersive.py | Python | mit | 5,872 |
""" call urls from a log file
examples:
bin/log_grep_urls -f ../app.log -s "Return trip"
bin/log_grep_urls -f ../app.log -s "No transit times available"
"""
from .base import Base
from ott.utils import test_utils
class CallUrls(Base):
""" call urls from file.urls
"""
url_file = None
search ... | OpenTransitTools/utils | ott/utils/parse/logs/call_urls.py | Python | mpl-2.0 | 1,183 |
#!/usr/bin/python
'''
This script is used to select only assignments of students that met requirements
Select qualified folders from submissions/ and copy into reports/
Usage: python selection.py section date(MMDD) time(MMHHam/pm)
Eaxmple: python selection.py 5 0324 0300PM
'''
import re
from collections import default... | yyl/Assignment-Grading-Suite | selection.py | Python | gpl-2.0 | 2,320 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | songmonit/CTTMSONLINE | openerp/addons/base/res/res_users.py | Python | agpl-3.0 | 44,626 |
import os
ADMINS = ['you@example.com']
DEBUG = False
SECRET_KEY = 'quality is free!'
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(
os.path.dirname(__file__), '../data.sqlite3')
| omaciel/qpd | config/production.py | Python | gpl-3.0 | 191 |
# encoding: utf-8
# module PyQt4.QtCore
# from /usr/lib/python3/dist-packages/PyQt4/QtCore.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import sip as __sip
class QTextDecoder(): # skipped bases: <class 'sip.wrapper'>
"""
QTextDecoder(QTextCodec)
QTextDecoder(QTextCodec, QTextCo... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyQt4/QtCore/QTextDecoder.py | Python | gpl-2.0 | 912 |
# -*- coding: utf-8 -*-
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2015 Star2Bi... | romonzaman/newfies-dialer | newfies/apirest/dnc_serializers.py | Python | mpl-2.0 | 2,519 |
#!/usr/bin/python2.7
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2012-2014. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: khmer-project@idyll.org
#
# pylint: disable=missing-docstring,invalid-name
"""
Count th... | poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/khmer-1.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/count-overlap.py | Python | apache-2.0 | 2,765 |
# 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 may ... | Azure/azure-sdk-for-python | sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/v2021_09_01/aio/operations/_extensions_operations.py | Python | mit | 35,673 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('cases', '0006_case_billing_checked'),
]
operations = [
migrations.AlterField(
m... | HelloLily/hellolily | lily/cases/migrations/0007_auto_20160127_1355.py | Python | agpl-3.0 | 855 |
"""
Creates the metadata caption for figures in the style used by WMSViz.
Based on code originally in figure_builder.
@author rwilkinson
"""
import logging
import time
from cStringIO import StringIO
try:
from PIL import Image
except:
import Image
from matplotlib.figure import Figure
from matplotlib.backends.ba... | NERC-CEH/jules-jasmin | majic/joj/lib/wmsvizMetadataImageBuilder.py | Python | gpl-2.0 | 5,591 |
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Originally written by Barry Warsaw <barry@python.org>
#
# Minimally patched to make it even more xgettext compatible
# by Peter Funk <pf@artcom-gmbh.de>
#
# 2002-11-22 Jürgen Hermann <jh@web.de>
# Added checks that _() only contains string literals, and
# command li... | HiSPARC/station-software | user/python/Tools/i18n/pygettext.py | Python | gpl-3.0 | 22,083 |
import os
_basedir = os.path.abspath(os.path.dirname(__file__))
DEBUG = False
ADMINS = frozenset(['youremail@yourdomain.com'])
SECRET_KEY = 'SecretKeyForSessionSigning'
THREADS_PER_PAGE = 8
ICE_SECRET = 'test' | nikdoof/grumble | config.py | Python | bsd-3-clause | 213 |
from title import Title
from inventory import Inventory
def doit():
return Title.get(1)
| johm/infoshopkeeper | objects/test.py | Python | gpl-2.0 | 93 |
from datetime import datetime, timedelta
from grokcore.component import implements, name, GlobalUtility
from twisted.internet import defer
from twisted.enterprise import adbapi
from zope.interface import Interface
from zope.component import getUtility
import logging
import sys
from opennode.knot.model.compute import ... | opennode/opennode-knot | opennode/knot/backend/billing.py | Python | gpl-3.0 | 6,392 |
def add_without_op(x, y):
while y !=0:
carry = x & y
x = x ^ y
y = carry << 1
print(x)
def main():
x, y = map(int, input().split())
add_without_op(x, y)
if __name__ == "__main__":
main() | libchaos/algorithm-python | bit/add_with_op.py | Python | mit | 233 |
"""
Parser function parse() to parse the .wpout output file of Wannier90.
"""
from __future__ import print_function
import inspect
import re
from collections import defaultdict
from . import show_output
# Match the lines describing the nearest-neighbour Shells
# Groups:
# 0: Shell Index
# 1: distance (ang^-1)
# 2: mu... | mostofi/wannier90 | test-suite/tools/parsers/parse_wpout.py | Python | gpl-2.0 | 7,010 |
from __future__ import unicode_literals
from django.db import models | sachinkumar123/approprate | cloudApp/moderator/models.py | Python | mit | 69 |
from enum import Enum
from typing import Tuple
from utils.lexer import Lexer, Rule
class MapInfoParserError(Exception):
def __init__(self, message: str, position: Tuple[int, int]):
super(Exception, self).__init__('Line {} column {}: {}'.format(position[0], position[1], message))
class MapInfoToken(Enum... | GitExl/DoomIdgamesArchive | idgames-extract/src/doom/mapinfoparser.py | Python | bsd-2-clause | 1,810 |
# Copyright (c) 2015 Microsoft Corporation
from z3 import *
x = Real('x')
y = Real('y')
g = Goal()
g.add(x > 10, y == x + 1)
g.add(y > 1)
t = Tactic('simplify')
r = t.apply(g)
print(r)
print(len(r))
for s in r:
print(s)
print("old goal:")
print(g)
t = Then('simplify', 'solve-eqs')
r = t.apply(g)
print r
s = Sol... | dstaple/z3test | old-regressions/python/tst11.py | Python | mit | 480 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "super_auto_wash.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure t... | utarsuno/SuperAutoWash | super_auto_wash/manage.py | Python | mit | 813 |
# -*- coding: utf-8 -*-
"""
Acceptance tests for Video.
"""
import os
from unittest import skipIf
from mock import patch
from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc
from common.test.acceptance.pages.common.auto_auth import AutoAuthPage
from common.test.acceptance.pages.lms.co... | msegado/edx-platform | common/test/acceptance/tests/video/test_video_module.py | Python | agpl-3.0 | 8,758 |
#!/usr/bin/env python
import os
import shutil
import unittest
import ray
from ray.rllib.agents.registry import get_agent_class
from ray.tune.trial import ExportFormat
CONFIGS = {
"A3C": {
"explore": False,
"num_workers": 1,
"framework": "tf",
},
"APEX_DDPG": {
"explore": F... | richardliaw/ray | rllib/tests/test_export.py | Python | apache-2.0 | 3,784 |
from RockStar import RockStar
groovy_code = "println 'Hello world'"
rock_it_bro = RockStar(days=400, file_name='helloWorld.groovy', code=groovy_code)
rock_it_bro.make_me_a_rockstar()
| clakech/rockstar | examples/groovy_rockstar.py | Python | mit | 184 |
# Outspline - A highly modular and extensible outliner.
# Copyright (C) 2011-2014 Dario Giovannetti <dev@dariogiovannetti.net>
#
# This file is part of Outspline.
#
# Outspline 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 Softw... | xguse/outspline | src/outspline/info/plugins/wxscheduler_basicrules.py | Python | gpl-3.0 | 1,178 |
'''
Aim :: To demonstrate the use of a dictionary
Define a simple dictionary , add values to it and iterate and print it
Dictionary works based on hashing principle ... simply said key,value pairs
** A dictionary object is a mutable datatype which means it couldnt be hashed
Anything that cant be hashed can... | arunchandramouli/fanofpython | code/features/datatypes/dicts.py | Python | gpl-3.0 | 3,592 |
import sys
import pytz
import arrow
import traceback
import icalendar
from datetime import datetime, date
from icalendar import Calendar as iCalendar
from flanker import mime
from html2text import html2text
from util import serialize_datetime, valid_base36
from timezones import timezones_table
from inbox.models.event ... | wakermahmud/sync-engine | inbox/events/ical.py | Python | agpl-3.0 | 23,323 |
#!/usr/bin/env python
"""
Copyright (c) 2015 RasDom by Aeondave
See the file 'LICENSE' for copying permission
"""
import SocketServer, time
from lib import settings
ACK = "\x06"
SIZE = 1024
class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):
def handle(self):
print "Client connec... | AeonDave/RasDom | classes/Socket.py | Python | mit | 5,542 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | xodus7/tensorflow | tensorflow/python/estimator/canned/boosted_trees.py | Python | apache-2.0 | 61,217 |
from .validator import Validator
from ..util import register_as_validator
class ExactLength(Validator):
__validator_name__ = 'exact_length'
def __init__(self, exact_length):
super(ExactLength, self).__init__()
self.exact_length = exact_length
def validate(self, data, request=None, sessio... | Performante/pyFormante | pyFormante/validation/exact_length.py | Python | gpl-2.0 | 411 |
# -*- coding: utf-8 -*-
import sympy as sp
import symbtools as st
x1, x2, x3 = sp.symbols("x1, x2, x3")
vec_x = sp.Matrix([x1, x2, x3])
vec_xdot = st.time_deriv(vec_x, vec_x)
xdot1, xdot2, xdot3 = vec_xdot
F_eq = sp.Matrix([ xdot3 + x1*xdot2 - x2*xdot1 ])
#P1i = sp.Matrix([ [x2,-x1,1] ])
#P0i = sp.Matrix([ [-xdot2... | klim-/franke_algorithm | examples/franke_ex5.py | Python | gpl-3.0 | 333 |
#! /usr/bin/env python
from __future__ import print_function
import json
import os
import pprint
import sys
import traceback
import boto3
import botocore
import tables
def get_client(aws_access_key_id=None, aws_secret_access_key=None,
aws_session_token=None, region_name=None, profile_name=None):
... | samstav/try-dynamodb | dynamo.py | Python | apache-2.0 | 4,690 |
# -*- coding: utf-8 -*-
import datetime
from django.utils.translation import get_language
from django.conf import settings
class LanguageCookieMiddleware(object):
def process_response(self, request, response):
language = get_language()
if settings.LANGUAGE_COOKIE_NAME in request.COOKIES and \
... | mpetyx/palmdrop | venv/lib/python2.7/site-packages/cms/middleware/language.py | Python | apache-2.0 | 722 |
#!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | lmazuel/azure-sdk-for-python | azure-cognitiveservices-nspkg/setup.py | Python | mit | 1,770 |
import os, os.path
import urllib2
import traceback
from datetime import datetime
from dateutil import parser as dateparser
from lxml import etree
from lxml.builder import ElementMaker
import ext.geni
import ext.sfa.trust.gid as gid
import eisoil.core.pluginmanager as pm
from eisoil.core import serviceinterface
from ... | EICT/C-BAS | src/vendor/geniv3rpc/g3rpc/genivthree.py | Python | bsd-3-clause | 32,338 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Copyright (c) 2016 Cédric Clerget - HPC Center of Franche-Comté University
#
# This file is part of Janua-SMS
#
# http://github.com/mesocentrefc/Janua-SMS
#
# This program is free software: you can redistribute it and/or modify
# it under th... | mesocentrefc/Janua-SMS | janua/ws/auth.py | Python | gpl-2.0 | 6,128 |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | ChinaMassClouds/copenstack-server | openstack/src/horizon-2014.2/horizon/templatetags/branding.py | Python | gpl-2.0 | 2,028 |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/nitroml | examples/openml_cc18_benchmark.py | Python | apache-2.0 | 3,831 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# The GeoTag-X project builder.
# Copyright (C) 2015 UNITAR.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | geotagx/geotagx-project-template | build.py | Python | agpl-3.0 | 3,156 |
# Copyright (c) 2017 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, ... | NiklasRosenstein/py-nr | tests/test_context.py | Python | mit | 1,553 |
#!/usr/bin/env python
import sys
import os
import glob
#######################################################
candidate_xsldirs = (
# Fedora
'/usr/share/sgml/docbook/xsl-stylesheets',
# Cygwin
'/usr/share/docbook-xsl',
# Debian
'/usr/share/xml/docbook/stylesheet/nwalsh',
# SUSE
'/usr/... | bdmod/extreme-subversion | BinarySourcce/subversion-1.6.17/doc/tools/bin/find-xsl.py | Python | gpl-2.0 | 1,191 |
from django.conf.urls.defaults import patterns, url
from fragments.views import FragmentCreate, FragmentDetail, FragmentList
urlpatterns = patterns('',
url(r'^$', FragmentList.as_view(), name="fragments_fragment_list"),
url(r'^create/', FragmentCreate.as_view(), name="fragments_fragment_create"),
url(r'^(... | mariocesar/django-fragments | fragments/urls.py | Python | bsd-3-clause | 400 |
from dungeon.dungeon import Dungeon
def main():
testdungeon = Dungeon('level1.txt')
print(testdungeon)
if main.__name__ == '__main__':
main() | int3l/dungeons-and-pythons | main.py | Python | mit | 155 |
"""
flask.ext.httpauth
==================
This module provides Basic and Digest HTTP authentication for Flask routes.
:copyright: (C) 2014 by Miguel Grinberg.
:license: BSD, see LICENSE for more details.
"""
from functools import wraps
from hashlib import md5
from random import Random, SystemRandom
from flask impo... | misaakidis/vSwitchWebUI | flask_httpauth.py | Python | gpl-2.0 | 4,346 |
# Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
An interface to Swagger specifications.
This module provides the ability to automatically derive somewhat sensible
Python type definitions from definitions in a Swagger specification. The
Python types enforce the constraints defined by the Swagg... | LeastAuthority/txkube | src/txkube/_swagger.py | Python | mit | 33,318 |
import re
class TaxonomyExtractor:
def taxonomy_from_annotated_tree(self, dendropy_tree):
'''Given an annotated dendropy tree, return the taxonomy of each tip
Parameters
---------
tree: dendropy.Tree
Decorated tree to extract taxonomy from
Returns... | geronimp/graftM | graftm/taxonomy_extractor.py | Python | gpl-3.0 | 2,175 |
from plex.objects.core.base import Descriptor, Property
class Director(Descriptor):
id = Property(type=int)
tag = Property
@classmethod
def from_node(cls, client, node):
return cls.construct(client, cls.helpers.find(node, 'Director'), child=True)
| fuzeman/plex.py | plex/objects/library/extra/director.py | Python | mit | 274 |
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
class MetaTag(models.Model):
"""Meta tags defined by user"""
url = models.CharField(_(u'url'), max_length=255,
help_text=_(u'always use full page path with trailing slash: "/... | mennanov/django-blueprint | project_name/apps/seo/models.py | Python | gpl-2.0 | 917 |
from Components.NimManager import nimmanager
from Plugins.Plugin import PluginDescriptor
from Screens.ScanSetup import ScanSetup
from Screens.ServiceScan import ServiceScan
from Screens.MessageBox import MessageBox
from Tools.Directories import resolveFilename, SCOPE_CONFIG, copyfile
from os import unlink
from enigma i... | blzr/enigma2 | lib/python/Plugins/SystemPlugins/DefaultServicesScanner/plugin.py | Python | gpl-2.0 | 5,135 |
"""Provide sample implementation for leica microscope."""
import json
import voluptuous as vol
from camacq.const import IMAGE_EVENT
from camacq.plugins.sample import (
BASE_SET_SAMPLE_ACTION_SCHEMA,
Image,
ImageContainer,
Sample,
SampleEvent,
register_sample,
)
LEICA_SAMPLE_EVENT = "leica_sam... | CellProfiling/cam_acq | camacq/plugins/leica/sample.py | Python | apache-2.0 | 18,214 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | jacquerie/inspire-next | inspirehep/modules/tools/authorlist.py | Python | gpl-3.0 | 10,487 |
# -*- coding:utf-8
'''
Created on 22/05/2015
@author: C&C - HardSoft
'''
import os
import sys
import traceback
from util.change import change
from util.homogenize import Homogenize
from columns import Columns
from calc_length import calc_length
class GerJobPdZds(object):
def __init__(self, jobname, path, di... | flavio-casacurta/File-FixedS | GerJobPdZds.py | Python | mit | 3,378 |
#!/opt/local/bin/python
import string
import os
import re
def header(n) :
return "//\n\
// BAGEL - Brilliantly Advanced General Electronic Structure Library\n\
// Filename: MSCASPT2_tasks" + str(n) + ".cc\n\
// Copyright (C) 2014 Toru Shiozaki\n\
//\n\
// Author: Toru Shiozaki <shiozaki@northwestern.edu>\n\
// Mai... | nubakery/smith3 | python/mscaspt2/tasks_split.py | Python | gpl-2.0 | 2,252 |
from django.conf.urls import url
from .views import BlogList, BlogDetail, CommentForm
urlpatterns = [
url(r'^$', BlogList.as_view(), name='list'),
url(r'^(?P<pk>[0-9]+)/$', BlogDetail.as_view(), name='detail'),
#url(r'^(?P<pk>[0-9]+)/comment/$', CommentForm.as_view(), name='create_comment'),
] | henryfjordan/django_beginnings | django_beginnings/blog/urls.py | Python | bsd-3-clause | 308 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" QiBuild """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print... | aldebaran/qibuild | python/qitoolchain/database.py | Python | bsd-3-clause | 8,869 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | npuichigo/ttsflow | third_party/tensorflow/tensorflow/python/kernel_tests/split_op_test.py | Python | apache-2.0 | 12,123 |
import numpy as np
from scipy.fftpack import fft, ifft
from scipy.signal import freqz_zpk
from src.spectral.minimum_phase_decomposition import (_check_convergence,
_conjugate_transpose,
_get_causal_signal,
... | edeno/Jadhav-2016-Data-Analysis | tests/spectral/test_minimum_phase_decomposition.py | Python | gpl-3.0 | 4,559 |
#MenuTitle: Select All Global Guides
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Selects all global guides.
"""
thisFont = Glyphs.font # frontmost font
selectedLayers = thisFont.selectedLayers # active layers of selected glyphs
def selectGuidesOnLayer( thisLay... | mekkablue/Glyphs-Scripts | Guides/Select All Global Guides.py | Python | apache-2.0 | 685 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-17 17:14
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import spectator.core.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
("spectator_co... | philgyford/django-spectator | spectator/reading/migrations/0001_initial.py | Python | mit | 10,589 |
import sys
arquivo_nome = sys.argv[1]
linhas = open(arquivo_nome).readlines()
nlinhas = len(linhas)
saida_texto = ''
max_tamanho_linha = 0
for i in range (0, nlinhas):
if (len(linhas[i]) > max_tamanho_linha):
max_tamanho_linha = len(linhas[i])
if (max_tamanho_linha % 2 == 0):
max_tamanho_linha = max_tamanho_linh... | rafapzz/learning-python | center_align.py | Python | gpl-3.0 | 532 |
"""
WSGI config for hotorcold project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... | cholarajaa/cold-temperature | hotorcold/hotorcold/wsgi.py | Python | gpl-3.0 | 396 |
""" Contains the database models for the application.
"""
| Teddy-Schmitz/temperature_admin | models/__init__.py | Python | mit | 58 |
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | HybridF5/tempest_debug | tempest/api/image/v1/test_images_negative.py | Python | apache-2.0 | 3,746 |
import subprocess
import pytest
from pikka_bird_collector.collectors.base_port_command import BasePortCommand
class TestBasePortCommand:
COMMAND_OK = ['echo', 'HELLO']
COMMAND_ERR_STATUS = ['test', '-f', '__666__']
COMMAND_ERR_MISSING = ['echoooooooooo']
def test_exec_command(self... | tiredpixel/pikka-bird-collector-py | test/collectors/test_base_port_command.py | Python | mit | 643 |
# Copyright 2009-2011 Luc Saffre
# License: BSD (see file COPYING for details)
"""A middleware for sending SQL statements to the Lino logger.
Intended for use with the django development server.
"""
from __future__ import print_function
from builtins import object
from django.db import connection
from django.templa... | khchine5/lino | lino/utils/sqllog.py | Python | bsd-2-clause | 2,861 |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
import numpy as np
import os
import tempfile
import subprocess
import sys
try:
import astropy.io.fits as fits
except ImportError:
import pyfits as fits
def check_fits_file(file_name, hdu_dict, hdu_num=1):
with fits.open(file_name) as f:
assert len(... | ziotom78/polycomp | tests/test_cli.py | Python | bsd-3-clause | 3,976 |
#######################################################################
# This file is part of Lyntin.
# copyright (c) Free Software Foundation 2001, 2002
#
# Lyntin is distributed under the GNU General Public License license. See the
# file LICENSE for distribution details.
# $Id: exported.py,v 1.15 2004/03/30 22:05:... | v-legoff/accertin | lyntin/exported.py | Python | gpl-3.0 | 22,137 |
# coding=utf-8
from __future__ import unicode_literals
class BasePipe(object):
"""
Optional implementable pipe methods:
def get_request(self, request):
pass
def get_response(self, response):
return response
def set_request(self, request):
pass
def set_response(self,... | 5monkeys/content-io | cio/pipeline/pipes/base.py | Python | bsd-3-clause | 845 |
"""Component to interface with an alarm control panel."""
from abc import abstractmethod
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.const import (
ATTR_CODE,
ATTR_CODE_FORMAT,
SERVICE_ALARM_ARM_AWAY,
SERVICE_ALARM_ARM_CUSTOM_BYPASS,
SERVICE_ALARM_ARM_... | joopert/home-assistant | homeassistant/components/alarm_control_panel/__init__.py | Python | apache-2.0 | 5,904 |
# -*- coding: UTF-8 -*-
import datetime
from mongoengine import *
import time
import sys
from time import strptime
import traceback
from lisa_models.table import Table_Model
from lisa_models.dynamicTable import DynamicTable
def create_value(string_value, string_type):
try:
strptime(string_value,'%d/%m/%Y... | ssoto/hack4medAND | lisa_graph/lisa_modules/real_table_middleware.py | Python | gpl-2.0 | 1,629 |
from conans.model.conan_file import ConanFile
from conans import CMake
import os
channel = os.getenv("CONAN_CHANNEL", "stable")
username = os.getenv("CONAN_USERNAME", "Mikayex")
class DefaultNameConan(ConanFile):
name = "DefaultName"
version = "0.1"
settings = "os", "compiler", "arch", "build_... | Mikayex/conan-openexr | test_package/conanfile.py | Python | mit | 840 |
from django.conf.urls import url
from django.contrib import admin
from . import views
urlpatterns = [
#url(r'^$', views.posts_list, name = "list"),
url(r'^(?P<id>\d+)/$', views.posts_detail, name = "detail"),
url(r'^create$', views.posts_create, name = "create"),
url(r'^(?P<id>\d+)/edit/$', views.post... | pandeydivesh15/Farmers-Portal | post/urls.py | Python | mit | 422 |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | YoshikawaMasashi/magenta | magenta/music/melodies_lib_test.py | Python | apache-2.0 | 26,690 |
#!/usr/bin/env python
# -*- encoding:utf-8 -*-
import requests
import os,sys,copy,json,re,math,time,copy,random,datetime,types
import gensim
import datetime
import numpy as np
###将所有词相应的向量放入wordsvecfile:{"word":[index,wordcount,similar_word,word_vector]}
def wordbook(wordhousefile, modelfile, min_count):
wordsdic ... | zhengjieupc/ZhiHu | bin/vector.py | Python | mit | 4,765 |
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import redirect_to_login
from django.core.urlresolvers import reverse
from django.db.models import Count
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from ... | pculture/mirocommunity | localtv/playlists/views.py | Python | agpl-3.0 | 9,007 |
__author__ = 'fahadadeel'
from setuptools import setup, find_packages
setup(
name = 'aspose-cells-java-for-python',
packages = find_packages(),
version = '1.0',
description = 'Aspose.cells Java for Python is a project that demonstrates / provides the Aspose.Cells for Java API usage examples in Python.... | fahadadeel/Aspose.Cells-for-Java | Plugins/Aspose-Cells-Java-for-Python/setup.py | Python | mit | 705 |
#!/usr/bin/env python
#
# Copyright (c) 2013-2018 Quarkslab.
# This file is part of IRMA project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the top-level directory
# of this distributi... | quarkslab/irma | probe/extras/tools/nsrl/import_nsrl.py | Python | apache-2.0 | 2,175 |
# -*- coding: utf-8 -*-
"""
test/test_connection
~~~~~~~~~~~~~~~~~~~~~
Tests for the SPDYConnection object.
"""
import spdypy
import spdypy.connection
from .test_stream import MockConnection
from unittest.mock import MagicMock
class TestSPDYConnection(object):
def test_can_create_connection(self):
conn =... | Lukasa/spdypy | test/test_connection.py | Python | mit | 7,468 |
from prettytable import PrettyTable
import pandas as pd
class Column(object):
"""
A Columns is an in-memory reference to a column in a particular table. You
can use it to do some basic DB exploration and you can also use it to
execute simple queries.
"""
def __init__(self, con, query_template... | yhat/db.py | db/column.py | Python | bsd-2-clause | 7,909 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | EliteTK/qutebrowser | qutebrowser/config/config.py | Python | gpl-3.0 | 36,139 |
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import json
import logging
import threading
from six.moves import BaseHTTPServer
from six.moves import http_client
_STOP_EVENT = '/fakeserver/__... | endlessm/chromium-browser | tools/swarming_client/tests/httpserver.py | Python | bsd-3-clause | 2,782 |
from math import floor
def degrees_to_ddm(dd):
degrees = int(floor(dd))
minutes = (dd - degrees) * 60
return (degrees, minutes)
def latitude_to_ddm(dd):
direction = "S" if dd < 0 else "N"
degrees, minutes = degrees_to_ddm(abs(dd))
return "{0:02d}{1:05.2f}{2}".format(
degrees,
... | rossengeorgiev/aprs-python | aprslib/util/__init__.py | Python | gpl-2.0 | 764 |
from setuptools import setup, find_packages
setup(
name='ln2sql',
version='0.2',
url='https://github.com/FerreroJeremy/ln2sql',
license='GNU',
author='Jérémy Ferrero,Vikram Singh,Shashank Khare',
author_email='jeremy.ferrero@compilatio.net,mailvikram@email.com,shashank88@gmail.com',
descrip... | FerreroJeremy/ln2sql | setup.py | Python | gpl-3.0 | 497 |
###########################################
# #
# cp_hand.py #
# author: irza pulungan #
# #
# this py will forward incoming MQTT #
# message to Serial USB port arduino #
# loaded wit... | irzaip/chippy | cp_hand.py | Python | lgpl-3.0 | 1,479 |
import random, sys
filename = sys.argv[1]
outputname = sys.argv[2]
f = open(filename, encoding='utf-8')
output = open(outputname, 'w', encoding='utf-8')
inputarray = []
for line in f:
pair = line.split("^", -1)
pair[3] = pair[3].rstrip()
inputarray.append(pair)
length = len(inputarray)
answerarray = []
for i... | kapelner/HouseTurker | Randomized_Data/answer_key.py | Python | mit | 873 |
from jinja2 import Environment, FileSystemLoader
from collections import defaultdict
import glob
import os
credits = ""
print "Getting lines..."
with open(os.path.expanduser("~\\Documents\\GitHub\\TheLegendofAdlez\\Credits.txt"), "r") as creditsfile:
credits = creditsfile.read()
lines = []
for line in credits.... | milkey-mouse/Nada | Credits/Credits/Credits/Credits.py | Python | mit | 4,967 |
# -*- coding: utf-8 -*-
#
# plugins/MediaPlayerClassic/__init__.py
#
# Copyright (C) 2006 MonsterMagnet
#
# This file is a plugin for EventGhost.
# Copyright © 2005-2016 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost is free software: you can redistribute it and/or modify it under
# the terms of the GNU... | WoLpH/EventGhost | plugins/MediaPlayerClassic/__init__.py | Python | gpl-2.0 | 106,729 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.