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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
# coding=utf-8
"""
@package mi.instrument.wetlabs.fluorometer.flort_d.driver
@file marine-integrations/mi/instrument/wetlabs/fluorometer/flort_d/driver.py
@author Art Teranishi
@brief Driver for the flort_d
Release notes:
Initial development
"""
import datetime
import time
import re
from mi.c... | petercable/mi-instrument | mi/instrument/wetlabs/fluorometer/flort_d/driver.py | Python | bsd-2-clause | 77,155 |
import csv
import os
import sys
import traceback
import sqlite3
import fnmatch
import decimal
import datetime
def valid_dt(dt):
try:
datetime.datetime.strptime(dt, "%m/%d/%Y")
return True
except:
return False
def adapt_decimal(d):
return str(d)
def convert_decimal(s):
return decimal.Decimal(s)
def db_cur(... | frederick623/wat | date_transform.py | Python | apache-2.0 | 2,296 |
import argparse
import logging
import helper
import puller
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--verbose',
help='increase logging verbosity',
action='store_true')
parser.add_argument('-c', '--conf', type=str,
... | jakubtuchol/HNTracker | src/__main__.py | Python | mit | 1,429 |
#!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Install Debian sysroots for building chromium.
"""
# The sysroot is needed to ensure that binaries will run on Debian Wheezy,
# ... | dartino/dart-sdk | build/linux/sysroot_scripts/install-sysroot.py | Python | bsd-3-clause | 5,524 |
# Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# 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
#
# Unles... | wolverineav/neutron | neutron/tests/api/test_bgp_speaker_extensions_negative.py | Python | apache-2.0 | 6,469 |
from supertagging.modules import handlers
handlers.setup() | uclastudentmedia/django-supertagging | supertagging/__init__.py | Python | apache-2.0 | 59 |
from django import template
register = template.Library()
def submit_row(context):
"""
Displays the row of buttons for delete and save.
"""
opts = context['opts']
change = context['change']
is_popup = context['is_popup']
save_as = context['save_as']
return {
'onclick_attrib': ... | jwmayfield/nexus-admin | nexus_admin/templatetags/nexus_admin.py | Python | apache-2.0 | 1,043 |
#
# django-filer documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 16 22:05:55 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration valu... | webu/django-filer | docs/conf.py | Python | bsd-3-clause | 7,456 |
"""Base class for common speaker tasks."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Coroutine
import contextlib
import datetime
from functools import partial
import logging
from typing import Any
import urllib.parse
import async_timeout
from soco.core import MUSIC_SRC_LI... | aronsky/home-assistant | homeassistant/components/sonos/speaker.py | Python | apache-2.0 | 43,630 |
""" Fedora Notifications pkgdb client """
import logging
import time
import requests
import requests.exceptions
import fedmsg.meta
from dogpile.cache import make_region
from fedora.client.fas2 import AccountSystem
log = logging.getLogger(__name__)
try:
import re2 as re
except ImportError:
log.warning("Cou... | jeremycline/fmn | fmn/rules/utils.py | Python | lgpl-2.1 | 7,808 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (C) 2009-2010 Nicolas P. Rougier
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#---------------... | davidcox/glumpy | glumpy/image.py | Python | bsd-3-clause | 8,858 |
import pandas as pd
# from atmPy.tools import thermodynamics
from atmPy.atmos import timeseries
import numpy as np
from atmPy.aerosols import sampling_efficiency as sampeff
from atmPy.tools import pandas_tools
_date_time_alts = ['uas_datetime']
_pressure_alt = ['StaticP', 'PRESS']
_temp_alt = ['AT_cont', 'AT'... | lo-co/atm-py | build/lib/atmPy/for_removal/Manta_payload/manta_payload.py | Python | mit | 6,200 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains classes and functions for celestial coordinates
of astronomical objects. It also contains a framework for conversions
between coordinate systems.
"""
from __future__ import (absolute_import, division, print_function,
... | kelle/astropy | astropy/coordinates/__init__.py | Python | bsd-3-clause | 1,239 |
import os
import sys
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
requires = [
'PyCK',
'pyramid',
'SQLAlchemy',
'transaction',
'pyramid_... | kashifpk/droneos | droneos_ui/setup.py | Python | gpl-2.0 | 1,304 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('link', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='link',
name='mailto',
... | pbs/django-cms | cms/plugins/link/migrations/0002_auto_20150928_1109.py | Python | bsd-3-clause | 494 |
# -*- coding: utf-8 -*-
#
# bumper-lib documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 5 01:01:24 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | maxzheng/bumper-lib | docs/conf.py | Python | mit | 8,243 |
from datetime import datetime
import dateutil.parser
import pytz
class Utils:
@staticmethod
def str_to_cassandra_time(dt_str):
print dt_str
dt = dateutil.parser.parse(dt_str)
dt = Utils.ensure_offset_aware(dt)
#epoch = datetime.utcfromtimestamp(0)
epoch = datetime.fromti... | jacekdalkowski/bike-timer | web-api/biketimerwebapi/db/repositories/cassandra/utils.py | Python | apache-2.0 | 733 |
import nose.tools as nt
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
from treeano.sandbox.nodes import anrat
fX = theano.config.floatX
def test_anrat_node():
network = tn.AdamNode(
"adam",
{"subtree": tn.InputNode("x", shape=(None, 1)),
... | diogo149/treeano | treeano/sandbox/nodes/tests/anrat_test.py | Python | apache-2.0 | 894 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('wrecks', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='wreck',
old_name='sou... | greencoder/shipwrecksproject | wrecks/migrations/0002_auto_20150713_1805.py | Python | mit | 388 |
# -*- coding: utf-8 -*-
'''
testing module for the worker and dns discovery library
'''
from dns import resolver
from mock import patch, Mock
from odin.worker import Worker
IP = '192.168.0.1'
@patch('dns.resolver.Resolver')
class TestWoker:
""" test worker obj"""
def test_resolve_no_timeout(self, m_dns):
... | j0lly/Odin | tests/test_worker.py | Python | mit | 3,072 |
# Copyright 2016 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... | dhalleine/tensorflow | tensorflow/contrib/learn/python/learn/graph_actions.py | Python | apache-2.0 | 24,626 |
#!/usr/bin/python
# Copyright 2012 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 applic... | AppScale/crisismap | jsonp.py | Python | apache-2.0 | 7,687 |
# encoding: utf-8
'''
@author: Jose Emilio Romero Lopez
@copyright: Copyright 2013-2014, Jose Emilio Romero Lopez.
@license: GPL
@contact: jemromerol@gmail.com
This file is part of APASVO.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Pu... | jemromerol/apasvo | apasvo/gui/views/loaddialog.py | Python | gpl-3.0 | 5,689 |
# Copyright 2011 Sebastien Maccagnoni-Munch
#
# This file is part of Omoma.
#
# Omoma is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# Omoma is distributed in the hope that it will be useful,
# b... | TheGU/omoma | omoma/omoma_web/templatetags/__init__.py | Python | gpl-3.0 | 666 |
# Lint as: python3
# Copyright 2020 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 ... | mlperf/training_results_v0.7 | Google/benchmarks/bert/implementations/bert-cloud-TF2.0-tpu-v3-32/tf2_common/modeling/hyperparams/base_config.py | Python | apache-2.0 | 2,947 |
from flask import Flask, render_template
from flask.ext.bootstrap import Bootstrap
from flask.ext.moment import Moment
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask.ext.uploads import UploadSet, configure_uploads, IMAGES
from config import config
bootstrap = Bootstrap(... | chenke91/ihaveablog | app/__init__.py | Python | mit | 1,126 |
__author__ = "Jerome Kieffer"
__license__ = "MIT"
__copyright__ = "2017, ESRF"
import numpy
from math import log
from .collections import GOF
from ._cormap import measure_longest
class LongestRunOfHeads(object):
"""Implements the "longest run of heads" by Mark F. Schilling
The College Mathematics Journal, V... | kif/freesas | freesas/cormap.py | Python | mit | 4,026 |
import os
from PIL import Image
import numpy as np
from tvm.contrib.download import download_testdata
def get_mobilenet():
url = 'https://docs-assets.developer.apple.com/coreml/models/MobileNet.mlmodel'
dst = 'mobilenet.mlmodel'
real_dst = download_testdata(url, dst, module='coreml')
return os.path.abs... | Huyuwei/tvm | tests/python/frontend/coreml/model_zoo/__init__.py | Python | apache-2.0 | 1,032 |
import random
from hashlib import sha256
from urllib.parse import urlencode, urlparse
from django import template
from django.conf import settings
from django.http import HttpRequest
from django.utils.http import urlquote
from django.utils.safestring import SafeData, mark_safe
from core.utils import sanitize_next
re... | tejoesperanto/pasportaservo | core/templatetags/utils.py | Python | agpl-3.0 | 5,909 |
#!/usr/bin/env python3
"""Simple multiprocess HTTP server written using an event loop."""
import argparse
import os
import socket
import signal
import time
import asyncio
import aiohttp
import aiohttp.server
from aiohttp import websocket
ARGS = argparse.ArgumentParser(description="Run simple HTTP server.")
ARGS.add_... | vaskalas/aiohttp | examples/mpsrv.py | Python | apache-2.0 | 9,115 |
"""
Overview
========
Tabs are a great feature when manipulating several files. This plugin implements Key-Commands to create,
open files, change the focus between opened tabs.
Key-Commands
============
Namespace: tabs
Mode: Global
Event: <Alt-comma>
Description: It pops a file selection window to load the content... | iogf/vy | vyapp/plugins/tabs.py | Python | mit | 2,532 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# screw_maker2_0.py
#
"""
Macro to generate screws with FreeCAD.
Version 1.4 from 1st of September 2013
Version 1.5 from 23rd of December 2013
Corrected hex-heads above M12 not done.
Version 1.6 from 15th of March 2014
Added PySide support
Version 1.7 from April 2014
... | shaise/FreeCAD_FastenersWB | screw_maker.py | Python | gpl-2.0 | 194,972 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 利用Python的切片功能实现一个类似trim去掉字符串两边空格的方法
def trim1(s):
"""利用迭代来实现"""
if s[:1] != " " and s[-1:] != " ":
return s
elif s[:1] == " ":
return trim1(s[1:])
elif s[-1:] == " ":
return trim1(s[:-1])
def trim(s):
"""更简洁的利用循环来实现"""
... | felix9064/python | Demo/liaoxf/slice_trim.py | Python | mit | 903 |
# -*- coding: utf-8 -*-
#
# Test_simulator.py
# AstroObject
#
# Created by Alexander Rudy on 2012-01-11.
# Copyright 2012 Alexander Rudy. All rights reserved.
# Version 0.6.1
#
from tests.apitests import *
import AstroObject.simulator as AS
from AstroObject.cache import *
import nose.tools as nt
from nose.pl... | alexrudy/AstroObject | tests/test_simulator.py | Python | gpl-3.0 | 3,211 |
#!/usr/bin/env python2
from os import geteuid, devnull
import logging
# shut up scapy
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
conf.verb=0
from sys import exit
import binascii
import struct
import argparse
import signal
import base64
from urllib import unquote
from subprocess ... | jorik041/net-creds | net-creds.py | Python | gpl-3.0 | 36,772 |
from StringIO import StringIO
from django.test import TestCase
from mock import patch
from core.management.commands import run_docker
from projects.models import Project
from builds.models import Version
class TestRunDocker(TestCase):
'''Test run_docker command with good input and output'''
fixtures = ['te... | takluyver/readthedocs.org | readthedocs/rtd_tests/tests/test_core_management.py | Python | mit | 2,433 |
# Copyright 2020 The FedLearner 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... | bytedance/fedlearner | fedlearner/data_join/data_portal_master.py | Python | apache-2.0 | 4,823 |
from __future__ import absolute_import, print_function
import collections
import logging
import six
from django.conf import settings
from django.db import transaction
from django.utils.encoding import force_text
from sentry.utils import json
from sentry.utils.strings import truncatechars
def safe_execute(func, *ar... | mvaled/sentry | src/sentry/utils/safe.py | Python | bsd-3-clause | 6,439 |
# The MIT License (MIT)
# Copyright (c) 2014-2015 CNRS
# 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, m... | camomile-project/camomile-client-python | example/populate.py | Python | mit | 3,552 |
#!/usr/bin/python
# Copyleft 2010, Daniel Beecham <joshu@lunix.se>
# All rights reversed.
"""This module will get and send Mac serial, system build and Mac OS X version."""
import cnf
import commands
import urllib
import sys
import re
def main():
"""servermonitor.mac main function."""
if sys.platform == 'da... | jhaals/servermonitor | modules/mac.py | Python | bsd-3-clause | 1,236 |
# Copyright 2015, 2016 OpenMarket Ltd
#
# 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 agreed to in ... | TribeMedia/synapse | synapse/config/appservice.py | Python | apache-2.0 | 6,118 |
from dic.experiment import Experiment
from dic.plots import generate_plots
'''This script generates data for a given experiment condition and plots it in
a single figure. Plotting options are:
polar: Plots in polar coordinates if true, otherwise Cartesian.
areaplot: Plots the "error area" (\gamma*\sigma_gamma*\sigma... | scott-trinkle/DIC | main.py | Python | mit | 1,049 |
import random
class Crop:
#Konstruktor
def __init__(self, growth_rate, light_need, water_need):
#Attribute
self._growth = 0
self._days_growing = 0
self._growth_rate = growth_rate
self._light_need = light_need
self._water_need = water_need
self._status = "Seed"
self._type = "Generic"
#Dictiona... | Tanoshinderuyo/Python | CropSimulator/crop_class.py | Python | gpl-2.0 | 3,607 |
# Copyright 2011 VMware, 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 ... | paninetworks/neutron | neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py | Python | apache-2.0 | 80,312 |
import io
import subprocess
from unittest import mock
from mitmproxy.utils import debug
def test_dump_system_info():
assert debug.dump_system_info()
with mock.patch('subprocess.check_output') as m:
m.side_effect = subprocess.CalledProcessError(-1, 'git describe --tags --long')
assert 'releas... | dwfreed/mitmproxy | test/mitmproxy/utils/test_debug.py | Python | mit | 687 |
from abstract_feature import AbstractFeature
from token_feature import HeadFeature, get_lemma
class DependencyFeature(AbstractFeature):
accepted_deps=[ "nn", "agent", "dobj", "nsubj", "amod", "nsubjpass", "poss", "appos"]
"""
Universal Dependencies
"""
def apply(self, sentence, mention, features... | shanzhenren/AFET | DataProcessor/Feature/dependency_feature.py | Python | gpl-3.0 | 2,135 |
"""Single slice vgg with normalised scale.
"""
import functools
import lasagne as nn
import numpy as np
import theano
import theano.tensor as T
import data_loader
import deep_learning_layers
import image_transform
import layers
import preprocess
import postprocess
import objectives
import theano_printer
import update... | 317070/kaggle-heart | configurations/je_os_segmentandintegrate_noreg.py | Python | mit | 12,455 |
import random
import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
@pytest.fixture
def driver(request):
driver = webdriver.Chrome()
driver.implicitly_w... | dmchu/selenium_gr_5 | tests/day_8/hw_day_8_task_14.py | Python | apache-2.0 | 1,741 |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | mjzmjz/swift | swift/common/ring/ring.py | Python | apache-2.0 | 18,195 |
from calendar import timegm
from datetime import datetime, timedelta
from .Pingdom import Pingdom
from .Database import Database
from .log import log
class PingdomBackup:
MAX_INTERVAL = 2764800
def __init__(self, email, password, app_key, database):
self.pingdom = Pingdom(email, password, app_key)
... | joelverhagen/PingdomBackup | pingdombackup/PingdomBackup.py | Python | mit | 2,948 |
# -*- coding: utf-8 -*-
# Dual-fisheye to 360-photo conversion tool
# Supports equirectangular and cubemap output formats
#
# Usage instructions:
# python fisheye.py'
# Start interactive alignment GUI.
# python fisheye.py -help
# Print this help message.
# python fisheye.py lens.cfg in1.jpg in2.jpg gui
# ... | ooterness/DualFisheye | fisheye.py | Python | mit | 44,517 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.desk.reportview import get_match_cond
from frappe.model.db_query import DatabaseQuery
from frappe.utils import nowdate
def ge... | indictranstech/tele-erpnext | erpnext/controllers/queries.py | Python | agpl-3.0 | 10,512 |
# -*- coding: utf-8 -*-
from datetime import datetime
import errno
import mock
from multiprocessing import Process
import os
from os.path import abspath, dirname, join, realpath
import signal
import socket
import time
import traceback
import requests
from Cryptodome import Random
from selenium import webdriver
from s... | garrettr/securedrop | securedrop/tests/functional/functional_test.py | Python | agpl-3.0 | 8,117 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os
import glob
import argparse
from pprint import pformat
from lib.termcolor import colored
from cmd import run, force, cd
from log import Logger
log = Logger(__name__)
DBSNP_HOME = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DBSNP_BUILDS = ['b147... | knmkr/dbsnp-pg | script/python/dbsnp-pg-ctl.py | Python | agpl-3.0 | 5,098 |
#!/usr/bin/env python3
import sys
import os
import mvtools_exception
import terminal_colors
import get_platform
import generic_run
import path_utils
import standard_cpp
"""
build.py
A Python template for building C++ programs
This script is supposed to be integrated similar to
the following structure:
(project)/
(... | mvendra/mvtools | codegen/templates/pybuild/pybuild_cpp.py | Python | mit | 8,224 |
# Copyright 2015 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 a... | MehdiSfr/tensor-flow | tensorflow/python/kernel_tests/reduction_ops_test.py | Python | apache-2.0 | 20,753 |
from pathlib import Path
import shutil
from subprocess import call
from base.management import BaseCommand
from django.core.management import call_command
from django.conf import settings
BABEL_CONF = """
module.exports = {
presets: [
[
'@babel/preset-env',
{
targe... | fiduswriter/fiduswriter | fiduswriter/base/management/commands/jest.py | Python | agpl-3.0 | 1,082 |
#!/usr/bin/env pytest
#
# Test two each of two different custom machine resources in the same job,
# checking the sum and peak metrics for each. This set of tests is run
# against static slots for simplicity.
#
# Then repeat the test using partitionable slots. I've never seen the
# custom resource code fail in parti... | htcondor/htcondor | src/condor_tests/test_custom_machine_resource_instances.py | Python | apache-2.0 | 9,623 |
# Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.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 later version.
# T... | csutherl/sos | sos/plugins/kvm.py | Python | gpl-2.0 | 2,089 |
#
# Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com
#
# This file is part of EigenD.
#
# EigenD 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) a... | Eigenlabs/EigenD | plg_language/builtin_conn.py | Python | gpl-3.0 | 16,737 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "punctuil_django.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| codefortulsa/punctuil | manage.py | Python | apache-2.0 | 258 |
"""Python package for using the JPush API"""
from .core import JPush
from .common import JPushFailure, Unauthorized
from .push import (
Push,
all_,
tag,
tag_and,
alias,
registration_id,
notification,
ios,
android,
winphone,
platform,
audience,
option... | jpush/jbox | Server/venv/lib/python3.5/site-packages/jpush/__init__.py | Python | mit | 1,298 |
#
# The Python Imaging Library.
# $Id: Image.py 2812 2006-10-07 10:08:37Z fredrik $
#
# the Image class wrapper
#
# partial release history:
# 1995-09-09 fl Created
# 1996-03-11 fl PIL release 0.0 (proof of concept)
# 1996-04-30 fl PIL release 0.1b1
# 1999-07-28 fl PIL release 1.0 final
# 2000-06-07 fl PIL re... | tdsmith/celltool | celltool/utility/pil_lite/PIL/Image.py | Python | gpl-2.0 | 30,891 |
from stellar_sdk import Price
class TestPrice:
def test_xdr(self):
n, d = 1, 2
price_obj = Price(n, d).to_xdr_object()
assert price_obj.to_xdr() == "AAAAAQAAAAI="
from_instance = Price.from_xdr_object(price_obj)
assert isinstance(from_instance, Price)
assert from_in... | StellarCN/py-stellar-base | tests/test_price.py | Python | apache-2.0 | 710 |
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
from functools import partial
import re
import warnings
from ._compat import range_type, text_type, PY2
from . import err
#: Regular expression for :meth:`Cursor.executemany`.
#: executemany only suports simple bulk insert.
#: You can use... | imron/scalyr-agent-2 | scalyr_agent/third_party/pymysql/cursors.py | Python | apache-2.0 | 17,238 |
# coding=utf-8
#
# This file is part of SickGear.
#
# SickGear 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 later version.
#
# SickGear is distribu... | SickGear/SickGear | sickbeard/providers/tvchaosuk.py | Python | gpl-3.0 | 15,109 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-06-21 13:19
from __future__ import unicode_literals
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
replaces = [
("wladmin", "0001_initial"),
("wladmin", "0002_auto_20180118... | dontnod/weblate | weblate/wladmin/migrations/0001_squashed_0003_auto_20180215_1127.py | Python | gpl-3.0 | 1,324 |
from data import Source
class OctetsToBitrate(Source):
def __init__(self, name, sources, intervals_average=1):
self.name = name
self.dependencies = sources
self.intervals_average = intervals_average
def set_interval(self, interval):
self.interval = interval
def run(self):... | Selfnet/dashboard | backend/dash/conversions.py | Python | bsd-2-clause | 3,791 |
from __future__ import print_function
import json
import os
import subprocess
import tempfile
import textwrap
import shutil
import sys
from buck_repo import check_output, which
from tracing import Tracing
def get_file_contents_if_exists(path, default=None):
with Tracing('BuckProject.get_file_contents_if_it_exist... | mread/buck | bin/buck_project.py | Python | apache-2.0 | 5,320 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models import CMSPlugin
# Feel free to extend this class instead of Contact.
from cmsplugin_contact import settings
class BaseContact(CMSPlugin):
SPAM_PROTECTION_CHOICES = (
(0, 'Honeypot'),
(1, 'Akismet... | maccesch/cmsplugin-contact | cmsplugin_contact/models.py | Python | bsd-2-clause | 2,737 |
# 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 distributed in the hope that it will be useful,
# bu... | daniyalzade/polysh | polysh/file_transfer.py | Python | gpl-2.0 | 8,669 |
#!/usr/bin/env python3
from collections import defaultdict
from os.path import basename, join
import pprint
import extract
def readable_bytes(data: bytes) -> str:
return ' '.join(str(b).zfill(3) for b in data)
falloutformat = """{fname}
flags: {flags}
Flag 1
flag1data: {flag1data}
Flag 6
factionsize: {faction... | nycz/SkyrimFaceTransfer | inspectsave.py | Python | gpl-3.0 | 4,220 |
from __future__ import absolute_import, unicode_literals
import re
from django.forms import RegexField
from .widgets import ColorFieldWidget
RGB_REGEX = re.compile('^#?((?:[0-F]{3}){1,2})$', re.IGNORECASE)
class RGBColorField(RegexField):
"""Form field for regular forms"""
widget = ColorFieldWidget
d... | charettes/django-colorful | colorful/forms.py | Python | mit | 439 |
"""
Copyright 2015 Stefano Terna
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 agreed to in writing, software... | iottly/prettysettings | prettysettings/__init__.py | Python | apache-2.0 | 594 |
from .dialog import AddOnsDialog
| umlfri/umlfri2 | umlfri2/qtgui/appdialogs/addons/__init__.py | Python | gpl-3.0 | 33 |
#
# This file is part of the CCP1 Graphical User Interface (ccp1gui)
#
# (C) 2002-2005 CCLRC Daresbury Laboratory
#
# 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 ... | alexei-matveev/ccp1gui | viewer/selections.py | Python | gpl-2.0 | 4,789 |
# -*- 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/utils/mail.py | Python | gpl-2.0 | 8,164 |
# Copyright 2010-2013, Sikuli.org
# Released under the MIT License.
# modified RaiMan 2013
from __future__ import with_statement
from org.sikuli.basics import Debug
Debug.log(3, "Jython: sikuli: Sikuli: entering")
import time
import __builtin__
import __main__
import types
import sys
import os
import inspect
Debug.lo... | azoft-dev-team/imagrium | libs/sikuli/Sikuli.py | Python | mit | 13,054 |
#==========================
# Config Parameters
#==========================
interval_x= 6
interval_y= 6
entry_width= 30
btn_width= 5
btn_hegiht= 1
grp_offsetX= -2
grp_offsetY= -16
interval_rdbox= 60
#===================================================
# Save Path
#===================================================
sa... | FBTUG/DevZone | FBTUG_Commander/gui_vars.py | Python | mit | 1,401 |
# -*- coding: utf-8 -*-
"""
Deployments
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
s3db.hrm_vars()
# -----------------------------------------------------------------------------
def index():
"... | gallifrey17/eden | controllers/deploy.py | Python | mit | 30,000 |
# -*- coding: utf-8 -*-
#
# icestudio documentation build configuration file, created by
# sphinx-quickstart on Thu May 26 11:44:15 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | Jesus89/icestudio | docs/conf.py | Python | gpl-2.0 | 11,589 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for cros_mark_chrome_as_stable.py."""
from __future__ import print_function
import base64
import os
import sys... | endlessm/chromium-browser | third_party/chromite/scripts/cros_mark_chrome_as_stable_unittest.py | Python | bsd-3-clause | 11,462 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
from scrapy.item import Item, Field
class WeibozItem(Item):
# define the fields for your item here like:
# name = scrapy.Field()
mblogid = Field(serializer... | luzhijun/weiboSA | _site/weiboZ/items.py | Python | apache-2.0 | 805 |
"""
Get help with VASP parameters from VASP wiki.
"""
import re
import requests
import urllib3
from bs4 import BeautifulSoup
class VaspDoc:
"""
A VASP documentation helper.
"""
def __init__(self):
"""
Init for VaspDoc.
"""
self.url_template = "http://www.vasp.at/wiki... | vorwerkc/pymatgen | pymatgen/io/vasp/help.py | Python | mit | 2,205 |
from django.db import models
from datetime import datetime
from isecho.settings import LANGUAGES
class Flatpage(models.Model):
title = models.CharField(max_length=200, blank=False)
slug = models.SlugField()
body = models.TextField()
date = models.DateField(blank=False, default=datetime.now())
lang... | mrafieee/django-base | apps/flatpages/models.py | Python | gpl-3.0 | 406 |
# Included modules
import socket
import struct
import os
from cStringIO import StringIO
# Third party modules
import gevent
from Debug import Debug
from Config import config
from util import RateLimit, StreamingMsgpack
FILE_BUFF = 1024*512
# Request from me
class FileRequest(object):
__slots__ = ("server", "con... | rarbg/ZeroNet | src/File/FileRequest.py | Python | gpl-2.0 | 8,834 |
import pkg_resources
from string import Template
model_template = Template(pkg_resources.resource_string(__name__, "model_template.C"))
lorentz_calc_template = Template(pkg_resources.resource_string(__name__, "lorentz_calc_template.C"))
sconstruct_template = Template(pkg_resources.resource_string(__name__, "sconstru... | cms-externals/sherpa | MODEL/UFO/templates.py | Python | gpl-3.0 | 427 |
# Copyright © 2020, Joseph Berry, Rico Tabor (opendrop.dev@gmail.com)
# OpenDrop is released under the GNU GPL License. You are free to
# modify and distribute the code, but always under the same license
#
# If you use this software in your research, please cite the following
# journal articles:
#
# J. D. Berry, M. J. ... | jdber1/opendrop | opendrop/mvp/__init__.py | Python | gpl-3.0 | 1,481 |
import sys
from services.housing import HouseTemplate
from engine.resources.scene import Point3D
def setup(housingTemplates):
houseTemplate = HouseTemplate("object/tangible/deed/city_deed/shared_cityhall_corellia_deed.iff", "object/building/player/city/shared_cityhall_corellia.iff", 0)
houseTemplate.addBuildingSig... | ProjectSWGCore/NGECore2 | scripts/houses/player_cityhall_corellia_style_01.py | Python | lgpl-3.0 | 688 |
# python3
# pylint: disable=g-bad-file-header
# Copyright 2019 DeepMind Technologies Limited. 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... | deepmind/bsuite | bsuite/baselines/tf/boot_dqn/agent.py | Python | apache-2.0 | 8,645 |
import logging
from ..directives import directives_by_section
logger = logging.getLogger(__name__)
class Stanza(object):
"""
Subclass for config file stanzas.
In an HAProxy config file, a stanza is in the form of::
stanza header
directive
directive
directive
S... | wglass/lighthouse | lighthouse/haproxy/stanzas/stanza.py | Python | apache-2.0 | 2,087 |
#!/usr/bin/env python
"""
Background:
--------
NARR_RetrieveLocation_Variable.py
Purpose:
--------
Routines to retrieve, output NARR data from a single point over time to combine for analysis
History:
--------
2016-09-20 : Bell - simplify existing multiple routines for various locations into one packag... | shaunwbell/FOCI_Analysis | ReanalysisRetrieval/NARR_RetrieveLocation_Variable.py | Python | mit | 6,281 |
'''
Project Euler - Problem 71
Consider the fraction, n/d, where n and d are positive integers. If n<d and
HCF(n,d)=1, it is called a reduced proper fraction.
If we list the set of reduced proper fractions for d<=8 in ascending order of
size, we get:
1/8, 1/7, 1/6, 1/5, 1/4, 2/7, 1/3, 3/8, 2/5, 3/7, 1/2, 4/7, 3/5, 5... | haphaeu/yoshimi | EulerProject/071.py | Python | lgpl-3.0 | 1,944 |
# coding=utf-8
# Copyright 2022 The Edward2 Authors.
#
# 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 o... | google/edward2 | experimental/attentive_uncertainty/utils.py | Python | apache-2.0 | 6,033 |
from django import forms
from django.utils.translation import ugettext_lazy as _
#import settings
from cmsplugin_contact.nospam.forms import HoneyPotForm, RecaptchaForm, AkismetForm
class ContactForm(forms.Form):
email = forms.EmailField(label=_("Email"))
subject = forms.CharField(label=_("Subject"), require... | wlanslovenija/cmsplugin-contact | cmsplugin_contact/forms.py | Python | bsd-2-clause | 821 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Zuza Software Foundation
#
# This file is part of Pootle.
#
# 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 t... | ttreeagency/PootleTypo3Org | pootle/apps/pootle_terminology/urls.py | Python | gpl-2.0 | 1,173 |
# -*- coding: utf-8 -*-
"""
fixtures.py
This module is for storing all of the relavant fixtures used in testing.
"""
from .fixtures_data import (
JSON15min2day,
two_sites_two_params_iv,
nothing_avail,
mult_flags,
diff_freq,
startDST,
endDST,
)
from .fixtures_daily_dupe import daily_dupe, d... | mroberge/hydrofunctions | tests/fixtures.py | Python | mit | 1,184 |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2009 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.or... | Goutte/Ni | v1/web/apostrophePlugin/web/js/fckeditor/editor/filemanager/connectors/py/fckutil.py | Python | gpl-2.0 | 4,235 |
############################################################################
##
## Copyright (C) 2006-2008 University of Utah. All rights reserved.
##
## This file is part of VisTrails.
##
## This file may be used under the terms of the GNU General Public
## License version 2.0 as published by the Free Software Foundat... | Nikea/VisTrails | contrib/cdat/scripts/init_inc.py | Python | bsd-3-clause | 1,823 |
#!/usr/bin/env python3
'''Khronos OpenGL colorspace extension for EGL.
This extension allows OpenGL and OpenGL ES surfaces to use the sRGB
and linear colorspaces that are already available to OpenVG.
http://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_gl_colorspace.txt
'''
# Copyright © 2014 Tim Pederick.
#
... | perey/pegl | src/pegl/ext/khr_glcolor.py | Python | gpl-3.0 | 1,654 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.