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 |
|---|---|---|---|---|---|
import pymel.core as pm
from ..errors import errors
from ..maya_testing import general
import control
# plane
def build_plane(name=None, crv=None, spans=None,
direction='u', width_axis=None,
width=1, log=True):
'''Given a valid curve, build nurbs plane
Attributes:
name... | Mauricio3000/fk_ik_sine_rig | tool/rig/utils.py | Python | gpl-3.0 | 6,142 |
import pymysql
from pymysql import converters
BITCOIN_API = "http://api.coindesk.com/v1/bpi/historical/close.json?start={start_date}&end={end_date}¤cy={currency}"
conv = converters.conversions.copy()
conv[246] = float # convert decimals to floats
conv[10] = str
conv[12] = str
DATABASE = {
'user': 'root'... | mauromsl/dark_web_datamining | python_src/default_settings.py | Python | gpl-3.0 | 507 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | davidam/python-examples | basics/json/object2json.py | Python | gpl-3.0 | 1,785 |
#!/usr/bin/env python
"""
=========================================
dummyActuator.py - Dummy Actuator Handler
=========================================
Does nothing more than print the actuator name and state; for testing purposes.
"""
import subprocess, os, time, socket
import sys
class actuatorHandler:
def __i... | jadecastro/LTLMoP | src/lib/handlers/share/dummyActuator.py | Python | gpl-3.0 | 2,618 |
"""Regresssion tests for urllib"""
import urllib.parse
import urllib.request
import http.client
import email.message
import io
import unittest
from test import support
import os
import tempfile
def hexescape(char):
"""Escape char as RFC 2396 specifies"""
hex_repr = hex(ord(char))[2:].upper()
if len(hex_re... | mancoast/CPythonPyc_test | fail/312_test_urllib.py | Python | gpl-3.0 | 40,650 |
# -*- coding: utf-8 -*-
{
'!langcode!': 'pt-br',
'!langname!': 'Português (do Brasil)',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "campo1=\'novovalor\'". Você não pode atualizar ou apagar os resultados de u... | urrego093/proyecto_mv | applications/datos/languages/pt-br.py | Python | gpl-3.0 | 11,305 |
#!/usr/bin/env python
'''
Using ciscoconfparse find the crypto maps that are not using AES (based-on the
transform set name). Print these entries and their corresponding transform set
name.
'''
import re
from ciscoconfparse import CiscoConfParse
def main():
'''
Using ciscoconfparse find the crypto maps that a... | shahalimurtaza/Pynet | Week1/Exercise10-KirkSolution.py | Python | gpl-3.0 | 1,072 |
from vsg.vhdlFile.extract import tokens
from vsg.vhdlFile.extract import utils
def get_consecutive_lines_starting_with_token(search_token, min_num_lines, lAllTokens, oTokenMap):
lReturn = []
lSearchLines = get_line_numbers_of_tokens_which_start_line(search_token, oTokenMap)
lGroups = group_lines(lSearch... | jeremiah-c-leary/vhdl-style-guide | vsg/vhdlFile/extract/get_consecutive_lines_starting_with_token.py | Python | gpl-3.0 | 1,683 |
from __future__ import absolute_import
from pimlico.datatypes.corpora.data_points import DataPointType, InvalidDocument, is_invalid_doc, \
invalid_document_or_raw, invalid_document
from .base import IterableCorpus
from .grouped import GroupedCorpus
from . import data_points
from . import tokenized
from . import fl... | markgw/pimlico | src/python/pimlico/datatypes/corpora/__init__.py | Python | gpl-3.0 | 1,270 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-08-13 07:57
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('street_agitation_bot', '0030_auto_20170813_0756'),
]
operations = [
migrations.Rena... | Kurpilyansky/street-agitation-telegram-bot | street_agitation_bot/migrations/0031_auto_20170813_0757.py | Python | gpl-3.0 | 775 |
#!/usr/bin/env python
# simple partition tool with purpose on pyparted testing
import parted
import getopt
import sys
import rfparted
import partedprint
def check_device(devpath):
"""Given the operating system level path to a device node, set
the value of self.dev and self.disk. Return false if an
in... | sonald/Red-Flag-Linux-Installer | hippo/services/lib/fdisk.py | Python | gpl-3.0 | 3,072 |
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.core.exceptions import ValidationError
from django.contrib.auth.models import Group
CATEGORY = (('', '----'), ('1', _('Student')),
('2', _('Teaching Staff')), ('3', _... | fga-gpp-mds/2016.2-SAS_FGA | sas/user/models.py | Python | gpl-3.0 | 4,935 |
from urllib.request import urlopen
import xml.etree.ElementTree as ET
#--testing
url = 'http://py4e-data.dr-chuck.net/comments_42.xml'
#--actual
url = 'http://py4e-data.dr-chuck.net/comments_35445.xml'
data = urlopen(url).read()
tree = ET.fromstring(data)
counts = tree.findall('.//count')
counts = [int(count.text) fo... | rlmitchell/coursera | py4e/3_using_python_to_access_web_data/ex-5.py | Python | gpl-3.0 | 364 |
from PySpice.Netlist import SubCircuit, Circuit
from PySpice.Units import *
subcircuit_1N4148 = SubCircuit('1N4148', 1, 2)
subcircuit_1N4148.R('1', 1, 2, 5.827E+9)
subcircuit_1N4148.D('1', 1, 2, '1N4148')
subcircuit_1N4148.model('1N4148', 'D',
IS=4.352E-9, N=1.906, BV=110, IBV=0.0001, RS=0.6458... | thomaslima/PySpice | unit-test/todo/test_netlist.py | Python | gpl-3.0 | 1,702 |
from pyramid.events import NewRequest, subscriber, BeforeRender
from pyramid.i18n import get_localizer, TranslationStringFactory, \
TranslationString
from pyramid.security import authenticated_userid
from lokp.models import DBSession
from lokp.config.customization import get_customization_name
from lokp.models imp... | CDE-UNIBE/lokp | lokp/subscribers.py | Python | gpl-3.0 | 3,518 |
#!/usr/bin/python2
import sys
lines = sys.stdin.readlines()
sorted_lines = sorted(lines)
sys.stdout.writelines(sorted_lines)
| jmahler/shootout | sort/python2/sort.py | Python | gpl-3.0 | 129 |
import json
import pytest
from randovania.game_description import data_reader, data_writer, game_migration
def test_round_trip_small(test_files_dir):
# Setup
with test_files_dir.joinpath("prime2_small_v1.json").open("r") as data_file:
original_data = game_migration.migrate_to_current(json.load(data_f... | henriquegemignani/randovania | test/game_description/test_schema_migration.py | Python | gpl-3.0 | 1,219 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 GNS3 Technologies Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | harrijs/gns3-server | gns3server/modules/dynamips/nodes/bridge.py | Python | gpl-3.0 | 3,328 |
def function6(a, *param):
print "variadicArgs"
def function7(a, *args, **kwargs):
print "variadicAndKeywordArgs" | bblfsh/python-driver | fixtures/vararg_python2.py | Python | gpl-3.0 | 121 |
#!/usr/bin/env python
"""
================================================
playerLocomotionCommand.py - Player Pos2D Client
================================================
Sends velocity commands to player
"""
import sys
class locomotionCommandHandler:
def __init__(self, proj, shared_data):
try:
... | jadecastro/LTLMoP | src/lib/handlers/deprecated/locomotionCommand/playerLocomotionCommand.py | Python | gpl-3.0 | 664 |
from DE_code import DE_opt, numpy
from optTune import get_F_vals_at_specified_OFE_budgets
def Ros_ND(x) :
"gerneralised Rossenbrock function"
return sum([100*(x[ii+1]-x[ii]**2)**2 + (1-x[ii])**2 for ii in range(len(x)-1)])
prob_d = 6
def run_DE_on_Ros_ND(CPV_tuple, OFE_budgets, randomSeed):
X_min, f_best_... | hamish2014/optTune | examples/DE_tuning_setup.py | Python | gpl-3.0 | 1,445 |
from plone.indexer.decorator import indexer
from Products.CMFCore.interfaces import IContentish
from Products.CMFCore.utils import getToolByName
@indexer(IContentish)
def get_last_modified_user(object, **kw):
pr = getToolByName(object, "portal_repository")
history = pr.getHistoryMetadata(object)
if histor... | esteele/Plone-Users-Group-Browser-Views-Demo | src/demo.testproduct/src/demo/testproduct/index.py | Python | gpl-3.0 | 582 |
"""Runs all tests."""
import os
import sys
import glob
import unittest
def main():
"""Runs the tests."""
failurestrings = []
for test in glob.glob('test_*.py'):
sys.stderr.write('\nRunning tests in {0}...\n'.format(test))
test = os.path.splitext(test)[0]
suite = unittest.TestLoad... | jbloomlab/phydms | tests/run_tests.py | Python | gpl-3.0 | 1,044 |
import operator
import re
from collections import namedtuple
# BEGIN operator flags
# operator precedence
PREC_ADD = 0
PREC_MUL = 1
PREC_MOD = 2
PREC_EXP = 3
# associativity
ASSOC_LEFT = 0
ASSOC_RIGHT = 1
#END operator flags
# grouping tokens
GROUP_OPEN_TOKENS = ('(')
GROUP_CLOSE_TOKENS = (')')
# operators dictio... | ringulreith/tidbits | ShuntingYardCalculator.py | Python | gpl-3.0 | 4,491 |
import sys, os
sys.path.append(os.path.join(sys.path[0],'core','glsl', '__global__'))
import pkgutil
import inspect
__all__ = []
for loader, name, is_pkg in pkgutil.walk_packages(__path__):
module = loader.find_module(name).load_module(name)
for name, value in inspect.getmembers(module):
if name.startswith('__'... | elmeunick9/UPBGE-CommunityAddon | project/core/glsl/__init__.py | Python | gpl-3.0 | 390 |
#!/usr/bin/env python3
'''
Export database tables to json files.
Copyrght 2000-2016 GoodCrypto
Last modified: 2016-05-30
'''
from __future__ import unicode_literals
import os, re, sys, tarfile
from traceback import format_exc
from django.conf import settings
from django.core import serializers
from djang... | goodcrypto/goodcrypto-libs | reinhardt/export_db_to_json.py | Python | gpl-3.0 | 7,886 |
# -*- coding: utf-8 -*-
#
# django-ponies
# Sample Django project to get started
#
# Inspired by mibou
#
# Copyright (C) 2016 euhmeuh
#
# 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 ver... | euhmeuh/django-ponies | ponies/settings.py | Python | gpl-3.0 | 4,406 |
# -*- coding: utf-8 -*-
"""
Retrieves an scanning algorithms list from the given web server, and allows the user to execute one of them
"""
2
import os
import urllib
import scanconfig
def import_URL(URL):
exec urllib.urlopen(URL).read() in globals()
menurl = scanconfig.cte_web_root+"/scan_exes"
print "Running... | EST-EAST/FoVScanTester | launcher.py | Python | gpl-3.0 | 738 |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... | sharad/calibre | src/calibre/db/categories.py | Python | gpl-3.0 | 9,987 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2009-2021 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""Classes and functions for interfacing with a Davis VantagePro, VantagePro2,
or VantageVue weather station"""
from __future__ import absolute_import
from __future__ import di... | weewx/weewx | bin/weewx/drivers/vantage.py | Python | gpl-3.0 | 134,839 |
#!/usr/bin/python
#
# test_run.py
#
# Author:
# keldzh <keldzh@gmail.com>
#
# Copyright (c) 2015 Anton Kovalyov
#
# 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 3 of ... | fAntel/pygroot | tests/test_run.py | Python | gpl-3.0 | 1,823 |
#! /usr/bin/env python
"""Test script for the binhex C module
Uses the mechanism of the python binhex module
Roger E. Masse
"""
import binhex
import tempfile
from test_support import verbose
def test():
try:
fname1 = tempfile.mktemp()
fname2 = tempfile.mktemp()
f = open(fname1, 'w')... | mancoast/CPythonPyc_test | cpython/161_test_binhex.py | Python | gpl-3.0 | 898 |
from matplotlib_venn import venn2, venn3, venn2_unweighted, venn3_unweighted
def venn_2d(dataframe, setOne='BPT', setTwo='He_II', compareBy='AGN', unweighted=False):
setSizes = {}
#groupOne = (setOne + ':P(Mixed)')
groupOne = (setOne + ':P(' + compareBy + ')')
groupTwo = (setTwo + ':P(' + com... | HowDoIUseThis/AGNClassification | utils/graphing/venn.py | Python | gpl-3.0 | 2,887 |
#!/usr/bin/python
'''
convert images from PGM to other formats
'''
import os, sys, glob, cv2, argparse
def parse_args():
'''parse command line arguments'''
parser = argparse.ArgumentParser("Convert pgm image to png or jpg")
parser.add_argument("directory", default=None,
help="directory ... | CanberraUAV/cuav | capturescripts/chameleon/pgm_convert.py | Python | gpl-3.0 | 1,457 |
import xml.etree.ElementTree as ET
from sets import Set
from com.uva.preprocess.dataset import DataSet
from com.uva.data import Data
class NetScience(DataSet):
""" Process netscience data set """
def __init__(self):
pass
def _process(self):
max_n = 500
... | wenzheli/python_new | com/uva/preprocess/netscience.py | Python | gpl-3.0 | 1,859 |
import numpy as np
from .abstract_model import Model
class Graph(Model):
def __init__(self, input_shape, nodes, connectivity):
super().__init__(input_shape)
self.nodes = nodes # some iterable containing Model instances (Layerstacks and/or Graphs)
self.conn = connectivity # 0/1 matrix d... | csxeba/brainforge | brainforge/model/graph.py | Python | gpl-3.0 | 854 |
#!/usr/bin/env python
""" __init__.py
retrieves WikiPedia articles """
# (C)opyrights 2008 by Albert Weichselbraun <albert@weichselbraun.net>
#
# 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 Foundat... | weblyzard/ewrt | src/eWRT/ws/wikipedia/descriptor.py | Python | gpl-3.0 | 2,380 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
###############################################################
# CLAM: Computational Linguistics Application Mediator
# -- Service Configuration File (Template) --
# by Maarten van Gompel (proycon)
# Centre for Language and Speech Technology / Language Machines
... | proycon/clam | clam/config/template.py | Python | gpl-3.0 | 16,253 |
#########################################################################
#
# Astronomy Club Membership
# file: membership/membership_log.py
#
# Copyright (C) 2017 Teruo Utsumi, San Jose Astronomical Association
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | sjaa/scheduler | membership/membership_log.py | Python | gpl-3.0 | 1,723 |
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Student"),
"items": [
{
"type": "doctype",
"name": "Student"
},
{
"type": "doctype",
"name": "Guardian"
},
{
"type": "doctype",
"name": "Student Log"
},
... | RandyLowery/erpnext | erpnext/config/schools.py | Python | gpl-3.0 | 3,604 |
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2012 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... | walterbender/portfolio | odf/attrconverters.py | Python | gpl-3.0 | 75,243 |
## plugin.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## 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, or (at your option)
## any later version.
... | jabber-at/python-nbxmpp | nbxmpp/plugin.py | Python | gpl-3.0 | 3,577 |
import services
from entities import EventLog
from entities import enum
from entities import IpAddress
import math
from datetime import datetime, timedelta
import logging
Weight = enum(HOURS=10, DAYS=10, SERVER=15, SUCCESS=35, VPN=0, INT=10, EXT=15, IP=15)
Threshold = enum(CRITICAL=50, SCARY=30, SCARECOUNT=2, SCAREDAT... | dandb/hacklog | hacklog/algorithm.py | Python | gpl-3.0 | 3,083 |
# coding=utf-8
"""Tests for medusa.clients.torrent module."""
import medusa.clients.torrent as sut
from medusa.clients.torrent import (
deluge_client, deluged_client, download_station_client, mlnet_client,
qbittorrent_client, rtorrent_client, transmission_client, utorrent_client
)
import pytest
@pytest.mark.... | fernandog/Medusa | tests/test_clients.py | Python | gpl-3.0 | 2,480 |
# TODO: Fix typing in this file.
# mypy: ignore-errors
import chess.svg
class WidgetError(Exception):
"""
raised when ipywidgets is not installed
"""
class NotJupyter(Exception):
"""
raised when InteractiveViewer is instantiated from a non jupyter shell
"""
try:
from ipywidgets import... | niklasf/python-chess | chess/_interactive.py | Python | gpl-3.0 | 5,843 |
# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from PyQt5.QtWidgets import QApplication
f... | hsoft/dupeguru | qt/preferences.py | Python | gpl-3.0 | 6,879 |
# -*- coding:Utf-8 -*-
"""Misc widgets used in the GUI."""
import os
from gi.repository import Gtk, GObject, Pango, GdkPixbuf, GLib
from gi.repository.GdkPixbuf import Pixbuf
from lutris.downloader import Downloader
from lutris.util import datapath
# from lutris.util.log import logger
from lutris import settings
PAD... | malkavi/lutris | lutris/gui/widgets.py | Python | gpl-3.0 | 20,833 |
# BlenderFDS, an open tool for the NIST Fire Dynamics Simulator
# Copyright (C) 2013 Emanuele Gissi, http://www.blenderfds.org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3... | firetools/blenderfds | config.py | Python | gpl-3.0 | 27,453 |
import asyncio
import websockets
@asyncio.coroutine
def hello(websocket, path):
websocket.send("HTTP/1.0 200 \n\n")
name = yield from websocket.recv()
print("< {}".format(name))
greeting = "Hello {}!".format(name)
yield from websocket.send(greeting)
print("> {}".format(greeting))
start_server... | belimawr/experiments | ESP8266_WebSocket/test.py | Python | gpl-3.0 | 463 |
from tkinter import *
from tkinter import ttk
root = Tk()
Label(root, text='Hello, Om!').pack()
button = ttk.Button(root, text='Click Me')
button.pack()
button['text'] = 'Press Me'
button.config(text='Push Me')
print(button)
print(root)
root.mainloop()
| comprakash/learning-python | learning-tkinter/src/getting_started/hello.py | Python | gpl-3.0 | 259 |
#!/usr/bin/env python
import os
import atpy
from pyraf import iraf
from pylab import *
from LCScommon import *
mypath=os.getcwd()
if mypath.find('Users') > -1:
print "Running on Rose's mac pro"
homedir='/Users/rfinn/'
elif mypath.find('home') > -1:
print "Running on coma"
homedir='/home/rfinn/'
# from... | rfinn/LCS | paper1code/LCSmakemipsnoiseimage.py | Python | gpl-3.0 | 6,850 |
# 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, get_filters_cond
from frappe.utils import nowdate
from collections import defaultdict
... | mbauskar/erpnext | erpnext/controllers/queries.py | Python | gpl-3.0 | 13,804 |
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Dec 22 2017)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################
impo... | turdusmerula/kipartman | kipartman/dialogs/panel_select_snapeda.py | Python | gpl-3.0 | 3,604 |
import math
def sieve(n):
t = range(3, n, 2)
sqrtn = int(math.sqrt(n))
i = 0
while t[i] <= sqrtn:
# remove all multiples of t[i]
p = t[i]
for j in range(len(t)-1, i, -1):
if t[j] % p == 0:
t.pop(j)
i += 1
return t
print sieve(1000)
| otfried/cs101 | code/lists/sieve.py | Python | gpl-3.0 | 274 |
import re
has_two_same_adjacent_digits_re = re.compile(r'(\d)\1')
has_a_discrete_pair_of_digits_re = re.compile(
'|'.join('((?<!{}){}{}(?!{}))'.format(n, n, n, n) for n in range(10)))
def has_two_same_adjacent_digits(n):
return has_two_same_adjacent_digits_re.search(str(n))
def has_a_discrete_pair_of_digit... | aarestad/advent-of-code-2015 | aoc_2019/day4.py | Python | gpl-3.0 | 823 |
# -*- coding:utf-8 -*-
__author__ = 'Leo'
import tornado.options
import tornado.web
from tornado.options import options
from game.handler.basehandler import BaseHandler
from utils.db import GameBaseDB
from game.server_manager import ServerManager
CREATE_TICKETS_TABLE_QUERY = '''
CREATE TABLE IF NOT EXISTS `Ticke... | eJon/enjoy | game/game_server.py | Python | gpl-3.0 | 2,220 |
import logging
import newrelic.agent
from django.conf import settings
from treeherder.autoclassify.tasks import autoclassify
from treeherder.log_parser.crossreference import crossreference_job
from treeherder.log_parser.utils import post_log_artifacts
from treeherder.model.models import (Job,
... | kapy2010/treeherder | treeherder/log_parser/tasks.py | Python | mpl-2.0 | 3,773 |
import time
from tornado.httpclient import HTTPRequest
from tornado.escape import url_escape
import test.base
from models import User, Sharedfile, Sourcefile, Conversation, Comment
class ConversationTests(test.base.BaseAsyncTestCase):
def setUp(self):
super(ConversationTests, self).setUp()
self.ad... | MLTSHP/mltshp | test/functional/conversations_tests.py | Python | mpl-2.0 | 5,863 |
# Generated by Django 2.2.13 on 2020-06-06 18:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bot', '0006_auto_20200603_0522'),
]
operations = [
migrations.AddField(
model_name='account',
name='protected',
... | jeromecc/doctoctocbot | src/bot/migrations/0007_account_protected.py | Python | mpl-2.0 | 445 |
# -*- coding: utf-8 -*-
import asyncio
import requests
from cli_common.log import get_logger
from cli_common.phabricator import PhabricatorAPI
from cli_common.pulse import run_consumer
from cli_common.utils import retry
from pulselistener import task_monitoring
from pulselistener.hook import Hook
from pulselistener.h... | lundjordan/services | src/pulselistener/pulselistener/listener.py | Python | mpl-2.0 | 8,476 |
#!/usr/bin/env python3
# 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 2017-2018 - Edoardo Morassutto <edoardo.morassutto@gmail.com>
# Copyright 2017 - Luc... | algorithm-ninja/territoriali-backend | terry/handlers/upload_handler.py | Python | mpl-2.0 | 3,564 |
# 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/.
from marionette_driver.by import By
from marionette_harness import MarionetteTestCase, WindowManagerMixin
class TestC... | Yukarumya/Yukarum-Redfoxes | testing/marionette/harness/marionette_harness/tests/unit/test_click_chrome.py | Python | mpl-2.0 | 1,226 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
####################################################################################
##
## File: concant_properties.py
## Authors: Clinton De Young, Tyler Peterson and Dave Mamanakis
## Date: November 2, 2010
##
## ----------------------------------------------------------... | IntelligentSigma/PseudoLocCodeExamples | python/pseudo.py | Python | mpl-2.0 | 23,834 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# py-bson-rpc documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 7 23:52:34 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
... | seprich/py-bson-rpc | doc/source/conf.py | Python | mpl-2.0 | 9,654 |
"""Example using the ray transform with fan beam geometry."""
import numpy as np
import odl
# Reconstruction space: discretized functions on the rectangle
# [-20, 20]^2 with 300 samples per dimension.
reco_space = odl.uniform_discr(
min_pt=[-20, -20], max_pt=[20, 20], shape=[300, 300], dtype='float32')
# Make a ... | aringh/odl | examples/tomo/ray_trafo_cone_2d.py | Python | mpl-2.0 | 1,436 |
from rest_framework.renderers import JSONRenderer
class NamespaceJSONRenderer(JSONRenderer):
"A JSON renderer that wraps the result data in a namespace"
namespace = 'objects'
def render(self, data, *args, **kwargs):
data = {self.namespace: data}
return super(NamespaceJSONRenderer, self).r... | openjck/distribution-viewer | viewer/api/renderers.py | Python | mpl-2.0 | 427 |
# Copyright 2012 Ben Cordero.
#
# This file is part of udpgen.
#
# udpgen 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 License, or
# (at your option) any later version.
#
# ud... | bencord0/udpgen | udpgen/urls.py | Python | agpl-3.0 | 1,370 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-present Taiga Agile LLC
#
# 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
# License, or (at your option) any later ver... | taigaio/taiga-back | tests/integration/test_exporter_api.py | Python | agpl-3.0 | 4,732 |
''' -- imports from python libraries -- '''
import os
import ast
# from datetime import datetime
import datetime
''' -- imports from installed packages -- '''
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.shortcuts import render_to_response #, render uncomment when to u... | sunnychaudhari/gstudio | gnowsys-ndf/gnowsys_ndf/ndf/views/mis.py | Python | agpl-3.0 | 31,071 |
"""
:mod:`Tor2Web`
=====================================================
.. automodule:: Tor2Web
:synopsis: Stats routines
.. moduleauthor:: Arturo Filasto' <art@globaleaks.org>
.. moduleauthor:: Giovanni Pellerano <evilaliv3@globaleaks.org>
"""
# -*- coding: utf-8 -*-
import json
from datetime import date, d... | globaleaks/Tor2web | tor2web/utils/stats.py | Python | agpl-3.0 | 1,327 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('categories', '0001_initial'),
('documents', '0002_page_refer_document'),
]
operations = [
migrations.AddField(
... | Foxugly/MyTaxAccountant | documents/migrations/0003_document_refer_category.py | Python | agpl-3.0 | 532 |
# Copyright 2018 Eficent Business and IT Consulting Services, S.L.
# <http://www.eficent.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models
class Message(models.Model):
_inherit = "mail.message"
@api.multi
def unlink(self):
for rec in sel... | Eficent/mailbox_replica | fetchmail_fetch_missing/models/mail_message.py | Python | agpl-3.0 | 481 |
# -*- coding: utf-8 -*-
from openerp import models, fields, api, exceptions
class Project(models.Model):
_name = 'bestja.project'
_inherit = ['message_template.mixin']
_order = 'id desc'
def _current_members(self):
"""
Limit to members of the current organization only.
"""
... | KrzysiekJ/bestja | addons/bestja_project/models.py | Python | agpl-3.0 | 8,591 |
# -*- coding: utf-8 -*-
# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
from django.db import models
from dja... | akvo/akvo-rsr | akvo/codelists/models/budget_identifier.py | Python | agpl-3.0 | 956 |
# Copyright (c) since 2001, Kisio Digital and/or its affiliates. All rights reserved.
import json
from chaos import models, exceptions, mapper, db
from utils import get_application_periods
def fill_and_get_pt_object(navitia, all_objects, json, add_to_db=True):
"""
:param navitia: Navitia Class
:param all... | CanalTP/Chaos | chaos/db_helper.py | Python | agpl-3.0 | 17,166 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2020-07-20 08:30
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('organization_projects', '0092_auto_20200703_1644'),
('organization_network', '0145_teamproje... | Ircam-Web/mezzanine-organization | organization/network/migrations/0146_auto_20200720_1030.py | Python | agpl-3.0 | 523 |
"""
WSGI config for timtec 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`` s... | mupi/escolamupi | timtec/wsgi.py | Python | agpl-3.0 | 1,419 |
import datetime
def add_gigasecond(dt_obj):
return dt_obj + datetime.timedelta(seconds=10**9)
| CubicComet/exercism-python-solutions | gigasecond/gigasecond.py | Python | agpl-3.0 | 101 |
#-*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who... | Micronaet/micronaet-contract | contract_manage_report/report/__init__.py | Python | agpl-3.0 | 1,479 |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
# 因為 publishconf.py 在 pelicanconf.py 之後, 因此若兩處有相同變數的設定, ... | mdecourse/2017springcd | local_publishconf.py | Python | agpl-3.0 | 2,026 |
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | ingadhoc/account-financial-tools | account_interests/__manifest__.py | Python | agpl-3.0 | 1,428 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-present Taiga Agile LLC
#
# 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
# License, or (at your option) any later ver... | taigaio/taiga-back | tests/integration/test_importers_github_api.py | Python | agpl-3.0 | 8,796 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import subprocess
import time
import logging
from binary_utils import Binary
# Create logger
logger = logging.getLogger(__name__)
# Get program filename
program_filename = os.path.basename(sys.argv[0])
# Get MATAM root dir absolute ... | bonsai-team/matam | scripts/matam_db_preprocessing.py | Python | agpl-3.0 | 21,753 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
#!/usr/bin/python
# This script is for cleaning up of all data from system including
# all transactions and masters (excludes default masters).
# Basically after running this file, system will reset to i... | Yellowen/Owrang | utilities/cleanup_data.py | Python | agpl-3.0 | 6,485 |
import time
from C4CApplication.page_objects.CreateBranchPage import CreateBranchPage
from C4CApplication.simulation.Actor import Actor
from C4CApplication.page_objects.HomePage import HomePage
from C4CApplication.page_objects.MyCare4Care import MyCare4Care
class BPAdminActor(Actor):
"""
This class represent... | dsarkozi/care4care-sdp-grp4 | Care4Care/C4CApplication/simulation/BPAdminActor.py | Python | agpl-3.0 | 2,859 |
# Generated by Django 2.2.17 on 2020-11-18 22:57
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import simple_history.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depende... | edx/credentials | credentials/apps/credentials/migrations/0017_historicalprogramcompletionemailconfiguration_programcompletionemailconfiguration.py | Python | agpl-3.0 | 4,637 |
# -*- coding: utf-8 -*-
from openerp import models, fields, api
class ExTimePeriod(models.Model):
_name = 'mqo.extimeperiod'
note = fields.Char(string="Note")
exercise_id = fields.Many2one('mqo.exercise',
ondelete='cascade', string="Exercise", required=True)
start_date = fields.Da... | drummingbird/ppe | mqo_exercises/models/exercise.py | Python | agpl-3.0 | 3,786 |
# This file is part of Fedora Community.
# Copyright (C) 2008-2010 Red Hat, Inc.
#
# 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
# License, or (at your option) ... | fedora-infra/fedora-packages | fedoracommunity/connectors/bodhiconnector.py | Python | agpl-3.0 | 27,347 |
from collatex import *
from xml.dom import pulldom
import re
import glob
from datetime import datetime, date
# import pytz
# from tzlocal import get_localzone
# today = date.today()
# utc_dt = datetime(today, tzinfo=pytz.utc)
# dateTime = utc_dt.astimezone(get_localzone())
# strDateTime = str(dateTime)
now = datetime... | ebeshero/Pittsburgh_Frankenstein | collateXPrep/old/collation_to_textTable.py | Python | agpl-3.0 | 5,280 |
# Copyright 2014-2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# pylint: disable=consider-merging-classes-inherited
import logging
from odoo import _, api, fields, models
from odoo.exceptions import AccessDenied
class CleanupPurgeLine(models.AbstractModel):
... | Vauxoo/server-tools | database_cleanup/models/purge_wizard.py | Python | agpl-3.0 | 2,925 |
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#... | vegeclic/django-regularcom | common/forms.py | Python | agpl-3.0 | 2,325 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | Johnzero/OE7 | openerp/addons-modules/purchase/purchase.py | Python | agpl-3.0 | 64,117 |
"""
Unittests for the opal.core.discoverable module
"""
from mock import patch
from django.test import override_settings
from opal.core import exceptions
from opal.core.test import OpalTestCase
from opal.utils import AbstractBase
from opal.core import discoverable
class NewOpalObjectType(object):
pass
class New... | khchine5/opal | opal/tests/test_core_discoverable.py | Python | agpl-3.0 | 5,937 |
# -*- coding: utf-8 -*-
from distutils.core import setup
import py2exe
import glob
import sys
data_files = [
(r'graphics', glob.glob('..\graphics\*.glade')),
(r'graphics\images', glob.glob('..\graphics\images\*.png')),
(r'graphics\images', glob.glob('..\graphics\images\*.gif')),
(r'graphics\images', glob.glob('..... | SBillion/timetableasy | build/windows/setup.py | Python | agpl-3.0 | 2,051 |
# coding: UTF-8
from django.contrib.auth.models import User
from const.models import UserIdentity
from registration.models import RegistrationManager
def sendemail(request,username,password,email,identity,person_firstname,send_email=True, **kwargs):
#判断用户名是否存在存在直接返回
if not AuthUserExist(username, identity,perso... | DutBright/scientificResearch | common/sendEmail.py | Python | agpl-3.0 | 1,006 |
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2016 Noviat nv/sa (www.noviat.com)
# Copyright© 2016 ICTSTUDIO <http://www.ictstudio.eu>
# License: AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from openerp import api, fields, models
class AccountBankStatementLine(models.Model):
_inherit = 'account.bank.stat... | ICTSTUDIO/accounting-addons | account_bank_statement_cost_center/models/account_bank_statement_line.py | Python | agpl-3.0 | 938 |
import json
from typing import List
from baton._baton.json import DataObjectJSONDecoder
from baton.models import DataObject
from mcheck.metadata.irods_metadata.file_metadata import IrodsSeqFileMetadata
IRODS_METADATA_LEGACY_LIBRARY_ID_PROPERTY = "library"
IRODS_METADATA_LIBRARY_ID_PROPERTY = "library_id"
IRODS_METAD... | wtsi-hgi/metadata-check | mcheck/main/input_parser.py | Python | agpl-3.0 | 2,802 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.conf import se... | suutari/shoop | shuup/core/models/_shops.py | Python | agpl-3.0 | 4,508 |
# Copyright 2015-2019 Cedric RICARD
#
# This file is part of CloudMailing.
#
# CloudMailing 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 License, or
# (at your option) any lat... | ricard33/cloud-mailing | cloud_mailing/satellite/sendmail.py | Python | agpl-3.0 | 20,395 |
# -*- coding: utf-8 -*-
"""
Unit tests for the localization of emails sent by instructor.api methods.
"""
from django.core import mail
from django.urls import reverse
from django.test.utils import override_settings
from nose.plugins.attrib import attr
from six import text_type
from courseware.tests.factories import I... | Edraak/edraak-platform | lms/djangoapps/instructor/tests/test_api_email_localization.py | Python | agpl-3.0 | 3,965 |