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 |
|---|---|---|---|---|---|
"""
WSGI config for api project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` sett... | urfonline/api | config/wsgi.py | Python | mit | 1,914 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-12-09 01:29
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("hordak", "0007_auto_20161209_0111")]
operations = [
migrations.RenameField("Account", "has_state... | adamcharnock/django-hordak | hordak/migrations/0008_auto_20161209_0129.py | Python | mit | 353 |
# -*- coding: utf-8; -*-
#
# @file sequences
# @brief collgate
# @author Frédéric SCHERMA (INRA UMR1095)
# @date 2018-01-09
# @copyright Copyright (c) 2018 INRA/CIRAD
# @license MIT (see LICENSE file)
# @details
def fixture(fixture_manager, factory_manager):
acc_seq = "CREATE SEQUENCE IF NOT EXISTS accession_n... | coll-gate/collgate | server/accession/fixtures/sequences.py | Python | mit | 661 |
"""
Django settings for lark project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from .base import *
# Build paths inside the project like this: os.path.join... | mozillazg/lark | lark/lark/settings_dev.py | Python | mit | 2,143 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('fastapp', '0010_auto_20150910_2010'),
]
operations = [
migrations.AddField(
model_name='thread',
nam... | sahlinet/fastapp | fastapp/migrations/0011_thread_updated.py | Python | mit | 451 |
class ClopureSyntaxError(Exception):
def __init__(self, *args, pos=0, **kwargs):
super().__init__(*args, **kwargs)
self.pos = pos
class ClopureRuntimeError(Exception):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
| vbkaisetsu/clopure | clopure/exceptions.py | Python | mit | 273 |
from datetime import datetime, timedelta
import json
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from django_dynamic_fixture import G, N
from freezegun import freeze_time
from mock import patch
from issue.models import (
Assertion, ExtendedEnum, Issue, IssueAction, ... | wesleykendall/django-issue | issue/tests/model_tests.py | Python | mit | 22,256 |
class TooManyMissingFrames(Exception):
pass
class InvalidDuration(Exception):
pass
class InvalidTag(Exception):
pass
class InvalidID3TagVersion(Exception):
pass
class CouldntDecodeError(Exception):
pass
| cbelth/pyMusic | pydub/exceptions.py | Python | mit | 233 |
#! /usr/bin/env python
import os
import sys
import shutil
import logging
import argparse
import tempfile
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from webloader.phantomjs_loader import PhantomJSLoader
from webloader.curl_loader import CurlLoader
from webloader.pythonrequests_loader import Python... | dtnaylor/web-profiler | tools/test.py | Python | mit | 2,306 |
# topics.serializers
# Serializers for the topic and voting models.
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Wed Sep 09 09:34:46 2015 -0400
#
# Copyright (C) 2015 District Data Labs
# For license information, see LICENSE.txt
#
# ID: serializers.py [] benjamin@bengfort.com $
"""
Seri... | DistrictDataLabs/topicmaps | topics/serializers.py | Python | mit | 2,138 |
import random
import numpy as np
class ReplayBuffer(object):
def __init__(self, max_size):
self.max_size = max_size
self.cur_size = 0
self.buffer = {}
self.init_length = 0
def __len__(self):
return self.cur_size
def seed_buffer(self, episodes):
self.init_... | n3011/deeprl | dataset/replay_v2.py | Python | mit | 4,664 |
#encoding:utf-8
subreddit = 'jacksepticeye'
t_channel = '@r_jacksepticeye'
def send_post(submission, r2t):
return r2t.send_simple(submission)
| Fillll/reddit2telegram | reddit2telegram/channels/~inactive/r_jacksepticeye/app.py | Python | mit | 149 |
#!/bin/python
# The purpose of this script is to take the *machine-readable* output of UMLS
# MetaMap and convert it to something that looks like a sentence of UMLS CUIs,
# if possible. Ideally there would be an option in MetaMap to do this, assuming
# it is sensible.
import re
import sys
#INTERACTIVE = True
INTERA... | corcra/UMLS | parse_metamap.py | Python | mit | 8,989 |
from copy import copy
import numpy as np
from .fortranio import FortranFile
from .snapview import SnapshotView
class SnapshotIOException(Exception):
"""Base class for exceptions in the the snapshot module."""
def __init__(self, message):
super(SnapshotIOException, self).__init__(message)
class Snaps... | spthm/glio | snapshot.py | Python | mit | 18,934 |
"""
Export to RAW/RPL file format
Based on:
http://www.nist.gov/lispix/doc/image-file-formats/raw-file-format.htm
"""
# Standard library modules.
import os
# Third party modules.
# Local modules.
from pyhmsa.fileformat.exporter.exporter import _Exporter, _ExporterThread
from pyhmsa.spec.datum.analysislist import A... | pyhmsa/pyhmsa | pyhmsa/fileformat/exporter/raw.py | Python | mit | 3,504 |
import time
import cgi
import json
import os
import BaseHTTPServer
HOST_NAME = 'localhost'
PORT_NUMBER = 9400
class PlayerService(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
self.send_response(200)
self.send_header("Content-type", "application/json")
self.end_headers()
... | rolandkakonyi/poker-player-objc | player_service.py | Python | mit | 1,447 |
from django.http import HttpResponseRedirect
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext as _
from .custom_fields import (
BooleanTimeStampField,
BooleanTimeStampFormField,
BooleanTimeStampWidget,
)
try:
from dal_select2.widgets import ModelS... | DjangoAdminHackers/ixxy-admin-utils | ixxy_admin_utils/admin_mixins.py | Python | mit | 6,862 |
"""
WSGI config for bugsnag_demo 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.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bugsnag_demo.settings")
from dja... | overplumbum/bugsnag-python | example/django/bugsnag_demo/wsgi.py | Python | mit | 399 |
import _plotly_utils.basevalidators
class TickvalsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name="tickvals", parent_name="sunburst.marker.colorbar", **kwargs
):
super(TickvalsValidator, self).__init__(
plotly_name=plotly_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/sunburst/marker/colorbar/_tickvals.py | Python | mit | 483 |
"""Box geometry."""
from __future__ import division
from .helpers import poparg
class Box(object):
"""A Box holds the geometry of a box with a position and a size.
Because of how it is typically used, it takes a single dictionary of
arguments. The dictionary of arguments has arguments popped from it, ... | nedbat/cupid | cupid/box.py | Python | mit | 5,647 |
"""
Recursive data-types and support functions.
"""
| OaklandPeters/recursor | recursor/__init__.py | Python | mit | 52 |
from django.conf.urls import *
from apps.profile import views
urlpatterns = patterns('',
url(r'^get_preferences?/?', views.get_preference),
url(r'^set_preference/?', views.set_preference),
url(r'^set_account_settings/?', views.set_account_settings),
url(r'^get_view_setting/?', views.get_view_setting),
... | eric-stanley/NewsBlur | apps/profile/urls.py | Python | mit | 1,662 |
#!/usr/bin/env python
"""
Main command line script of the pas package.
The main function contained in this module is used ai main entry point for the
pas command line utility.
The script is automatically created by setuptool, but this file can be
directly invoked with `python path/to/pas.py` or directly if its execut... | GaretJax/pop-analysis-suite | pas/bin/pas.py | Python | mit | 4,689 |
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import json
from django.contrib.contenttypes.models import ContentType
from rest_framework import serializers
from . import models
from pdc.apps.common.serializers import StrictSerializerMixin, DynamicFieldsSe... | lao605/product-definition-center | pdc/apps/package/serializers.py | Python | mit | 9,310 |
import view
try:
view.main()
except:
print('Invalid List Format')
view.terminate()
| surru/Three-Musketeers-Game | multiagent/main.py | Python | mit | 113 |
# -*- coding: utf-8 -*-
if False:
from gluon import current, URL, SQLFORM, redirect
from gluon import IS_NOT_EMPTY, Field, IS_EMAIL
from gluon import IS_NOT_IN_DB
request = current.request
response = current.response
session = current.session
cache = current.cache
T = current.T
from ... | ybenitezf/nstock | controllers/org.py | Python | mit | 4,822 |
import unittest
from tweetMining import TweetMining, TweetProxy, TestProxy, HttpProxy
import nltk
class TweetMiningTestCase(unittest.TestCase):
def setUp(self):
self.tweetMining = TweetMining(proxy='test')
self.search = self.tweetMining.search(q="twitter")
self.userInfoResponse = self.tweet... | domenicosolazzo/TweetMining | tests/test_tweetMining.py | Python | mit | 13,682 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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... | rwl/PyCIM | CIM15/IEC61970/Wires/ProtectedSwitch.py | Python | mit | 4,514 |
import sqlite3
import numpy
import scipy.sparse
from django.test import SimpleTestCase
from matrixstore.serializer import serialize, serialize_compressed, deserialize
class TestSerializer(SimpleTestCase):
def test_simple_serialisation(self):
obj = {"hello": 123}
self.assertEqual(deserialize(ser... | ebmdatalab/openprescribing | openprescribing/matrixstore/tests/test_serializer.py | Python | mit | 1,843 |
import pika
import pickle
from display import LCDLinearScroll
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
channel.exchange_declare(exchange='clock_output', type='fanout')
result = channel.queue_declare(exclusive=True)
queue_name = result.m... | Tyler-Ward/GolemClock | display/mq.py | Python | mit | 1,102 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from rest_framework import routers
from courts import views
router = routers.DefaultRouter()
router.register(r'courts', views.CourtsViewSet)
urlpatterns = patterns('',
url(r'^api/v1/', include(router.urls)),
url(r'^api-auth/... | mmmoli/open-courts | opencourts/urls.py | Python | mit | 433 |
#!/usr/bin/env python3
import re
from enum import Enum
diags = []
with open('input.txt', 'r') as f:
diags = f.read().splitlines()
#--- challenge 1
gamma = ""
for i in range(0, len(diags[0])):
zeros = len([x for x in diags if x[i] == "0"])
ones = len([x for x in diags if x[i] == "1"])
gamma += "0" if zeros ... | jekhokie/scriptbox | python--advent-of-code/2021/3/solve.py | Python | mit | 1,039 |
import pyspark
import operator
import sys
#311 call 2010 to present csv
#0 Unique Key,Created Date,Closed Date,Agency,Agency Name,
#5 Complaint Type,Descriptor,Location Type,Incident Zip,Incident Address,
#10 Street Name,Cross Street 1,Cross Street 2,Intersection Street 1,
#14 Intersection Street 2,Address Type,Cit... | alejandro-mc/BDM-DDD | value_noisecomplaints/getLoudMusicComp.py | Python | mit | 2,652 |
#!/usr/bin/python3
import os
import cgi
import cgitb
import json
from pprint import pprint
import setup.common as co
import setup.sqlcommon as sqlc
import setup.defaultpaths as dfp
import setup.getinput as gi
import setup.dbsetup as dbs
import setup.gettags as gt
import setup.createsongsjson as csj
import setup.create... | ampyche/ampyche | ampyche_setup.py | Python | mit | 3,407 |
import pytest
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
run_gitlabform,
DEFAULT_README,
get_gitlab,
)
gl = get_gitlab()
@pytest.fixture(scope="function")
def branches(request, gitlab, group_and_project):
branches = [
"protect_branch_but_allow_all",
"pr... | egnyte/gitlabform | tests/acceptance/test_branches.py | Python | mit | 32,440 |
#!/usr/bin/python
# TODO: issues with new oauth2 stuff. Keep using older version of Python for now.
# #!/usr/bin/env python
from participantCollection import ParticipantCollection
import re
import datetime
import pyperclip
# Edit Me!
# This script gets run on the first day of the following month, and that month's UR... | foobarbazblarg/stayclean | stayclean-2020-january/display-final-after-month-is-over.py | Python | mit | 3,056 |
#!/usr/bin/env python2
# coding:utf-8
from twython import Twython
from colors import const
#import const
import numpy as np
import PIL.Image as img
import colorsys
import StringIO
import os
from datetime import datetime
from datetime import timedelta
from random import randint
number_of_colours = 1094
def is_morning... | lesguillemets/gae_twbots | colors/colors.py | Python | mit | 3,088 |
import datetime as dt
import threading
from serial_device.or_event import OrEvent
import numpy as np
import pandas as pd
import gobject
import gtk
import matplotlib as mpl
from streaming_plot import StreamingPlot
from ...max11210_adc_ui import MAX11210_read
import logging
def _generate_data(stop_event, data_ready, d... | wheeler-microfluidics/mr-box-peripheral-board.py | mr_box_peripheral_board/ui/gtk/measure_dialog.py | Python | mit | 7,247 |
import os
import shutil
from jinja2 import Environment, PackageLoader
import html
import xml.etree.ElementTree as et
class moodle_module:
def __init__(self, **kwargs):
self.backup = kwargs['backup']
self.temp_dir = kwargs['temp_dir']
self.db = kwargs['db']
self.directory = kwargs[... | ocdude/mbzextract | mbzextract/plugins/page/page.py | Python | mit | 2,508 |
#!/usr/bin/env python3
from shutil import copyfile
import glob
import os
sql = './sql'
expected = './expected'
NEW_FILES = ['native_features']
for file in NEW_FILES:
filelist = glob.glob(f"{sql}/*{file}.sql")
for path in filelist:
try:
os.remove(path)
except:
print("Err... | enova/pgl_ddl_deploy | generate_new_native_tests.py | Python | mit | 3,132 |
#!/usr/bin/env python
# encoding: utf-8
'''
cmd_options -- Command Line Options Handler for JET MSS
'''
import os
import sys
import logging
from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
from os.path import dirname, expanduser, join, split, splitext, isabs
from subprocess import ... | stampedeboss/lights | lights/cmdoptions.py | Python | cc0-1.0 | 3,918 |
from decimal import Decimal
import logging
logger = logging.getLogger(__name__)
def check_number_for_decimal_conversion(number):
a = type(number) in (int, long)
b = isinstance(number, (str, unicode, Decimal))
c = isinstance(number, float)
if not (a or b or c):
logger.warning("You are using ... | dkronst/mexbtcapi | mexbtcapi/concepts/currency.py | Python | cc0-1.0 | 8,843 |
#
# Get the pin which correlates with a given purpose.
#
# @param char array purpose
# The purpose to search by.
# @return int
# A pin which can be used for the given purpose.
#
def getPin(purpose):
purpose_collection = {
"i2c-data": 20
"i2c-clock": 19
"adc": 39
"adc0": 39
"adc-0": 39
... | makerblueprint/retrospecification | modules/host/beaglebone-black/beaglebone-black.py | Python | cc0-1.0 | 599 |
import re
def check_patterns():
patterns_list = []
#Read patterns file
with open("patterns.txt") as patterns1:
for line in patterns1:
line = line.rstrip("\n")
patterns_list.append(line)
print(patterns_list)
#Read log file
with open("Sample Logs.txt") as log... | gatoravi/python_chennai_jul2016 | code/parsing_logs_arun.py | Python | cc0-1.0 | 991 |
"""
Django settings for djangoecommerce project.
Generated by 'django-admin startproject' using Django 1.9.8.
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/
"""
impo... | gileno/curso-citi | djangoecommerce/settings.py | Python | cc0-1.0 | 4,345 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
check same interface phos_binding patterns
"""
import os
import sys
import urllib
import urllib2
import cPickle as pickle
from multiprocessing import Pool
def get_entityid(p):
pdbid,interface_id,chain1,chain2 = p
url = 'http://www.rcsb.org/pdb/rest/customRepo... | lituan/tools | pisa/pisa_same_entity.py | Python | cc0-1.0 | 5,849 |
import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'MODEL1006230003.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
ret... | biomodels/MODEL1006230003 | MODEL1006230003/model.py | Python | cc0-1.0 | 427 |
#! /usr/bin/python
import sys, localconfig, platform, time
#OS Runtime comments
if platform.system() == "Windows":
sys.path.append(localconfig.winpath)
print "You are running the AnkitBot UAA Module for Windows. Sponsored by DQ. :)"
else:
sys.path.append(localconfig.linuxpath)
print "You... | QEDK/AnkitBot | UAA/UAA.py | Python | epl-1.0 | 680 |
#
# Copyright (c) 2010 Mikhail Gusarov
#
# 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, d... | PierreBdR/point_tracker | point_tracker/path.py | Python | gpl-2.0 | 49,237 |
from pyspark import SparkContext
from pyspark import SparkConf
from pyspark.streaming import StreamingContext
from pyspark.streaming.kafka import KafkaUtils
from pyspark.sql import SQLContext, Row
from pyspark.sql.types import *
from cassandra.cluster import Cluster
from cassandra import ConsistencyLevel
from cqlengine... | andyikchu/insightproject | realtime_processing/twitter_stream.py | Python | gpl-2.0 | 2,063 |
## begin license ##
#
# "Weightless" is a High Performance Asynchronous Networking Library. See http://weightless.io
#
# Copyright (C) 2012-2013, 2017, 2020-2021 Seecr (Seek You Too B.V.) https://seecr.nl
#
# This file is part of "Weightless"
#
# "Weightless" is free software; you can redistribute it and/or modify
# it... | seecr/weightless-core | test/lib/seecr-test-2.0/seecr/test/io.py | Python | gpl-2.0 | 2,438 |
"""urlconf for the base application"""
from django.conf.urls import url, patterns
urlpatterns = patterns('base.views',
url(r'^$', 'home', name='home'),
)
| kralla/django-base | base/urls.py | Python | gpl-2.0 | 180 |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=1>
# Wright-Fisher model of mutation, selection and random genetic drift
# <markdowncell>
# A Wright-Fisher model has a fixed population size *N* and discrete non-overlapping generations. Each generation, each individual has a random number of ... | alvason/probability-insighter | code/mutation-drift-selection.py | Python | gpl-2.0 | 11,460 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, #
# Diego Muñoz Escalante. #
# (pacoqueen@users.sourceforge.ne... | pacoqueen/ginn | ginn/formularios/consulta_partidas_por_producto.py | Python | gpl-2.0 | 12,338 |
__author__ = 'Marko Milutinovic'
"""
This class will implement an Arithmetic Coding decoder
"""
import array
import utils
import math
class ARDecoder:
BITS_IN_BYTE = 8
def __init__(self, wordSize_, vocabularySize_, terminationSymbol_):
"""
Initialize the object
:param wordSize_: Th... | markomilutin/kompressor | ARDecoder.py | Python | gpl-2.0 | 12,579 |
from django.utils.unittest.case import TestCase
from scheduler.models import ScheduleGenerator
from uni_info.models import Semester, Course
class ScheduleGeneratorTest(TestCase):
"""
Test class for schedule generator, try different courses
"""
fixtures = ['/scheduler/fixtures/initial_data.json']
... | squarebracket/star | scheduler/tests/schedule_generator_tests.py | Python | gpl-2.0 | 3,829 |
"""
This script is responsible for generating recommendations for the users. The general flow is as follows:
The best_model saved in HDFS is loaded with the help of model_id which is fetched from model_metadata_df.
`spark_user_id` and `recording_id` are fetched from top_artist_candidate_set_df and are given as input t... | metabrainz/listenbrainz-server | listenbrainz_spark/recommendations/recording/recommend.py | Python | gpl-2.0 | 19,039 |
# Copyright (C) 2008, One Laptop Per Child
# Copyright (C) 2009, Tomeu Vizoso
#
# 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 v... | rparrapy/sugar | extensions/cpsection/updater/view.py | Python | gpl-2.0 | 16,181 |
#
# Copyright (C) 2010 Norwegian University of Science and Technology
# Copyright (C) 2011-2015 UNINETT AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV 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
# ... | sigmunau/nav | python/nav/web/portadmin/views.py | Python | gpl-2.0 | 25,624 |
#! /usr/bin/python3
# -*- coding:utf-8 -*-
# Funciones y parametros arbitrarios
def funcion(**nombres):
print (type(nombres))
for alumno in nombres:
print ("%s es alumno y tiene %d años" % (alumno, nombres[alumno]))
return nombres
#diccionario = {"Adrian":25, "Niño":25, "Roberto":23, "Celina":23}
p... | IntelBUAP/Python3 | codigo27.py | Python | gpl-2.0 | 388 |
class OptParser:
"""Parses the options in the given file and allowed for the content to be returned.
The file is expected to contain key/value pairs. Empty lines, and lines where first non
white space is a # are ignored.
"""
def __init__(self, filename):
self.filename = filename
def parse(self):
myvars... | simonmikkelsen/roughcut | lib/optparser.py | Python | gpl-2.0 | 760 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | huiyiqun/check_mk | web/htdocs/mkeventd.py | Python | gpl-2.0 | 15,616 |
import re
class Aunt:
name = ''
def __init__(self, name):
self.name = name
self.count = {'children':-1,
'cats' : -1,
'samoyeds' : -1,
'pomeranians' : -1,
'akitas' : -1,
'vizslas' : -1,
... | hasteur/advent_of_code | 2015/puzzle16.py | Python | gpl-2.0 | 2,024 |
"""
Example Directory
.. automodule:: pyatb.examples.get_current_price
"""
| hsonntag/yatb | pyatb/examples/__init__.py | Python | gpl-2.0 | 77 |
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit
# for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2021 by the BurnMan team, released under the GNU
# GPL v2 or later.
# This module provides higher level chemistry-related functions.
from __future__ import absolute_import
import nu... | geodynamics/burnman | burnman/tools/chemistry.py | Python | gpl-2.0 | 8,056 |
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either ve... | Polarcraft/KbveBot | commands/uptime.py | Python | gpl-2.0 | 1,314 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='pyapi-emergence',
url='',
author='Neil Newman, Jonathan Marini',
author_email='nnewman2@albany.edu, jmarini@ieee.org',
packages=['emergence'],
... | wbg-optronix-lab/pyapi-emergence | setup.py | Python | gpl-2.0 | 357 |
# pylint:disable=R0201
from OpenOrange import *
from Document import Document
from Label import Label
from SQLTools import codeOrder, monthCode
from datetime import datetime
class AlotmentDoc(Document):
classattr = "classattr"
def getRecorda(self):
class newObj(object):
Status = 1
... | ancho85/pylint-playero-plugin | tests/input/func_noerror_query_getattr.py | Python | gpl-2.0 | 4,814 |
# -*- coding: utf-8 -*-
#
# test_connect_all_to_all.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | lekshmideepu/nest-simulator | testsuite/pytests/test_connect_all_to_all.py | Python | gpl-2.0 | 6,019 |
# !/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
import urllib2
import cookielib
import base64
import re
import json
import hashlib
'''该登录程序是参考网上写的'''
cj = cookielib.LWPCookieJar()
cookie_support = urllib2.HTTPCookieProcessor(cj)
opener = urllib2.build_opener(cookie_support, urllib2.HTTPHandler)
urllib2.ins... | wangtaoking1/found_website | 项目代码/Login.py | Python | gpl-2.0 | 2,910 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | ikoula/cloudstack | tools/marvin/marvin/lib/common.py | Python | gpl-2.0 | 67,873 |
import PyQtExtras
from PyQt5.QtWidgets import QFrame, QApplication
import sys
def main(args):
app = QApplication([])
main_frame = QFrame()
list_view = PyQtExtras.ListScrollArea(main_frame)
list_view.add_item_by_string('Item 1')
list_view.add_item_by_string('Item 2')
list_view.add_item_by_s... | jhavstad/model_runner | src/ScrollListViewTest.py | Python | gpl-2.0 | 469 |
#!/usr/bin/env python3
number = 23
guess = int(input('Enter an integer : '))
if guess == number:
# 新块从这里开始
print('Congratulations, you guessed it.')
print('(but you do not win any pizzas!)')
# 新块在这里结束
elif guess < number:
# 另一代码块
print('No, it is a little higher than that')
# 你可以在此做任何你希望在该代码块内进行的事情
else:
prin... | pam-phy/python-notes | byte-of-python/if.py | Python | gpl-2.0 | 600 |
from django.test import TestCase
from django import forms
from django.forms.models import ModelForm
import unittest
from employee.forms import *
from django.test import Client
class TestBasic(unittest.TestCase):
"Basic tests"
def test_basic(self):
a = 1
self.assertEqual(1, a)
class Modelfo... | nikhila05/MicroSite | employee/tests.py | Python | gpl-2.0 | 946 |
import os
import re
import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
from oeqa.utils.decorators import testcase
class BitbakeTests(oeSelfTest):
def getline(self, res, line):
for l in res.output.split('\n'... | schleichdi2/OPENNFR-6.1-CORE | opennfr-openembedded-core/meta/lib/oeqa/selftest/bbtests.py | Python | gpl-2.0 | 14,655 |
callbacks = []
def startupNotification(callback):
callbacks.append(callback)
return callback
def notify():
for callback in callbacks:
callback()
| xfire/guppy | guppy/startup.py | Python | gpl-2.0 | 172 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.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... | gramps-project/addons-source | SetAttributeTool/SetAttributeTool.gpr.py | Python | gpl-2.0 | 1,411 |
#!/usr/bin/env python
#-*- coding: utf8 -*-
# Copyright 2009-2012 Kamil Winczek <kwinczek@gmail.com>
#
# This file is part of series.py.
#
# series.py 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... | kwinczek/tvseries | tvs/cache.py | Python | gpl-2.0 | 5,742 |
"""
Read a snakefood dependencies file and output the list of all files.
"""
# This file is part of the Snakefood open source package.
# See http://furius.ca/snakefood/ for licensing details.
import sys
from os.path import join
from snakefood.depends import read_depends, flatten_depends
def main():
import optp... | jd23/py-deps | lib/python/snakefood/flatten.py | Python | gpl-2.0 | 535 |
# -*- coding: utf-8 -*-
#############################################################
# This file was automatically generated on 2022-01-18. #
# #
# Python Bindings Version 2.1.29 #
# ... | Tinkerforge/brickv | src/brickv/bindings/bricklet_silent_stepper_v2.py | Python | gpl-2.0 | 57,690 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "QiuDaBao.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| sysuccc/QiuDaBao | manage.py | Python | gpl-2.0 | 251 |
# ----------------------------- #
# Common simplifications passes #
# ----------------------------- #
from miasm2.expression.modint import mod_size2int, mod_size2uint
from miasm2.expression.expression import *
from miasm2.expression.expression_helper import *
def simp_cst_propagation(e_s, e):
"""This passe incl... | chubbymaggie/miasm | miasm2/expression/simplifications_common.py | Python | gpl-2.0 | 21,237 |
# -*- coding: utf-8 -*-
"""
Industrial Dual Analog In Plugin
Copyright (C) 2015 Olaf Lüke <olaf@tinkerforge.com>
Copyright (C) 2015-2016 Matthias Bolte <matthias@tinkerforge.com>
industrial_dual_analog_in.py: Industrial Dual Analog In Plugin Implementation
This program is free software; you can redistribute it and/or... | Tinkerforge/brickv | src/brickv/plugin_system/plugins/industrial_dual_analog_in/industrial_dual_analog_in.py | Python | gpl-2.0 | 9,465 |
#!/usr/bin/env python
import jsonschema
import json
import os
import sys
import os.path as op
import tempfile
import pytest
from argparse import ArgumentParser, RawTextHelpFormatter
from jsonschema import ValidationError
from boutiques.validator import DescriptorValidationError
from boutiques.publisher import ZenodoEr... | boutiques/schema | tools/python/boutiques/bosh.py | Python | gpl-2.0 | 26,811 |
from geobricks_data_scripts.dev.utils.data_manager_util import get_data_manager
data_manager = get_data_manager()
# TODO How to handle the fact that is in storage?
data_manager.delete("mod13a2", True, False, False)
| geobricks/geobricks_data_scripts | geobricks_data_scripts/dev/storage/data/delete/delete_storage_metadata.py | Python | gpl-2.0 | 217 |
__author__ = 'oskyar'
from django.db import models
from django.utils.translation import ugettext as _
from s3direct.fields import S3DirectField
from smart_selects.db_fields import ChainedManyToManyField
# Manager de Asignatura
class SubjectManager(models.Manager):
def owner(self, pk_subject):
return self... | oskyar/test-TFG | TFG/apps/subject/models.py | Python | gpl-2.0 | 2,996 |
import os
from com.googlecode.fascinator.api.indexer import SearchRequest
from com.googlecode.fascinator.api.storage import StorageException
from com.googlecode.fascinator.common.solr import SolrDoc, SolrResult
from org.apache.tapestry5.internal.services import URLEncoderImpl
from org.apache.tapestry5.internal import ... | redbox-mint/redbox | config/src/main/config/portal/default/redbox/scripts/download.py | Python | gpl-2.0 | 7,869 |
from routersploit.modules.payloads.cmd.netcat_reverse_tcp import Payload
# netcat reverse tcp payload with lhost=192.168.1.4 lport=4321
reverse_tcp = (
"nc 192.168.1.4 4321 -e /bin/sh"
)
def test_payload_generation():
""" Test scenario - payload generation """
payload = Payload()
payload.lhost = "1... | dasseclab/dasseclab | clones/routersploit/tests/payloads/cmd/test_netcat_reverse_tcp.py | Python | gpl-2.0 | 398 |
from __future__ import absolute_import, print_function, division
from six.moves import range, map, filter, zip
from six import iteritems
from collections import deque, defaultdict
from .polygon import is_same_direction, line_intersection
from .surface_objects import SaddleConnection
# Vincent question:
# using deque... | videlec/sage-flatsurf | flatsurf/geometry/straight_line_trajectory.py | Python | gpl-2.0 | 31,149 |
import numpy as np
import matplotlib.pyplot as plt
from stimulus import *
from myintegrator import *
from functions import *
import matplotlib.gridspec as gridspec
import cPickle as pickle
#-------------------------------------------------------------------
#-------------------------------------------------------------... | ulisespereira/PereiraBrunel2016 | figure7/plotting.py | Python | gpl-2.0 | 5,736 |
# coding: utf-8
from qgis.gui import QgsColorWheel
color_wheel = QgsColorWheel()
def on_color_wheel_changed(color):
print(color)
color_wheel.colorChanged.connect(on_color_wheel_changed)
color_wheel.show()
| webgeodatavore/pyqgis-samples | gui/qgis-sample-QgsColorWheel.py | Python | gpl-2.0 | 214 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
### 2008-2015 Charlie Barnes.
### 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 la... | charlie-barnes/dipper-stda | pdf.py | Python | gpl-2.0 | 8,846 |
# pywws - Python software for USB Wireless Weather Stations
# http://github.com/jim-easterbrook/pywws
# Copyright (C) 2008-15 Jim Easterbrook jim@jim-easterbrook.me.uk
# 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 F... | 3v1n0/pywws | src/pywws/device_pyusb.py | Python | gpl-2.0 | 5,584 |
import os,sys,urllib2
import xbmcplugin,xbmcgui
import xml.etree.ElementTree as ET
__addon__ = "SomaFM"
__addonid__ = "plugin.audio.somafm"
__version__ = "0.0.2"
def log(msg):
print "[PLUGIN] '%s (%s)' " % (__addon__, __version__) + str(msg)
log("Initialized!")
log(sys.argv)
rootURL = "http://soma... | nils-werner/xbmc-somafm | default.py | Python | gpl-2.0 | 1,907 |
"""
Nonlinear cartoon+texture decomposition ipol demo web app
"""
from lib import base_app, build, http, image
from lib.misc import ctime
from lib.misc import prod
from lib.base_app import init_app
import shutil
import cherrypy
from cherrypy import TimeoutError
import os.path
import time
from math import ceil
class a... | juan-cardelino/matlab_demos | ipol_demo-light-1025b85/app_available/blmv_nonlinear_cartoon_texture_decomposition/app.py | Python | gpl-2.0 | 11,626 |
# HRGRN WebServices
# Copyright (C) 2016 Xinbin Dai, Irina Belyaeva
# This file is part of HRGRN WebServices API.
#
# HRGRN API 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... | Arabidopsis-Information-Portal/hrgrn_webservices | services/hrgrn_search_path_by_locus/exception.py | Python | gpl-2.0 | 1,942 |
#*****************************************************************************
# Copyright (C) 2017 Lee Worden <worden dot lee at gmail dot com>
#
# Distributed under the terms of the GNU General Public License (GPL) v.2
# http://www.gnu.org/licenses/
#************************************************... | tcporco/SageBoxModels | boxmodel/boxmodel.py | Python | gpl-2.0 | 26,560 |
#!/usr/bin/env python
#
# Copyright (c) 2016 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list o... | teamfx/openjfx-8u-dev-rt | modules/web/src/main/native/Source/JavaScriptCore/Scripts/builtins/builtins_generate_internals_wrapper_implementation.py | Python | gpl-2.0 | 7,074 |
# encoding: utf-8
# module PyKDE4.kio
# from /usr/lib/python2.7/dist-packages/PyKDE4/kio.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdeui as __PyKDE4_kdeui
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
class KDirWatch(__PyQt4_QtCore.QObject):
# no doc
def addDir(self... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/PyKDE4/kio/KDirWatch.py | Python | gpl-2.0 | 2,320 |
#!/usr/bin/env python3
#
# (c) 2013, Russell Stuart.
# Licensed under GPLv2, or any later version. See COPYING for details.
#
from distutils.core import setup
import re
def get_long_description():
handle = open("doc/lrparsing.rst")
while not next(handle).startswith("====="):
pass
long_description=[]
for l... | wks/lrparsing3 | setup.py | Python | gpl-2.0 | 1,264 |