code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
import re
from transformer.registry import register
from transformer.transforms.base import BaseTransform
# updated to include seperate regexes - testing is much easier here:
# orig and default (UNI1): https://regex101.com/r/FCS4px/1
# uni2: https://regex101.com/r/sk6MVY/1
# na: https://regex1... | zapier/transformer | transformer/transforms/string/phone_number_extract.py | Python | gpl-3.0 | 3,211 |
'''
Created on Jul 5, 2014
updated: May 28, 2015: added AMCMC
@author: jonaswallin
'''
import numpy as np
import numpy.random as npr
from ..utils.gammad import ln_gamma_d
def f_prior_nu(x, nu=0.01):
"""
deafult prior for nu which is gamma
returns : log of prior
"""
return -nu*x
class n... | JonasWallin/logisticnormal | logisticnormal/PurePython/priors.py | Python | gpl-3.0 | 5,934 |
''' Module '''
import re
import logging
class CurrentCost:
''' Class '''
'''
def __init__(self, data=None, logger=None):
''' Method '''
self._data = data
self.logger = logger or logging.getLogger(__name__)
self.time = None
self.uid = None
self.value = None
'''... | gljohn/meterd | meterd/parser/currentcost.py | Python | gpl-3.0 | 1,012 |
# Not used by any item
type = "passive"
def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("High Speed Maneuvering"), "signatureRadiusBonus",
src.getModifiedItemAttr("eliteBonusCommandDestroyer3"), skill="Command Destroyers")
| Ebag333/Pyfa | eos/effects/elitebonuscommanddestroyermwdsigradius3.py | Python | gpl-3.0 | 312 |
# -*- coding: utf8 -*-
# This file is a part of SMSShell
#
# Copyright (c) 2016-2018 Pierre GINDRAUD
#
# SMSShell 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... | Turgon37/SMSShell | SMSShell/commands/help.py | Python | gpl-3.0 | 1,862 |
from submission import Submission
class JulesSubmission(Submission):
def author(self):
return 'Jules'
def run(self, s):
import hashlib
salt = s.strip()
password = [0]*8
indexChanged = []
index = 0
while(len(indexChanged) < 8):
md5 = hashlib... | lypnol/adventofcode-2016 | day-5/part-2/jules.py | Python | gpl-3.0 | 702 |
# (void)walker unit test backend
# Copyright (C) 2012 David Holm <dholmster@gmail.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any... | dholm/voidwalker | voidwalker/backends/test/target.py | Python | gpl-3.0 | 2,273 |
'''
gomsurveyplot.py: This program creates the sky heatmap plot from the GomSpace
survey data.
input: A CSV file containing the sky survey data generated by the survey
program provided by GomSpace.
output: A heatmap plot of the input data.
... | CQT-Alex/GSN-heatmap | gomsurveyplot.py | Python | gpl-3.0 | 10,155 |
"""
ESSArch is an open source archiving and digital preservation system
ESSArch
Copyright (C) 2005-2019 ES Solutions AB
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... | ESSolutions/ESSArch_Core | ESSArch_Core/essxml/ProfileMaker/migrations/0007_auto_20160908_1428.py | Python | gpl-3.0 | 1,696 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (C) 2005-2007 Juan David Ibáñez Palomar <jdavid@itaapy.com>
# Copyright (C) 2007 Sylvain Taverne <sylvain@itaapy.com>
# Copyright (C) 2008 David Versmisse <david.versmisse@itaapy.com>
#
# This program is free software: you can redistribute it and/or modify
# it ... | hforge/ikaaro | scripts/icms-stop.py | Python | gpl-3.0 | 1,970 |
'''
Author: Hoa V. Do
Copyright (c) 2014 Hoa V. Do <vit@launchar.com>
Project: abeja
Module: server.core
Core library of Abeja server
This file is part of Abeja.
Abeja 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 Softw... | launchar/abeja | abeja/abeja/server/core.py | Python | gpl-3.0 | 10,798 |
import random
import sys
sys.setrecursionlimit(10000)
UPLIMIT = 10000
NUMBERS = 500
NUMBER_RANGE = (1,UPLIMIT/4)
def randNums(n):
return [randGen(NUMBER_RANGE[0], NUMBER_RANGE[1]) for i in range(n)]
def randGen(start, end):
return random.randint(start, end)
def solve(numlist):
if UPLIMIT >= 1000 and... | shuqin/pystudy | pystudy/basic/to100.py | Python | gpl-3.0 | 4,575 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/oval_5/DeprecatedInfoElement.py | Python | gpl-3.0 | 915 |
##
## This file is part of the sigrok-meter project.
##
## Copyright (C) 2015 Jens Steinhauser <jens.steinhauser@gmail.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2... | swegener/sigrok-meter | multiplotwidget.py | Python | gpl-3.0 | 6,148 |
# Author: Jason Lu
import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname='10.0.031', port=52113, username='root', password='123')
stdin, stdout, stderr = ssh.exec_command('df')
result = stdout.read()
print(result.decode())
ssh.close()
| jinzekid/codehub | python/day9/ssh.py | Python | gpl-3.0 | 310 |
# -*- coding: utf-8 *-*
# Copyright (c) 2013 Tisserant Pierre
#
# This file is part of Dragon dice simulator.
#
# Dragon dice simulator 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 ve... | TheLazyHase/dragon_dice_simulator | business/dice/face/missile_with_special/bullseye.py | Python | gpl-3.0 | 1,129 |
import unittest
from rope.base import pyobjects, builtins
from ropetest import testutils
class BuiltinTypesTest(unittest.TestCase):
def setUp(self):
super(BuiltinTypesTest, self).setUp()
self.project = testutils.sample_project()
self.pycore = self.project.pycore
self.mod = testut... | timwee/emacs-starter-kit-mr-flip-forked | vendor/rope/ropetest/builtinstest.py | Python | gpl-3.0 | 20,183 |
#
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly 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 3 of the... | Erotemic/local | depricated/speech/Examples/notepad_example.py | Python | gpl-3.0 | 2,882 |
# -*- coding: utf-8 -*-
#
# This program is part of GASP, a toolkit for newbie Python Programmers.
# Copyright (C) 2009, the GASP Development Team
#
# 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 Foundatio... | tarzenda/gasp | tests/mockbackends.py | Python | gpl-3.0 | 772 |
# -*- coding: utf-8 -*-
#Based on sXML-master projet on gitHub
__author__= "Luis C. Pérez Tato (LCPT)"
__copyright__= "Copyright 2015 LCPT"
__license__= "GPL"
__version__= "3.0"
__email__= "l.pereztato@gmail.com"
__author__= "Luis C. Pérez Tato (LCPT)"
__copyright__= "Copyright 2015 LCPT"
__license__= "GPL"
__versio... | lcpt/xc | python_modules/import_export/sciaXML/scia_loads/LoadCaseContainer.py | Python | gpl-3.0 | 2,570 |
#!/usr/bin/env python
# Copyright (C) 2012 nwmaltego Developer.
# This file is part of nwmaltego - https://github.com/bostonlink/nwmaltego
# See the file 'LICENSE' for copying permission.
# Maltego Phrase to NW Threat
# Author: David Bressler (@bostonlink)
import sys
import urllib2, urllib, json
from datetime import ... | bostonlink/nwmaltego | nw_phrase_2_threat.py | Python | gpl-3.0 | 1,962 |
#!/usr/bin/python
# -*- encoding: UTF-8 -*-
'''NFL Simulator
List of classes: -none-
List of functions:
main
'''
# built-in modules
import random
import math
from pprint import pprint
# third-party modules
import numpy as np
from scipy.stats import skew, kurtosis
from scipy.special import erf, er... | ampron/nflstat | simulator_NFL.py | Python | gpl-3.0 | 8,159 |
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... | aslab/rct | higgs/branches/ros-groovy/higgs_gazebo_simulation/rqt_robot_plugins/rqt_robot_monitor/src/rqt_robot_monitor/robot_monitor.py | Python | gpl-3.0 | 24,412 |
import os
import osiris
import globalvars
class OmlRotator(osiris.OMLHtmlWrapper):
def __init__(self, tag):
osiris.OMLHtmlWrapper.__init__(self, tag, "div", False, "", "", "")
def processHtml(self, item, context):
extensionID = globalvars.extension.getID().getString()
context.page.addJavascript("/... | OsirisSPS/osiris-sps | client/data/extensions/148B613D055759C619D5F4EFD9FDB978387E97CB/scripts/oml/rotator.py | Python | gpl-3.0 | 610 |
#!/usr/bin/env python
'''
Created on Sep 18, 2009
@author: sgallagh
'''
import unittest
import os
import shutil
import tempfile
from stat import *
import sys
srcdir = os.getenv('srcdir')
if srcdir:
sys.path.insert(0, "./src/config")
srcdir = srcdir + "/src/config"
else:
srcdir = "."
import SSSDConfig
d... | akamensky/sssd | src/config/SSSDConfigTest.py | Python | gpl-3.0 | 80,155 |
#!/usr/bin/python
"""to build genome.phylogenetic_profile table in agrogenomdb"""
import sys, os, tree2
nfphyloprofile = sys.argv[1]
nfout = sys.argv[2]
fphyloprofile = open(nfphyloprofile, 'r')
fout = open(nfout, 'w')
dboolstr = {True:'T', False:'F', '1':'T', '0':'F'}
header = fphyloprofile.readline().rstrip('\n')... | flass/agrogenom | pipeline/scripts_agrogenom/3_Ananalysis_of_genome_histories/phyloprofile_to_db.py | Python | gpl-3.0 | 757 |
import wx
import os
class bucky(wx.Frame):
def __init__(self, parent, id):
wx.Frame.__init__(self, parent, id, 'Git GUI', size =(500,500))
panel = wx.Panel(self)
gitAddB = wx.Button(panel, label = "add", pos = (0,0), size =(60,60))
gitCommitB = wx.Button(panel, label="commit", pos ... | LondoMundo/githubFrontendPy | gitGUI.py | Python | gpl-3.0 | 1,265 |
#!/usr/bin/python3
import configparser # ConfigParser
import socket # socket
import os # path.exists
import sys # exit
import struct # unstruct
import logging # log
class BaseScanner(object):
"""MAC 주소를 스캔하는 클래스
"""
# 스니핑 소켓 생성
# @arg: socket - interface 가 있는 config
def _create_socket(self):
... | munhyunsu/WorkLogger | src/basescanner/base_scanner.py | Python | gpl-3.0 | 6,046 |
#
# Copyright (C) 2009 Brad Howes.
#
# This file is part of Pyslimp3.
#
# Pyslimp3 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, or (at your option) any later version.
#
# Pyslimp3 is distr... | bradhowes/pyslimp3 | server/ClientPersistence.py | Python | gpl-3.0 | 3,504 |
from immutable import Immutable
class BinaryTree(Immutable):
"""Immutable Binary Tree.
Left child always smaller than the parent.
Right child always bigger than the parent.
Each element exists only once in a binary tree.
Attributes:
left (BinaryTree): left node.
right (BinaryTree... | d-kiss/candyland | trees/binary_tree.py | Python | gpl-3.0 | 3,771 |
# Copyright (C) 2010-2018 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 version 3 of the License, or
# (at your option) any later v... | mkuron/espresso | testsuite/python/random_pairs.py | Python | gpl-3.0 | 3,399 |
# coding: utf-8
'''
select_one_from_previous_answers
'''
from ..load_fixture_json import load_fixture_json
DATA = {
'title': 'Household survey with select_one from previous answers',
'id_string': 'select_one_from_previous_answers',
'versions': [
load_fixture_json('select_one_from_previous_answers... | kobotoolbox/formpack | tests/fixtures/select_one_from_previous_answers/__init__.py | Python | gpl-3.0 | 336 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-04 10:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("delft3dworker", "0007_delft3dworker_workerid"),
]
operations = [
migrations.... | openearth/delft3d-gt-server | delft3dworker/migrations/0008_delft3dworker_info.py | Python | gpl-3.0 | 512 |
'''
Project: Arduino SC Interface - A GUI for Arduino serial comunication
@author: Andrea Cirillo <sabageek.blogspot.com>
@copyright: 2012 Andrea Cirillo
@license: GPL-3
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as p... | beerbauf/Arduino-SC-Interface | src/SerialComunication.py | Python | gpl-3.0 | 1,152 |
from argparse import ArgumentParser
from yahoo_finance import Share
import pyperclip
import urllib2
from bs4 import BeautifulSoup
currentrelease = 'Pattern Target Finder 1.2'
#v1.2 - Added get earnings date function
#v1.1 - Get's current delayed price from Yahoo_Finance
# Allowed you to override price -p 123
# Copi... | nhsb1/PatternTargetFinder | ptf.py | Python | gpl-3.0 | 3,499 |
# (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any l... | andrewcbennett/iris | lib/iris/tests/test_cdm.py | Python | gpl-3.0 | 49,510 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file has a two purpose:
1. Force the use of the "Agg" matplotlib backend for the tests. Otherwise lots
of windows pop up.
2. Force OpenBLAS to use single threading. Otherwise it will deadlock in some
cases.
It will be run by pytest, as specified in the pytest... | krischer/LASIF | conftest.py | Python | gpl-3.0 | 1,387 |
## INFO ##
## INFO ##
# TODO: %o is not available in output, nor input strings, only in command
# TODO: !-macro and ^-flags should only be available
# at the beginning of a command
#-- CHEATSHEET ----------------------------------------------------------------#
# HOWTO: http://sublimetext.info/docs/en/referenc... | petervaro/tup | src/tup.py | Python | gpl-3.0 | 23,015 |
# Hashing a string into a binary representation helps compare them in linear time, and storing the max length for each
# binary representation in a hashmap is just icing on the cake
class Solution:
def maxProduct(self, words: List[str]) -> int:
def string_to_bool(string):
mask = 0b0
... | 1337/yesterday-i-learned | leetcode/318m.py | Python | gpl-3.0 | 1,034 |
from http import HTTPStatus
from flask import jsonify
from flask_restful import abort
from logging import Logger
from pbench.server import PbenchServerConfig, JSON
from pbench.server.api.resources import Schema, Parameter, ParamType
from pbench.server.api.resources.query_apis import (
CONTEXT,
ElasticBase,
... | distributed-system-analysis/pbench | lib/pbench/server/api/resources/query_apis/datasets_detail.py | Python | gpl-3.0 | 6,242 |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 8 16:11:48 2013
@author: ivan
"""
import numpy
import time
from PyDAQmx.DAQmxFunctions import *
from PyDAQmx.DAQmxConstants import *
terminals = {}
terminals['Dev1'] = ['Dev1/ai%s' % line for line in range(0, 2)]
terminals['Dev2'] = ['Dev2/ai%s' % line for line in ra... | xmnlab/minilab | labtrans/daq/MultiChannelAnalogInput.py | Python | gpl-3.0 | 2,739 |
import tkinter as tk
from tkinter import ttk
from collections import namedtuple
import sqlite3
from enum import Enum
import re
import datetime
import logging
import os
import time
# Regular expression we rely upon
win_loss_pattern = r'PowerTaskList\.DebugPrintPower\(\) - TAG_CHANGE Entity=(.+) tag=PLAYSTATE value=... | Seek/ValueTracker | hs.py | Python | gpl-3.0 | 16,651 |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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; eith... | pferreir/indico-backup | indico/MaKaC/plugins/Collaboration/Vidyo/pages.py | Python | gpl-3.0 | 11,041 |
__problem_title__ = "Path sum: two ways"
__problem_url___ = "https://projecteuler.net/problem=81"
__problem_description__ = "In the 5 by 5 matrix below, the minimal path sum from the top left to " \
"the bottom right, by , is indicated in bold red and is equal to 2427. " \
... | jrichte43/ProjectEuler | Problem-0081/solutions.py | Python | gpl-3.0 | 949 |
# Copyright 2016 Boomer AI, Inc.
#
# This file is part of Boomer Core.
#
# Boomer Core 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.
... | clusterfudge/boomer | boomer/skills/wolfram_alpha/__init__.py | Python | gpl-3.0 | 7,636 |
# 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,... | slightstone/SickRage | sickbeard/postProcessor.py | Python | gpl-3.0 | 45,995 |
#!/usr/bin/env python3
#
# Copyright (C) 2008-2020 Sébastien Helleu <flashcode@flashtux.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 of the License, or
# (at your opti... | sim642/weechat | doc/docgen.py | Python | gpl-3.0 | 33,442 |
from frappe import _
def get_data():
return {
'fieldname': 'review',
'transactions': [
{
'label': _('Action'),
'items': ['Quality Action']
},
{
'label': _('Meeting'),
'items': ['Quality Meeting']
... | brownharryb/erpnext | erpnext/quality_management/doctype/quality_review/quality_review_dashboard.py | Python | gpl-3.0 | 347 |
#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import re
from calibre.ebooks.docx.names import XPath, get
class Field(obje... | insomnia-lab/calibre | src/calibre/ebooks/docx/fields.py | Python | gpl-3.0 | 4,524 |
#!/usr/bin/env python3
import PISM
from PISM.util import convert
from math import cos, pi
# Simple testing program for Lingle & Clark bed deformation model.
# Runs go for 150,000 years on 63.5km grid with 100a time steps and Z=2 in L&C model.
# SCENARIOS: run 'python bed_deformation.py -scenario N' where N=1,2,3,4 a... | pism/pism | examples/python/bed_deformation.py | Python | gpl-3.0 | 5,232 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... | mckerrj/ansible | lib/ansible/executor/play_iterator.py | Python | gpl-3.0 | 27,494 |
from __future__ import generators
import os
import re
import stat
#
# Useful function to return a list of files in a directory based on a dos-style wildcard like "*.txt"
#
# for name in WildcardSearch( "d:/hl2/src4/dt*.cpp", 1 ):
# print name
#
def WildcardSearch( wildcard, bRecurse=0 ):
# First find the base direc... | RaisingTheDerp/raisingthebar | root/devtools/WildcardSearch.py | Python | gpl-3.0 | 1,401 |
#!/usr/bin/env python3
"""
Copyright (c) 2014 by nurupo <nurupo.contributions@gmail.com>
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 right... | TokTok/toxcore | other/fun/bootstrap_node_info.py | Python | gpl-3.0 | 4,847 |
#!/usr/bin/env python3
#
# mmgen = Multi-Mode GENerator, a command-line cryptocurrency wallet
# Copyright (C)2013-2022 The MMGen Project <mmgen@tuta.io>
# Licensed under the GNU General Public License, Version 3:
# https://www.gnu.org/licenses
# Public project repositories:
# https://github.com/mmgen/mmgen
# http... | mmgen/mmgen | mmgen/wallet/brain.py | Python | gpl-3.0 | 1,905 |
import os
from FeatureArray import FeatureArray
from FeatureArrayToMatrix import FeatureArrayToMatrix
class Embedder:
def embed(self, directory, tfidf = True):
"""
For a given directory containing a TOC and a data/
directory as, for example, created by joern-demux,
create an e... | fabsx00/joern-tools | joerntools/mlutils/pythonEmbedder/PythonEmbedder.py | Python | gpl-3.0 | 2,124 |
#!/usr/bin/env python
import re
import json
import argparse
import numpy as np
def parse_range(index_list):
indices = []
string = "".join(index_list)
terms = string.split(",")
for term in terms:
if "-" in term:
start, end = [int(x) for x in term.split("-")]
indices += l... | peter-reinholdt/propertyfit | gen_topology.py | Python | gpl-3.0 | 4,046 |
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2016 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... | crisely09/horton | horton/espfit/test/test_mask.py | Python | gpl-3.0 | 3,493 |
'''
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.
This program is distributed in the hope that it will be useful,
but WITHOUT... | francocurotto/GraphSLAM | src/python-helpers/commons/g2o2lab.py | Python | gpl-3.0 | 1,819 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 NLPY.ORG
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
import numpy as np
from line_iterator import LineIterator
class FeatureContainer(object):
def __init__(self, path=None, dtype="libsvm", feature_n=-1):
s... | zomux/nlpy | nlpy/util/feature_container.py | Python | gpl-3.0 | 1,660 |
# -*- coding: utf-8 -*-
# * Authors:
# * Arezki Feth <f.a@majerti.fr>;
# * Miotte Julien <j.m@majerti.fr>;
# * TJEBBES Gaston <g.t@majerti.fr>
"""
Py3o exporters
>>> model = Company.query().first()
>>> template = Template.query().first()
>>> odt_file_datas = compile_template(model, template.data_obj... | majerteam/sqla_inspect | sqla_inspect/py3o.py | Python | gpl-3.0 | 12,289 |
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.test import TestCase
# Create your tests here.
from portfolio.apps.core.models import User
class UserModelTests(TestCase):
def test_admin_user_exist(self):
sel... | i404ed/portfolio-dir | portfolio/apps/core/tests.py | Python | gpl-3.0 | 697 |
"""Ncpol2SDPA
=====
Provides
1. A converter from a polynomial optimization problems of commuting and
noncommuting variables to a semidefinite programming relaxation.
2. Helper functions to define physics problems.
"""
__version__ = "1.11.1"
from .faacets_relaxation import FaacetsRelaxation
from .sdp_relaxation ... | cgogolin/ncpol2sdpa | ncpol2sdpa/__init__.py | Python | gpl-3.0 | 1,560 |
# -*- coding: utf-8 -*-
from odoo import fields, models
class CustomSurvey(models.Model):
_inherit = 'survey.survey'
auth_required = fields.Boolean('Login required', help="Users with a public link will be requested to login before taking part to the survey",
oldname="authenticate", default=True)
... | hgsoft/hgsoft-addons | custom_survey_multi_emails_and_portal/models/custom_survey.py | Python | gpl-3.0 | 454 |
"""
Machine model serializer
"""
from __future__ import unicode_literals
from rest_framework import serializers
from access.models import Machine
class MachineSerializer(serializers.ModelSerializer):
"""
Machine model (de)Serializer
"""
department = serializers.HyperlinkedRelatedField(many=False,
... | ForgeGreensboro/forge-tool-control-api | access/serializers/MachineSerializer.py | Python | gpl-3.0 | 570 |
from psycopg2._psycopg import adapt
class StringUtils(object):
@staticmethod
def adapt_to_str_for_orm(value):
value = (value.replace('%', '')
.replace(':', '')
)
adapted_value = adapt(value)
return adapted_value.getquoted()[1:-1]
| LittleRichard/sormtger | server/utils/StringUtils.py | Python | gpl-3.0 | 305 |
# coding: utf-8
__version__ = '0.7.1'
| jedie/django-cms-tools | django_cms_tools/version.py | Python | gpl-3.0 | 39 |
import datetime
from django.core.management.base import NoArgsCommand
from django.conf import settings as django_settings
from askbot import models
from askbot import const
from askbot.conf import settings as askbot_settings
from django.utils.translation import ugettext as _
from django.utils.translation import ungette... | tvenkat/askbot-devel | askbot/management/commands/send_accept_answer_reminders.py | Python | gpl-3.0 | 3,704 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2015 Uwe Hermann <uwe@hermann-uwe.de>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the Li... | zeldin/libsigrokdecode | decoders/spiflash/lists.py | Python | gpl-3.0 | 3,593 |
# coding=UTF-8
# Copyright 2011 James O'Neill
#
# This file is part of Kapua.
#
# Kapua 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.... | hemebond/kapua | forms.py | Python | gpl-3.0 | 7,905 |
"""
This script can be used to ssh to a cloud server started by GNS3. It copies
the ssh keys for a server to a temp file on disk and starts ssh using the
keys.
Right now it only connects to the first cloud server listed in the config
file.
"""
import getopt
import os
import sys
from PyQt4 import QtCore, QtGui
SCR... | noplay/gns3-gui | scripts/ssh_to_server.py | Python | gpl-3.0 | 3,813 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2020 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net>
#
# This file is part of qutebrowser.
#
# qutebrowser 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... | t-wissmann/qutebrowser | tests/unit/misc/test_keyhints.py | Python | gpl-3.0 | 7,603 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | akhilaananthram/nupic.research | sound_encoder/live_sound_encoding_demo.py | Python | gpl-3.0 | 2,476 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... | elianerpereira/gtg | GTG/core/__init__.py | Python | gpl-3.0 | 10,171 |
import logging
import sys
from PyQt5.QtCore import Qt, QEvent
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QSystemTrayIcon, QAction, QMenu, QApplication
from feeluown.player import State
from feeluown.gui.helpers import elided_text
TOGGLE_APP_TEXT = ('激活主窗口', '隐藏主窗口')
TOGGLE_PLAYER_TEXT = ('播放', '暂停')
... | cosven/FeelUOwn | feeluown/gui/tray.py | Python | gpl-3.0 | 7,673 |
#!/usr/bin/python
# pass: block filler - it does nothing.
# logical operators - and/or
print "welcome to the market"
food_type = raw_input("please enter the item- meat/fish/chicken/veg: ")
if food_type == 'meat':
pass
elif food_type == 'fish':
print "welcome to the fish market."
fish_type = raw_input("pl... | tuxfux-hlp-notes/python-batches | archieves/batch-66/05.2-market.py | Python | gpl-3.0 | 1,081 |
import logging
import os
import sys
import unittest
from sickchill.oldbeard import browser
class BrowserTestAll(unittest.TestCase):
"""
Test methods in oldbeard.browser
"""
def setUp(self):
self.here = os.path.normpath(os.path.dirname(__file__))
@unittest.skipUnless(os.name == 'nt', 'Tes... | Vagab0nd/SiCKRAGE | tests/browser_tests.py | Python | gpl-3.0 | 3,177 |
from django.forms import ModelForm, inlineformset_factory, HiddenInput, ModelChoiceField
from .models import BirthForm, SanityPillars, InnateAbility, StabilitySources
class CharBirthForm(ModelForm):
class Meta:
model = BirthForm
fields = ['name', 'pronoun', 'age', 'birthplace', 'drive', 'occupation... | danwchan/trail_of_cthulhu | mythos_website_upgrade/characterbirther/forms.py | Python | gpl-3.0 | 2,580 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
*********************************************
*
* PlotRruffSpectraRound
* Plot Rruff spectra
* Files must be in RRuFF
* version: 20171208c
*
* By: Nicola Ferralis <feranick@hotmail.com>
*
***********************************************
'''
print(__doc__)
import numpy ... | feranick/SpectralMachine | Utilities/PlotRruffSpectraRound.py | Python | gpl-3.0 | 3,466 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pyscada', '0010_auto_20160115_0918'),
('modbus', '0003_auto_20160115_0918'),
]
operations = [
migrations.RenameField... | trombastic/PyScada | pyscada/modbus/migrations/0004_auto_20160115_0920.py | Python | gpl-3.0 | 454 |
## Copyright 2005-2006 Luc Saffre
## This file is part of the Lino project.
## Lino is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later versio... | MaxTyutyunnikov/lino | obsolete/src/lino/apps/contacts/tables.py | Python | gpl-3.0 | 8,256 |
"""bluesky.filtermerge"""
__author__ = "Joel Dubowy"
import abc
import logging
from bluesky.config import Config
class FiresActionBase(object, metaclass=abc.ABCMeta):
"""Base class for merging or filtering fires
"""
def __init__(self, fires_manager, fire_class):
"""Constructor
args:
... | pnwairfire/bluesky | bluesky/filtermerge/__init__.py | Python | gpl-3.0 | 1,578 |
# coding: latin1
## Copyright 2003-2007 Luc Saffre
## This file is part of the Lino project.
## Lino is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) ... | MaxTyutyunnikov/lino | obsolete/tests/8.py | Python | gpl-3.0 | 2,702 |
"""
Import all modules and packages in the serverFeatures package
['account', 'connection', 'interface', 'package', 'process']
"""
from pycaf.architecture.devices.server import Server
from pycaf.architecture.devices.lists.serverList import ServerList
from pycaf.architecture.devices.server_windows import ServerWindows... | maximeolivier/pyCAF | pycaf/architecture/devices/__init__.py | Python | gpl-3.0 | 378 |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""Calculations with datetime values.
"""
__version__ = "$Id$"
#end_pymotw_header
import datetime
today = datetime.datetime.today()
print 'Today :', today
yesterday = today - datetime.timedelta(days=1)
print 'Yest... | qilicun/python | python2/PyMOTW-1.132/PyMOTW/datetime/datetime_datetime_math.py | Python | gpl-3.0 | 572 |
# -*- 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.
from pyoko.conf import settings
from pyoko.db.schema_update import SchemaUpdater
from tests.data.solr_schema import test_data_solr_fields_debug_z... | zetaops/pyoko | tests/test_model_to_solr_schema.py | Python | gpl-3.0 | 1,268 |
# Copyright 2016-2017 Christian Shtarkov
#
# This file is part of Autobump.
#
# 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 ver... | cshtarkov/autobump | autobump/handlers/python.py | Python | gpl-3.0 | 8,380 |
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2015 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... | eustislab/horton | horton/correlatedwfn/test/test_lagrange.py | Python | gpl-3.0 | 5,097 |
# This script does the following:
#
# - create a user using bonafide and and invite code given as an environment
# variable.
#
# - create and upload an OpenPGP key manually, as that would be
# a responsibility of bitmask-dev.
#
# - send an email to the user using sendmail, with a secret in the body.
#
# - start a s... | leapcode/soledad | tests/e2e/test_incoming_mail_pipeline.py | Python | gpl-3.0 | 1,604 |
# Copyright 2014-2015 Canonical Limited.
#
# This file is part of charm-helpers.
#
# charm-helpers is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# charm-helpers is distributed in the hope ... | whitmo/charmhelpers | charmhelpers/contrib/templating/pyformat.py | Python | gpl-3.0 | 1,028 |
# This file is part of MAMMULT: Metrics And Models for Multilayer Networks
#
# 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 ver... | KatolaZ/mammult | models/growth/node_deg_over_time.py | Python | gpl-3.0 | 2,400 |
# -*- coding: utf-8 -*-
# --------------------------------------------------------------------------------
# Logger (kodi)
# --------------------------------------------------------------------------------
import inspect
import xbmc
from platformcode import config
loggeractive = (config.get_setting("debug") == True)... | pitunti/alfaPitunti | plugin.video.alfa/platformcode/logger.py | Python | gpl-3.0 | 1,925 |
"""
raven.utils.encoding
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import warnings
def force_unicode(s, encoding='utf-8', errors='strict'):
"""
Similar to smart_unicode, except that lazy i... | lptorres/noah-inasafe | web_api/third_party/raven/utils/encoding.py | Python | gpl-3.0 | 3,604 |
from p2pool.dash import networks
from p2pool.util import math
# CHAIN_LENGTH = number of shares back client keeps
# REAL_CHAIN_LENGTH = maximum number of shares back client uses to compute payout
# REAL_CHAIN_LENGTH must always be <= CHAIN_LENGTH
# REAL_CHAIN_LENGTH must be changed in sync with all other clients
# cha... | jakehaas/p2pool-dash | p2pool/networks.py | Python | gpl-3.0 | 2,185 |
import configparser
import unittest
import zabbix_cli.config
class MockConfig(configparser.ConfigParser, object):
def __init__(self):
super(MockConfig, self).__init__({'option_a': 'a', 'option_b': 'b'})
self.add_section('foo')
self.add_section('bar')
class TestOptionDescriptor(unittest... | usit-gd/zabbix-cli | tests/test_config.py | Python | gpl-3.0 | 3,454 |
# This file is part of django-ca (https://github.com/mathiasertl/django-ca).
#
# django-ca 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... | mathiasertl/django-ca | ca/django_ca/tests/tests_extensions.py | Python | gpl-3.0 | 71,893 |
#!/bin/sh
# vim: syntax=python
''':'
# First try to run this script with python3, else run with python then python2
if command -v python3 >/dev/null 2>/dev/null; then
exec python3 "$0" "$@"
elif command -v python >/dev/null 2>/dev/null; then
exec python "$0" "$@"
else
exec python2 "$0" "$@"
fi
'''
""" Rudder in... | Normation/rudder-tools | contrib/inventory-hooks/aws.py | Python | gpl-3.0 | 2,553 |
# Copyright (C) 2011 Groza Cristian
#
# 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.
#
# This program is di... | cgroza/gEcrit | gEcritSession.py | Python | gpl-3.0 | 3,647 |
# import sys
# sys.path.append('/home/openflow/frenetic/updates/examples')
from nxtopo import NetworkXTopo
from mininet.topo import Node
import networkx as nx
class MyTopo( NetworkXTopo ):
def __init__( self, enable_all = True ):
comp_graph = nx.complete_graph(32)
graph = nx.Graph()
... | XianliangJ/collections | CNUpdates/updates/examples/hypercube.py | Python | gpl-3.0 | 753 |
import os
import sys
import traceback
VALID = ['.mp3', '.ogg', '.m4a']
ENCODING = 'utf-8'
M3U = '.m3u'
SKIP_FOLDERS = ['SCS.4DJ_', 'RECYCLE.BIN', 'System Volume Information']
def skipFolder(name):
for s in SKIP_FOLDERS:
if s in name:
return True # SKIP
return False # ACCEPT
def norma... | audetto/playlist_generator | generate.py | Python | gpl-3.0 | 2,088 |
# -*- coding: utf-8 -*-
############################################################################
#
# Copyright (C) 2011-2014
# Christian Kohlöffel
#
# This file is part of DXF2GCODE.
#
# DXF2GCODE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General P... | Poofjunior/dxf2gcode | gui/messagebox.py | Python | gpl-3.0 | 2,949 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.