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 |
|---|---|---|---|---|---|
q1_start = 0
q1_end = 1
N_q1 = 1
q2_start = 0
q2_end = 1
N_q2 = 1
p1_start = -10
p1_end = 10
N_p1 = 32
p2_start = -0.5
p2_end = 0.5
N_p2 = 1
p3_start = -0.5
p3_end = 0.5
N_p3 = 1
N_ghost_q = 0
N_ghost_p = 0
| ShyamSS-95/Bolt | example_problems/nonrelativistic_boltzmann/advected_gaussian_pulse_in_p_space/1V/with_only_E1/domain.py | Python | gpl-3.0 | 243 |
import subprocess
import cfg
import util
import shutil
import os
import time
import tempfile
import easywebdav
import filecmp
from nose.tools import with_setup
from nose.tools import assert_raises
#
# NOTE: following tests have been implemented using easywebdav instead of davfs2
#
pjoin = os.path.join
assert subpro... | luv/webdav_tests | test_suite_09_limits.py | Python | gpl-3.0 | 3,365 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import os
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
WTF_CSRF_ENABLED = True
SECRET_KEY = "4c2cc707e708b9b2ad8a5d427868d580e85ea3943912d916"
SECURITY_PASSWORD_SALT = "3e5fade13026ad4d6121d428c6eb43adf078d1719d1f4615"... | Aurantia/AurantiaWebService | settings.py | Python | gpl-3.0 | 667 |
from sqlalchemy import ForeignKey
from brewlog import db
class ParamRecord(db.Model):
__tablename__ = 'params'
id = db.Column(db.Integer, primary_key=True)
brew_id = db.Column(db.Integer, ForeignKey('brews.brew_id'))
param_type = db.Column(db.String(20), nullable=False)
value = db.Column(db.Strin... | hinnefe2/brewlog | brewlog/models/params.py | Python | gpl-3.0 | 413 |
import logging
try:
import queue
except ImportError: # pragma: no cover
import Queue as queue
import signal
import threading
import time
import six
from six.moves import urllib
try:
import requests
except ImportError: # pragma: no cover
requests = None
try:
import websocket
except ImportError: #... | max00xam/service.maxxam.teamwatch | lib/engineio/client.py | Python | gpl-3.0 | 25,302 |
from dataclasses import dataclass
from typing import Dict, Tuple, Union
from randovania.game_description.item import migrations
from randovania.game_description.item.ammo import Ammo
from randovania.game_description.item.item_category import ItemCategory
from randovania.game_description.item.major_item import MajorIte... | henriquegemignani/randovania | randovania/game_description/item/item_database.py | Python | gpl-3.0 | 2,456 |
# -*- coding: utf-8 -*-
'''
Copyright 2015
Centre de données socio-politiques (CDSP)
Fondation nationale des sciences politiques (FNSP)
Centre national de la recherche scientifique (CNRS)
License
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Gene... | CDSP/zephserver | examples/zephserversettings.py | Python | gpl-3.0 | 2,360 |
import ConfigParser
import clg
import os
import yaml
import yamlordereddictloader
from cli import exceptions
from cli import logger
from cli import utils
LOG = logger.LOG
SPEC_EXTENSION = '.spec'
BUILTINS_REPLACEMENT = {
'__DEFAULT__': "default"
}
TRIM_PARAMS = ['default', 'required']
class ValueArgument(obj... | tkammer/infrared | cli/spec.py | Python | gpl-3.0 | 15,689 |
#!/usr/bin/env python
import sys
import time
import scapy.all as scapy
SEQ_MAX = 2**32 - 1
previous_packets = set()
def is_retransmission(packet):
packet_key = "%d%d%d" % (packet[scapy.TCP].sport,
packet[scapy.TCP].dport,
packet[scapy.TCP].seq)
i... | NullHypothesis/active-probing-tools | source_port_analysis.py | Python | gpl-3.0 | 1,711 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013,2014,2015,2016 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 v... | KonradBreitsprecher/espresso | samples/cellsystem_test.py | Python | gpl-3.0 | 2,497 |
import unicodedata
import curses
class BufferError(Exception):
def __init__(self, msg):
self._msg = msg
def __str__(self):
return repr(self._msg)
def interpret_arrowkey(key):
directions = { curses.KEY_UP : (0, -1),
curses.KEY_DOWN : (0, 1),
curses.KEY_RIGHT : (1, 0),
curses.KEY_LEF... | federicotdn/piter | src/util.py | Python | gpl-3.0 | 625 |
# Copyright 2014-2020 Chris Cummins <chrisc.101@gmail.com>.
#
# 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... | ChrisCummins/clgen | labm8/py/pbutil.py | Python | gpl-3.0 | 19,110 |
"""
Author: RedFantom
Contributors: Daethyra (Naiii) and Sprigellania (Zarainia)
License: GNU GPLv3 as in LICENSE
Copyright (C) 2016-2018 RedFantom
"""
# Standard Library
from datetime import datetime, timedelta
from multiprocessing import Event
import os
import six
import sys
from queue import Queue
from threading imp... | RedFantom/GSF-Parser | parsing/realtime.py | Python | gpl-3.0 | 51,914 |
from __future__ import print_function
from ADSOrcid.models import ClaimsLog
from ADSOrcid import tasks
from collections import defaultdict
app = tasks.app
def run():
stats = defaultdict(lambda: 0)
authors = {}
i = 0
with app.session_scope() as session:
for r in session.query(ClaimsLog).or... | adsabs/ADSOrcid | scripts/count.py | Python | gpl-3.0 | 863 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import socket
import requests
def GetIP(target):
timeout = 8
ip=""
valid_responses = ['200', '401', '403', '404', '301', '302']
try:
if str(requests.get('http://' + target,timeout = timeout).status_code) not in valid_responses:
if str(requests.ge... | n4xh4ck5/wh01p | modules/getip/getip.py | Python | gpl-3.0 | 636 |
"""Module for configuring the host environment"""
import os
import json
import sys
class HostConfig():
"""Sets up the required components on the host environment"""
def __init__(self):
"""Host"""
self.path = None
self.apps = None
def get_path(self):
"""Gets... | tagn/plex-stack | lib/host.py | Python | gpl-3.0 | 1,728 |
# Copyright 2014 Ahmet Cetinkaya
# This file is part of pastefromhtml.
# pastefromhtml 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.... | cetinkaya/pastefromhtml | htmlcdparser.py | Python | gpl-3.0 | 19,903 |
from sklearn import tree
import pyfirmata
import time
import pandas
from pandas.tools.plotting import scatter_matrix
import matplotlib.pyplot as plt
from sklearn import model_selection
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import acc... | ricoen/drip_boot | drip_boot.py | Python | gpl-3.0 | 1,411 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author:
# Łukasz Polak <l.polak@gmail.com>
#
"""This is main file for whole GUI part of OpenBCI - main window of whole
application, along with loading all needed modules GUIs"""
# We are using newer version of QVariant through our GUI, so we might as well
# set it... | BrainTech/openbci | obci/gui/frontend/main_gui.py | Python | gpl-3.0 | 4,516 |
from .baseclass import Protocol
from .overrides import Mac, Ethernet, IPv4, Payload, Tcp, Udp
__all__ = [
'Protocol',
'Mac', 'Ethernet', 'IPv4', 'Payload', 'Tcp', 'Udp',
]
| little-dude/simple-ostinato | simple_ostinato/protocols/__init__.py | Python | gpl-3.0 | 181 |
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import argparse
import rospy
import rostopic
class Histogram():
def __init__(self, arguments):
self.args = arguments
self.data = {}
self.labels = []
for i in range(0, len(self.args.topics)):
# ... | PalouseRobosub/robosub | scripts/histogram.py | Python | gpl-3.0 | 4,036 |
from hydra_pywr_common.hydropower_nodes import *
| UMWRG/PywrApp | hydra_pywr/__init__.py | Python | gpl-3.0 | 49 |
# Copyright (C) 2018, Yu Sheng Lin, johnjohnlys@media.ee.ntu.edu.tw
# This file is part of Nicotb.
# Nicotb 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 opti... | johnjohnlin/nicotb | sim/ahb/Ahb_test.py | Python | gpl-3.0 | 2,569 |
from planning.models import TeachingCapability, PlanningCourse
from courselib.auth import requires_role
from coredata.models import Person
from django.shortcuts import render_to_response
from django.template import RequestContext
@requires_role('PLAN')
def view_capabilities(request):
instructors = Person.objects.... | sfu-fas/coursys | oldcode/planning/views/view_capabilities.py | Python | gpl-3.0 | 1,166 |
import datetime
from string import Template
import robocompdsl.dsl_parsers.parsing_utils as p_utils
from robocompdsl.templates.templateCPP.plugins.base.functions import function_utils as utils
from robocompdsl.templates.common.templatedict import TemplateDict
AGM_INNERMODEL_ASSOCIATION_STR = """\
innerModel = std::ma... | robocomp/robocomp | tools/cli/robocompdsl/robocompdsl/templates/templateCPP/plugins/agm/functions/src/specificworker_cpp.py | Python | gpl-3.0 | 3,615 |
import pprint
from wizard.importoervoer import ImportOrders, Credentials, ImportProds, ImportSmaak, ImportVlees
imp = ImportOrders(Credentials.user, Credentials.pw)
if imp.connect():
savecur = imp.get_cur()
imp.importtable()
imp = ImportProds(Credentials.user, Credentials.pw, savecur)
pprint.pprint(imp.importtab... | micha-shepher/oervoer-wizard | oervoer-django/oervoer/src/testimport.py | Python | gpl-3.0 | 490 |
#!/usr/bin/env python
#
# Copyright 2007,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, gr_unittest, blocks
import math
class test_max(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()... | trabucayre/gnuradio | gr-blocks/python/blocks/qa_max.py | Python | gpl-3.0 | 5,142 |
# A very crude plugin system that suits our needs.
# Copyright (C) 2010 Francis Markham
# 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) ... | thegooglecodearchive/geolocate-cli | plugins.py | Python | gpl-3.0 | 4,000 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of XBMC Mega Pack Addon.
Copyright (C) 2014 Wolverine (xbmcmegapack@gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Softwar... | xbmcmegapack/plugin.video.megapack.dev | resources/lib/menus/home_countries_greece.py | Python | gpl-3.0 | 1,109 |
# Copyright 2009 Daniel Woodhouse
#
#This file is part of mtp-lastfm.
#
#mtp-lastfm 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.
#
#mtp... | woodenbrick/mtp-lastfm | mtplastfm/webservices.py | Python | gpl-3.0 | 7,361 |
#!/usr/bin/env python
import os
import os.path
import sys
import string
###############################################################
## #
## Edyta Malolepsza #
## David Wales' group, University of Cambridge ... | marktoakley/LamarckiAnt | SCRIPTS/AMBER/symmetrise_prmtop/perm-prmtop.ff02.py | Python | gpl-3.0 | 25,578 |
'''char embedding transformer testcases'''
from unittest import TestCase
import numpy as np
from seq2vec.transformer import CharEmbeddingOneHotTransformer
from .test_transformer_base import CharEmbeddingTransformerBase
class TestCharEmbeddingOneHotTransformerClass(
CharEmbeddingTransformerBase,
TestC... | Yoctol/seq2vec | seq2vec/tests/transformer/test_char_embedding.py | Python | gpl-3.0 | 1,946 |
import pygame
from fish import Fish
from seaweed import Seaweed
class Water:
def __init__(self):
# color, pos_x, pos_y, width, height
self.mOrangeFish = Fish((255, 152, 0), 50, 175, 175, 100)
self.mGreyFish = Fish((96, 125, 139), 350, 130, 125, 200)
self.mRedFish = Fish((183, 28, 28), 200, 300, 175, 50... | joshl8n/school-projects | illustrate/water.py | Python | gpl-3.0 | 1,287 |
"""Proficiency components."""
from component_objects import Component, Element
class ProficiencyAddModal(Component):
"""Definition of proficiency add modal component."""
modal_div_id = 'addProficiency'
name_id = 'proficiencyAddNameInput'
type_id = 'proficiencyAddTypeInput'
description_id = 'prof... | adventurerscodex/uat | components/core/character/proficiency.py | Python | gpl-3.0 | 1,561 |
from pyramid.httpexceptions import HTTPFound
from pyramid.view import view_config
from ticketing.macros.baselayout import BaseLayout
from ticketing.models import Ticketing
class Discount(BaseLayout):
@view_config(
route_name="discount",
renderer="templates/discount.pt",
context=Ticket... | Intuity/Tktr | ticketing/profile/discount.py | Python | gpl-3.0 | 2,266 |
# -*- coding: utf-8 -*-
import sys
import math
from numpy import arange
sys.path.append("g:\\Github\\iapws")
from iapws import IAPWS97
student = {2: 1, 3: 2, 4: 3}
print(student)
print(len(student))
m = student.keys()
n = student.values()
print(m)
print(n)
s = {}
for i in range(0, 2):
s[i] = 1
print(s)
m_cache = ... | Molar2016/Pressure_drop-in-my-loop | Test.py | Python | gpl-3.0 | 1,102 |
"""
" "
" This file is part of the 20n/act project. "
" 20n/act enables DNA prediction for synthetic biology/bioengineering. "
" Copyright (C) 2017 20n Labs, Inc. "
" ... | 20n/act | reachables/src/main/python/DeepLearningLcmsPeak/netcdf/netcdf_parser.py | Python | gpl-3.0 | 2,813 |
from collections import Counter
class Solution(object):
def leastInterval(self, tasks, n):
"""
:type tasks: List[str]
:type n: int
:rtype: int
"""
count = Counter(tasks)
theMax = max(count.values())
return max(len(tasks), ((theMax - 1) * (n + 1)
... | wufangjie/leetcode | 621. Task Scheduler.py | Python | gpl-3.0 | 393 |
'''
Simple clustering techniques.
Classes
---------
.. autosummary::
ClusteredData
MergedClusters
ThresholdClusters
'''
import numpy as np
import collections
from abc import ABCMeta, abstractmethod
import logging
_logger = logging.getLogger(__name__)
class ClusteredData(collections.Sequence):
''... | MattNolanLab/ei-attractor | grid_cell_model/analysis/clustering.py | Python | gpl-3.0 | 5,770 |
#!/usr/bin/env python3
# Old Transactions
import pymysql
def mainactions(args_list, configs, db_cur) :
help_string='''
Usage:
* Default: Returns the number of old, active transactions
(By Default 1 Day). By Default Warn Crit Time is the format for
customization otherwise it's 50/100'''
unknown_error=False
war... | chalbersma/persist_transaction | perf/oldtx.py | Python | gpl-3.0 | 1,653 |
#!/usr/bin/env python
"""
simplepath.py
functions for digesting paths into a simple list structure
Copyright (C) 2005 Aaron Spike, aaron@ekips.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; eit... | piyush-jain1/GSoC17OctaveGeometry | inst/io/@svg/simplepath.py | Python | gpl-3.0 | 6,961 |
#!/usr/bin/env python
"""
@file route2trips.py
@author Michael Behrisch
@author Daniel Krajzewicz
@date 2008-03-19
@version $Id: route2trips.py 13811 2013-05-01 20:31:43Z behrisch $
This script converts SUMO routes back into SUMO trips which serve
as input to one of the routing applications.
It reads the route... | rudhir-upretee/Sumo17_With_Netsim | tools/trip/route2trips.py | Python | gpl-3.0 | 2,364 |
# -*- coding: utf-8 -*-
import ted_util as tu
from ted_util import dec
import ted_sqlite as ts
fil = 'tdf.sql3'
sqlc = "create table mis(id INTEGER PRIMARY KEY, xr, per, typ, erg, js, jse);"
sqli = "insert into mis values (null, ?, ?, ?, ?, ?, ?);"
sqls = '''select xr, per, typ, erg, p0(js, 'forol') as sk, p0(jse, 'm... | tedlaz/pyted | tedutil_old/mis.py | Python | gpl-3.0 | 3,105 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.common import Backend
from lib.core.common import extractRegexResult
from lib.core.common import getSQLSnippet
from lib.core.common import getUnicode
... | zhinaonet/sqlmap-z | lib/core/agent.py | Python | gpl-3.0 | 50,858 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from builtins import object
import pytest
from psychopy import event, core
from psychopy.preferences import prefs
from psychopy.visual import Window
from pyglet.window.key import (MOD_SHIFT,
MOD_CTRL,
MOD_ALT,
... | hoechenberger/psychopy | psychopy/tests/test_events/test_keyboard_events.py | Python | gpl-3.0 | 11,035 |
#!/usr/bin/env python3
import subprocess
from pynput import keyboard
KEY = keyboard.Key.scroll_lock
SOURCE = '@DEFAULT_SOURCE@'
class PushToTalk():
def __init__(self, source, key):
# Mute microphone as default state
self.muted = True
self.pactl_command = 'pactl set-source-mute {} '.form... | anders-larsson/random-scripts | pysh_to_talk/pysh_to_talk.py | Python | gpl-3.0 | 1,059 |
#!/usr/bin/env python
"""Filter LightDock final swarm results depending on the compatibility with the membrane"""
from __future__ import print_function
import sys
import os
import argparse
import shutil
import re
from prody.measure.contacts import Contacts
from prody import parsePDB, confProDy
from lightdock.util.log... | brianjimenez/lightdock | bin/post/lgd_filter_membrane.py | Python | gpl-3.0 | 5,399 |
#-*- coding: utf-8 -*-
'''
Created on 24 авг. 2010
@author: ivan
'''
from gi.repository import Gtk
import logging
from foobnix.fc.fc import FC
from foobnix.helpers.image import ImageBase
from foobnix.util.const import SITE_LOCALE, ICON_FOOBNIX
from foobnix.util.localization import foobnix_localization
from foobnix.gu... | kagel/foobnix | foobnix/helpers/dialog_entry.py | Python | gpl-3.0 | 12,111 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class TutItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
image_urls = scrapy.Field()
images = sc... | leonlcw92/myScrapy | tut/tut/items.py | Python | gpl-3.0 | 333 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# eLyXer -- convert LyX source files to HTML output.
#
# Copyright (C) 2009 Alex Fernández
#
# 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... | jackdesert/lyxblogger | src/elyxer_io/convert.py | Python | gpl-3.0 | 5,642 |
from django.db import models
from django.db.models import Q
from decimal import Decimal, ROUND_UP
from django.conf import settings
from django.urls import reverse
import decimal
zero = Decimal("0.00")
penny = Decimal("0.01")
fifty_pence = Decimal("0.50")
pound = Decimal("1.00")
class CaseInsensitiveFieldMixin:
"... | sde1000/miltonxero | invoicer/models.py | Python | gpl-3.0 | 10,923 |
# linearizedGP -- Implementation of extended and unscented Gaussian processes.
# Copyright (C) 2014 National ICT Australia (NICTA)
#
# This file is part of linearizedGP.
#
# linearizedGP is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by... | NICTA/linearizedGP | linearizedGP/gputils.py | Python | gpl-3.0 | 4,822 |
import os
import urllib.request
from flask import current_app
def download_img(comm):
print(os.getcwd())
url_list = comm.pics
img_dir_path = os.path.join(current_app.config.get("IMAGE_FOLDER", ""), comm.market + comm.idInMarket)
# 创建图片目录
if not os.path.exists(img_dir_path):
os.mkdir(img_di... | armorunicorn/price_forecast | price_interface/global_fun.py | Python | gpl-3.0 | 1,096 |
import pytest
import os
import sys
import shlex
from atg.util import align
BOWTIE2_LOG = os.path.join(os.path.dirname(__file__), 'data', 'bowtie2_SE.log')
KALLISTO_LOG = os.path.join(os.path.dirname(__file__), 'data', 'kallisto_run.json')
class TestSTARCommand:
def test_star_arg_parsing(self):
arguments ... | BennerLab/atg | tests/test_alignment_helper.py | Python | gpl-3.0 | 5,435 |
#!/usr/bin/env python3
import subprocess
import sys
from os.path import abspath, dirname, join
from time import sleep, perf_counter
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditi... | apeschar/webwinkelkeur-virtuemart | test/test.py | Python | gpl-3.0 | 3,695 |
# -*- coding: utf-8 -*-
# from __future__ import division
import cv2
import numpy as np
import glob
import shutil
from random import shuffle
import os
import json
import re
import preprocess as pp
import training as train
import sklearn as sk
# from sklearn import svm
from scikits.learn import cross_val, datasets, dec... | theidentity/lekha_OCR_1.0 | initial_temp.py | Python | gpl-3.0 | 15,395 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contest', '0015_auto_20160119_0336'),
]
operations = [
migrations.AddField(
model_name='scorecriterion',
... | azuer88/tabulator | tabulator/contest/migrations/0016_scorecriterion_weighted_score.py | Python | gpl-3.0 | 485 |
#!/usr/bin/python3
class ClsAttribute:
visibility_dict = {0 : "public",
1 : "private",
2 : "protected",
3 : "public"} #3 stands for implementation which is not implemented
#so public is default here
... | Rihorama/dia2code | src/dia2code/classd/cls_attribute.py | Python | gpl-3.0 | 1,404 |
#!/usr/bin/python -u
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib import admin
from datetime import datetime
from gestion.models import *
# Create your models here.
class Licencias(models.Model):
tipo = models.CharField(max_length=150, blank=True,verbose_name='nombre')
des... | desarrollosimagos/svidb | administrativo/documentos/models.py | Python | gpl-3.0 | 1,156 |
# -*- coding: utf-8 -*-
###############################################################################
# #
# Ambrosia - a tool to visualize ANANAS results #
# ... | MalwareLabHagenberg/ambrosia | ambrosia_plugins/network/__init__.py | Python | gpl-3.0 | 2,143 |
# Redlist - a user tracker for Reddit
# Version 1.1.9
import praw, time, cmd, tabulate
from colorama import init, Fore, Back, Style
init(autoreset = True)
print("What platform are you running Redlist on?\nThis is required by the Reddit API guidelines.")
PLATFORM = input("--> ").lower()
print("\n")
CLIENT_VERSION = ... | HorizonFoxtrot/Redlist | redlist.py | Python | gpl-3.0 | 13,314 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
from configparser import ConfigParser
import pytest
from hamster_lib.helpers import config_helpers
from hamster_lib.helpers.config_helpers import HamsterAppDirs
class TestHamsterAppDirs(object):
"""Make sure that our cu... | projecthamster/hamster-lib | tests/helpers/test_config_helpers.py | Python | gpl-3.0 | 7,849 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-05-01 08:06
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('os2webscanner', '0012_auto_20180501_1004'),
]
operations = [
migrations.AlterModelT... | os2webscanner/os2webscanner | django-os2webscanner/os2webscanner/migrations/0013_auto_20180501_1006.py | Python | mpl-2.0 | 414 |
D: Dict[str, Dict[int, int]] = {'a': {1: 0}, 'b': {1: 1}, 'c': {1: 2}, 'd': {1: 3}}
k: Set[str] = D.keys()
z: Set[Dict[int, int]] = D.values()
# FINAL: D -> "a"@[0, 1], "b"@[1, 1], "c"@[1, 2], _@[1, 3]; k -> [-inf, inf]; keys(D) -> 0@[-inf, inf], _@⊥; len(D) -> [4, 4]; len(k) -> [1, 1]; len(z) -> [1, 1]; values(D) -> ... | caterinaurban/Lyra | src/lyra/unittests/numerical/interval/forward/indexing3/keyval.py | Python | mpl-2.0 | 351 |
import json
from os.path import join, dirname
from jsonschema import validate
SCHEMA_FILE = "normandy-schema.json"
def assert_valid_schema(data):
schema = _load_json_schema()
return validate(data, schema)
def _load_json_schema():
relative_path = join("schemas", SCHEMA_FILE)
absolute_p... | mozilla/normandy | contract-tests/v3_api/support/assertions.py | Python | mpl-2.0 | 461 |
# Generated by Django 1.11.16 on 2018-12-14 19:51
# 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 django.db import migrations, models
class Migration(migration... | lonnen/socorro | webapp-django/crashstats/cron/migrations/0004_auto_20181214_1951.py | Python | mpl-2.0 | 4,301 |
# This script tests the various coordinate conversion utilities in the scripting API. To be run asynchronously.
# Created by Toni Sagrista
from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface
from gaia.cu9.ari.gaiaorbit.util import GlobalConf
gs = EventScriptingInterface.instance()
gs.disableInput()
gs.... | vga101/gaiasky | assets/scripts/tests/refsys-conversion-test.py | Python | mpl-2.0 | 3,032 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This is week5 warmup task_02 Import a Module Namespace"""
import task_01.peanut
TIME = task_01.peanut.BUTTER
| emad8878/is210-week-05-warmup | task_02.py | Python | mpl-2.0 | 160 |
from django.contrib import admin
from django.core.exceptions import PermissionDenied
from harold.base.models import Feedback
class FeedbackAdmin(admin.ModelAdmin):
list_display = ('created_on', 'sentiment', 'text', 'email',
'notes', 'assigned_to', 'closed')
search_fields = ('text',)
... | willkg/harold | harold/base/admin.py | Python | mpl-2.0 | 497 |
# This config file can be appended to any other mozharness job
# running under tbpl. The purpose of this config is to override
# values that are specific to Release Engineering machines
# that can reach specific hosts within their network.
# In other words, this config allows you to run any job
# outside of the Release... | simar7/build-mozharness | configs/developer_config.py | Python | mpl-2.0 | 1,008 |
# -*- coding: utf-8 -*-
"""
.. module:: MyCapytain.errors
:synopsis: MyCapytain errors
.. moduleauthor:: Thibault Clérice <leponteineptique@gmail.com>
"""
class MyCapytainException(BaseException):
""" Namespacing errors
"""
class JsonLdCollectionMissing(MyCapytainException):
""" Error thrown when ... | Capitains/MyCapytain | MyCapytain/errors.py | Python | mpl-2.0 | 2,639 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r"^sub/(?P<user_name>[a-zA-Z0-9]+)/(?P<value>[0-9]+)",views.ajax_sub_credit,name="sub credit"),
url(r"^add/(?P<user_name>[a-zA-Z0-9]+)/(?P<value>[0-9]+)",views.ajax_add_credit,name="add credit"),
url(r"^ajax/all",views.ajax_get_all_... | tiregram/Boufix | snackix/urls.py | Python | agpl-3.0 | 824 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Adriano Monteiro Marques
#
# Author: Piotrek Wasilewski <wasilewski.piotrek@gmail.com>
#
# 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 Sof... | umitproject/network-admin | netadmin/utils/charts/charttools.py | Python | agpl-3.0 | 2,781 |
# -*- coding: utf-8 -*-
from openerp.osv import fields, osv
import openerp.addons.decimal_precision as dp
class rainsoft_account_invoice(osv.osv):
_name='account.invoice'
_inherit = 'account.invoice'
_columns={
'p_comment':fields.related('partner_id','comment',type='text',relation='r... | kevin8909/xjerp | openerp/addons/Rainsoft_Xiangjie/rainsoft_account_invoice.py | Python | agpl-3.0 | 2,540 |
# Copyright 2020 Tecnativa - Carlos Dauden
# Copyright 2020 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.tests import common
class TestPartnerContactAddressDefault(common.TransactionCase):
def setUp(self):
super().setUp()
self.Partner = ... | OCA/partner-contact | partner_contact_address_default/tests/test_partner_contact_address_default.py | Python | agpl-3.0 | 1,714 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'Alias', fields ['topic', 'name']
db.delete_unique(u'main_alias', ['topic_id... | CENDARI/editorsnotes | editorsnotes/main/migrations/0110_auto__del_alias__del_unique_alias_topic_name.py | Python | agpl-3.0 | 24,408 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
#
# 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
#... | MostlyOpen/odoo_addons | myo_survey/wizard/__init__.py | Python | agpl-3.0 | 936 |
# Generated by Django 2.2.5 on 2019-10-02 16:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("mailing", "0006_auto_20191002_1752")]
operations = [
migrations.AddField(
model_name="segment",
name="events_organizer",
... | lafranceinsoumise/api-django | agir/mailing/migrations/0007_segment_events_organizer.py | Python | agpl-3.0 | 552 |
# -*- coding: utf-8 -*-
"""
flask_principal
~~~~~~~~~~~~~~~
Identity management for Flask.
:copyright: (c) 2012 by Ali Afshar.
:license: MIT, see LICENSE for more details.
"""
from __future__ import with_statement
__version__ = '0.3.5'
from functools import partial, wraps
from collections impo... | StealthMicro/OctoPi-Makerbot | env/Lib/site-packages/flask_principal/__init__.py | Python | agpl-3.0 | 13,726 |
# -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | CLVsol/oehealth | oehealth_prescription/oehealth_patient_medication.py | Python | agpl-3.0 | 2,721 |
#---------------------------------------------------------------------------
# Players Unit tests
#---------------------------------------------------------------------------
from ..testcase import TestCase
from .helpers import asynctest, UnitTestCase
from flexmock import flexmock
from davezdominoes.gameserver.player ... | linuxsoftware/dominoes | tests/test_gameserver/test_player.py | Python | agpl-3.0 | 2,374 |
from django.contrib import admin
from survey.actions import make_published
from survey.exporter.csv import Survey2Csv
from survey.exporter.tex import Survey2Tex
from survey.models import Answer, Category, Question, Response, Survey
class QuestionInline(admin.StackedInline):
model = Question
ordering = ("orde... | Pierre-Sassoulas/django-survey | survey/admin.py | Python | agpl-3.0 | 1,693 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-06-19 18:29
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('organization_projects', '0... | Ircam-Web/mezzanine-organization | organization/projects/migrations/0086_auto_20190619_2029.py | Python | agpl-3.0 | 1,124 |
# Copyright 2013-2020 Akretion France (https://akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Fiscal Position VAT Check",
"version": "14.0.1.0.0",
"category": "Invoices & Payments",
"license": ... | OCA/account-financial-tools | account_fiscal_position_vat_check/__manifest__.py | Python | agpl-3.0 | 637 |
from django.db import models
class CachedResponse(models.Model):
class Meta:
unique_together = (
('method', 'url', 'kwargs')
)
method = models.CharField(max_length=10)
url = models.TextField()
kwargs = models.TextField()
content = models.BinaryField()
data = mode... | leesdolphin/rentme | rentme/raw/importer/models.py | Python | agpl-3.0 | 372 |
'''
Context processors for AWSTrial pages
'''
from django.conf import settings
def google_analytics_id(request):
"""Adds the google analytics id to the context if it's present."""
return {
'google_analytics_id': getattr(settings, 'GOOGLE_ANALYTICS_ID', None),
}
def theme_assets_root(request):
... | appsembler/awstrial | awstrial/trial/context_processors.py | Python | agpl-3.0 | 532 |
# TODO separate into different package modules
| dibaunaumh/fcs-skateboard | fcs_aux/mies/__init__.py | Python | agpl-3.0 | 47 |
from flask import request
from flask_restplus import Resource
from skf.api.security import security_headers, validate_privilege
from skf.api.checklist_category.business import update_checklist_category
from skf.api.checklist_category.serializers import checklist_type_update, message
from skf.api.kb.parsers import autho... | blabla1337/skf-flask | skf/api/checklist_category/endpoints/checklist_category_update.py | Python | agpl-3.0 | 1,240 |
# -*- coding: utf-8 -*-
{
'name': 'Project Issue to Change Request',
'version': '8.0.1.0.3',
'summary': 'Create Change Requests from Project Issues',
'sequence': '19',
'complexity': 'easy',
'author': 'Matmoz d.o.o., '
'Project Expert Team',
'contributors': [
'Matjaž... | sysadminmatmoz/pmis | issue_change_request/__manifest__.py | Python | agpl-3.0 | 609 |
import urlparse
import os, sys
tools_dir = os.environ.get('TOOLSDIR')
lib_path = os.path.abspath(tools_dir)
sys.path.append(lib_path)
from msc_utils_parsing import *
from blockchain_utils import *
from msc_apps import *
import random
def send_form_response(response_dict):
expected_fields=['from_address', 'to_addre... | Nevtep/omniwallet | api/send.py | Python | agpl-3.0 | 10,105 |
# -*- coding: utf-8 -*-
# Copyright (C) 2016-Today: Odoo Community Association (OCA)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
import os
from git import Repo
from subprocess import check_output
from datetime import ... | legalsylvain/oca-custom | __unported__/oca_freestore/models/github_repository_branch.py | Python | agpl-3.0 | 11,894 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Harvard
#
# Authors:
# Xavier Antoviaque <xavier@antoviaque.org>
#
# This software's license gives you freedom; you can copy, convey,
# propagate, redistribute and/or modify this program under the terms of
# the GNU Affero General Public License (AGPL) as publishe... | open-craft/xblock-mentoring | mentoring/title.py | Python | agpl-3.0 | 1,443 |
# sqlalchemy/__init__.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from . import util as _util # noqa
from .inspection import inspect # noqa
f... | skarra/PRS | libs/sqlalchemy/__init__.py | Python | agpl-3.0 | 4,621 |
"""
Tests for Discussion API views
"""
from datetime import datetime
import json
from urlparse import urlparse
import httpretty
import mock
from pytz import UTC
from django.core.urlresolvers import reverse
from rest_framework.test import APIClient
from discussion_api.tests.utils import (
CommentsServiceMockMixi... | shubhdev/edx-platform | lms/djangoapps/discussion_api/tests/test_views.py | Python | agpl-3.0 | 28,826 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Avoin Systems (http://avoin.systems).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publ... | avoinsystems/product_lot_sequence | __init__.py | Python | agpl-3.0 | 994 |
# 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.utils import cint, flt, cstr, comma_or
from frappe import _, throw
from erpnext.stock.get_item_details import get_bin_details
... | gsnbng/erpnext | erpnext/controllers/selling_controller.py | Python | agpl-3.0 | 16,561 |
"""
Student Views
"""
import datetime
import logging
import uuid
from collections import namedtuple
from bulk_email.models import Optout
from courseware.courses import get_courses, sort_by_announcement, sort_by_start_date
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.de... | a-parhom/edx-platform | common/djangoapps/student/views/management.py | Python | agpl-3.0 | 48,715 |
from django.conf import settings
from django.urls import reverse
from django_ical.views import ICalFeed
from registration.utils import get_or_404
class HelperFeed(ICalFeed):
timezone = settings.TIME_ZONE
product_id = "-//helfertool.org//Helfertool"
def get_object(self, request, event_url_name, helper_p... | helfertool/helfertool | src/registration/feeds.py | Python | agpl-3.0 | 1,186 |
# -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2016 Scifabric LTD.
#
# PYBOSSA 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 op... | PyBossa/pybossa | test/test_importers/test_s3_importer.py | Python | agpl-3.0 | 6,099 |
import asyncio
from server import Server
#def main(arguments):
def main():
loop = asyncio.get_event_loop()
server = Server()
asyncio.async(server.run_server())
try:
loop.run_forever()
except KeyboardInterrupt:
print('Received interrupt, closing')
server.close()
finally... | r4mp/evolver_server | evolver_server/app.py | Python | agpl-3.0 | 486 |