code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
import datetime
from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext_lazy as _, ugettext as __
from django.contrib.auth.models import User
class UnableToActivateWorkflow(Exception):
"""
To be raised if unable t... | indexofire/gravoicy | gravoicy/libs/workflow/models.py | Python | bsd-3-clause | 40,120 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_policy_exemptions_operations.py | Python | mit | 42,135 |
from random import seed
from mongoengine import connect
import pytest
@pytest.fixture
def User(django_settings):
from regme.documents import User
return User
@pytest.yield_fixture
def db(User):
connect(db='test_regme')
User.drop_collection()
yield
User.drop_collection()
@pytest.fixture
de... | lig/regme | tests/test_forms.py | Python | apache-2.0 | 3,782 |
from bson import ObjectId, json_util
from flask import g, request
from flask_restful import Resource
from service.SmsService import SmsService
from foodbeazt.fapp import app, mongo, admin_permission
import logging
class SmsApi(Resource):
def __init__(self):
self.log = logging.getLogger(__name__)
... | cackharot/fbeazt | src/foodbeazt/resources/sms.py | Python | apache-2.0 | 2,134 |
from pmg.models import db
from tests.fixtures import *
class UserData(DataSet):
class admin_user:
email = "admin"
name = "Admin"
password = "admin"
active = True
roles = [RoleData.admin, RoleData.editor]
confirmed = True
if __name__ == "__main__":
db.create_al... | Code4SA/pmg-cms-2 | setup_dev_database.py | Python | apache-2.0 | 864 |
#!/usr/bin/python
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# Copyright 2009 Didier Roche
#
# This file is part of Quickly ubuntu-application template
#
#This program is free software: you can redistribute it and/or modify it
#under the terms of the GNU General Public License version 3,... | didrocks/quickly | data/templates/ubuntu-application/share.py | Python | gpl-3.0 | 5,902 |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | 394954369/horizon | openstack_dashboard/dashboards/project/images/images/forms.py | Python | apache-2.0 | 11,525 |
import ast
import itertools
import functools
import re
from typing import Any, Iterable, Union
from formulaic.errors import FormulaParsingError
from .algos.tokens_to_ast import tokens_to_ast
from .algos.tokenize import tokenize
from .types import ASTNode, Factor, Operator, OperatorResolver, Term, Token
from .utils im... | matthewwardrop/formulaic | formulaic/parser/parser.py | Python | mit | 11,168 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | iceman1989/Check_mk | mkeventd/web/plugins/views/mkeventd.py | Python | gpl-2.0 | 48,814 |
import serial
import sqlite3
import time
import datetime
MEASUREMENT_COMMAND = b'm'
SERIAL_DEVICE = '/dev/ttyUSB0'
DB_FILE = 'measurements.db'
DB_SCHEMA = 'src/schema.sql'
DB_INSERT = 'src/insert.sql'
def read_measurements():
conn = serial.Serial(SERIAL_DEVICE, baudrate=9600, timeout=1)
if not conn.isOpe... | RoopeSavolainen/HomeAutomation | Raspi/src/reader.py | Python | mit | 1,390 |
#!/usr/bin/env python
import os, sys
import cosmology
import cosmopy
import numpy
import math
import pylab
import matplotlib
#from matplotlib import rc
Polygon = matplotlib.patches.Polygon
from matplotlib import rc
#rc('text', usetex=True)
#rc('font',**{'family':'sans-serif','sans-serif':['VeraSe']})
rc('axes', labels... | boada/planckClusters | snippets/magnitude-redshift-i.py | Python | mit | 7,008 |
#!/usr/bin/env python
from demobrowser import app, db
#db.drop_all()
db.create_all()
app.debug = app.config.get('DEBUG', False)
# This is required.
app.secret_key = app.config.get('SECRET_KEY', None)
if app.secret_key is None:
print "ERROR: SECRET_KEY not found in settings.cfg. Please see README.md for help!"
el... | FernFerret/demobrowser | run.py | Python | mit | 379 |
# coding: utf-8
_auth_views_code = '''# coding: utf-8
from . import auth
from flask import render_template, url_for, redirect, flash
from flask_login import login_user, logout_user, current_user, login_required
from app.models import User
from .forms import LoginForm
@auth.route('/login', methods=['GET', 'POST'])
d... | neo1218/mana | mana/templates/auth/_auth_views.py | Python | mit | 783 |
class Finger(object):
Thumb = 1
Index = 2
Middle = 4
Ring = 8
Pinky = 16
| dany74q/python-microsoft-project-prague-sdk | microsoft/gestures/finger.py | Python | mit | 93 |
from tree import Tree
from copy import deepcopy
import codecs
import sys
# http://www.nltk.org/_modules/nltk/treetransforms.html#chomsky_normal_form
HORZMARKOV = 0
VERTMARKOV = 0
LANGUAGE = "eng"
def read_from_ptb(filename):
ptb_file = open(filename, 'r')
for l in ptb_file:
tree = Tree.fromstring(l,... | ikekonglp/PAD | python/NewTree.py | Python | lgpl-3.0 | 35,875 |
import datet<caret> | dahlstrom-g/intellij-community | python/testData/completion/import.py | Python | apache-2.0 | 19 |
import hmac
import os
import warnings
KEY = os.environ.get('UNSUB_KEY')
if not KEY:
warnings.warn("Using insecure key for HMAC!")
KEY = 'thisisinsecure'
def generate(msg):
return hmac.new(KEY, msg).hexdigest()
def verify(sec, msg):
if isinstance(msg, unicode):
msg = msg.encode('utf-8')
if... | thingless/torweather | verifier.py | Python | mit | 531 |
import abc
import curses
import re
class EndGameException(Exception):
pass
class Player(object):
"""Recall game player.
A player takes a game (as a constructor argument). When
``play`` is called (no arguments) the game is played to
completion and the result of the game is returned.
"""
... | frasertweedale/recall | recall/player.py | Python | mit | 4,926 |
"""Tests the sites class."""
import requests_mock
from acapi.resources.environment import Environment
from acapi.resources.environmentlist import EnvironmentList
from acapi.resources.task import Task
from acapi.resources.tasklist import TaskList
from acapi.tests import BaseTest
@requests_mock.Mocker()
class TestSit... | skwashd/python-acquia-cloud | acapi/tests/test_site.py | Python | mit | 4,820 |
r"""Test correct treatment of various string literals by the parser.
There are four types of string literals:
'abc' -- normal str
r'abc' -- raw str
b'xyz' -- normal bytes
br'xyz' -- raw bytes
The difference between normal and raw strings is of course that in a
raw string, \ escapes (while still u... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.2/Lib/test/test_strlit.py | Python | mit | 5,040 |
#!/usr/bin/env python3
"""exfi.new_correct.py: fill small overlaps and gaps with abyss-sealer"""
import logging
from tempfile import \
mkstemp
from subprocess import Popen
import os
import pandas as pd
from exfi.io.bed import \
BED3_COLS, \
bed3_to_bed4, \
bed4_to_node2sequence, \
bed4_to_edge... | jlanga/exfi | exfi/correct.py | Python | mit | 5,566 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
import calendar
import sys
import time
import math
from peewee import SqliteDatabase, InsertQuery, \
IntegerField, CharField, DoubleField, BooleanField, \
DateTimeField, CompositeKey, fn
from playhouse.flask_utils import FlaskDB
from playhouse.pool import... | pir2/PokemonGo-Map | pogom/models.py | Python | agpl-3.0 | 25,093 |
#!/usr/bin/env python
'''
Author: Christopher Duffy
Date: February 2015
Name: nmap_scanner.py
Purpose: To scan a network
Copyright (c) 2015, Christopher Duffy All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are... | liorvh/pythonpentest | nmap_scannner.py | Python | bsd-3-clause | 2,228 |
# -*- coding: UTF-8 -*-
'''
Copyright (c) 2015 Scouter Project.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by app... | jw0201/scouter | scouter.host/scouter/lang/request.py | Python | apache-2.0 | 2,811 |
class RenFoo(object):
pass
print RenFoo
#comment: RenFoo must be renamed
'string: RenFoo must be renamed' | aptana/Pydev | tests/com.python.pydev.refactoring.tests/src/pysrcrefactoring/reflib/renameclass/renfoo.py | Python | epl-1.0 | 111 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set.py | Python | mit | 4,404 |
# Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""OS abstraction OS specific utility functions."""
# pylint: disable=unnecessary-lambda
import sys
if sys.platform == 'cygwin':
from api.pl... | luci/luci-py | appengine/swarming/swarming_bot/api/platforms/__init__.py | Python | apache-2.0 | 1,096 |
# coding=utf-8
# Author: Dennis Lutter <lad1337@gmail.com>
# URL: https://sickrage.github.io/
# Git: https://github.com/SickRage/SickRage.git
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... | p0psicles/SickRage | sickbeard/blackandwhitelist.py | Python | gpl-3.0 | 6,013 |
# Copyright 2017 Krzysztof Stopa (stopa.krzysztof.k@gmail.com)
# This file is part of Copernicus Atmosphere Monitoring Service (CAMS) downloading and
# processing tools (CAMS tools).
# CAMS tools is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as p... | kstopa/cams-tools | cams/regional.py | Python | lgpl-3.0 | 8,211 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | CristianBB/SickRage | sickbeard/__init__.py | Python | gpl-3.0 | 115,225 |
import numpy as np
from ss_generator import geometry
def get_internal_coordinates_from_ca_list(ca_list):
'''Get the list of ds, thetas and taus from a ca list.'''
ds = []
thetas = []
taus = []
for i in range(len(ca_list) - 1):
ds.append(np.linalg.norm(ca_list[i + 1] - ca_list[i]))
f... | xingjiepan/ss_generator | ss_generator/ca_tracing/basic.py | Python | bsd-3-clause | 4,853 |
#from .jtest import get_2014_nuggets
#from .submissions import Updates
from .judgements import (
get_2013_nuggets, get_2014_nuggets, get_2013_matches, get_2014_matches
)
from .data import Resource, get_resource_manager
from .misc import stringify_corenlp_doc, stringify_streamcorpus_sentence
import os
import signal
... | kedz/cuttsum | trec2014/python/cuttsum/sentsim.py | Python | apache-2.0 | 21,038 |
from vsg import token
from vsg.rules import single_space_between_token_pairs
lTokens = []
lTokens.append([token.library_clause.keyword, token.logical_name_list.logical_name])
class rule_002(single_space_between_token_pairs):
'''
This rule checks for excessive spaces after the **library** keyword.
**Vi... | jeremiah-c-leary/vhdl-style-guide | vsg/rules/library/rule_002.py | Python | gpl-3.0 | 657 |
#!/usr/bin/env python
#encoding=utf8
#Copyright [2014] [Wei Zhang]
#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 ... | anthonylife/EventRecommendation | script/combineEventInfo.py | Python | apache-2.0 | 1,864 |
"""Glyph-specific queries on font-files"""
from ttfquery import describe
try:
from OpenGLContext.debug.logs import text_log
except ImportError:
text_log = None
def hasGlyph( font, char, encoding=None ):
"""Check to see if font appears to have explicit glyph for char"""
glyfName = explicitGlyph( font, c... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/ttfquery/glyphquery.py | Python | lgpl-3.0 | 3,146 |
"""
Package lib
Non game specific code.
"""
| Trilarion/imperialism-remake | source/imperialism_remake/lib/__init__.py | Python | gpl-3.0 | 45 |
def get_point_cloud(point_cloud_id, number_points=None, history=None):
from voxel_globe.meta import models
from vpgl_adaptor import convert_local_to_global_coordinates_array, create_lvcs
import os
import numpy as np
from plyfile import PlyData
point_cloud = models.PointCloud.objects.get(id=point_cloud_id... | andyneff/voxel-globe | voxel_globe/voxel_viewer/tools.py | Python | mit | 2,354 |
# some system funcionts
import os
# to hash test
from martelo import hash
import pickle
from pprint import pprint
import requests
from soupselect import select
from BeautifulSoup import BeautifulSoup
from martelo import data2xls
import multiprocessing
# load the data collected in the first part
with open('data.pickle'... | mintyPT/scrapers | foodauthority.nsw.gov.au/app2.py | Python | mit | 2,650 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# 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... | esthermm/odoomrp-wip | stock_purchase_unit/models/stock_move.py | Python | agpl-3.0 | 1,968 |
#!/usr/bin/env python
#
# 3 - Left Motor Servo
# 4 - Right Motor Servo
# 5 - Pan Servo
# 14 (A0) - Analog Sensor
# 15 (A1) - Left Whisker
# 16 (A1) - Right Whisker
SIMULATE = 1
SENSOR_PIN = 14
L_BUMP = 15
R_BUMP = 16
SENSOR_THRESH = 400
DELAY_VAL = 700 # Delay for turning
if SIMULATE:
import... | dhylands/DragonTail | DragonSim.py | Python | mit | 4,656 |
''' Whole Body Motion: Multiple Effectors control ***'''
import argparse
import motion
import almath
import time
from naoqi import ALProxy
def main(robotIP, PORT=9559):
'''
Example of a whole body multiple effectors control "LArm", "RArm" and "Torso"
Warning: Needs a PoseInit before executing
... | mikemcfarlane/Code_sprints | Kivy/almotion_wbMultipleEffectors.py | Python | gpl-2.0 | 7,516 |
from sympy import sin, cos, atan2, log, exp, gamma, conjugate, sqrt, \
factorial, Integral, Piecewise, Add, diff, symbols, S, Float, Dummy, Eq
from sympy import Catalan, EulerGamma, E, GoldenRatio, I, pi
from sympy import Function, Rational, Integer, Lambda
from sympy.core.relational import Relational
from sympy.l... | kaichogami/sympy | sympy/printing/tests/test_fcode.py | Python | bsd-3-clause | 28,380 |
# The contents of this file are subject to the Mozilla Public License
# (MPL) Version 1.1 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# b... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/lepl/stream/factory.py | Python | agpl-3.0 | 4,763 |
#!/usr/bin/env python3
'''
Object : defaultdict
defaultdict: No need key is there or not
'''
from collections import defaultdict
s = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)]
# Create a dict with value type being list
d = defaultdict(list)
[d[k].append(v) for k, v in s]
print(d.ite... | jingwangian/tutorial | python/collection_tt/defaultdict_st.py | Python | gpl-3.0 | 909 |
"""
Bot wide hook opt-out for channels
"""
import asyncio
from collections import defaultdict
from fnmatch import fnmatch
from functools import total_ordering
from threading import RLock
from sqlalchemy import Table, Column, String, Boolean, PrimaryKeyConstraint, and_
from cloudbot import hook
from cloudbot.hook impo... | valesi/CloudBot | plugins/core/optout.py | Python | gpl-3.0 | 8,225 |
'''
Name: Dallas Fraser
Date: 2016-04-12
Project: MLSB API
Purpose: Holds the routes for the admin side
'''
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
from os.path import join
from flask import... | fras2560/mlsb-platform | api/admin/__init__.py | Python | apache-2.0 | 19,760 |
from django.conf import settings
from django.utils.timezone import now
from cronjobs import register
from remo.profiles.models import UserProfile
from remo.profiles.tasks import send_generic_mail
from remo.base.utils import go_back_n_months
@register
def new_reps_reminder():
"""Send email to reps-mentors listin... | mozilla/remo | remo/profiles/cron.py | Python | bsd-3-clause | 865 |
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.automation.base import Automation
log = CPLog(__name__)
class CP(Automation):
def getMovies(self):
if self.isDisabled():
return
return []
| Akylas/CouchPotatoServer | couchpotato/core/providers/automation/cp/main.py | Python | gpl-3.0 | 250 |
import unittest.mock
import typing_extensions
from bugwarrior import config, services
from bugwarrior.config import load, schema
from .base import ConfigTest
LONG_MESSAGE = """\
Some message that is over 100 characters. This message is so long it's
going to fill up your floppy disk taskwarrior backup. Actually it's... | ralphbean/bugwarrior | tests/test_service.py | Python | gpl-3.0 | 3,791 |
# Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
import os
from enum import Enum
from UM.PluginObject import PluginObject
class FileReader(PluginObject):
## Used as the return value of FileReader.preRead.
class PreReadResult(Enum):
# The user has acc... | onitake/Uranium | UM/FileHandler/FileReader.py | Python | agpl-3.0 | 1,713 |
from autosar.writer.writer_base import BaseWriter, ElementWriter
from autosar.base import applyFilter
import collections.abc
import autosar.behavior
import autosar.component
class PackageWriter(BaseWriter):
def __init__(self, version, patch):
super().__init__(version, patch)
self.registere... | cogu/autosar | autosar/writer/package_writer.py | Python | mit | 7,113 |
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
# Allow direct execution
import os
import re
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import http_server_port, try_rm
from youtube_dl import YoutubeDL
from y... | rg3/youtube-dl | test/test_downloader_http.py | Python | unlicense | 3,499 |
import inspect
from mock import MagicMock
from plastic import Plastic
from util import must_be_checkable
from cant_find_dependency import CantFindDependency
from primitive_musts import SafeObject
def _mock_must_return_itself_for_must_calls(mock):
mock.must_be_type.return_value = mock
mock.must_be_primitive = ... | umaptechnologies/must | details/class_pattern.py | Python | apache-2.0 | 9,902 |
import os, sys, inspect
# Add matrix-sdk submodule to path
__this_dir = os.path.split(inspect.getfile(inspect.currentframe()))[0]
__this_dir = os.path.realpath(os.path.abspath(__this_dir))
__matrix_dir = os.path.join(__this_dir, "matrix-python-sdk")
if __matrix_dir not in sys.path:
sys.path.insert(0, __matrix_dir)... | Vzaa/navi | navi/__init__.py | Python | apache-2.0 | 321 |
import subprocess
from i3pystatus import IntervalModule
class Ping(IntervalModule):
"""
This module display the ping value between your computer and a host.
``switch_state`` callback can disable the Ping when desired.
``host`` propertie can be changed for set a specific host.
.. rubric:: Availa... | eBrnd/i3pystatus | i3pystatus/ping.py | Python | mit | 2,244 |
"""-0.75/(1+x**2)-(0.65*x*math.atan(1/x))+0.65
(-4* x**2 - 20*x - 100) + (1 - x)**4
3*x**2+ 12/(x**3) - 5
3*x**4 + x**2 - 2*x + 1
10+x**3-2*x-5*(np.finfo(float).eps)**x
x**2- 10*(np.finfo(float).eps)**(0.1*x)
(10*x**3+3*x**2+5)**2
0.5/math.sqrt(1+x**2)- math.sqrt(1+x**2)*(1-0.5/(1+x**2))+x
(np.finfo(float).eps)**x-x**3... | jresendiz27/EvolutionaryComputing | practices/first/evolutionaryStrategies/functions.py | Python | apache-2.0 | 1,490 |
#!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | gkc1000/pyscf | pyscf/pbc/scf/test/test_hf.py | Python | apache-2.0 | 20,613 |
#!/usr/bin/python
import requests
import bs4
root_url = 'http://avito.ma'
index_url = root_url + '/fr/maroc/'
product = 'samsung'
url = index_url + product
products_link = []
products_price = []
products_title = []
def get_urls(url):
print url
response = requests.get(url)
soup = bs4.BeautifulSoup(response.te... | belheber/le-comparateur | pkgs/avito.py | Python | mit | 1,896 |
import json, hmac, hashlib, time, requests, base64
from requests.auth import AuthBase
class CoinbaseAuth(AuthBase):
SIGNATURE_HTTP_HEADER = 'CB-ACCESS-SIGN'
TIMESTAMP_HTTP_HEADER = 'CB-ACCESS-TIMESTAMP'
KEY_HTTP_HEADER = 'CB-ACCESS-KEY'
PASSPHRASE_HTTP_HEADER = 'CB-ACCESS-PASSPHRASE'
def __init__(... | streblo/requests-CoinbaseExchangeAuth | CoinbaseExchangeAuth.py | Python | mit | 1,350 |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | sorenh/cc | vendor/tornado/tornado/locale.py | Python | apache-2.0 | 19,768 |
# Webhooks for teamcity integration
from __future__ import absolute_import
from django.db.models import Q
from zerver.models import UserProfile
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success, json_error
from zerver.decorator import REQ, has_request_variables, api_key_only... | peiwei/zulip | zerver/views/webhooks/teamcity.py | Python | apache-2.0 | 3,963 |
# 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... | radicalbit/ambari | ambari-client/python-client/src/main/python/ambari_client/model/views.py | Python | apache-2.0 | 1,077 |
from openflow.optin_manager.monitoring.SessionMonitoringThread import SessionMonitoringThread
import time
import threading
#from vt_manager.settings.settingsLoader import MONITORING_INTERVAL
from django.conf import settings
'''
author:msune
Monitoring thread implementation
'''
SESSION_MULTIPLIER = 5
class Backgr... | dana-i2cat/felix | optin_manager/src/python/openflow/optin_manager/monitoring/BackgroundMonitor.py | Python | apache-2.0 | 854 |
"""Sponsors forms."""
from flask_wtf import Form
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from wtforms.validators import Email
from wtforms_alchemy import model_form_factory
from pygotham.models import Level, Sponsor
__all__ = ('SponsorApplicationForm', 'SponsorEditForm')
ModelForm = model_form_fa... | djds23/pygotham-1 | pygotham/sponsors/forms.py | Python | bsd-3-clause | 1,512 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (C) 2013 Didotech srl (<http://www.didotech.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# ... | dhp-denero/LibrERP | hr_employee_hierarchy/hr.py | Python | agpl-3.0 | 1,553 |
import requests
import logging
import redis
from requests.packages.urllib3.exceptions import ConnectionError
from core.serialisers import json
from dss import localsettings
# TODO(fergal.moran@gmail.com): refactor these out to
# classes to avoid duplicating constants below
HEADERS = {
'content-type': 'application/j... | fergalmoran/dss | core/realtime/notification.py | Python | bsd-2-clause | 928 |
#!/usr/bin/env python
# This file is part of nexdatas - Tango Server for NeXus data writer
#
# Copyright (C) 2012-2017 DESY, Jan Kotanski <jkotan@mail.desy.de>
#
# nexdatas is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... | nexdatas/writer | test/ProxyHelper.py | Python | gpl-3.0 | 1,599 |
from a10sdk.common.A10BaseClass import A10BaseClass
class AddressCfg(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param link_local: {"default": 0, "type": "number", "description": "Configure an IPv6 link local address", "format": "flag"}
:param anycast: {"default... | amwelch/a10sdk-python | a10sdk/core/interface/interface_tunnel_ipv6.py | Python | apache-2.0 | 2,656 |
# Copyright (c) 2008-2013 Szczepan Faber, Serhiy Oplakanets, Herr Kaste
#
# 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
... | zhilts/pymockito | mockito_util/write_readme.py | Python | mit | 1,779 |
from openerp.osv import osv, fields
class base_config_settings(osv.TransientModel):
_inherit = 'base.config.settings'
_columns = {
'company_share_product': fields.boolean('Share product to all companies',
help="Share your product to all companies defined in your instance.\n"
... | addition-it-solutions/project-all | addons/product/res_config.py | Python | agpl-3.0 | 1,299 |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the \"License\");
# you may not use this file except in compliance with the License.\n",
# 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 writ... | GoogleCloudPlatform/cloudml-samples | tensorflow/containers/unsupported_runtime/data_utils.py | Python | apache-2.0 | 1,538 |
import sys
import config_util # pylint: disable=import-error
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=no-init
class MLPerfInference(config_util.Config):
"""Basic Config class for the MLPerf Inference load generator."""
@staticmethod
def fetch_spec(props):
... | mlperf/inference_results_v0.5 | open/Inspur/code/resnet/schedule/src/loadgen/depot_tools/fetch_configs/mlperf_loadgen.py | Python | apache-2.0 | 860 |
print "imported modc"
stuff = 942
things = "squirrel"
| ArcherSys/ArcherSys | skulpt/test/run/pkga/pkgb/modc.py | Python | mit | 54 |
#!/usr/bin/python -OO
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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, e... | michal-ruzicka/archivematica | src/MCPServer/lib/RPCServer.py | Python | agpl-3.0 | 4,756 |
from setuptools import setup, find_packages
setup(name='BIOMD0000000227',
version=20140916,
description='BIOMD0000000227 from BioModels',
url='http://www.ebi.ac.uk/biomodels-main/BIOMD0000000227',
maintainer='Stanley Gu',
maintainer_url='stanleygu@gmail.com',
packages=find_packages(... | biomodels/BIOMD0000000227 | setup.py | Python | cc0-1.0 | 377 |
""" Module with graphs creation and configuration functions. """
from operator import itemgetter
from collections import defaultdict
import demandimport
with demandimport.enabled():
import bkcharts as charts
import bokeh.palettes as palettes
import numpy as np
import perun.profile.query as query
import perun... | tfiedor/perun | perun/view/scatter/factory.py | Python | gpl-3.0 | 10,803 |
from social_core.backends.nk import NKOAuth2
| cjltsod/python-social-auth | social/backends/nk.py | Python | bsd-3-clause | 45 |
# solve cliff-walking task with Q-Learning, very similar to SARSA
# original example problem from the book, introduction for reinforcement learning
# Author: Wenbin Li
# numeric backend
import pygame
from pygame.locals import *
import numpy as np
grid_size = 100
n_row = 4
n_col = 12
state = np.zeros((n_row * grid_siz... | wenbinli/rl | cliffWalk_QL.py | Python | mit | 6,866 |
import unittest
from mock import Mock
from cartodb_services.tomtom.isolines import TomTomIsolines, DEFAULT_PROFILE
from cartodb_services.tools import Coordinate
from credentials import tomtom_api_key
VALID_ORIGIN = Coordinate(-73.989, 40.733)
class TomTomIsolinesTestCase(unittest.TestCase):
def setUp(self):
... | CartoDB/geocoder-api | server/lib/python/cartodb_services/test/test_tomtomisoline.py | Python | bsd-3-clause | 992 |
# Generated by Django 3.1.7 on 2021-03-17 07:15
from django.db import migrations
from django.db.models import F
def fixup_readonly(apps, schema_editor):
Translation = apps.get_model("trans", "Translation")
db_alias = schema_editor.connection.alias
for translation in Translation.objects.using(db_alias).fi... | nijel/weblate | weblate/trans/migrations/0128_fix_pending_read_only.py | Python | gpl-3.0 | 848 |
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and... | 4shadoww/usploit | lib/dns/rdtypes/ANY/AMTRELAY.py | Python | mit | 3,439 |
# 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
# distributed under the Li... | thenetcircle/dino | test/api/test_api_ban.py | Python | apache-2.0 | 2,148 |
#!/usr/bin/env python3
# Copyright 2015-2016 Samsung Electronics Co., 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 requir... | dhs-shine/litmus | litmus/cmds/cmd_adhoc.py | Python | apache-2.0 | 1,115 |
# Copyright (c) 2018, NVIDIA CORPORATION. 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... | mlperf/training_results_v0.5 | v0.5.0/nvidia/submission/code/single_stage_detector/pytorch/nhwc/mnist_nhwc.py | Python | apache-2.0 | 5,689 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# gmail.py
#
import sys
import os
import smtplib
import getpass
import ConfigParser
from optparse import OptionParser
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.MIMEImage import MIMEImage
'''
Usage: gmail.py [opti... | ActiveState/code | recipes/Python/577690_Python_Gmail_script_smtp/recipe-577690.py | Python | mit | 4,221 |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
"""
Default Settings
"""
import os
DEFAULT_BUCKET_TYPE = os.environ.get('DEFAULT_BUCKET_TYPE', 'pyoko_models')
# write_once bucket doesn't support second... | zetaops/pyoko | pyoko/settings.py | Python | gpl-3.0 | 1,719 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("cases", "0044_caseaction_user_assignee")]
operations = [
migrations.AlterField(
model_name="case",
name="initial_... | praekelt/casepro | casepro/cases/migrations/0045_auto_20161014_1341.py | Python | bsd-3-clause | 501 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgarren/spack | var/spack/repos/builtin/packages/r-protgenerics/package.py | Python | lgpl-2.1 | 1,699 |
# Copyright 2011 OpenStack Foundation.
# 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 req... | Bloomie/murano-repository | muranorepository/openstack/common/notifier/rpc_notifier2.py | Python | apache-2.0 | 2,019 |
#!/usr/bin/env python
#=========================================================================
# This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
# License (GPL) version 3, as described at www.opensource.org.
# Copyright (C)2017 William H. Majoros (martiandna@gmail.com).
#==============================... | ReddyLab/1000Genomes | get-novel-features.py | Python | gpl-2.0 | 5,078 |
# -*- coding: utf-8 -*-
#!/usr/bin/python
# All code provided from the http://gengo.com site, such as API example code
# and libraries, is provided under the New BSD license unless otherwise
# noted. Details are below.
#
# New BSD License
# Copyright (c) 2009-2012, myGengo, Inc.
# All rights reserved.
#
# Redistributio... | shawnps/mygengo-python | examples/updateTranslationJob.py | Python | bsd-3-clause | 2,306 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-27 03:12
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('store', '0007_auto_20170518_1459'),
]
operations = [
migrations.AlterModelOptions(
... | okwow123/djangol2 | example/store/migrations/0008_auto_20170527_0312.py | Python | mit | 440 |
#!/usr/bin/env python3
""" Name that Shape module for use with Lab 5, Inf1340, Fall 2015 """
__author__ = 'Susan Sim'
__email__ = "ses@drsusansim.org"
__copyright__ = "2015 Susan Sim"
__license__ = "MIT License"
def name_that_shape(sides):
"""
For a given number of sides in a regular polygon, returns the sh... | benevolentprof/inf1340-2015-labs | name_that_shape.py | Python | mit | 1,259 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | annarev/tensorflow | tensorflow/python/keras/tests/tracking_test.py | Python | apache-2.0 | 21,433 |
# -*- coding: utf-8 -*-
#
# Cherokee-admin
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2010 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free Softwa... | nuxleus/cherokee-webserver | admin/plugins/failover.py | Python | gpl-2.0 | 1,026 |
import pandas as pd
import numpy as np
import re
import json
import os
import warnings
import shutil
from pathlib import Path
import codecs
"""
Helper functions to load the article data. The main method to use
is load_data().
"""
# Caution! Modifying this in code will have no effect since the
# default arguments are ... | chicago-justice-project/article-tagging | lib/tagnews/utils/load_data.py | Python | mit | 18,234 |
#!/usr/bin/env python
# encoding: utf-8
"""
cluster.py - manage the behaviour and start up of a cluster
Created by Dave Williams on 2016-07-19
"""
import os
import sys
import time
import string
import copy
import itertools
import subprocess as subp
import configparser
import boto
## Defaults
BASE_PATH = os.path.abs... | cdw/multifil | multifil/aws/cluster.py | Python | mit | 8,549 |
# -*- coding: utf-8 -*-
__all__ = [
"zynthian_autoconnect"
]
from zynautoconnect.zynthian_autoconnect import *
| zynthian/zynthian-ui | zynautoconnect/__init__.py | Python | gpl-3.0 | 112 |
# 任務一: task1.py
# 各班修課成員分組
# 分組的目的在讓修課的學員可以有組員可以討論問題, 可以分工合作, 可以互相砥礪, 或者....
# 分組的方法至少有兩種: 自己找組員, 或者由程式指定組員
# 當各組組員確定後, 為了要強迫讓分組組員能夠分散座位 (目的在強制組員間以網路系統內容進行協同)
# 希望各組先依照學號以數值遞增排序, 學號序最小者為各組組員, 而各組組序, 則由各組組長在組間遞增再排序
# 學號排序最小者為第一組, 然後依遞增序確定組序.
# 一旦各組組長確定後, 且各組組序確定後, 就由計算機程式依照電腦輔助設計室的座位, 採用電腦排各組員的固定座位
# 請問, 分別採用類比與數位方法進行分組... | s40523127/2017springwcm_g4 | course/task1.py | Python | agpl-3.0 | 902 |
"""Shim to allow python -m tornado.test.
This only works in python 2.7+.
"""
# pylint: skip-file
from __future__ import absolute_import, division, print_function
from salt.ext.tornado.test.runtests import all, main
# tornado.testing.main autodiscovery relies on 'all' being present in
# the main module, so import it ... | saltstack/salt | salt/ext/tornado/test/__main__.py | Python | apache-2.0 | 430 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.