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
# System imports import os from os.path import join # 3rd party libs from nose.tools import * from git import * # PyGitup imports from tests import basepath, init_master, update_file, write_file test_name = 'submodule' repo_path = join(basepath, test_name + os.sep) def _read_file(path): with op...
christer155/PyGitUp
tests/test_submodules.py
Python
mit
1,926
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, unified_strdate, urlencode_postdata, xpath_element, xpath_text, urljoin, ) class Laola1TvEmbedIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?laola1\.tv/tit...
adazey/Muzez
libs/youtube_dl/extractor/laola1tv.py
Python
gpl-3.0
5,096
from django.test import TestCase from .models import Article, Bar, Base, Child, Foo, Whiz class StringLookupTests(TestCase): def test_string_form_referencing(self): """ Regression test for #1661 and #1662 String form referencing of models works, both as pre and post reference, o...
mattseymour/django
tests/string_lookup/tests.py
Python
bsd-3-clause
2,471
# -*- coding: utf-8 -*- # auxilium # -------- # Python project for an automated test and deploy toolkit. # # Author: sonntagsgesicht # Version: 0.1.9, copyright Saturday, 02 October 2021 # Website: https://github.com/sonntagsgesicht/auxilium # License: Apache License 2.0 (see LICENSE file) from logging import l...
sonntagsgesicht/regtest
.aux/venv/lib/python3.9/site-packages/auxilium/tools/git_tools.py
Python
apache-2.0
3,958
__author__ = 'mmoore500'
LACVL/CV
demo_mike.py
Python
mit
24
# Copyright 2014 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , import logging import json import getpass import os import re import functools import datetime import time import sys # settings, , load and save settings, internal import se...
iriark01/yotta
yotta/lib/github_access.py
Python
apache-2.0
10,488
from nbodykit.core import DataSource import numpy class UnitTestDataSource(DataSource): """ A DataSource to be used in unit testing. Given a size and list of data types, this returns random numbers using :func:`numpy.random.random` (using the specified seed) for each desired column...
rainwoodman/nbodykit
nbodykit/test/utils/datasource.py
Python
gpl-3.0
1,656
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Interpreter version: python 2.7 # """ edeposit.amqp.ftp ----------------- In this module, :func:`.reactToAMQPMessage` is used only for **receiving** commands from the other side. Events caused by FTP users are handled by :mod:`monitor.py <.monitor>`. Commands can crea...
edeposit/edeposit.amqp.ftp
src/edeposit/amqp/ftp/__init__.py
Python
gpl-2.0
3,888
from .obc_mixin import OBCMixin, command, decode_words class FRAMMixin(OBCMixin): def __init__(self): pass @command("fram status {0}") def fram_status(self, index): pass @decode_words() @command("fram read {0} {1} {2}") def fram_read(self, index, address, length): pass...
PW-Sat2/PWSat2OBC
integration_tests/obc/fram.py
Python
agpl-3.0
456
class Solution: def pivotIndex(self, nums): """ :type nums: List[int] :rtype: int """ if nums is None or len(nums) == 0: return -1 record = {} for i in range(len(nums)): if i == 0: presum = 0 postsum = s...
euccas/CodingPuzzles-Python
leet/source/array/find_pivot_index.py
Python
mit
1,122
# -*- coding: utf-8 -*- """ Pretty printing of flypy IRs. """ from __future__ import print_function, division, absolute_import import os import re import dis import types from functools import wraps, partial from .lexing import lex_source from . import viz from flypy.pipeline import pipeline import pykit.ir from p...
flypy/flypy
flypy/viz/prettyprint.py
Python
bsd-2-clause
3,290
#!/usr/bin/env python import rospy from std_msgs.msg import String def talker(): pub = rospy.Publisher('chatter', String, queue_size=10) rospy.init_node('talker') rate = rospy.Rate(10) # 10hz while not rospy.is_shutdown(): hello_str = "hello world %s" % rospy.get_time() rospy.loginfo(h...
robomakery/spot
sw/ros/src/spot_behavior/src/talker.py
Python
mit
489
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free S...
neeasade/qutebrowser
qutebrowser/misc/httpclient.py
Python
gpl-3.0
3,708
import linuxdvb import fcntl fefd = open('/dev/dvb/adapter0/frontend0', 'r+') # Information feinfo = linuxdvb.dvb_frontend_info() fcntl.ioctl(fefd, linuxdvb.FE_GET_INFO, feinfo) print feinfo.name for bit, flag in linuxdvb.fe_caps.items(): if (feinfo.caps & bit) > 0: print("cap = "+flag) # Close fefd.clos...
koodilehto/kryptoradio-xmit-tests
receiver/adapter_info.py
Python
mit
324
""" Creation of the `Layout` instance for the Python input/REPL. """ from __future__ import unicode_literals from prompt_toolkit.enums import DEFAULT_BUFFER, SEARCH_BUFFER from prompt_toolkit.filters import IsDone, HasCompletions, RendererHeightIsKnown, HasFocus, Condition from prompt_toolkit.key_binding.vi_state impo...
tequa/ammisoft
ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/ptpython/layout.py
Python
bsd-3-clause
22,056
import lino lino.startup('lino_book.projects.apc.settings.demo') from django.utils import translation from lino.api.doctest import * from django.db.models import Q from django.db.models import Sum from lino_xl.lib.ledger.choicelists import TradeTypes from lino_xl.lib.vat.choicelists import VatRegimes, VatAreas intraco...
lsaffre/blog
docs/blog/2021/0902.py
Python
agpl-3.0
1,636
#!/usr/bin/env python # This file is part of nexdatas - Tango Server for NeXus data writer # # Copyright (C) 2012-2018 DESY, Jan Kotanski <jkotan@mail.desy.de> # # nexdatas is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the ...
nexdatas/tools
nxstools/pyeval/mythen.py
Python
gpl-3.0
2,279
from django.conf.urls import patterns, include, url import books.views bookpatterns = patterns('', url(r'^$', books.views.BookListView.as_view(), name='book-list'), url( r'^(?P<pk>\d+)/$', books.views.BookView.as_view(), name='book-detail', ), url( r'^(?P<pk>\d+)/send/(...
phildini/bockus
books/urls.py
Python
mit
2,608
# Copyright 2017 Dan Smith <dsmith@danplanet.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is ...
mach327/chirp_fork
chirp/drivers/rh5r_v2.py
Python
gpl-3.0
8,413
""" https://leetcode.com/problems/binary-tree-level-order-traversal/description/ Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 return its level order ...
abawchen/leetcode
solutions/102.py
Python
mit
1,244
#!/usr/bin/env python from MAPI.Util import * import sys import locale import getopt locale.setlocale(locale.LC_CTYPE, '') def print_help(): print "Usage: %s -u <username>" % sys.argv[0] print "" print "Migrate messages from one folder to another." print "" print "Required arguments:" print " ...
robertwbrandt/zarafa
zarafa-tools/mailstore/moveitems/moveitems.py
Python
gpl-2.0
6,737
""" This module contains the implementation of `geomeppy.IDF`. """ import itertools from typing import Any, Dict, List, Optional, Union # noqa from eppy.bunch_subclass import EpBunch # noqa from eppy.idf_msequence import Idf_MSequence # noqa from .geom.intersect_match import intersect_idf_surfaces, match_idf_surfa...
jamiebull1/geomeppy
geomeppy/idf.py
Python
mit
12,557
# -*- coding: utf-8 -*- from .base import * from matplotlib import pyplot as pl from matplotlib import cm from functools import wraps _almost_black = '#262626' _light_grey = '#fafafa' class PrettyTheme(BaseTheme): ''' A minimalist theme with ticks and axes only where required. More suitable for web pub...
spacecowboy/pyplotthemes
pyplotthemes/pretty.py
Python
gpl-2.0
7,086
""" Functions which wrap the Elastic client for convenience """ from elasticsearch.exceptions import AuthorizationException STATUS_GREEN = 'green' STATUS_YELLOW = 'yellow' STATUS_RED = 'red' def close_index(elastic_client, index): """ Given an Elastic client and and index, attempt to close the index :...
vertical-knowledge/pylastic
pylastic/helpers.py
Python
gpl-2.0
6,579
#!/usr/bin/env python """Handle records from /proc/self/oom_adj data files""" import regentest as RG import ProcHandlers as PH PFC = PH.ProcFieldConstants # --- def re_self_oom_adj(inprecs): """Iterate through parsed records and re-generate data file""" __template = "{oom:d}" for __hilit in inprecs:...
cnamejj/PyProc
regentest/self_oom_adj.py
Python
gpl-2.0
560
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from shop.models.defaults.bases import BaseOrderItem class OrderItem(BaseOrderItem): class Meta(object): abstract = False app_label = 'shop' verbose_name = _('Order item') verbose_name_plural = _('Orde...
hzlf/openbroadcast
website/shop/shop/models/defaults/orderitem.py
Python
gpl-3.0
330
import os import sys import time from Scripts.include.package import LOG_DIR class Logger(object): """ This Class is for redirecting the console messages to a log file... """ def __init__(self): self.terminal = sys.stdout self.log = open(LOG_DIR + '/Console_log_' + str(time.time()) + ...
Project-Bonfire/Bonfire
Scripts/include/Logger.py
Python
gpl-3.0
468
#!/usr/bin/python # -*- coding: utf-8 -*- import pywikibot from pywikibot import Category from pywikibot import pagegenerators import re from klasa import * from importsjp import * def addAspekt(title): # regex fetching all the data needed for the creation of new pages re_aspekt = re.compile(r'\'\'czasownik (...
alkamid/wiktionary
aspekty.py
Python
mit
6,220
# -*- coding: utf-8 -*- from __future__ import (division, print_function, absolute_import, unicode_literals) from . import dataset from . import browser from . import os from . import mobilephone from . import crawler from . import appliance from . import misc VERSION = (1, 2, 0) __version__ =...
mats116/ElasticBigQuery
dmp/external/woothee/__init__.py
Python
lgpl-3.0
4,241
"""Test the NZBGet config flow.""" from pynzbgetapi import NZBGetAPIException from homeassistant.components.nzbget.const import DOMAIN from homeassistant.config_entries import ( ENTRY_STATE_LOADED, ENTRY_STATE_NOT_LOADED, ENTRY_STATE_SETUP_RETRY, ) from homeassistant.const import CONF_HOST, CONF_NAME, CONF...
tchellomello/home-assistant
tests/components/nzbget/test_init.py
Python
apache-2.0
2,115
""" Module which groups all the aggregated precomputed information in order to save computational power. """ import pandas as pd from FirmsLocations.Preprocess.preprocess_cols import cp2str def read_agg(filepath): "Read file of aggregated info." table = pd.read_csv(filepath, sep=';') table = cp2str(tabl...
tgquintela/Mscthesis
FirmsLocations/IO/io_aggfile.py
Python
mit
557
from Event import Event from LightRider.Sequences import Blinker class Paused(Event): def _initInstance(self): self.leds = [[24,1], [23,1], [26,1]] self.sequence = Blinker()
thomaskneisel/LightRider
bin/LightRider/OctoPrint/events/Paused.py
Python
mit
180
class Double: cpp_type = "double" class Int: cpp_type = "int" class Uniform(Double): """ Uniform distributions. """ def __init__(self, a, b): self.a, self.b = a, b def from_uniform(self): s = "" s += "{x} = {a} + ({b} - ({a}))*_{x};\n" return self.insert_pa...
eggplantbren/DNest4
python/dnest4/distributions.py
Python
mit
7,698
#!/usr/bin/env python2 #encoding: UTF-8 import sys from Tkinter import * tinker = Tk() tk = tinker; tk.attributes('-fullscreen', True) # Add a canvas to the screen width = 1920 height = 1080 canvas = Canvas(tk, bg="black", height=height, width=width) canvas.pack(side='top', fill='both', expand='yes') tk.mai...
jeremysells/test
Python/docker-tkinter/tkinker.py
Python
mit
327
from pyramid.events import subscriber from . import helpers @subscriber("pyramid.events.BeforeRender") def register_globals(event): event["h"] = helpers.WebHelper(event['request'])
rebeccaframework/rebecca.bootstrapui
rebecca/bootstrapui/subscribers.py
Python
mit
187
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # import base64 import json from six import string_types from kubernetes_py.models.unversioned.BaseModel import BaseModel from kubernetes_py.mo...
sebastienc/kubernetes-py
kubernetes_py/models/v1/Secret.py
Python
apache-2.0
8,321
# ______________________________________________________________________ from __future__ import absolute_import import itertools import opcode from .opcode_util import itercode # ______________________________________________________________________ class BytecodeVisitor (object): opnames = [name.split('+')[0] f...
llvmpy/llvmpy
llpython/bytecode_visitor.py
Python
bsd-3-clause
12,689
class PasswordException(Exception): pass class NewPasswordException(Exception): pass class OperationError(Exception): pass class HostnameResolutionError(Exception): pass
jdeltoft/uPyLoader
src/utility/exceptions.py
Python
mit
191
# -*- coding: utf-8 -*- # # MWN2_matlab documentation build configuration file, created by # sphinx-quickstart on Fri Apr 04 20:28:37 2014. # # 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. #...
stabix/stabix
doc/conf.py
Python
agpl-3.0
10,426
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-01 18:03 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
rymcimcim/django-foosball
game/migrations/0001_initial.py
Python
mit
2,887
# Copyright 2017 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...
frreiss/tensorflow-fred
tensorflow/python/data/experimental/benchmarks/unbatch_benchmark.py
Python
apache-2.0
2,561
MacRomanEncoding = ( None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, 'space', 'exclam', 'quotedbl', 'num...
olivierdalang/stdm
third_party/reportlab/pdfbase/_fontdata_enc_macroman.py
Python
gpl-2.0
2,969
from hypergan.discriminators.pyramid_discriminator import PyramidDiscriminator from hypergan.gan_component import ValidationException from hypergan.ops import TensorflowOps from hypergan.search.default_configurations import DefaultConfigurations from hypergan import GAN from hypergan.generators.resizable_generator imp...
255BITS/HyperGAN
tests/gans/test_standard_gan.py
Python
mit
2,974
''' The DSR module contains different drop shape relationships used in pydisdrometer for the scattering calculations. ''' import numpy as np def tb(D_eq): '''Thurai and Bringi Drop Shape relationship model. Implementation of the Thurai and Bringi Drop Shape model given in [1] . This gives the ratio of t...
aamatthews/PyDisdrometer
pydisdrometer/DSR.py
Python
lgpl-2.1
2,694
#!/usr/bin/python3 # -*- coding: utf-8 -*- #external imports import sys import optparse import os #internal imports from subuserlib.classes.user import LockedUser from subuserlib.classes.permissionsAccepters.acceptPermissionsAtCLI import AcceptPermissionsAtCLI import subuserlib.commandLineArguments import subuserlib.su...
subuser-security/subuser
subuserlib/builtInCommands/subuser.py
Python
lgpl-3.0
5,675
# scans input from a file import codecs class Scan(object): def __init__(self, input_file): self.file = input_file self.line = "" self.pos = 0 # pos in characters # position for source purposes self.line_pos = 0 self.char_pos = 0 # implement EOF. def next(self): if len(self.line) - self.pos == 0: ...
cptaffe/lispy
scan.py
Python
bsd-3-clause
938
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-30 11:22 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('taskmanager', '0001_initial')...
danhuynhdev/taskbuster
taskbuster/apps/taskmanager/migrations/0002_auto_20161030_1822.py
Python
mit
1,416
import hashlib import random import string hash_algo = hashlib.sha1 def passwd(password, salt=None): if salt is None: salt = '' for c in random.sample(string.printable, 4): salt = salt + c return "%s%s" % (salt, hash_algo((salt + password).encode()).hexdigest()) def compare(salted_hash, passwor...
elitegreg/mudpy
mudpy/utils/passwd_tool.py
Python
gpl-3.0
432
import threading from PyQt5.Qt import QInputDialog, QLineEdit, QVBoxLayout, QLabel from electrum.i18n import _ from .ledger import LedgerPlugin from ..hw_wallet.qt import QtHandlerBase, QtPluginBase from electrum_gui.qt.util import * #from btchip.btchipPersoWizard import StartBTChipPersoDialog class Plugin(LedgerPl...
digitalbitbox/electrum
plugins/ledger/qt.py
Python
mit
2,116
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
fxfitz/ansible
lib/ansible/modules/network/nxos/nxos_linkagg.py
Python
gpl-3.0
12,502
# vi: ts=4 expandtab syntax=python # # Copyright (C) 2009-2010 Canonical Ltd. # Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # # Author: Scott Moser <scott.moser@canonical.com> # Author: Juerg Haefliger <juerg.haefliger@hp.com> # # This program is free software: you can redistribute it an...
pwyliu/cloud-init-0.6.3
cloudinit/CloudConfig/cc_rsyslog.py
Python
gpl-3.0
3,237
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2017-05-24 14:48 # @Author : Max # @File : register.py from inter import main from flask import request import pprint from source import Mongo_db import json @main.route('/register') def register(): ret = {} register_args = request.args.to_dict() ...
PangPangPangPangPang/webapp
source/register.py
Python
mit
785
import os import re import shutil from ...workspace_factory import workspace_factory from ....utils import in_temporary_directory, temporary_directory from ....utils import assert_cmd_success from ....utils import assert_cmd_failure from ....utils import assert_files_exist from ....utils import catkin_success from .....
catkin/catkin_tools
tests/system/verbs/catkin_build/test_build.py
Python
apache-2.0
17,712
# Copyright (c) 2016-2017, Parallels International GmbH # Copyright (c) 2017-2022, Virtuozzo International GmbH, All rights reserved # # This file is part of OpenVZ. OpenVZ 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 ...
OpenVZ/vcmmd
vcmmd/util/logging.py
Python
lgpl-2.1
1,733
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
plumgrid/plumgrid-nova
nova/test.py
Python
apache-2.0
10,797
# coding=utf-8 ''' cron trigger @author: Huiyugeng ''' import datetime import trigger class CronTrigger(trigger.Trigger): def __init__(self, cron): trigger.Trigger.__init__(self, 0, 1); self.cron = cron def _is_match(self): parser = CronParser(self.cron) ...
interhui/py_task
task/trigger/cron_trigger.py
Python
artistic-2.0
3,634
""" Script for importing a content library from a tar.gz file """ import base64 import os import tarfile from django.conf import settings from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.core.exceptions import SuspiciousOperation from django.core.management....
eduNEXT/edunext-platform
cms/djangoapps/contentstore/management/commands/import_content_library.py
Python
agpl-3.0
4,399
# -*- coding: utf-8 -*- # # Copyright (C) 2009-2015 Ben Kurtovic <ben.kurtovic@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation ...
earwig/earwigbot
earwigbot/commands/watchers.py
Python
mit
2,194
# -*- coding: utf-8 -*- from django.conf.urls import url from .views import * urlpatterns = [ url(r'^device$', device, name="device"), url(r'^verify/(?P<key>[a-f0-9]{32})$', verify, name="verify"), url(r'^subscribe$', subscribe, name="subscribe"), url(r'^subscriptions/(?P<device_id>[a-f0-9\-]{36})$', s...
CodeforChemnitz/TheaterWecker
django/api/urls.py
Python
mit
416
# # Copyright (C) 2015 Red Hat, Inc. # # 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 2.1 of the License, or # (at your option) any later version. # # This program is di...
vathpela/anaconda
tests/lib/gladecheck.py
Python
gpl-2.0
7,090
# Spawn Area file created with PSWG Planetary Spawn Tool import sys from java.util import Vector def addSpawnArea(core): dynamicGroups = Vector() dynamicGroups.add('endor_bark_mite') dynamicGroups.add('endor_bloodseeker') dynamicGroups.add('endor_bolle') dynamicGroups.add('endor_donkuwah') dynamicGroups.add('end...
ProjectSWGCore/NGECore2
scripts/mobiles/spawnareas/endor_se_1.py
Python
lgpl-3.0
421
# -*- encoding: utf-8 -*- """Implements Partition Table UI.""" from robottelo.ui.base import Base, UIError from robottelo.ui.locators import common_locators, locators from robottelo.ui.navigator import Navigator from selenium.webdriver.support.select import Select class PartitionTable(Base): """Implements the CR...
abalakh/robottelo
robottelo/ui/partitiontable.py
Python
gpl-3.0
2,722
""" WSGI config for 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.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") os.environ.setdefault("DJANGO_CONF...
MihaZelnik/Meeple
src/meeple/wsgi.py
Python
mit
438
import datetime PROPER_DATE_FORMAT = '%Y-%m-%d' EXAMPLE_PROPER_DATE = '2016-10-29' def format_nba_query_param(s: str): """ stats.nba request query parameters are in UpperCamelCase format with the exception of Id which is ID. """ return ''.join([w.title() if w.lower() != 'id' else 'ID' for w in s...
jsonchin/nba_stats_scraper_db_storage
nba_ss_db/scrape/utils.py
Python
apache-2.0
3,570
# Copyright (c) 2008-2010, Michael Gorven, Stefano Rivera # Released under terms of the MIT/X/Expat Licence. See COPYING for details. from datetime import datetime from ibid.db.types import IbidUnicode, IbidUnicodeText, Integer, DateTime from sqlalchemy import Table, Column, ForeignKey, UniqueConstraint from sqlalche...
caktus/ibid
ibid/db/models.py
Python
gpl-3.0
9,715
# VMware vSphere Python SDK # Copyright (c) 2008-2015 VMware, 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 # # Unle...
alexkolar/pyvmomi
tests/test_container_view.py
Python
apache-2.0
1,730
# This file is part of fedmsg. # Copyright (C) 2012 Red Hat, Inc. # # fedmsg 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 2.1 of the License, or (at your option) any later version. #...
maxamillion/autocloud
fedmsg.d/endpoints-autocloud.py
Python
agpl-3.0
1,340
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
dannyperry571/theapprentice
script.module.dnspython/lib/dns/rdtypes/ANY/CAA.py
Python
gpl-2.0
2,631
# encoding: utf-8 """ ip.py Created by Thomas Mangin on 2010-01-15. Copyright (c) 2010-2012 Exa Networks. All rights reserved. Modified by Orange - 2014 """ import math import socket from bagpipe.exabgp.structure.address import AFI,SAFI from bagpipe.exabgp.message.update.route import Route _bgp = {} for netmask in ...
murat1985/bagpipe-bgp
bagpipe/exabgp/structure/ip.py
Python
apache-2.0
3,122
#!/usr/bin/env python # -*- coding: utf-8 -*- _type = 'RCE' """ 测试用例 """ import random import time def poc(str): time.sleep(3) if random.randint(1, 10) > 5: return True return False def exp(str, command): print "Exploit moudle test."
S4kur4/Sepia
script/_script_test.py
Python
gpl-2.0
265
from math import pi import matplotlib import matplotlib.pyplot as plt import numpy as np from das.legacy.Numerics import Propagator from das.legacy.OptimalControlProblem import * problem = OptimalControlProblem(name='Planar Hypersonic') # Define the states and rates problem.State(name='h', expr='v*sin(gam)', units=...
msparapa/das
examples/Hypersonics/planarHypersonic.py
Python
gpl-3.0
3,116
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-04-04 18:58 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('snippets', '0006_snippet_la...
vitorfs/cmdbox
cmdbox/snippets/migrations/0007_auto_20160404_1858.py
Python
mit
1,372
from qgl2.qgl2 import concur, qreg, qgl2decl from qgl2.qgl2 import sequence, pulse, qgl2main, classical from qgl2.qgl1 import QubitFactory, X90, Y90, X, MEAS, Utheta, Xtheta from qgl2.qgl1 import Call, BlockLabel, Goto, LoadRepeat, Repeat, Return from qgl2.qgl1 import CmpEq from qgl2.util import init @qgl2decl def ...
BBN-Q/pyqgl2
test/code/ce/t5.py
Python
apache-2.0
700
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobil...
ProjectSWGCore/NGECore2
scripts/mobiles/dathomir/outbreak_deathtrooper_lvl_90.py
Python
lgpl-3.0
4,065
# encoding: utf-8 """ family.py Created by Thomas Mangin on 2014-06-22. Copyright (c) 2014-2015 Exa Networks. All rights reserved. """ from exabgp.configuration.engine.registry import Raised from exabgp.configuration.engine.registry import Entry from exabgp.configuration.engine.parser import boolean from exabgp.bgp....
lochiiconnectivity/exabgp
lib/exabgp/configuration/neighbor/capability.py
Python
bsd-3-clause
3,372
# -*- coding: utf-8 -*- from collections import namedtuple Face = namedtuple('Face', ['normal', 'v1', 'v2', 'v3']) """ :obj:`namedtuple` of :obj:`tuple`: 4 x 3 tuple of tuples corresponding to the normal and the three points comprising a `Face` """
scholer/cadnano2.5
cadnano/extras/math/face.py
Python
mit
254
# coding=utf-8 """ Collects JMX metrics from the Jolokia Agent. Jolokia is an HTTP bridge that provides access to JMX MBeans without the need to write Java code. See the [Reference Guide](http://www.jolokia.org/reference/html/index.html) for more information. By default, all MBeans will be queried for metrics. All n...
jaxxstorm/fullerite
src/diamond/collectors/jolokia/jolokia.py
Python
apache-2.0
7,813
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys f = open(sys.argv[2], 'w+') f.write(sys.argv[1]) f.close()
ibc/MediaSoup
worker/deps/gyp/test/gyp-defines/echo.py
Python
isc
251
DOCUMENT_TYPE = 'd' AREA_TYPE = 'a' ARTICLE_TYPE = 'c' IMAGE_TYPE = 'i' MAP_TYPE = 'm' OUTING_TYPE = 'o' ROUTE_TYPE = 'r' USERPROFILE_TYPE = 'u' WAYPOINT_TYPE = 'w' BOOK_TYPE = 'b' XREPORT_TYPE = 'x' ALL = [ AREA_TYPE, ARTICLE_TYPE, IMAGE_TYPE, MAP_TYPE, OUTING_TYPE, ROUTE_TYPE, USERPROFILE_TYPE, WAYPOINT_TYPE...
c2corg/v6_api
c2corg_api/models/common/document_types.py
Python
agpl-3.0
348
from innermodelcamera import InnerModelCamera class InnerModel (object): pass class InnerModelRGBD (InnerModelCamera): def __init__(self, id: str, width: float, height: float, focal: float, noise: float, port: int, ifconfig: str, innermodel: 'InnerModel', parent: 'InnerModelNode' = None): ...
robocomp/robocomp
libs/innermodel-python3/innermodel_python3/innermodelrgbd.py
Python
gpl-3.0
930
# -*- coding: utf-8 -*- # # * Copyright (c) 2009-2020. Authors: Cytomine SCRLFS. # * # * 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...
cytomine/Cytomine-tools
external_software_sample/add_software.py
Python
apache-2.0
2,516
"""Accuracy tests against data pulled from HORIZONS.""" from numpy import max from skyfield import api from skyfield.constants import AU_M from skyfield.io import download from skyfield.jpllib import Kernel one_second = 1.0 / 24.0 / 60.0 / 60.0 arcsecond = 1.0 / 60.0 / 60.0 ra_arcsecond = 24.0 / 360.0 / 60.0 / 60.0 m...
exoanalytic/python-skyfield
skyfield/tests/test_against_horizons.py
Python
mit
3,037
# Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it and/or modify # it under the terms of the G...
espressopp/espressopp
src/integrator/MDIntegrator.py
Python
gpl-3.0
3,045
from coalib.bears.LocalBear import LocalBear from coalib.results.Result import Result from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY class LineCountBear(LocalBear): LANGUAGES = {'All'} AUTHORS = {'The coala developers'} AUTHORS_EMAILS = {'coala-devel@googlegroups.com'} LICENSE = 'AGPL-3.0'...
Asnelchristian/coala-bears
bears/general/LineCountBear.py
Python
agpl-3.0
1,107
import re from django import http from django.apps import apps from django.utils.cache import patch_vary_headers from django.utils.six.moves.urllib.parse import urlparse from .compat import MiddlewareMixin from .conf import conf from .signals import check_request_enabled ACCESS_CONTROL_ALLOW_ORIGIN = 'Access-Control...
hchen1202/django-react
virtualenv/lib/python3.6/site-packages/corsheaders/middleware.py
Python
mit
6,154
def add(a,b): #define the functions by adding return a+b def sub (x,y):#define the fuctions by subtracting return x-y def mul(e,f):#define the fuctions by multiplying return e*f def div (j,k):#define the fuctions by diving return (j/k) def hours_from_seconds (a):#define the fuctions to fine number of seconds i...
yumi2198-cmis/yumi2198-cmis-cs2
function.py
Python
cc0-1.0
2,659
#Create your views here. from django.shortcuts import render from common.models import Course from backend.logging import loginfo from common.utility import getWeek from django.db.models import Q from users.models import SmallClass,StudentProfile from django.views.decorators import csrf import datetime @csrf.csrf_prot...
EducationAdministrationSystem/EducationSystem
president/views.py
Python
agpl-3.0
1,953
#!/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...
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/buildtools/checkdeps/builddeps.py
Python
mit
15,226
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## Vincent Mauge <vmauge.nospam@nospam.gmail.com> ## This program is published under a GPLv2 license """ RADIUS (Remote Authentication Dial In User Service)...
1nc1n3rat0r/scapy
scapy/layers/radius.py
Python
gpl-2.0
7,509
import json database = {"Database_Name":"doppelstern.hdb","Database_Hash":[]} #{"Malware_Name":"Doppelstern.hdb.Is.Dead.RIP","Malware_Hash":"3b583df09ec829197e03819fddf45f84"} f = open('md5.dat') content = f.readlines() for line in content: malware = line.split(':') database["Database_Hash"].append({'Malwa...
maxlabelle/WebMalwareScanner
signatures/rfxn_lmd_md5_convert.py
Python
bsd-3-clause
457
from pycp2k.inputsection import InputSection class _xalpha1(InputSection): def __init__(self): InputSection.__init__(self) self.Section_parameters = None self.Xa = None self.Scale_x = None self._name = "XALPHA" self._keywords = {'Xa': 'XA', 'Scale_x': 'SCALE_X'} ...
SINGROUP/pycp2k
pycp2k/classes/_xalpha1.py
Python
lgpl-3.0
368
# Copyright 2014 Google 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 law or ag...
Sorsly/subtle
google-cloud-sdk/lib/googlecloudsdk/api_lib/compute/metadata_utils.py
Python
mit
6,561
import os import subprocess from typing import Optional, Set, Type from irctest.basecontrollers import ( BaseServerController, DirectoryBasedController, NotImplementedByController, ) from irctest.irc_utils.junkdrawer import find_hostname_and_port TEMPLATE_CONFIG = """ include "modules.default.conf"; me {...
ProgVal/irctest
irctest/controllers/unrealircd.py
Python
mit
5,057
# Expected output is 3 # Will we get the expected output # If not what is a change we can make # to get the expected output?? a = "1" b = 2 print(a+b) # Is there another change we can make? # Hint: The original values of a and b alone can be left alone # casting polymorphism stuff here # duck typing, tuple is polymo...
micronicstraining/python
module_1/assessment/4.py
Python
agpl-3.0
384
#!/usr/bin/env python # Example for reading data from phone and convering it to and from # vCard, vTodo, vCalendar import gammu import sys sm = gammu.StateMachine() if len(sys.argv) == 2: sm.ReadConfig(Filename = sys.argv[1]) else: sm.ReadConfig() sm.Init() # For calendar entry # Read entry from phone entr...
markjeee/gammu
python/examples/vcs.py
Python
gpl-2.0
1,047
import cgi, urllib.parse from lxml.builder import E from lxml.etree import tostring from .sunburnt import SolrInterface from nose.tools import assert_equal debug = False schema_string = \ """<schema name="timetric" version="1.1"> <types> <fieldType name="string" class="solr.StrField" sortMissingLast="true" o...
superdesk/Live-Blog
build-package/distribution/sunburnt/test_sunburnt.py
Python
agpl-3.0
9,468
class User(object): def __init__(self, name): self._name = name @property def is_anonymous(self): return False class UserAnonymous(User): def __init__(self): pass @property def is_anonymous(self): return False anonymous = UserAnonymous()
vbraun/oxford-strings
app/users.py
Python
gpl-2.0
311
# This file consists of testing for functions that generate messages/strings # and convert data into another format import sys sys.path.append('../..') # Libraries # Standard library import unittest # Local print(sys.path) from lemur import (app, db, test_db_uri) from lemur import models as m import helper_random as r...
reed-college/lemur
lemur/tests/test_integration_utility_generate_and_convert.py
Python
mit
6,261
from __future__ import absolute_import import warnings from django import forms from django.core.urlresolvers import reverse from django.core import exceptions from django.utils.translation import pgettext, ugettext_lazy as _, ugettext from django.core import validators from django.contrib.auth.tokens import default_...
nimbis/django-allauth
allauth/account/forms.py
Python
mit
21,465
''' GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. ''' # Building a Standard Primal Linear Progr...
jGaboardi/LP_MIP
Gurobi_Primal_Standard.py
Python
lgpl-3.0
3,759