repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
noedelima/EDA-UFF-2017-1
gerarq.py
from random import * from collections import Counter path = "/home/noedelima/Documentos/11 - Arquivos e Utilitários Diversos/workspace/EDA-IC-Uff/src/vendas.txt" dados_venda = [] total_vendido = [] with open(path, "w") as arq: for item in range(1600): filial = randint(1, 5000) ano = randint(1950, 2017) ...
xyproto/turbine
djl/libs/Fopen.py
#!/usr/bin/env python # coding: utf-8 # Fopen # Copyright (C) 2009 Florian Joncour - Diablo150 <diablo151@wanadoo.fr # # This file is the source code of Fopen, a fake object file for Python # # Fopen is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
hfegetude/EjerciciosMicroondas
tema3/ej11/parte2.py
import numpy as np import matplotlib.pyplot as plt def cart2pol(x, y): theta = np.arctan2(y, x) rho = np.hypot(x, y) return theta, rho def pol2cart(theta, rho): x = rho * np.cos(theta) y = rho * np.sin(theta) return x, y def add_radius(x, y, r ): ang, mod = cart2pol(x, y) return pol2c...
mvo5/snapcraft
tests/spread/plugins/colcon/snaps/colcon-talker-listener/src/listener_py/setup.py
import os from setuptools import setup package_name = "listener_py" setup( name=package_name, version="1.0.0", py_modules=["listener"], data_files=[ (os.path.join("share", package_name), ["package.xml"]), ( os.path.join("share", package_name, "launch"), [os.path...
sdeleeuw/mediocris
mediocris/tests/test_view_topic.py
from django.test import Client, TestCase from django.urls import reverse from rest_framework import status from mediocris.tests.factories import UserFactory, TopicFactory class TopicViewSetTestCase(TestCase): def setUp(self): self.user = UserFactory(is_staff=False, is_superuser=False) TopicFac...
prophaner/ConfigBackup
configbackup.py
import paramiko import time import re import os import json import logging import shutil import socket import difflib import smtplib # sntp: relay.momentapharma.com:25 No_Auth # Logging configuration log_file = 'logs.log' logging.basicConfig(filename=log_file, level=logging.DEBUG, format='%(asctime)s %(message)s') log...
ncc-unesp/goo-server
dispatcher/migrations/0001_initial.py
# -*- 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): # Adding model 'Site' db.create_table('dispatcher_site', ( ('id', self.gf('django.db.models.fiel...
sjamcsclub/ROOM-B-CS-Club-Materials
Turtle Lesson/Turtle Fun 1.py
from turtle import * wn = Screen() alex = Turtle() alex.shape("turtle") alex.speed(10000) a = [[10, 10], [10, 50], [20, 50], [20, 10]] def drawCoords(listCoords): alex.penup() for i in listCoords: alex.setposition(i[0], i[1]) alex.pendown() alex.fillcolor("red") def SquareSpiral(turtleO...
kgullikson88/Chiron-Scripts
MakeMassRatioDistribution.py
""" This script goes through the stars observed, and searches for both known and new companions to each target. Right now, it only does known companions automatically """ import sys import os from matplotlib import rc import pySIMBAD as sim # rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) ## fo...
raulperula/python_tutorials
tutorial-pygame/src/example13.py
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = "Raul Perula-Martinez" __date__ = "2015-01" __version__ = "$ Revision: 1.0 $" import pygame pygame.init() # set window size screen = pygame.display.set_mode((480, 300)) # exit (quit) quit_cond = False # timer clock = pygame.time.Clock() # create the text...
DIRACGrid/DIRAC
src/DIRAC/DataManagementSystem/scripts/dirac_dms_replica_metadata.py
#!/usr/bin/env python """ Get the given file replica metadata from the File Catalog """ import os from DIRAC import exit as DIRACExit from DIRAC.Core.Base.Script import Script @Script() def main(): # Registering arguments will automatically add their description to the help menu Script.registerArgument(("Loc...
pedro2d10/SickRage-FR
tests/search_tests.py
#!/usr/bin/env python2.7 # coding=UTF-8 # Author: Dennis Lutter <lad1337@gmail.com> # 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 Softwar...
EternityForest/KaithemAutomation
kaithem/src/thirdparty/recur/compiledparser.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # CAVEAT UTILITOR # # This file was automatically generated by TatSu. # # https://pypi.python.org/pypi/tatsu/ # # Any changes you make to it will be overwritten the next time # the file is generated. from __future__ import print_function, division, absolute_import, u...
ubc/compair
compair/tests/learning_records/test_user_events.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import pytz from data.fixtures.test_data import BasicTestData from compair.tests.test_compair import ComPAIRLearningRecordTestCase from compair.core import db from flask_login import current_app from compair.learning_records.capture_events i...
ptroja/spark2014
gnatmerge/share/gnatmerge/library/spec_maps.py
"""Merges from one status space to another This module provide ways to map the power set of status space to an other status space; e.g. the status space of VCs ("VC_PROVED", "VC_NOT_PROVED") to the status space of an enclosing source entity (e.g. "FULLY PROVED", "NOT PROVED", "PARTIALLY PROVED"). The map is expressed ...
np/alot
alot/db/errors.py
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com> # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file class DatabaseError(Exception): pass class DatabaseROError(DatabaseError): """cannot write to read-only database""" pas...
jeremiah-c-leary/vhdl-style-guide
vsg/tests/block/test_rule_601.py
import os import unittest from vsg.rules import block from vsg import vhdlFile from vsg.tests import utils sTestDir = os.path.dirname(__file__) lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_601_test_input.vhd')) class test_block_rule(unittest.TestCase): def setUp(self): self...
improlabs/Banglish-Sentiment-Analysis
senalysis-2.py
#!/usr/local/bin/python #coding:utf8 from pyavrophonetic import avro from textblob import TextBlob from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer banglish = "ami to shudhu Ilish je Chandpur er eita confirm korechilam... Shorshe r sathe mile je sorshe ilish namok shushadu khabar toiri hobe ami ki...
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/scripts/cleanup_datasets/update_dataset_size.py
#!/usr/bin/env python """ Updates dataset.size column. Remember to backup your database before running. """ import sys, os, ConfigParser import galaxy.app assert sys.version_info[:2] >= ( 2, 4 ) def main(): ini_file = sys.argv.pop(1) conf_parser = ConfigParser.ConfigParser( {'here':os.getcwd()} ) conf_pa...
kizniche/Mycodo
alembic_db/alembic/versions/4b619edb9a8f_add_more_camera_options.py
"""Add more camera options Revision ID: 4b619edb9a8f Revises: 440d382bfaa6 Create Date: 2019-10-21 13:12:43.893863 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '4b619edb9a8f' down_revision = '440d382bfaa6' branch_labels = None depends_on = None def upgrade(...
ercius/openNCEM
ncempy/test/test_io_dm.py
""" Tests for the basic functionality of the dm io module. """ import pytest import time from pathlib import Path import ncempy.io.dm class Testdm3: """ Test the DM3 io module """ @pytest.fixture def data_location(self): # Get the location of the test data files test_path = Pat...
joemonti/drogon-master-py
modules/__init__.py
""" __init__.py This file is part of Drogon. Drogon 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. Drogon is distributed in the hope that...
kudrom/genesis2
genesis2/utils/filesystem.py
import os def unlink_recursive(dir): if os.path.isdir(dir): for file in os.listdir(dir): file_path = os.path.join(dir, file) if os.path.isdir(file_path): unlink_recursive(file_path) else: os.unlink(file_path) os.rmdir(dir) els...
rocky/python3-trepan
trepan/processor/command/set_subcmd/autopython.py
# -*- coding: utf-8 -*- # Copyright (C) 2009, 2012-2013, 2015 Rocky Bernstein # # 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) a...
abdullah-radwan/pray-times
PrayTimesLib.py
# compatible with python 2.x and 3.x import math import re import time ''' --------------------- Copyright Block ---------------------- praytimes.py: Prayer Times Calculator (ver 2.3) Copyright (C) 2007-2011 PrayTimes.org Python Code: Saleem Shafi, Hamid Zarrabi-Zadeh Original js Code: Hamid Zarrabi-Zadeh License...
skipmodea1/plugin.video.roosterteeth
resources/lib/roosterteeth_const.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- import sys import os import xbmc import xbmcaddon from bs4 import BeautifulSoup # # Constants # ADDON = "plugin.video.roosterteeth" SETTINGS = xbmcaddon.Addon(id=ADDON) LANGUAGE = SETTINGS.getLocalizedString RESOURCES_PATH = os.path.join(xbmcaddon.Addon(id=ADDON).getAddon...
wufangjie/leetcode
007. Reverse Integer.py
''' Example1: x = 123, return 321 Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here are some good questions to ask before coding. Bonus points for you if you have already thought through this! If the integer's last digit is 0, what should the output be? ie, cases such as 10, 1...
aroth-arsoft/arsoft-web-crashupload
app/crashdump/db_default.py
#!/usr/bin/python # -*- coding: utf-8 -*- # kate: space-indent on; indent-width 4; mixedindent off; indent-mode python; from trac.db import Table, Column, Index name = 'crashdump' version = 13 tables = [ Table('crashdump', key=('id'))[ Column('id', type='int', auto_increment=True), Column('uuid', ...
mhbu50/erpnext
erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt import frappe from frappe.core.page.permission_manager.permission_manager import reset from frappe.utils import add_days, today from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note from erpnext.st...
Block137/Dual2
Tools/autotest/sim_vehicle.py
#!/usr/bin/env python """ Framework to start a simulated vehicle and connect it to MAVProxy. Peter Barker, April 2016 based on sim_vehicle.sh by Andrew Tridgell, October 2011 """ import atexit import getpass import optparse import os import os.path import signal import subprocess import sys import tempfile import ti...
uberfastman/yahoo-fantasy-football-metrics
report/data.py
__author__ = "Wren J. R. (uberfastman)" __email__ = "wrenjr@yahoo.com" import itertools from calculate.metrics import CalculateMetrics from calculate.points_by_position import PointsByPosition from dao.base import BaseLeague, BaseMatchup, BaseTeam from utils.report_tools import add_report_team_stats, get_player_game_...
chenzw95/Discord-Selfbot
appuselfbot.py
import collections import datetime import math import subprocess import asyncio import random import glob import gc import psutil import sys import re import traceback import argparse import os import logging import requests import logging.handlers import discord from bs4 import BeautifulSoup from js...
CalthorpeAnalytics/urbanfootprint
footprint/client/configuration/scag_dm/built_form/scag_dm_land_use_definition.py
# UrbanFootprint v1.5 # Copyright (C) 2017 Calthorpe Analytics # # This file is part of UrbanFootprint version 1.5 # # UrbanFootprint is distributed under the terms of the GNU General # Public License version 3, as published by the Free Software Foundation. This # code is distributed WITHOUT ANY WARRANTY, without impl...
saintleva/limited-apt
src/metrics.py
# # Copyright (C) Anton Liaukevich 2011-2020 <leva.dev@gmail.com> # # This program 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 later versio...
bootchk/pensool
source/decorators.py
''' Most Pensool decorators for debug, transform, invalidate. See also picking. Generically: functions that modify other functions i.e. metaprogramming. Like macros. Specifically, modify function calls with pre- and post- operations. ''' ''' Copyright 2010, 2011 Lloyd Konneker This file is part of Pensool. Penso...
chendaniely/pystan
pystan/api.py
#----------------------------------------------------------------------------- # Copyright (c) 2013-2015, PyStan developers # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. #---------------------------------------------------------------------------...
Scratchcat1/AATC
AATC_DB.py
import MySQLdb as sql import time,codecs from Crypto.Protocol.KDF import PBKDF2 def GetTime(): return int(time.time()) def CoordLessThanOrEqual(Coord1,Coord2):# True if Coord1 <= Coord2 List1 = list(Coord1) List2 = list(Coord2) BoolList = [] for x in range(len(List1)): #Goes through each item in t...
bgamari/photon-tools
tests/test_filter_photons.py
#!/usr/bin/python from photon_tools.timetag_types import * from photon_tools.filter_photons import filter_by_spans import numpy as np strobe = np.empty(1e2, dtype=strobe_event_dtype) strobe['t'] = np.arange(0,600,6) strobe['chs'] = strobe['t'] delta_a = np.empty(15, dtype=delta_event_dtype) delta_a['start_t'] = 10*n...
Palasekmar/kaira
gui/simulation.py
# # Copyright (C) 2010-2014 Stanislav Bohm # # This file is part of Kaira. # # Kaira 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, version 3 of the License, or # (at your option) any later ...
nens/spoc
spoc/migrations/0001_initial.py
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'LocationSort' db.create_table(u'spoc_locationsort', ( ...
d2emon/generator-pack
src/fixtures/other/school_subject.py
school_subjects = [ "Advanced Mathematics", "Alchemy", "Alien Anatomy", "Alien Anthropology", "Alien Archaeology", "Alien Arts", "Alien Biochemistry", "Alien Bioengineering", "Alien Biology", "Alien Biosecurity", "Alien Biotechnology", "Alien Calligraphy", "Alien Cell...
xupingmao/xnote
handlers/upgrade/upgrade_002.py
# -*- coding:utf-8 -*- # @author xupingmao # @since 2021/12/31 23:22:49 # @modified 2022/01/01 23:00:39 # @filename upgrade_002.py """note_index索引重建""" import xutils from xutils import dbutil from xutils import dateutil UPGRADE = xutils.DAO("upgrade") NOTE_DAO = xutils.DAO("note") def log_info(fmt, *args): prin...
Trilarion/omnitux2
tools/create_default_options.py
# Omnitux 2 - educational activities based upon multimedia elements # Copyright (C) 2014 Trilarion # # 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 you...
DIRACGrid/DIRAC
src/DIRAC/WorkloadManagementSystem/Client/CPUNormalization.py
######################################################################## # File : CPUNormalization.py # Author : Ricardo Graciani ######################################################################## """ DIRAC Workload Management System Client module that encapsulates all the methods necessary to handle CPU...
alfa-jor/addon
plugin.video.alfa/lib/python_libtorrent/python_libtorrent/net.py
#-*- coding: utf-8 -*- ''' python-libtorrent for Kodi (script.module.libtorrent) Copyright (C) 2015-2016 DiMartino, srg70, RussakHH, aisman 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 t...
xh4x0r3r/xh4x0r3r_blog
xh4x0r3r_blog/utils/db.py
from xh4x0r3r_blog.articles.models import * from xh4x0r3r_blog.core.models import * from django.db.models import Model, Q, QuerySet from random import randint from datetime import datetime import re #________________ General _______________# def query (model, **kwargs) : if type(model) != type(Model) : r...
compmetagen/strainest
strainest/scripts/strainest_cmd.py
#! /usr/bin/env python ## Copyright 2016 Davide Albanese <davide.albanese@gmail.com> ## Copyright 2016 Fondazione Edmund Mach (FEM) ## This file is part of strainest. ## ## strainest is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as publi...
kush100993/Parking_space_detection_and_tracking
Minarawala_code3_05.py
import numpy as np import cv2 as cv from skimage.filters.rank import entropy from skimage.morphology import disk import matplotlib.pyplot as plt from sklearn import svm import time # Use 'Minarawala_testvideo_03.mp4' and 'Minarawala_trainimage_04.jpg' together # Use 'Minarawala_testvideo_01.mp4' and 'Minarawa...
israel-lugo/netforeman
netforeman/route.py
#! /usr/bin/env python3 # NetForeman - making sure your network is running smoothly # Copyright (C) 2016, 2017 Israel G. Lugo # # This file is part of NetForeman. # # NetForeman 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 Sof...
smurfix/DaBroker
tests/test25_sqlbackref.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division, unicode_literals ## ## This file is part of DaBroker, a distributed data access manager. ## ## DaBroker is Copyright © 2014 by Matthias Urlichs <matthias@urlichs.de>, ## it is licensed under the GPLv3. See the file `README.rst` fo...
Apogaea/voldb
volunteer/apps/accounts/models.py
from __future__ import unicode_literals from django.core.exceptions import ObjectDoesNotExist from django.utils.encoding import python_2_unicode_compatible from authtools.models import AbstractEmailUser from volunteer.apps.accounts.utils import obfuscate_email @python_2_unicode_compatible class User(AbstractEmailU...
OpenCobolIDE/OpenCobolIDE
open_cobol_ide/view/editors/cobol.py
""" Contains the COBOL code editor widget. """ import logging import os import sys from pyqode.core.api import ColorScheme from pyqode.cobol.widgets import CobolCodeEdit as CodeEditBase from open_cobol_ide import backend from open_cobol_ide.compilers import get_file_type from open_cobol_ide.linter import CobolLinter...
Jonnymcc/ansible
lib/ansible/module_utils/basic.py
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
berkowitze/hveto
hveto/html.py
# -*- coding: utf-8 -*- # Copyright (C) Joshua Smith (2016-) # # This file is part of the hveto python package. # # hveto 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 # (...
mnd/planetwar
gamelib/viewer.py
#!/usr/bin/python # -*- mode: python; coding: utf-8 -*- # Copyright (C) 2014 Nikolay Merinov # Author: Nikolay Merinov <nikolay.merinov@member.fsf.org> # This file is part of PlanetWar. # PlanetWar is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
john-tornblom/pyrsl
setup.py
#!/usr/bin/env python # encoding: utf-8 # Copyright (C) 2015 John Törnblom import logging import unittest import os import sys import stat import zipfile try: from setuptools import setup from setuptools import Command from setuptools.command.build_py import build_py except ImportError: from distutils...
robertfoss/memcpy.io
publishconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'https://memcpy.io' RELATIVE_URLS = False DE...
stanfordnqp/spins-b
spins/goos/shapes.py
from typing import Callable, List, Optional, Tuple, Union import copy import numpy as np from spins import goos from spins.goos import flows class ShapeFlow(flows.Flow): pos: np.ndarray = flows.np_zero_field(3) rot: np.ndarray = flows.np_zero_field(3) priority: int = flows.constant_field(default=0) ...
spiderbit/canta-ng
mingus/core/scales.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ ================================================================================ Music theory Python package, scales module Copyright (C) 2008-2009, Bart Spaans This program is free software: you can redistribute it and/or modify it under the terms of the...
bcorbet/SickRage
sickbeard/providers/ezrss.py
# 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,...
jhamman/storylines
storylines/tools/post_process_gard_output.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import itertools from dateutil.relativedelta import relativedelta # import pandas as pd import xarray as xr from scipy.special import cbrt as _cbrt from scipy.stats import norm as norm from storylin...
ddietze/DOSSS
objects/DOSSS_PlanoConvexLens.py
""" .. 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 ...
Zeal22/cryptopals
set1/challenge4/solve.py
#!/usr/bin/python with open("4.txt", 'r') as inf, open("out.txt", 'w') as outf: myList = list() for line in inf.readlines(): i = line.strip().decode("hex") # weighted system: if single xor then for most part the upper nibble will be differ by only 1 bit at either 1 or 2. # With that ass...
evilsocket/pycryptocat
pycryptocat.py
#!/usr/bin/env python3 import argparse import os import sys from gi.repository import Gtk, WebKit class Cryptocat: def __init__(self): self.window = Gtk.Window() self.webview = WebKit.WebView() starter = 'core/index.html' cc_path = os.path.dirname(os.path.realpath(__file__)) ...
srgblnch/AlbaLinacTomcoMonitor
tango-ds/AlbaLinacTomco.py
#!/usr/bin/env python # -*- coding:utf-8 -*- ############################################################################## ## license : ##============================================================================ ## ## File : AlbaLinacTomco.py ## ## Project : Linac's Tomco ## ## This file is part of T...
agile4you/bottle-jwt
bottle_jwt/compat.py
# -*- coding: utf-8 -*- """`bottle_jwt.compat` module. Provides python 2, 3 compatibility functions. """ from __future__ import unicode_literals from __future__ import print_function import sys import codecs if sys.version_info.major > 2: from inspect import signature as _signature signature = _signature ...
fga-gpp-mds/2016.2-SAS_FGA
sas/booking/serializerviews.py
from booking.models import Place, Building from rest_framework import viewsets from rest_framework import generics from rest_framework.response import Response from booking.serializers import PlaceSerializer from booking.serializers import BuildingSerializer from rest_framework.decorators import detail_route class Pla...
atantet/transferLorenz
plot/plotAttractor.py
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import pylibconfig2 figFormat = 'png' def field(x, p): rho, sigma, beta = p f = np.array([sigma * (x[1] - x[0]), x[0] * (rho - x[2]) - x[1], x[0] * x[1] - beta * x[2]]) return f ...
wynand1004/6502_Assembly_Simulator
cpu_6502.py
class CPU(object): def __init__(self, program_counter=0x1000): # Create registers self.a = 0 self.x = 0 self.y = 0 # Create flags self.carry = False self.decimal = False self.interrupt = False self.negative = False self.overflow = False self.zero = False # Create program counter self.pr...
badele/serialkiller-plugins
skplugins/checker/network/ping.py
#!/usr/bin/env python # -*- coding: utf-8 -*- __authors__ = 'Bruno Adelé <bruno@adele.im>' __copyright__ = 'Copyright (C) 2013 Bruno Adelé' __description__ = """A plugins for serialkiller project""" __license__ = 'GPL' __version__ = '0.0.2' from skplugins.checker import checker import pyping class ping(checker): ...
madformuse/client
src/util/__init__.py
import sys import os import urllib2 from ctypes import * # Developer mode flag def developer(): return sys.executable.endswith("python.exe") from config import VERSION as VERSION_STRING LOGFILE_MAX_SIZE = 256 * 1024 #256kb should be enough for anyone UNITS_PREVIEW_ROOT = "http://content.faforever.com/faf/uni...
whitepyro/debian_server_setup
sickbeard/clients/generic.py
import re import time from hashlib import sha1 from base64 import b16encode, b32decode import sickbeard from sickbeard import logger from sickbeard.exceptions import ex from sickbeard.clients import http_error_code from lib.bencode import bencode, bdecode from lib import requests from lib.requests import exceptions c...
wufangjie/leetcode
121. Best Time to Buy and Sell Stock.py
''' Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit. Example 1: Input: [7, 1, 5, 3, 6, 4] Output: 5 max. difference = 6...
pgmillon/ansible
test/units/pytest/plugins/ansible_pytest_coverage.py
"""Monkey patch os._exit when running under coverage so we don't lose coverage data in forks, such as with `pytest --boxed`.""" from __future__ import (absolute_import, division, print_function) def pytest_configure(): try: import coverage except ImportError: coverage = None try: ...
Ramit110/Boredom-Nothing-More
Python/Personal_Projects/0002_Paritify.py
def Paritify(Bits, Mode): Count = 0 for x in range(0, len(Bits)): if (Bits[x] == "1"): Count+=1 if (Mode == 0):#Odd parity return str(Count%2).replace("0", "1").replace("1", "0")+Bits elif (Mode == 1):#Even parity return str(Count%2)+Bits return "ERROR" def Chec...
YantaiGao/learn_Python_The-Hard-Way
No29_ifTest.py
#-*- coding:utf-8 -*- people = 30 cats = 35 dogs = 15 if people < cats: print "people < cats : %d , %d" %(people,cats) print "Too many cats !!!" if people > cats: print "people and cats: %d , %d" %(people,cats) print "Not many cats." if people < dogs: print "people < dogs: %d , %d" %(people,dogs) print "Too m...
mganeva/mantid
scripts/SANS/sans/state/state.py
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + """ Defines the main State object.""" # pyli...
Donkyhotay/MoonPy
zope/i18n/__init__.py
############################################################################## # # Copyright (c) 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/pyshared/computerjanitor/plugin.py
# plugin.py - plugin base class for computerjanitor # Copyright (C) 2008 Canonical, Ltd. # # 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, version 3 of the License. # # This program is distribu...
feranick/GES_AT
GridEdgeAT/gridedgeat/acquisition.py
''' acquisition.py ------------- Class for providing a procedural support for data acquisition Copyright (C) 2017-2019 Nicola Ferralis <ferralis@mit.edu> Copyright (C) 2017-2019 Roberto Brenes <rbrenes@mit.edu> Copyright (C) 2017 Tony Wu <tonyw@mit.edu> This program is free software; you can redistribute it and/or mo...
B-UMMI/INNUca
src/SPAdes-3.14.0-Linux/bin/truspades.py
#!/usr/bin/env python ############################################################################ # Copyright (c) 2015 Saint Petersburg State University # All Rights Reserved # See file LICENSE for details. ############################################################################ import gzip import logging import...
dsavoiu/kafe2
kafe2/fit/representation/model/yaml_drepr.py
import textwrap import tokenize import numpy as np import six from ._base import ModelFunctionDReprBase, ParametricModelDReprBase from .. import _AVAILABLE_REPRESENTATIONS from .._base import DReprError from .._yaml_base import YamlReaderException, YamlReaderMixin, YamlWriterException, YamlWriterMixin from ..error im...
gborri/SickRage
sickrage/core/processors/failed_processor.py
# Author: echel0n <echel0n@sickrage.ca> # URL: https://sickrage.ca # # 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, or # (at your...
sonelu/pypot
pypot/dynamixel/motor.py
import numpy import logging from collections import defaultdict import pypot.utils.pypot_time as time from ..robot.motor import Motor from ..utils import SyncEvent from ..utils.trajectory import GotoMinJerk from ..utils.stoppablethread import StoppableLoopThread from pypot.utils.factory import register_class log...
cbr/EQ-lips-firmware
utils/numpot_mapping.py
#!/usr/bin/env python2 import numpy as np import math import sys NB_VALUE=32 # Draw gain of filter given its Pot value (P2) R1 and RL # index = np.arange(0, 256, 1) index = np.linspace(0,255, 256) a = index / 255.0 P2 = 10000.0 RL = 470.0 R1 = 3300.0 R2 = R1 y = 20*np.log10(( RL + a*(R1 + (1-a)*P2))/( RL + (1-a)*...
saurabh6790/erpnext
erpnext/education/api.py
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import json from frappe import _ from frappe.model.mapper import get_mapped_doc from frappe.utils import flt, cstr, getdate from fra...
xbmcmegapack/plugin.video.megapack.dev
resources/lib/menus/home_countries_timorleste.py
#!/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...
jbzdak/data-base-checker
bazydanych2/urls.py
#from bdchecker.views import TestSql from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib import admin from bdcheckerapp.views import LandingPage admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(...
ProteinDF/ProteinDF_pytools
scripts/pdf-test-h5.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2014 The ProteinDF development team. # see also AUTHORS and README if provided. # # This file is a part of the ProteinDF software package. # # The ProteinDF is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publ...
2-B/botgstuerm
botgstuerm/bot.py
#!/usr/bin/env python import time import random import threading import queue import feedparser from cleverbot import Cleverbot from botgstuerm import mattermost_cl from botgstuerm import config class bcolors: DFLT = "\033[39m" BLK = "\033[330m" RED = "\033[31m" GRN = "\033[32m" YEL = "\033[3...
CarlosLannister/OwadeReborn
owade/chromePass.py
#!/usr/bin/env python ############################################################################# ## ## ## This file is part of DPAPIck ## ## Windows DPAPI decryption & forensic toolkit ...
saadqc/Sub-Merge
VideoPlayer.py
#! /usr/bin/python # # Qt example for VLC Python bindings # Copyright (C) 2009-2010 the VideoLAN 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 Foundation; either version 2 of the License, or # (at...
epronk/mktoc
src/mktoc/disc.py
# Copyright 2008, Patrick C. McGinty # 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 distribut...
Whatang/DrumBurp
src/GUI/DBInfoDialog.py
# Copyright 2011-12 Michael Thomas # # See www.whatang.org for more information. # # This file is part of DrumBurp. # # DrumBurp 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,...
SnowWalkerJ/quantlib
quant/data/wind/tables/cfuturescontpro.py
from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE VARCHAR2 = VARCHAR class CFuturescontpro(BaseModel): """ 4.178 中国期货标准合约属性 Attributes ---------- object_id: VARCHAR2(100) 对象ID s_info_windcode: VARCHAR2(40) Wind代码 ...
pgoeser/gnuradio-mlse
python/qa_mlse_derotate_cc.py
#!/usr/bin/env python # # Copyright 2011 Paul Goeser # # This 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. # # This software is distributed in th...
sghai/robottelo
tests/foreman/ui/test_adusergroup.py
"""Test class for Active Directory Feature :Requirement: Adusergroup :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: UI :TestType: Functional :CaseImportance: High :Upstream: No """ from fauxfactory import gen_string from nailgun import entities from robottelo.config import settings from robott...
Dmitry-Me/cppcheck
tools/daca2.py
#!/usr/bin/env python # # 1. Create a folder daca2 in your HOME folder # 2. Put cppcheck-O2 in daca2. It should be built with all optimisations. # 3. Optional: Put a file called "suppressions.txt" in the daca2 folder. # 4. Optional: tweak FTPSERVER and FTPPATH in this script below. # 5. Run the daca2 script: python da...
adrianschroeter/kiwi
test/unit/system_size_test.py
from mock import patch import mock from kiwi.system.size import SystemSize class TestSystemSize(object): def setup(self): self.size = SystemSize('directory') def test_customize_ext(self): self.size.accumulate_files = mock.Mock( return_value=10000 ) assert self.si...
MicroInfect/bioinfx
strucfit.py
#!/home/wms_joe/bin/miniconda2/bin/python """ This script pulls in homologs of proteins from PDB as determined by HHSuite. It then employs UCSF Chimera to structurally match them and get an indication of how well they score (RMSD) in order to pick the best simulation. """ import os import subprocess import sys import a...