code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
#!/usr/bin/env python from distutils.core import setup setup(name = "comic-utils", version = "0.4", description = "Comic Utils", author = "Milan Nikolic", author_email = "gen2brain@gmail.com", license = "GNU GPLv3", url = "https://github.com/gen2brain/comic-utils", ...
gen2brain/comic-utils
setup.py
Python
gpl-3.0
576
""" ACTIVE Plugin for Generic Unauthenticated Web App Fuzzing via Wapiti This will perform a "low-hanging-fruit" pass on the web app for easy to find (tool-findable) vulns """ from owtf.managers.resource import get_resources from owtf.plugin.helper import plugin_helper DESCRIPTION = "Active Vulnerability Scanning with...
owtf/owtf
owtf/plugins/web/active/Wapiti_Unauthenticated@OWTF-WVS-003.py
Python
bsd-3-clause
506
#!/usr/bin/env python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that ...
narasimhan-v/avocado-misc-tests-1
io/net/bridge.py
Python
gpl-2.0
4,362
""" Copyright (c) 2014 Marshall Farrier license http://opensource.org/licenses/MIT @author: Marshall Farrier @contact: marshalldfarrier@gmail.com @since: 2014-11-10 @summary: Neural network Resources: Great performance ideas: http://stackoverflow.com/questions/21106134/numpy-pure-functions-for-performance-caching """ ...
aisthesis/machinelearning
experiments/neural.py
Python
mit
5,497
from django.test import TestCase from codesnip.forms import SnippetForm from codesnip.models import Snippet from . import utils class TestSnippetForm(TestCase): def test_language_sort(self): form = SnippetForm() assert form.fields['language'].choices == sorted(form.fields ...
vacuus/django-codesnip
tests/test_forms.py
Python
lgpl-3.0
771
# encoding=utf8 import asyncio import cat import random import os import wikipedia import time #from cleverwrap import CleverWrap #from utils.config import Config #for cleverwrap's key from discord.ext import commands from utils.logger import log from utils.tools import * from utils.unicode import * ...
robingall2910/RobTheBoat
commands/fuckery.py
Python
mit
16,251
print ("Enter the number of queens") N = int(input()) #chessboard #NxN matrix with all elements 0 board = [[0]*N for _ in range(N)] def is_attack(i, j): #checking if there is a queen in row or column for k in range(0,N): if board[i][k]==1 or board[k][j]==1: return True #checking diagon...
jainaman224/Algo_Ds_Notes
Queens_Problem/Queens_Problem.py
Python
gpl-3.0
1,960
__author__ = 'david'
davjohnst/fundamentals
tests/traversal/dfs/__init__.py
Python
apache-2.0
21
import os import tempfile from ogrtools.interlis.model_loader import ModelLoader TEMPDIR = tempfile.gettempdir() def test_detect_ili1(): loader = ModelLoader("./tests/data/ili/Beispiel.itf") assert loader.detect_format() == 'Interlis 1' def test_detect_ili2(): loader = ModelLoader( "./tests/da...
sourcepole/ogrtools
tests/test_model_loader.py
Python
mit
2,496
# -*- coding: utf-8 -*- # # PyQus documentation build configuration file, created by # sphinx-quickstart on Fri Mar 04 15:12:59 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
JorgeDeLosSantos/pyqus
docs/source/conf.py
Python
mit
9,475
from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import numpy as np import pandas as pd from sys import argv import os from os import path def parse_labels(s, n=9): v = [0] * n if type(s) is str: for x...
jingxiang-li/kaggle-yelp
get_features.py
Python
mit
2,208
# -*- coding: utf-8 -*- # © 2004-2011 Pexego Sistemas Informáticos. (http://pexego.es) # © 2012 NaN·Tic (http://www.nan-tic.com) # © 2013 Acysos (http://www.acysos.com) # © 2013 Joaquín Pedrosa Gutierrez (http://gutierrezweb.es) # © 2014-2015 Serv. Tecnol. Avanzados - Pedro M. Baeza # (http://www.servicios...
diagramsoftware/l10n-spain
l10n_es_aeat_mod347/models/mod347.py
Python
agpl-3.0
38,108
import csv import os import inspect import sys import datetime import calendar sys.path = [os.path.dirname(inspect.getfile(inspect.currentframe()))] + sys.path from NullData import NullData class PlatiumData(NullData): def __init__(self): super(PlatiumData, self).__init__() self.key_index = -1 ...
guiqing0402/ThinkingFinancial
src/DataProvider/PlatiumData.py
Python
gpl-2.0
2,206
# -*- coding: utf-8 -*- #Example of numerical integration with Gauss-Legendre quadrature #Translated to Python by Kyrre Ness Sjøbæk import sys import numpy from computationalLib import pylib #Read input if len(sys.argv) == 1: print "Number of integration points:" n = int(sys.stdin.readline()) print "Integ...
CompPhysics/ComputationalPhysicsMSU
doc/Programs/LecturePrograms/programs/NumericalIntegration/python/program1.py
Python
cc0-1.0
1,014
"""FFmpeg wrapper.""" import json import logging import subprocess from os.path import join from medusa import app from medusa.logger.adapters.style import CustomBraceAdapter log = CustomBraceAdapter(logging.getLogger(__name__)) log.logger.addHandler(logging.NullHandler()) class FfMpegException(Exception): """...
pymedusa/Medusa
medusa/helpers/ffmpeg.py
Python
gpl-3.0
5,707
# -*- coding: utf-8 -*- from datetime import datetime from sqlalchemy import desc from flask import render_template, redirect, request, session, url_for, flash from flask.ext.login import (LoginManager, login_user, logout_user, current_user, login_required) from flask.ext.mail import Mail,...
samitnuk/urlsaver
app/views.py
Python
mit
7,261
#!/usr/bin/env python import json, logging, sys import python_sqs log = None line = None encodings = ('UTF-8', 'WINDOWS-1252', 'ISO-8859-1') try: python_sqs.init(json_input=True) log = logging.getLogger(__name__) line = sys.stdin.readline() while line: line = line.strip() for encoding i...
Praesidio/syslog-ng-python-sqs
python_sqs_stdin.py
Python
gpl-2.0
871
import functools import sys from oslo.config import cfg from canary.openstack.common import log from canary.transport.wsgi.driver import Driver app_container = Driver() conf = cfg.CONF conf(project='canary', prog='canary', args=[]) log.setup('canary') LOG = log.getLogger(__name__) def _fail(returncode, ex): ...
tonytan4ever/canary
canary/common/cli.py
Python
apache-2.0
910
import stats import numpy as np reader = stats.Reader('SpinnMotor') import math def filter(data, tau, dt=0.001): decay = math.exp(-dt/tau) data = np.array(data) for i in range(len(data)-1): data[i+1] = data[i+1]*(1-decay)+data[i]*decay return data plot = stats.plot.time.Time(reader.time-...
tcstewar/spinnbot
plot_motor.py
Python
gpl-2.0
692
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-redis-shell', version='0.2.1', packages=['djangore...
loisaidasam/django-redis-shell
setup.py
Python
mit
1,144
""" The :mod:`cbar.datasets` module includes dataset loading utilities including methods to load and fetch the CAL500, CAL10k, and Freesound dataset. """ # from .base import load_dataset from .cal10k import fetch_cal10k from .cal500 import fetch_cal500 from .freesound import load_freesound from .freesound import load_...
dschwertfeger/cbar
cbar/datasets/__init__.py
Python
mit
459
""" Copyright (c) 2017, 2019 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import re import koji import os import responses import sys import time from copy import deepcopy from atomic_reactor.constants import...
DBuildService/atomic-reactor
tests/plugins/test_resolve_composes.py
Python
bsd-3-clause
60,957
from ...Helpers.environment import Environment def strset(env, node): args_node = node.args.interpret(env) if len(args_node) < 3: raise RuntimeError('strset is not call with three arguments') str = args_node[0].interpret(env) var_name = args_node[0].name char_index = args_node[1].interpret...
PetukhovVictor/compiler
src/Interpreter/Eval/statements/strings.py
Python
mit
589
# We expose many Processing-related names as builtins, so that no imports # are necessary, even in auxilliary modules. import __builtin__ import os.path from numbers import Number # Bring all of the core Processing classes by name into the builtin namespace. from processing.core import PApplet __builtin__.PApplet = P...
mashrin/processing.py
runtime/src/jycessing/core.py
Python
apache-2.0
23,307
import json, logging, os, requests, webbrowser from .. util import constants, crypto, files log = logging.getLogger(__name__) RESPONSE_KEYS = set(('timestamp', 'record_hash', 'journal_urls')) def signed_hash(document): private_key = crypto.make_private_key() public_key = private_key.public_key() art_hash...
arthash/arthash
arthash/arthasher/arthashing.py
Python
artistic-2.0
1,450
from kapteyn import maputils from matplotlib import pyplot as plt fitsobj = maputils.FITSimage("m101.fits") fig = plt.figure() fig.subplots_adjust(left=0.18, bottom=0.10, right=0.90, top=0.90, wspace=0.95, hspace=0.20) for i in range(4): f = fig.add_subplot(2,2,i+1) mplim = fitsobj.Annotat...
kapteyn-astro/kapteyn
doc/source/EXAMPLES/mu_minorticks.py
Python
bsd-3-clause
1,126
# -*- coding: utf-8 -*- from iktomi import web from iktomi.web.filters import * from iktomi.templates import jinja2, Template from environment import Environment import cfg import handlers as h static = static_files(cfg.STATIC) media = static_files(cfg.MEDIA_DIR, cfg.MEDIA_URL) form_temp = static_files(cfg.FORM_TEMP,...
boltnev/iktomi
examples/filefield/app.py
Python
mit
735
import six from voluptuous import Invalid from rest_framework.exceptions import ParseError from .metaclasses import MetaFiltersMixin from .schema import base_query_params_schema @six.add_metaclass(MetaFiltersMixin) class FiltersMixin(object): ''' This viewset provides dynamically generated filters by app...
manjitkumar/drf-url-filters
filters/mixins.py
Python
mit
3,718
# TS test - unit testing for agent import sys import json import shlex from SCons.Errors import StopError class TestException(Exception): pass class Test: EXPECT_OK = 0 EXPECT_SIGNAL = 1 EXPECT_RETURN = 2 EXPECT_TIMEOUT = 3 SIGABRT = 6 SIGNALS = {'SEGV': 11} def __in...
myaut/tsload
agent/tools/build/tstest.py
Python
gpl-3.0
6,826
# Copyright (c) 2014 IBM Corp. # 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...
tianweizhang/nova
nova/tests/api/openstack/compute/contrib/test_block_device_mapping_v1.py
Python
apache-2.0
16,347
# -*- coding: utf-8 -*- # # hpelefthandclient documentation build configuration file, created by # sphinx-quickstart on Mon Nov 25 13:33:35 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated fil...
hpe-storage/python-lefthandclient
docs/conf.py
Python
apache-2.0
9,299
from unitz import unit, done import logging import subprocess log = logging.getLogger(__name__) @unit('nth') def nth(src_list, n): o_element = src_list[n] return done() @unit('slice_list') def slice_list(src_list, from_ix = 0, end_ix = -1): if end_ix == -1: o_new_list = src_list[from_ix:] el...
sudeep9/unitz
std_units/list_units.py
Python
mit
388
from nose.plugins.skip import SkipTest def test_greendns_getnameinfo_resolve_port(): try: from eventlet.support import greendns except ImportError: raise SkipTest('greendns requires package dnspython') # https://bitbucket.org/eventlet/eventlet/issue/152 _, port1 = greendns.getnameinfo...
sbadia/pkg-python-eventlet
tests/greendns_test.py
Python
mit
437
import os, sys, optparse import tqdm import pymagnitude class LexSub: def __init__(self, wvec_file, topn=10): self.wvecs = pymagnitude.Magnitude(wvec_file) self.topn = topn def substitutes(self, index, sentence): "Return ten guesses that are appropriate lexical substitutions for the w...
anoopsarkar/nlp-class-hw
lexsub/default.py
Python
apache-2.0
1,525
# -*- coding:utf-8 -*- from django.conf import settings import logging logger = logging.getLogger(__name__) from haystack.views import SearchView from haystack.query import SearchQuerySet from djblog.models import Post # # Haystack View # class CustomSearchView(SearchView): def __init__(self, *args, **kwargs): ...
ninjaotoko/djblog
djblog/views/search.py
Python
bsd-3-clause
443
# -*- coding: utf-8 -*- import os y = str(5**4**3**2) print("5**4**3**2 = %s...%s and has %i digits" % (y[:20], y[-20:], len(y))) os.system("pause")
NicovincX2/Python-3.5
Théorie des nombres/Arithmétique/Théorie algébrique des nombres/Arithmétique multiprécision/arbitrary-precision_integers_example.py
Python
gpl-3.0
152
from django.contrib.auth.models import User from django.test import TestCase from django.test.client import Client class FarmerTestCase(TestCase): def setUp(self): User.objects.create_superuser('testuser', 'testuser@douban.com', ...
huoxy/farmer
farmer/tests.py
Python
mit
534
# content from # https://gist.githubusercontent.com/bsweger/e5817488d161f37dcbd2/raw/d7f39aa69e0818d56206b3d0e8660543d6ad64f3/useful_pandas_snippets.py # List unique values in a DataFrame column pd.unique(df.column_name.ravel()) # Convert Series datatype to numeric, getting rid of any non-numeric values df['col'] = ...
gth158a/experience
python/pandas.py
Python
gpl-3.0
5,766
#!usr/bin/env python #-*- coding: utf-8 -*- from sklearn import preprocessing from sklearn import metrics from sklearn import cross_validation from sklearn.datasets import load_svmlight_file from sklearn.cross_validation import cross_val_score from sklearn.cross_validation import train_test_split import numpy as np im...
zhangxyz/MLFSdel
src/CART.py
Python
bsd-2-clause
1,481
import itertools import numpy as np import EDGE as edge from astropy.io import ascii ''' jobmaker.py Script that uses job_file_create to produce a file with all the parameters in the grid and creates the job files themselves. HOW TO USE THIS SCRIPT: 1) Change the gridpath to be where you want the jobfiles to be...
danfeldman90/EDGE
jobmaker.py
Python
mit
3,586
#!/usr/bin/env python2 # -*- coding:utf-8 -*- # Copyright (c) 2012-2013 Simon Conseil <simon.conseil at camptocamp.org> # 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, ...
c2corg/c2c-stats
c2cstats/__init__.py
Python
mit
3,846
from test import support import time import unittest import locale import sysconfig import sys import platform try: import threading except ImportError: threading = None # Max year is only limited by the size of C int. SIZEOF_INT = sysconfig.get_config_var('SIZEOF_INT') or 4 TIME_MAXYEAR = (1 << 8 * SIZEOF_INT...
mancoast/CPythonPyc_test
fail/331_test_time.py
Python
gpl-3.0
26,064
# # Copyright 2013, Couchbase, Inc. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
mnunberg/couchbase-python-client
couchbase/user_constants.py
Python
apache-2.0
1,007
# -*- coding: utf-8 -*- from __future__ import unicode_literals from rest_framework import viewsets from reminder.models import Reminder from reminder.serializers import ReminderListSerializer, ReminderDetailSerializer class ReminderViewSet(viewsets.ModelViewSet): """ Reminder view set the user to set remin...
Rub4ek/scalors-assignment-backend
reminder/views.py
Python
mit
736
""" Serializer fields perform validation on incoming data. They are very similar to Django's form fields. """ from __future__ import unicode_literals import copy import datetime import inspect import re import warnings from decimal import Decimal, DecimalException from django import forms from django.co...
hsfzxjy/wisecitymbc
site_packages/rest_framework/fields.py
Python
gpl-2.0
36,626
# pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103 import numpy as np from mock import patch from glue.core import Data, DataCollection from glue.app.qt import GlueApplication from glue.core.tests.util import simple_session from ..vispy_data_viewer import BaseVispyViewer from ...volume.volume_viewer import Vispy...
glue-viz/glue-3d-viewer
glue_vispy_viewers/common/tests/test_vispy_viewer.py
Python
bsd-2-clause
2,436
############################################################################## # 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...
skosukhin/spack
var/spack/repos/builtin/packages/r-mcmcglmm/package.py
Python
lgpl-2.1
1,917
# Python sccript for adding images to the html files in a reproducible way. import os import subprocess as subprocess import sys import glob import fileinput find = '<h1>Index</h1>' replace = '<br>\n<br>\n<br>\n<img src="static/gitnet.png" height="250" width="250"/>' files = glob.glob('gitnet/*.html') for ...
networks-lab/gitnet
docs/gitnet/static/Unused/further_parsing.py
Python
gpl-3.0
4,062
# -*- coding: utf-8 -*- # © 2016 Oihane Crucelaegui - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import fields, models class QcInspection(models.Model): _inherit = 'qc.inspection' inventory_line_id = fields.Many2one( comodel_name="stock.inventory.line", st...
alfredoavanzosc/odoo-addons
quality_control_stock_inventory/models/qc_inspection.py
Python
agpl-3.0
502
import warnings DISPLAY_WIDTH = 'display_width' ARITHMETIC_JOIN = 'arithmetic_join' ENABLE_CFTIMEINDEX = 'enable_cftimeindex' FILE_CACHE_MAXSIZE = 'file_cache_maxsize' WARN_FOR_UNCLOSED_FILES = 'warn_for_unclosed_files' CMAP_SEQUENTIAL = 'cmap_sequential' CMAP_DIVERGENT = 'cmap_divergent' KEEP_ATTRS = 'keep_attrs' O...
shoyer/xray
xarray/core/options.py
Python
apache-2.0
4,581
from theano import tensor as T import theano import numpy as np network_ops = imp.load_source('network_ops', 'code/parsing/algorithms/network_ops.py') class threed_grid_lstm_cell(): def __init__(self, name, input_shapes, output_shapes): assert(len(input_shapes) == 3) assert(len(output_shapes...
MichSchli/Speciale
code/parsing/algorithms/network_ops_grid_lstm.py
Python
gpl-3.0
4,528
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core, workspace from caffe2.python.test_util import TestCase import numpy as np lengths = [[0], [1, 2], [1, 0, 2, 0]] features1 = [[], ...
ryfeus/lambda-packs
pytorch/source/caffe2/python/operator_test/emptysample_ops_test.py
Python
mit
2,122
"""Tests for batchprocessors """ import codecs from django.test import TestCase from evennia.utils import batchprocessors, utils import mock import textwrap class TestBatchprocessorErrors(TestCase): @mock.patch.object(utils, "pypath_to_realpath", return_value=[]) def test_read_batchfile_raises_IOError(self, ...
jamesbeebop/evennia
evennia/utils/tests/test_batchprocessors.py
Python
bsd-3-clause
7,050
# -*- coding: utf-8 -*- #***************************************************************************** # Copyright (C) 2006 Jorgen Stenarson. <jorgen.stenarson@bostream.nu> # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software....
deanhiller/databus
webapp/play1.3.x/python/Lib/site-packages/pyreadline/lineeditor/history.py
Python
mpl-2.0
10,186
import codecs import logging import os import sys from collections import namedtuple import six import yaml from .errors import CircularReference from .errors import ComposeFileNotFound from .errors import ConfigurationError from .interpolation import interpolate_environment_variables from .validation import validate...
KevinGreene/compose
compose/config/config.py
Python
apache-2.0
18,913
#!/usr/bin/python # Copyright (c) 2015 Matthew Earl # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, mer...
matthewearl/lorri-align
stars.py
Python
mit
4,982
# coding: utf-8 # In[2]: from mcpi.minecraft import Minecraft import time #ip ip="192.168.1.12" #name of player name='chocolatepowder' #連線ip mc = Minecraft.create(ip) #跑5次 for w in range(0,5): #說Hello mc.postToChat('Hello') #停1秒 time.sleep(1) # In[ ]:
jacchwill/will-minecraft
2018/20181105.py
Python
gpl-3.0
294
from .explanation import Explanation from .is_not import is_not from .is_all import is_all from .is_any import is_any from .is_blank import is_blank, is_not_blank from .is_eq import is_eq from .is_fixed import is_fixed from .is_something import is_something from .is_nothing import is_nothing from .is_one import is_one ...
Daanvdk/is_valid
is_valid/__init__.py
Python
mit
3,037
import subprocess import pynotify import time def notify_with_subprocess(title, message): subprocess.Popen(['notify-send', title, message]) return def notify_with_pynotify(title, message): pynotify.init("Test") notice = pynotify.Notification(title, message) notice.show() return def update_wit...
cloud-engineering/xfc-email-notifier
snippets/snippet_notfication.py
Python
mit
939
# encoding: utf-8 from . import auth from . import config from . import erp
grap/odoo-eshop
odoo_eshop/eshop_app/tools/__init__.py
Python
agpl-3.0
77
print("아무 숫자나 입력해 보세욤~") UserChoice=int(input()) for Num in [str(index) for index in range(1, UserChoice+1)]: times = Num.count('3') + Num.count('6') + Num.count('9') if times: print("짝!" * times) else: print(Num)
imn00133/pythonSeminar17
exercise/369/Junho/08_17_Junho_369.py
Python
mit
265
""" @file coi-services/mi.idk.platform/package_driver.py @author Emily Hahn @brief Main script class for running the package_driver process """ import os import sys import subprocess from mi.core.log import get_logger ; log = get_logger() import mi.idk.package_driver from mi.idk.exceptions import InvalidParameters fr...
janeen666/mi-instrument
mi/idk/platform/package_driver.py
Python
bsd-2-clause
1,720
from setuptools import setup, find_packages import os # The VERSION file is codegned by the build. # setup.py needs to be in version control, but checking versions into that is problematic def get_version(): version = None script_dir = os.path.dirname(os.path.realpath(__file__)) script_dir = os.path.join(s...
ni/nifpga-python
setup.py
Python
mit
1,928
"""Policy framework for the email package. Allows fine grained feature control of how the package parses and emits data. """ import abc from email import header from email import charset as _charset from email.utils import _has_surrogates __all__ = [ 'Policy', 'Compat32', 'compat32', ] ...
Orav/kbengine
kbe/src/lib/python/Lib/email/_policybase.py
Python
lgpl-3.0
14,685
# -*- coding: utf-8 -*- # Copyright 2016 ACSONE SA/NV (<http://acsone.eu>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api class MailComposeMessage(models.TransientModel): _inherit = 'mail.compose.message' @api.model def default_get(self, fiel...
open-synergy/social
mail_optional_autofollow/wizard/mail_compose_message.py
Python
agpl-3.0
1,014
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2018 Zomboided # # 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)...
Zomboided/service.vpn.manager
libs/alternativeNord.py
Python
gpl-2.0
24,931
import sys import tweepy import json from datetime import datetime import os from grammar_parser import get_spellings from pprint import pprint import pickle import random import time import sys auth = tweepy.OAuthHandler(consumer_key = '<get this from twitter>', consumer_secret = '<get thi...
antoniocarlosortiz/twitter-grammar-bot
twitter_grammar_bot.py
Python
mit
4,519
#!/usr/bin/env python3 # ---------------------------------------------------------------------------- # Copyright (c) 2013--, Qiyun Zhu and Katharina Dittmar. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # --------------------...
DittmarLab/HGTector
hgtector/util.py
Python
bsd-3-clause
21,150
#-*- coding:utf-8 -*- import word_cutting if __name__ == "__main__": hashtag_dict = {} with open("../data/NewsEvent.tsv", "r") as file_ob: next(file_ob) for line in file_ob: data = line.split("\t") node_number = data[1] node_text = data[3] if nod...
IDRC-Tsinghua/Vectorize
src/news_event_hashtag.py
Python
mit
755
from helpers import here DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ) MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'ywot.sqlite' # Or path to database file if using sqlite3. DATABASE_USER = '' ...
zischwartz/yourworldoftext
settings.py
Python
bsd-3-clause
2,295
# *** encoding: utf-8 *** """ An :class:`~.InputProcessor` receives callbacks for the keystrokes parsed from the input in the :class:`~prompt_toolkit.inputstream.InputStream` instance. The `InputProcessor` will according to the implemented keybindings call the correct callbacks when new key presses are feed through `f...
niklasf/python-prompt-toolkit
prompt_toolkit/key_binding/input_processor.py
Python
bsd-3-clause
8,942
# Copyright (C) 2011 Google 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 copyright # notice, this list of conditions and the ...
sgraham/nope
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/builders.py
Python
bsd-3-clause
5,290
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Traverses the source tree, parses all found DEPS files, and constructs a dependency rule table to be used by subclasses. The format...
junhuac/MQUIC
src/buildtools/checkdeps/builddeps.py
Python
mit
17,168
''' View the coding live on Twitch @ https://www.twitch.tv/gmangavin and look at the github @ https://github.com/gmangavin/PyWeb chromedriver for gui view, phantomjs for ghost view. ''' import selenium.webdriver #Imports module import time #Imports time import threading #Imports threading, used to have multiple things...
gmangavin/PyMegle
Other Py/PyMegleTwo.py
Python
mit
5,053
from binding import * from .Value import ValueSymbolTable, Value from .ADT.StringRef import StringRef @ValueSymbolTable class ValueSymbolTable: if LLVM_VERSION >= (3, 3): _include_ = 'llvm/IR/ValueSymbolTable.h' else: _include_ = 'llvm/ValueSymbolTable.h' new = Constructor() delete = De...
llvmpy/llvmpy
llvmpy/src/ValueSymbolTable.py
Python
bsd-3-clause
486
from random import Random NUM_SAMPLES_TO_GENERATE = 2000 fileHandle = open('randomRGBSamples.csv', 'w') rand = Random() rand.seed(54321) for i in range(NUM_SAMPLES_TO_GENERATE): colorIndex = rand.randint(1,500) % 3 r = 0 g = 0 b = 0 if (colorIndex == 0): # Red r = rand.randint(230, 255) g = rand.randint(0...
cduvedi/CS229-project
feature_extraction/generateRandomRGBData.py
Python
gpl-2.0
695
# vim: set et sw=4 sts=4 fileencoding=utf-8: # # Python camera library for the Rasperry-Pi camera module # Copyright (c) 2013-2017 Dave Jones <dave@waveform.org.uk> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # ...
aa4cc/raspi-ballpos
picamera/__init__.py
Python
gpl-3.0
4,014
# $Id$ # # Copyright (C) 2003 Rational Discovery LLC # All Rights Reserved # import sys,os.path from rdkit import six from rdkit import RDConfig from rdkit.VLib.Supply import SupplyNode from rdkit import Chem class SDSupplyNode(SupplyNode): """ SD supplier Sample Usage: >>> fileN = os.path.join(RDConfig...
adalke/rdkit
rdkit/VLib/NodeLib/SDSupply.py
Python
bsd-3-clause
1,316
from __future__ import print_function try: from collections import MutableMapping except ImportError: from UserDict import DictMixin as MutableMapping class ObjectDB(object): def __init__(self, db, validation): self.db = db self.validation = validation self.observers = [] ...
emacsway/rope
rope/base/oi/objectdb.py
Python
gpl-2.0
4,753
# -*- coding: utf-8 -*- for i in range(int(raw_input())): print 0 if int(raw_input()) % 2 == 0 else 1
vicenteneto/online-judge-solutions
URI/1-Beginner/1866.py
Python
mit
107
#!/usr/bin/env python3 # Copyright (c) 2015-2021 The Dash Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' feature_llmq_connections.py Checks intra quorum connections ''' import time from test_framework.test...
thelazier/dash
test/functional/feature_llmq_connections.py
Python
mit
4,723
#! /usr/bin/env python3 # Copyright 2016 Toyota Research Institute # # 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 a...
ggould256/libpmp
cost.py
Python
apache-2.0
2,073
import numpy as np from scipy.integrate import quad c=2.99792458e+08 #m/s -- speed of light in vacumn h=6.62606876e-34 #J s -- Planck's constant kb=1.3806503e-23 # J/K -- Boltzman's constant c=3.e8 #speed of light (m/s) c1=2.*h*c**2. c2=h*c/kb sigma=2.*np.pi**5.*kb**4./(15*h**3.*c**2.) def planckDeriv(wavel,Te...
dennissergeev/classcode
lib/planck.py
Python
cc0-1.0
4,199
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-01-21 10:55 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('diary', '0008_auto_20170112_1138'), ] operations = [ migrations.AlterField(...
pyprism/Diary
diary/migrations/0009_auto_20170121_1655.py
Python
mit
434
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file from waflib import Utils,Errors from waflib.Configure import conf def get_extensions(lst): ret=[] for x in Utils.to_list(lst): if not isinstance(x,str): x=x.name ret.append(x[x.rfind('.')+1:...
Gnurou/glmark2
waflib/Tools/c_aliases.py
Python
gpl-3.0
1,500
from unittest import TestCase from plivo import plivoxml from tests import PlivoXmlTestCase class RecordElementTest(TestCase, PlivoXmlTestCase): def test_set_methods(self): expected_response = '<Response><Record action="https://foo.example.com" callbackMethod="GET" ' \ 'callbac...
plivo/plivo-python
tests/xml/test_recordElement.py
Python
mit
1,989
# _ _ _ _____ _ _ _____ _ _ ___ ___ _ __ # /_\ | | |_ _| |_ (_)_ _ __ _ __|_ _|_ _| | |__ / __| \| |/ / # / _ \| | | | | | ' \| | ' \/ _` (_-< | |/ _` | | / / \__ \ |) | ' < # /_/ \_\_|_| |_| |_||_|_|_||_\__, /__/ |_|\__,_|_|_\_\ |___/___/|_|\_\ # |__...
allthingstalk/python-sdk
allthingstalk/exceptions.py
Python
apache-2.0
1,345
__author__ = "Radical.Utils Development Team (Andre Merzky, Ole Weidner)" __copyright__ = "Copyright 2013, RADICAL@Rutgers" __license__ = "MIT" import os import sys import singleton as rs import read_json as rj # ------------------------------------------------------------------------------ # _test_config = ...
anisyonk/pilot
radical/utils/testing.py
Python
apache-2.0
6,675
# Copyright 2014 Dan Krause #:deploy:OHsentinel:/usr/local/share/OHsentinel # # 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 # # ...
humarf/OHsentinel
OHssdp.py
Python
apache-2.0
2,132
import os import ast """ Load the cornell movie dialog corpus. Available from here: http://www.cs.cornell.edu/~cristian/Cornell_Movie-Dialogs_Corpus.html """ class CornellData: """ """ def __init__(self, dirName): """ Args: dirName (string): directory where to load the corp...
mertyildiran/Dragonfire
dragonfire/deepconv/corpus/cornelldata.py
Python
mit
2,691
from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:8013") pwd = raw_input("Enter old wallet passphrase: ") pwd2 = raw_input("Enter new wallet passphrase: ") access.walletpassphrasechange(pwd, pwd2)
baconcoins/ChickenBaconRanch
contrib/wallettools/walletchangepass.py
Python
mit
220
import time import RSA from gmpy2 import * import matplotlib.pyplot as plt def generate2d(): _x = [] _y = [] for x in xrange(1,10): mil = int(round(time.time())*1000000) n = RSA.generateLargePrime(x) mil = int(round(time.time())*10000000000) - mil _y.append(int(mil)) _x.append(bit_length(n)) print _x pr...
amninder/crypto
fabfile/crypto/2d_graph.py
Python
mit
467
# Copyright 2010-2011 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, Inc. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # 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 Li...
shahar-stratoscale/nova
nova/tests/api/openstack/compute/test_servers.py
Python
apache-2.0
195,575
""" WSGI config for scandere project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETT...
cldrn/rainmap-lite
rainmap-lite/scandere/wsgi.py
Python
gpl-3.0
394
def test_client_info(client): assert 'name' in client.es.info() def test_search_create_index(client): response = client.search().idx( id='test.id', body={}, doc_type='doc.test') assert response['_type'] == 'doc.test' def test_search_create_index_with_prefix(client_prefix): ...
mongkok/elastic-sdk
tests/test_client.py
Python
mit
1,367
#!/usr/bin/python3 from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QApplication from rpg import Base from rpg.gui.wizard import Wizard import logging import sys def main(): base = Base() app = QApplication(sys.argv) base.conf.parse_cmdline() base.load_plugins() if base.conf...
Shootervm/rpg
rpg.py
Python
gpl-2.0
699
import logging import pygame from .. import Collage class SimpleResize(Collage): """ Example class for collage plugins - Takes a single image and resizes it """ name = 'simple resize' def __init__(self, config): super(SimpleResize, self).__init__(config) def generate...
loktacar/wallpapermaker
plugins/simple_resize/simple_resize.py
Python
mit
734
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2018 PyTroll community # Author(s): # Martin Raspaud <martin.raspaud@smhi.se> # 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, ...
adybbroe/python-geotiepoints
geotiepoints/modisinterpolator.py
Python
gpl-3.0
9,888
#!/usr/bin/env python # coding: utf-8 import csv import importlib import io import os import tempfile from textwrap import dedent as twdd import unittest import kraken_biom as kb def prep_kraken_input(data): kdr = csv.DictReader(data, fieldnames=kb.field_names, delimiter="\t") return [entry for entry in kdr]...
smdabdoub/kraken-biom
test/test_parsing.py
Python
mit
14,737
""" Ports define where each port has: - name - midpoint: (x, y) - width: - orientation: (deg) 0, 90, 180, 270. where 0 faces east, 90 (north), 180 (west), 270 (south) - Type: - optical - electrical (DC) - rf (high frequency) - detector (Superconducting) """ import pp @pp.autoname def test_component...
psiq/gdsfactory
pp/samples/17_ports.py
Python
mit
814