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 # # Code related to ESET's Stantinko research. # This script can decrypt network communication for all Stantinko's components. # These components are the Plugin Downloader Service Installer, the Plugin Downloader Service (PDS) # and the Browser Extension Downloader Service (BEDS). # It decrypt rep...
eset/malware-research
stantinko/decrypt_stantinko.py
Python
bsd-2-clause
4,395
# -*- coding: utf-8 -*- # Copyright 2014 Diamond Light Source Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
FedeMPouzols/Savu
savu/test/test_utils.py
Python
gpl-3.0
7,989
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup uses a pluggable XML or HTML parser to parse a (possibly invalid) document into a tree representation. Beautiful Soup provides provides methods and Pythonic idioms that make it easy to navigate...
pforret/python-for-android
python3-alpha/python-libs/bs4/__init__.py
Python
apache-2.0
12,519
""" Traits tests. Copyright (c) 2011 The PyroScope Project <pyroscope.project@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 of the License, or (at y...
Rudde/pyroscope
pyrocore/src/tests/test_traits.py
Python
gpl-2.0
1,084
import matplotlib.pyplot as plt def getBarStyle(): return dict( ecolor='black', ) def getColorsStyle(): return ['red','green','blue'] def getSaveParams(): return dict( transparent=True, dpi=300, ) def saveFigure(fileName): kwargs =getSaveParams() plt.savefig(f...
bchappet/dnfpy
src/experiments/plotStyle.py
Python
gpl-2.0
413
""" Helpers for Course Blocks tests. """ from openedx.core.lib.block_structure.cache import BlockStructureCache from ..api import get_cache def is_course_in_block_structure_cache(course_key, store): """ Returns whether the given course is in the Block Structure cache. """ course_usage_key = store.mak...
louyihua/edx-platform
openedx/core/djangoapps/content/block_structure/tests/helpers.py
Python
agpl-3.0
429
from django.conf.urls import patterns, url, include from django.contrib import admin from lessonApp.views import index, signin, add_lesson, login_error, register, about from lessonApp import views urlpatterns = patterns('', url(r'^$', index, name='index'), url(r'^signin/'...
rednerrus/fiveLessons
lessonApp/urls.py
Python
mit
662
from tree import * from worker import * import multiprocessing import graph as graph import random # create a sample undirected graph g = graph.sampleUnDirectedGraph() # get list of all vertex in graph vertexList = g.getVertices() # initialize an empty tree object tree = Tree() # choose random node from graph, this wi...
abhipec/academicCodes
CS350M/main.py
Python
gpl-2.0
2,153
# Copyright (C) 2006-2014 Bastian Kleineidam # # 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 distr...
linkcheck/linkchecker
linkcheck/director/__init__.py
Python
gpl-2.0
4,647
"""Sensor to indicate whether the current day is a workday.""" from datetime import datetime, timedelta import logging from typing import Any import holidays import voluptuous as vol from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity from homeassistant.const import CONF_NAME, WEEKD...
pschmitt/home-assistant
homeassistant/components/workday/binary_sensor.py
Python
apache-2.0
5,959
############################################################################### ## ## Copyright (C) 2014 Tavendo GmbH ## ## 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:/...
robtandy/AutobahnPython
examples/asyncio/websocket/slowsquare/server_py2.py
Python
apache-2.0
1,953
# Copyright 2014 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
devendermishrajio/nova
nova/objects/agent.py
Python
apache-2.0
2,846
import os import re import sys import logging import json from glob import iglob from collections import defaultdict import numpy as np from settings import CACHE_DIR, REF_DIR from utils import set_up_logging from utils import mkdir_p log = set_up_logging('describe', loglevel=logging.DEBUG) def describe_dos(optio...
influence-usa/campaign-finance_state_PA
tasks/describe.py
Python
mit
2,837
from common_fixtures import * # NOQA def test_host_deactivate(super_client, new_context): host = new_context.host agent = super_client.reload(host).agent() assert host.state == 'active' agent = super_client.wait_success(agent) assert agent.state == 'active' host = super_client.wait_success(...
rancherio/cattle
tests/integration/cattletest/core/test_host.py
Python
apache-2.0
7,066
''' Created on 03.06.2011 @author: Sergey Khayrulin ''' import math class Vertex(object): ''' Class defines 3D point point has x,y,z coordinates and diameter ''' def __init__(self,x=0, y=0, z=0,diametr=0): ''' Constructor ''' self.x = round(x...
openworm/Blender2NeuroML
src/Entity/Vertex.py
Python
mit
1,325
# -*- coding: utf-8 -*- # # Ductus documentation build configuration file, created by # sphinx-quickstart on Sat Aug 28 00:07:53 2010. # # and manually modified... # # 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 #...
wikiotics/ductus2
docs/conf.py
Python
gpl-3.0
7,958
# Krzysztof Joachimiak 2017 # sciquence: Time series & sequences in Python # # Data processors for making sliding_window # Author: Krzysztof Joachimiak # # License: MIT from sklearn.preprocessing import Binarizer from sciquence.base import Processor import numpy as np class WindowMaker(Processor): ''' Obj...
krzjoa/sciquence
sciquence/sequences/window_maker.py
Python
mit
1,438
"""Script to run after installation of HIRE Script function which are executed after model installation and """ import os import zipfile import configparser from energy_demand.basic import basic_functions from energy_demand.assumptions import general_assumptions from energy_demand.scripts import s_rs_raw_shapes from...
nismod/energy_demand
energy_demand/scripts/s_post_installation.py
Python
mit
2,987
from diofant import (And, Equality, MatrixSymbol, Mod, Or, Piecewise, Unequality, Xor) from diofant.abc import a, b, c, x from diofant.printing.lambdarepr import NumPyPrinter __all__ = () def test_numpy_piecewise_regression(): """ Test that NumPyPrinter needs to print Piecewise()'s choi...
diofant/diofant
diofant/tests/printing/test_numpy.py
Python
bsd-3-clause
1,552
__author__ = 'bromix' from resources.lib import kodion from resources.lib.kodion.items import DirectoryItem, UriItem from resources.lib.youtube.helper import v3, tv, extract_urls, UrlResolver, UrlToItemConverter from . import utils def _process_related_videos(provider, context, re_match): result = [] provid...
shopgps/repo.hackphone
plugin.video.youtube/resources/lib/youtube/helper/yt_specials.py
Python
gpl-2.0
9,060
""" Separate module with function samples for serialization tests, to avoid issues with __main__. """ import math from numba import jit, generated_jit from numba.core import types @jit((types.int32, types.int32)) def add_with_sig(a, b): return a + b @jit def add_without_sig(a, b): return a + b @jit(nopyth...
cpcloud/numba
numba/tests/serialize_usecases.py
Python
bsd-2-clause
2,317
import gtk from gio import VolumeMonitor from gui.mounts_manager_window import MountsManagerWindow class MountsManager: """Class used for monitoring and managing mounts menu""" def __init__(self, application): self._application = application self._mounts = {} # create user interface...
Hammer2900/SunflowerX
application/mounts.py
Python
gpl-3.0
4,872
# Copyright 2012 Cloudbase Solutions Srl # # 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...
alexpilotti/cloudbase-init
cloudbaseinit/utils/windows/winrmconfig.py
Python
apache-2.0
7,611
try: from ConfigParser import ConfigParser except ImportError: from configparser import ConfigParser import json import logging from tabpy.tabpy_server.management.util import write_state_config from threading import Lock from time import time logger = logging.getLogger(__name__) # State File Config Section N...
tableau/TabPy
tabpy/tabpy_server/management/state.py
Python
mit
20,688
#!/usr/bin/env python2 # ============================================================ # File: hex-array.py [input files] # Description: inputs a file, and formats it in a hex array # Created by Henry Crute # 3/5/2015 # ============================================================ #12 hex digits on a line import sys ...
seadsystem/ShR2
ESP8266/keys/hex_array.py
Python
mit
804
a = 1 s = 0 while a != 0: print('Current Sum: ',s) a = float(input('Number? ')) s = s + a print('Total Sum: ',s)
Swaraj1998/MyCode
Python/prog5.py
Python
mit
115
from CGATReport.Tracker import * from cpgReport import * ########################################################################## class cgiIntervals(cpgTracker): """Summary stats of intervals called by the peak finder. """ mPattern = "_cgi_cap_bed$" def __call__(self, track, slice=None): da...
CGATOxford/CGATPipelines
CGATPipelines/pipeline_docs/pipeline_cpg/trackers/macs_cgi_intervals.py
Python
mit
6,389
# PyVision License # # Copyright (c) 2009 David S. Bolme # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this lis...
tigerking/pyvision
src/pyvision/types/RangeImage.py
Python
bsd-3-clause
8,282
# # Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/] # # This file is part of IGE - Outer Space. # # IGE - Outer Space 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 Lice...
OuterDeepSpace/OuterDeepSpace
libs/client/osci/dialog/EmpireOverviewDlg.py
Python
gpl-2.0
10,411
""" test StoragElement """ import os import tempfile import mock import unittest import itertools from DIRAC import S_OK from DIRAC.Resources.Storage.StorageElement import StorageElementItem from DIRAC.Resources.Storage.StorageBase import StorageBase from DIRAC.ConfigurationSystem.Client.ConfigurationData import ...
Andrew-McNab-UK/DIRAC
Resources/Storage/test/Test_StorageElement.py
Python
gpl-3.0
23,884
# coding: utf-8 from __future__ import ( absolute_import, print_function, unicode_literals, ) from unittest import TestCase import responses from pydocxresizeimages.util import image from pydocxresizeimages.test.utils import get_fixture, mock_request class GetImageDataAndFileNameTestCase(TestCase): ...
jhubert/pydocx-resize-images
tests/util/test_image.py
Python
apache-2.0
2,175
# coding=utf-8 from __future__ import absolute_import, with_statement __author__ = 'mazesoul' TRACKER_PROTO_PKG_LEN_SIZE = 8 IP_ADDRESS_SIZE = 16 FDFS_DOMAIN_NAME_MAX_SIZE = 128 FDFS_GROUP_NAME_MAX_LEN = 16 FDFS_MAX_SERVERS_EACH_GROUP = 32 FDFS_MAX_GROUPS = 512 FDFS_MAX_TRACKERS = 16 FDFS_MAX_META_NAME_LEN = 64 F...
Forrest-Liu/pyfdfs
pyfdfs/enums.py
Python
gpl-2.0
8,728
f = open('../cs.txt', 'r') def get_next_jira_ticket(): global f while True: for line in f: line = line.strip() yield line f.close() f = open('../cs.txt', 'r') gen = get_next_jira_ticket() def get_jira_batch(batchsize): full_texts = [] for i in range...
rueckstiess/jiratopic
onlineldavb/jirarandom.py
Python
apache-2.0
456
# pmrep interface from infa3.pmrep import Pmrep # exceptions from infa3.exceptions import InfaError, InfaPmrepError __all__ = ['Pmrep', 'InfaError', 'InfaPmrepError']
kradecki/infa
infa3/__init__.py
Python
gpl-2.0
169
# -*- 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): # Deleting field 'ContentRepository.existing_license' db.delete_column(u'...
universalcore/unicore-cms-django
cms/migrations/0018_auto__del_field_contentrepository_existing_license__del_field_contentr.py
Python
bsd-2-clause
10,221
"""Triton Daemon - Communication server for Oxford Triton system The Triton fridge already has communication capacity to directly control and read both the temperatures and other elements of the fridge (pressure sensors, valves, compressor, ...). However, the Triton logging uses binary format files that can only be o...
yausern/stlab
devices/TritonDaemon/TritonDaemon.py
Python
gpl-3.0
4,577
# # buildroot/share/PlatformIO/scripts/mks_robin_nano.py # import robin robin.prepare("0x08007000", "mks_robin_nano.ld", "Robin_nano.bin")
JimBrown/MarlinTarantula
buildroot/share/PlatformIO/scripts/mks_robin_nano.py
Python
gpl-3.0
139
from django import forms from django.contrib.admin.widgets import AdminRadioSelect, AdminRadioFieldRenderer from edc_base.form.forms import BaseModelForm from edc_constants.constants import ON_STUDY from edc_visit_tracking.forms import VisitFormMixin from bcvp.bcvp.choices import VISIT_REASON, VISIT_INFO_SOURCE, VISI...
botswana-harvard/bcvp
bcvp/bcvp_subject/forms/subject_visit_form.py
Python
gpl-2.0
1,222
#Version 1.1 import sys sys.path.append('/var/www/html/modules/libraries') import schedule import time import pytz from astral import * import datetime import os import subprocess import mysql.connector import threading import paho.mqtt.client as mqtt import random file = open('/var/www/html/config.php', 'r') for li...
deklungel/iRulez
old/modules/timer/timer.py
Python
mit
8,273
# -*- coding: utf-8 -*- import re import time from module.plugins.internal.Account import Account class CatShareNet(Account): __name__ = "CatShareNet" __type__ = "account" __version__ = "0.12" __status__ = "testing" __description__ = """Catshare.net account plugin""" __license__ ...
manuelm/pyload
module/plugins/accounts/CatShareNet.py
Python
gpl-3.0
1,812
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020-2022 F4PGA Authors # # 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 # # Unl...
SymbiFlow/prjuray
utils/spec/picosoc.py
Python
isc
1,000
# -*- coding: utf-8 -*- """ Copyright (C) 2012 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib from httplib import BAD_REQUEST, CONFLICT, FORBIDDEN, METHOD_NOT_ALLOWED...
alirizakeles/zato
code/zato-server/src/zato/server/connection/http_soap/__init__.py
Python
gpl-3.0
1,596
# Practice 4 import sys def convertLower(s): result = s.lower() # convert to lower for i in range(len(result)): # if char is white space then delete it if (result[i]==" "): result = result.replace(s[i],'') print(result) return result def blackOrWhite(col): ...
sqzr1/Getter-Setter-Generator
tests/regression_test_samples/python/practice4.py
Python
gpl-3.0
929
# Copyright 2013: Mirantis 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 b...
yeming233/rally
tests/unit/plugins/openstack/scenarios/keystone/test_basic.py
Python
apache-2.0
15,405
# Copyright (c) 2014 Marist SDN Innovation lab Joint with Plexxi 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/license...
openstack/congress
congress/datasources/vCenter_driver.py
Python
apache-2.0
13,522
#!/usr/bin/env python # txt2tags - generic text conversion tool # http://txt2tags.org # # Copyright 2001-2010 Aurelio Jargas # Copyright 2010-2019 Jendrik Seipp # # This file is based on txt2tags version 2.6, but has been modified for # RedNotebook. The changes compared to the upstream version are: # # * use spaces i...
jendrikseipp/rednotebook
rednotebook/external/txt2tags.py
Python
gpl-2.0
236,959
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
nburn42/tensorflow
tensorflow/python/profiler/profiler.py
Python
apache-2.0
2,023
# -*- coding: utf-8 -*- from __future__ import print_function # (at top of module) import sys, requests # Note: in order to use this example, you need to have at least one account # that you can send money from (i.e. be the owner). # All properties are now kept in one central place from props.default import * #...
OpenBankProject/Hello-OBP-DirectLogin-Python
hello_payments.py
Python
apache-2.0
2,468
#!/usr/bin/python from __future__ import absolute_import, division, print_function, unicode_literals from builtins import (ascii, bytes, chr, dict, filter, hex, input, #pip install future int, map, next, oct, open, pow, range, round, str, super, zip) import subprocess import ...
pkerpedjiev/ernwin
fess/utils.py
Python
agpl-3.0
2,072
#! /usr/bin/env python """ Master Controller and Agent for DSR simulation. Revision Info ============= * $LastChangedBy: mandke $ * $LastChangedDate: 2011-12-20 23:57:48 -0600 (Tue, 20 Dec 2011) $ * $LastChangedRevision: 5393 $ :author: Ketan Mandke <kmandke@mail.utexas.edu> :copyright: Copyright 2009-2011 The...
reidlindsay/wins
sandbox/experiments/dsr/connect/mastercontrol.py
Python
apache-2.0
7,727
#!/usr/bin/env python """Unit test for the linux sysctl parser.""" import io from absl import app from grr_response_core.lib.parsers import linux_sysctl_parser from grr_response_core.lib.rdfvalues import paths as rdf_paths from grr_response_core.lib.rdfvalues import protodict as rdf_protodict from grr.test_lib impo...
google/grr
grr/core/grr_response_core/lib/parsers/linux_sysctl_parser_test.py
Python
apache-2.0
2,039
# Copyright 2017 Gabinete do Vereador Leandro Lyra # # 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 appli...
GVLL/domrj
domrj/dompdf/content.py
Python
apache-2.0
2,514
from django.core.management.base import BaseCommand from lizard_efcis.models import ImportMapping, MappingField class Command(BaseCommand): help = '''Aanmaken import-mappings for csv-file''' def handle(self, *args, **options): self.create_ibever_opname_mapping() self.create_hdsr_bio_opname_m...
lizardsystem/lizard-efcis
lizard_efcis/management/commands/create_mapping.py
Python
gpl-3.0
22,255
# -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os from datetime import date import json from django.core.cache import cache from django....
mkmelin/bedrock
bedrock/mozorg/tests/test_views.py
Python
mpl-2.0
14,148
from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... setup( name="waketor", version="0.0.1", author="Pierre...
rethore/waketor
setup.py
Python
apache-2.0
780
from mpi4py import MPI from numpy import zeros # we need to declare these variables somehow, # since we are calling mpi subroutines size = -1 rank = -1 comm = MPI.COMM_WORLD rank = comm.Get_rank() size = comm.Get_size() nx = 4 ny = 3 * 2 x = zeros(nx) y = zeros((3,2)) if rank == 0: x[:] = 1.0 y[:,:] = 1.0 s...
ratnania/pyccel
tests/macro/scripts/MPI/np_point_to_point_3.py
Python
mit
1,592
# -*- coding: utf-8 -*- # Copyright 2008-2014 Jaap Karssenberg <jaap.karssenberg@gmail.com> '''This module contains the main object to "execute" a template and fill in the parameters, call functions etc. The L{TemplateProcessor} defined here takes care of the template control flow ('IF', 'FOR', etc.). Also see the L...
fabricehong/zim-desktop
zim/templates/processor.py
Python
gpl-2.0
6,126
''' simple-MC: Main module Copyright 2014, Dan Schien Licensed under MIT. ''' import importlib import xlrd __author__ = 'schien' NAME = 'name' TYPE = 'type' PARAM_A = 'param_a' PARAM_B = 'param_b' PARAM_C = 'param_c' MODULE = 'module' LABEL = 'label' UNIT = 'unit' TABLE_STRUCT = { NAME: 0, MODULE: 1, ...
dschien/simple-MC
simplemc/__init__.py
Python
mit
3,544
from django.contrib import admin from .models import * # Register your models here. admin.site.register(VerbalSubCategories) admin.site.register(ProgrammingSubCategories) admin.site.register(QuizSubCategories)
SJIT-Hackerspace/SJIT-CodingPortal
Subcategories/admin.py
Python
apache-2.0
209
""" Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. For example, given s = "leetcode", dict = ["leet", "code"]. Return true because "leetcode" can be segmented as "leet code". """ __author__ = 'Danyang' class S...
algorhythms/LeetCode
139 Word Break.py
Python
mit
3,284
#!/usr/bin/env python """ Copyright 2013 OpERA Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agree...
ComputerNetworks-UFRGS/OpERA
python/app/ofdm_estimation/tsha_file_noise.py
Python
apache-2.0
10,133
lex_locators = { 'app_launcher': { 'app_link': "//div[@class='slds-section slds-is-open salesforceIdentityAppLauncherDesktopInternal']//section[@id='cards']//div[@class='appTileTitle' and text()='{}']", 'button': "css: nav.appLauncher button div.slds-icon-waffle", 'current_app': "//div[cont...
e02d96ec16/CumulusCI
cumulusci/robotframework/locators.py
Python
bsd-3-clause
2,702
# -*- encoding: utf-8 -*- __author__ = 'ray' __date__ = '2/27/15' from flask import Blueprint from .views import ThemeView def create_blueprint(**kwargs): blueprint = Blueprint('themes', __name__) view = ThemeView.as_view('themes', **kwargs) blueprint.add_url_rule( endpoint='theme', r...
Kotaimen/stonemason
stonemason/service/tileserver/themes/__init__.py
Python
mit
587
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2012 Zhang ZY<http://idupx.blogspot.com/> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/L...
bufferx/twork
twork/utils/__init__.py
Python
apache-2.0
729
import os from new import instancemethod from ufo.database import DocumentHelper from ufo.constants import Notification, FriendshipStatus from ufo.sharing import FriendDocument from ufo.debugger import Debugger from ufo.errors import * class FriendFilter: def __init__(self, key="login", **kw): self.kw = kw...
vienin/python-ufo
ufo/user.py
Python
gpl-2.0
8,585
import pickle import cloudpickle from io import BytesIO import taskloaf.refcounting import taskloaf.allocator class CloudPicklerWithCtx(cloudpickle.CloudPickler): def __init__(self, file): super().__init__(file) self.refs = [] def persistent_id(self, obj): if isinstance(obj, taskloaf...
tbenthompson/taskloaf
taskloaf/serialize.py
Python
mit
1,384
import copy from direct.directnotify import DirectNotifyGlobal from direct.interval.IntervalGlobal import * from direct.showbase import DirectObject import random from BattleBase import * import BattleExperience import BattleParticles import MovieDrop import MovieFire import MovieHeal import MovieLure import MovieNPCS...
ToontownUprising/src
toontown/battle/Movie.py
Python
mit
37,173
#!/usr/bin/env python3 import sys from json import dumps ### CompoundStack is the class to use for all parsers. class ParallelRecord(object): """ParallelRecord tracks objects that are parallel to a primary record stack. Used by CompoundStack.""" def __init__(self, type, name, id): self.type = typ...
ARTFL-Project/PhiloLogic5
python/philologic/OHCOVector.py
Python
gpl-3.0
12,529
eggs = 'spam7:eggs'
tsdmgz/ansible
test/integration/targets/module_utils/module_utils/spam7/ham/__init__.py
Python
gpl-3.0
20
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2014, 2015 CERN. ## ## Invenio 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 opt...
SCOAP3/scoap3
rawtext_search.py
Python
gpl-2.0
9,093
import copy import theano import numpy as np import theano.tensor as T from theano import config from theano import function from pylearn2.expr.probabilistic_max_pooling import max_pool_c01b from pylearn2.sandbox.cuda_convnet.probabilistic_max_pooling import prob_max_pool_c01b from pylearn2.utils import float32_floatX...
fyffyt/pylearn2
pylearn2/sandbox/cuda_convnet/tests/test_probabilistic_max_pooling.py
Python
bsd-3-clause
5,330
# Copyright Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
rjschwei/WALinuxAgent
tests/ga/test_remoteaccess_handler.py
Python
apache-2.0
26,126
""" Since this is basically firmware, it should be able to handle a lot of hard coding. Some of the elements, especially the events to add, will be difficult to allow the user to send. 1. ??? 2. List of message objects 3. Pop random element off list of message objects 4. When list reaches X entries, start the ???...
Kiganshee/Flip-Sign
FlipDotSign.py
Python
cc0-1.0
9,790
# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # ------------------------------------------------------...
crossroadchurch/paul
tests/functional/openlp_core_ui_media/__init__.py
Python
gpl-2.0
1,602
#!/usr/bin/env python2.6 # Copyright (C) 2013-2014 Computer Sciences Corporation # # 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 ...
crawlik/ezbake-dev-tools
artifactory_yum_deploy/deploy_rpms_to_artifactory_yum.py
Python
apache-2.0
7,905
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin import frogblog.urls import surgery.urls urlpatterns = [ # Examples: # url(r'^$', 'tt.views.home', name='home'), url(r'^admin/', include(admin.site.urls))...
curlyjr25/FrogWebsite
frogs/urls.py
Python
bsd-3-clause
472
#! /usr/bin/env python3 from test import support import unittest import urllib.parse RFC1808_BASE = "http://a/b/c/d;p?q#f" RFC2396_BASE = "http://a/b/c/d;p?q" RFC3986_BASE = 'http://a/b/c/d;p?q' SIMPLE_BASE = 'http://a/b/c/d' # A list of test cases. Each test case is a two-tuple that contains # a string with the q...
wdv4758h/ZipPy
lib-python/3/test/test_urlparse.py
Python
bsd-3-clause
40,212
from typing import Dict from django.http import HttpRequest, HttpResponse from zerver.decorator import webhook_view from zerver.lib.request import REQ, has_request_variables from zerver.lib.response import json_success from zerver.lib.webhooks.common import check_send_webhook_message from zerver.models import UserPro...
eeshangarg/zulip
zerver/webhooks/homeassistant/view.py
Python
apache-2.0
915
#!/usr/bin/env python __author__ = "Frederico Martins" __license__ = "GPLv3" __version__ = 0.1 # SOAP check for endpoints with curl statement. # Usage: python check_soap_endpoint.py -t json -u 'Vodafone TV Net Voz/2.2/ANDROID' -H http://localserver:8080/service/location -d '{"sid":"randomstring"}' -c Success from ar...
flippym/centreon-orchestration
plugins/check_soap_endpoint.py
Python
gpl-3.0
3,014
# coding=utf-8 import kataja.globals as g from kataja.singletons import ctrl from kataja.ui_widgets.Panel import PanelAction # ==== Class variables for KatajaActions: # # k_action_uid : unique id for calling this action. required, other are optional # k_command : text used for menu command and log feedback, unless t...
jpurma/Kataja
kataja/actions/line_options_panel_actions.py
Python
gpl-3.0
20,886
'''This module contains the ComplexityVisitor class which is where all the analysis concerning Cyclomatic Complexity is done. There is also the class HalsteadVisitor, that counts Halstead metrics.''' import ast import collections import operator # Helper functions to use in combination with map() GET_COMPLEXITY = ope...
rubik/radon
radon/visitors.py
Python
mit
14,879
""" run this with ./manage.py test website see http://www.djangoproject.com/documentation/testing/ for details """ from django.conf import settings from django.core.urlresolvers import reverse from django.shortcuts import render_to_response from django.template import Context from django.template.loader import get_temp...
alexissmirnov/donomo
donomo_archive/deps/paypal.jonboxall/standard/pdt/tests/pdt.py
Python
bsd-3-clause
5,162
import sqlite3 class Point: def __init__(self, x, y): self.x, self.y = x, y def __conform__(self, protocol): if protocol is sqlite3.PrepareProtocol: return "%f;%f" % (self.x, self.y) con = sqlite3.connect(":memory:") cur = con.cursor() p = Point(4.0, -3.2) cur.execute("select ?",...
invisiblek/python-for-android
python3-alpha/python3-src/Doc/includes/sqlite3/adapter_point_1.py
Python
apache-2.0
352
from __future__ import absolute_import from errbot import BotPlugin, botcmd, re_botcmd, botmatch class DummyTest(BotPlugin): """Just a test plugin to see if it is picked up. """ @botcmd def foo(self, msg, args): """This runs foo.""" return 'bar' @re_botcmd(pattern=r"plz dont match...
mrshu/err
tests/dummy_plugin/dummy.py
Python
gpl-3.0
532
#!/usr/bin/python3 # -*- coding:utf-8 -*- import socket from urllib.request import urlopen, Request from urllib.error import URLError, HTTPError import threading from gymkhana.aux.printing_format import green_nd_bold, yellow_nd_bold, colorfill, end_format from gymkhana.aux.my_variables import uclm_url, uclm_port3, my...
pedroma-gomezp/Gymkhana_Computer_Networks_II
gymkhana/steps/step5.py
Python
gpl-3.0
2,162
"""Settings for accessing a distributed docker instance.""" # Copyright 2015 Solinea, 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
slashk/goldstone-server
goldstone/settings/docker_build.py
Python
apache-2.0
807
# -*- coding: utf-8 -*- import abc import logging import datetime import functools import httplib as http import urlparse import uuid from flask import request from oauthlib.oauth2.rfc6749.errors import MissingTokenError from requests.exceptions import HTTPError as RequestsHTTPError from modularodm import fields, Q ...
arpitar/osf.io
website/oauth/models/__init__.py
Python
apache-2.0
15,805
# Copyright 2017 Linaro Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
kjbracey-arm/mbed
targets/TARGET_Cypress/TARGET_PSOC6/sb-tools/imgtool/imgtool/keys/__init__.py
Python
apache-2.0
3,037
from genderize import Genderize import csv import requests import json print(Genderize().get(['James', 'Eva', 'Thunderhorse']))
davidam/python-examples
nlp/genderize/genderize-list.py
Python
gpl-3.0
130
from autotest.client.shared import host_protections from autotest.client.shared.settings import settings def migrate_up(manager): manager.execute_script(ADD_PROTECTION_COLUMN) def migrate_down(manager): manager.execute(DROP_COLUMN) default_protection = settings.get_value('HOSTS', 'default_protection') def...
lmr/autotest
database_legacy/migrations/010_add_protection_to_hosts.py
Python
gpl-2.0
829
#!/usr/bin/env python """Entry point module for the command-line interface. The kmos executable should be on the program path, import this modules main function and run it. To call kmos command as you would from the shell, use :: kmos.cli.main('...') Every command can be shortened as long as...
mhoffman/kmos
kmos/cli.py
Python
gpl-3.0
16,514
from accelerator.models import PartnerApplicationInterest from factory import SubFactory from factory.django import DjangoModelFactory from accelerator.tests.factories import ( ApplicationFactory, JudgingRoundFactory, PartnerFactory, ) class PartnerApplicationInterestFactory(DjangoModelFactory): partn...
masschallenge/django-accelerator
accelerator/tests/factories/partner_application_interest_factory.py
Python
mit
513
# Licensed as BSD by Yuriy Chushkin of the ESRF on 2014-08-06 ################################################################################ # Copyright (c) 2014, the European Synchrotron Radiation Facility # # All rights reserved. # # ...
Nikea/pyXPCS
pyxpcs/mp_corr.py
Python
bsd-3-clause
10,142
import re from os.path import abspath from build.project import Project from build.zlib import ZlibProject from build.meson import MesonProject from build.cmake import CmakeProject from build.autotools import AutotoolsProject from build.ffmpeg import FfmpegProject from build.openssl import OpenSSLProject from build.bo...
dhocker/MPD
python/build/libs.py
Python
gpl-2.0
15,098
#!/usr/bin/env python """Doxygen XML to SWIG docstring converter. Converts Doxygen generated XML files into a file containing docstrings that can be used by SWIG-1.3.x. Note that you need to get SWIG version > 1.3.23 or use Robin Dunn's docstring patch to be able to use the resulting output. Usage: doxy2swig.py i...
kctan0805/vdpm
share/gdal/gdal-2.0.0/swig/include/python/docs/doxy2swig.py
Python
lgpl-2.1
12,031
# -*- coding: utf-8 -*- from .inventory import item_json_in_list, spec_json def entry_json(entry): item = entry.item_snapshot spec = entry.item_spec_snapshot item_dict = item_json_in_list(item) spec_dict = spec_json(spec) return dict( id=str(entry.id), item=item_dict, spec=...
seasonstar/bibi
application/services/json_tmpl/entry.py
Python
apache-2.0
1,538
import logging import time import os from coala_utils.decorators import enforce_signature from coalib.misc.CachingUtilities import ( pickle_load, pickle_dump, delete_files) from coalib.misc.Exceptions import log_exception from coalib.processes.Processing import get_file_dict from coalib.io.FileProxy import ( F...
jayvdb/coala
coalib/misc/Caching.py
Python
agpl-3.0
10,392
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
blueboxgroup/keystone
keystone/controllers.py
Python
apache-2.0
6,964
from django.core.urlresolvers import reverse from django.test import TestCase class SmokeTestMeanCoach(TestCase): def test_index_page_returns_200(self): resp = self.client.get(reverse('meancoach:index')) assert resp.status_code == 200
dev-coop/meancoach
meancoach_project/apps/meancoach/tests/smoke_tests.py
Python
mit
258
# [[[cog import cog; cog.outl('"""\n%s\n"""' % file('../README.rst').read())]]] """ EPC (RPC stack for Emacs Lisp) for Python ========================================= Links: * `Documentation <http://python-epc.readthedocs.org/>`_ (at Read the Docs) * `Repository <https://github.com/tkf/python-epc>`_ (at GitHub) * `I...
tkf/python-epc
epc/__init__.py
Python
gpl-3.0
3,920