code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
from sst.actions import ( assert_title, fails, wait_for, ) from u1testutils import mail from u1testutils.sst import config from acceptance import helpers config.set_base_url_from_env() PASSWORD = 'Admin007' # 2) Create 2 accounts (A & B). In Account A add email address C and do not # verify. In Account ...
miing/mci_migo
acceptance/tests/emails/doubled_email.py
Python
agpl-3.0
1,736
""" Views related to course groups functionality. """ from django.views.decorators.csrf import ensure_csrf_cookie from django.views.decorators.http import require_POST from django.contrib.auth.models import User from django.core.paginator import Paginator, EmptyPage from django.core.urlresolvers import reverse from dj...
romain-li/edx-platform
openedx/core/djangoapps/course_groups/views.py
Python
agpl-3.0
19,604
#coding:utf-8 from openerp.osv import osv,fields class rainsoft_stock_return(osv.Model): _inherit='stock.return.picking' _defaults={ 'invoice_state': '2binvoiced', }
kevin8909/xjerp
openerp/addons/Rainsoft_Xiangjie/rainsoft_stock_return.py
Python
agpl-3.0
185
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
hlmnrmr/superdesk-core
apps/archive_history/service.py
Python
agpl-3.0
3,708
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
marwoodandrew/superdesk-core
content_api/publish/service.py
Python
agpl-3.0
6,723
############################################################################## # # ______ Releasing children from poverty _ # / ____/___ ____ ___ ____ ____ ___________(_)___ ____ # / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \ # / /___/ /_/ / / / / / / /_/ / /_/ (__ |__ ) / /_/...
CompassionCH/compassion-modules
survey_phone/__manifest__.py
Python
agpl-3.0
2,093
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = 'kmol' SITENAME = 'CDW11 網頁 (虎尾科大MDE)' SITEURL = 'http://cdw11-40323200.rhcloud.com/static/' # 不要用文章所在目錄作為類別 USE_FOLDER_AS_CATEGORY = False #PATH = 'content' #OUTPUT_PATH = 'output' TIMEZONE = 'Asia/Taipei' DEFAULT_LA...
tsrnnash/bg8-cdw11
static/pelicanconf.py
Python
agpl-3.0
2,146
import os from flask import current_app def get_absolute_file_path(relative_path: str) -> str: return os.path.join(current_app.config['UPLOAD_FOLDER'], relative_path)
SamR1/FitTrackee
fittrackee/workouts/utils_files.py
Python
agpl-3.0
174
# -*- coding: utf-8 -*- """ This is the common settings file, intended to set sane defaults. If you have a piece of configuration that's dependent on a set of feature flags being set, then create a function that returns the calculated value based on the value of FEATURES[...]. Modules that extend this one can change th...
XiaodunServerGroup/ddyedx
cms/envs/common.py
Python
agpl-3.0
18,114
"""TOSEC models""" from django.db import models class Category(models.Model): name = models.CharField(max_length=256) description = models.CharField(max_length=256) category = models.CharField(max_length=256) version = models.CharField(max_length=32) author = models.CharField(max_length=128) s...
lutris/website
tosec/models.py
Python
agpl-3.0
1,177
"""autogenerated by genpy from qbo_arduqbo/NoiseLevels.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct import std_msgs.msg class NoiseLevels(genpy.Message): _md5sum = "e44910923ee5ef3281d32758158e1379" _type = "qbo_arduqbo/NoiseLevels" _has_hea...
HailStorm32/Q.bo_stacks
qbo_arduqbo/src/qbo_arduqbo/msg/_NoiseLevels.py
Python
lgpl-2.1
7,510
""" This file shows how to use pyDatalog using facts stored in python objects. It has 3 parts : 1. define python class and business rules 2. create python objects for 2 employees 3. Query the objects using the datalog engine """ from pyDatalog import pyDatalog """ 1. define python class and business rul...
pcarbonn/pyDatalog
pyDatalog/examples/python.py
Python
lgpl-2.1
3,454
""" ECE 4564 Final Project Team: Immortal Title: HomeGuard - Home Visitors Detection and Alert System Filename: publisher.py Members: Arun Rai, Mohammad Islam, and Yihan Pang Date: 11/26/2014 --------------------------------------------------------------------- Description: 1. Receive host user information, and send i...
raiarun/HomeGuard
publisher.py
Python
lgpl-2.1
4,016
#!/usr/bin/env python # # Generated Thu Jul 22 14:11:34 2010 by generateDS.py. # import sys import getopt from xml.dom import minidom from xml.dom import Node # # If you have installed IPython you can uncomment and use the following. # IPython is available from http://ipython.scipy.org/. # ## from I...
wood-galaxy/FreeCAD
src/Tools/generateBase/generateModel_Module.py
Python
lgpl-2.1
101,247
# Copyright (C)2016 D. Plaindoux. # # 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, or (at your option) any # later version. class WebException(Exception): def __i...
d-plaindoux/fluent-rest
fluent_rest/runtime/response.py
Python
lgpl-2.1
1,628
#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it wi...
mlba-team/open-lighting
tools/rdm/rdm_responder_test.py
Python
lgpl-2.1
8,444
#! /usr/bin/python # Copyright 2004 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import sys, os class settings: module_name='TnFOX' boost_path = '' boost_libs_path = '' gccx...
ned14/tnfox
Python/environment.py
Python
lgpl-2.1
2,231
############################################################################ # # Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). # Contact: http://www.qt-project.org/legal # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Qt licenses may use this file in # ...
richardmg/qtcreator
share/qtcreator/debugger/dumper.py
Python
lgpl-2.1
20,529
#!/usr/bin/env python # -*- coding: utf-8 -*- # Authors: Chinmaya Pancholi <chinmayapancholi13@gmail.com>, Shiva Manne <s.manne@rare-technologies.com> # Copyright (C) 2017 RaRe Technologies s.r.o. """Learn word representations via fasttext's "skip-gram and CBOW models", using either hierarchical softmax or negative sa...
markroxor/gensim
gensim/models/fasttext.py
Python
lgpl-2.1
29,942
"""Wrapper functions for Tcl/Tk. Tkinter provides classes which allow the display, positioning and control of widgets. Toplevel widgets are Tk and Toplevel. Other widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton, Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox LabelFrame and PanedWi...
prefetchnta/questlab
bin/x64bin/python/37/Lib/tkinter/__init__.py
Python
lgpl-2.1
170,982
# Copyright (c) 2002 Zooko, blanu # This file is licensed under the # GNU Lesser General Public License v2.1. # See the file COPYING or visit http://www.gnu.org/ for details. __revision__ = "$Id: tristero.py,v 1.2 2002/12/02 19:58:54 myers_carpenter Exp $" nodeSchema='http://tristero.sourceforge.net/mnet/Meta...
zooko/egtp_new
egtp/tristero.py
Python
lgpl-2.1
687
#!/usr/bin/env python from __future__ import print_function import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from datetime import datetime, timedelta from obspy.core.utcdatetime import UTCDateTime from matplotlib import gridspec from pdart.view import stream_from_directory f...
cerinunn/pdart
extra_plots/plot_seismograms.py
Python
lgpl-3.0
10,680
# -*- coding: utf-8 -*- __author__ = 'sdukaka' #只是为了测试一下装饰器的作用 decorator import functools def log(func): @functools.wraps(func) def wrapper(*args, **kw): print('call %s():' % func.__name__) return func(*args, **kw) return wrapper @log def now(): print('2015-3-25') now() def logger(t...
sdukaka/sdukakaBlog
test_decorator.py
Python
lgpl-3.0
664
# -*- coding: utf-8 -*- # util.py # Copyright (C) 2012 Red Hat, Inc. # # Authors: # Akira TAGOH <tagoh@redhat.com> # # This library 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 ...
jamesni/fonts-tweak-tool
fontstweak/util.py
Python
lgpl-3.0
2,700
from pymongo import MongoClient import config class Database: def __init__(self, db_name=None): self.mongodb_client = create_mongodb_client() self.db = self.create_db(db_name) self.authenticate_user() def create_db(self, db_name): if db_name is None: return self.m...
fkie-cad/iva
database.py
Python
lgpl-3.0
3,952
""" useful decorators """ __author__ = "Philippe Guglielmetti" __copyright__ = "Copyright 2015, Philippe Guglielmetti" __credits__ = ["http://include.aorcsik.com/2014/05/28/timeout-decorator/"] __license__ = "LGPL + MIT" import multiprocessing from multiprocessing import TimeoutError from threading import Timer import...
goulu/Goulib
Goulib/decorators.py
Python
lgpl-3.0
5,279
# This file is part of PyEMMA. # # Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER) # # PyEMMA 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 vers...
markovmodel/PyEMMA
pyemma/coordinates/clustering/interface.py
Python
lgpl-3.0
12,270
""" X """ import cPickle as pickle import os import numpy import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt class PlotInterface(object): def plot_timeseries(self, times, values): pass def plot_sinwave(self, times, sinewave): pass def plot_area_ratio(self, on_period_...
ubccr/supremm
src/supremm/datadumper.py
Python
lgpl-3.0
6,457
# Copyright (c) 2010-2018 Benjamin Peterson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publi...
krathjen/studiolibrary
src/studiovendor/six.py
Python
lgpl-3.0
32,901
from pyactor.context import set_context, create_host, sleep, shutdown,\ serve_forever class Someclass(object): _tell = {'show_things'} def __init__(self, op, thing): self.things = [op, thing] def show_things(self): print(self.things) if __name__ == '__main__': set_context() ...
pedrotgn/pyactor
examples/initparams.py
Python
lgpl-3.0
539
# *-* encoding: utf-8 *-* import os import codecs import unicodedata try: from lxml import etree except ImportError: try: # Python 2.5 - cElementTree import xml.etree.cElementTree as etree except ImportError: try: # Python 2.5 - ElementTree import xml.etree.ElementT...
YACOWS/PyNFe
pynfe/utils/__init__.py
Python
lgpl-3.0
4,553
# (C) British Crown Copyright 2016, Met Office # # This file is part of cartopy. # # cartopy 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 la...
zak-k/cartopy
lib/cartopy/tests/crs/test_nearside_perspective.py
Python
lgpl-3.0
2,158
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # 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...
lukaszpiotr/pylama_with_gjslint
pylama/checkers/pylint/reporters/__init__.py
Python
lgpl-3.0
4,482
#!/usr/bin/env python # -*- coding: utf-8 -* import clutter from clutter import cogl import math class Clock(clutter.Actor): __gtype_name__ = 'Clock' """ A clock widget """ def __init__(self, date=None, texture=None): clutter.Actor.__init__(self) self._date = date sel...
UbiCastTeam/candies
candies2/clock.py
Python
lgpl-3.0
3,642
import itertools import re import random import time import urllib2 from bs4 import BeautifulSoup import csv import os import os.path import string import pg from collections import OrderedDict import tweepy import sys # lint_ignore=E302,E501 _dir = os.path.dirname(os.path.abspath(__file__)) _cur = pg.connect(host="1...
claytontstanley/dissertation
dissProject/scrapeUsers.py
Python
lgpl-3.0
18,399
#!/usr/bin/env python # # Copyright (C) 2015 Jonathan Racicot # # 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...
InfectedPacket/TerrorCat
UI.py
Python
lgpl-3.0
32,143
#! /usr/bin/python # -*- coding: utf-8 -*- """ Plot cost evolution @author: verlaanm """ # ex1 #load numpy and matplotlib if needed import matplotlib.pyplot as plt #load data import dud_results as dud # create plot of cost and parameter plt.close("all") f,ax = plt.subplots(2,1) ax[0].plot(dud.costTotal); ax[0].se...
OpenDA-Association/OpenDA
course/exercise_black_box_calibration_polution_NOT_WORKING/plot_cost.py
Python
lgpl-3.0
504
#!/usr/bin/env python from string import punctuation import argparse import fnmatch import os import shutil import sys import json sys.path.insert(1, '/var/www/bedrock/') sys.path.insert(0, '/var/www/bedrock/src/') import analytics.utils import dataloader.utils import visualization.utils from multiprocessing import Qu...
Bedrock-py/bedrock-core
validation/validationScript.py
Python
lgpl-3.0
17,191
import math,re,sys,os,time import random as RD import time try: import netCDF4 as NC except: print("You no install netCDF4 for python") print("So I do not import netCDF4") try: import numpy as NP except: print("You no install numpy") print("Do not import numpy") class GRIDINFORMATER: """ ...
metalpen1984/SciTool_Py
GRIDINFORMER.py
Python
lgpl-3.0
66,239
#!/usr/bin/env python # -*- coding: utf-8 -*- from lxml import html import requests import csv, codecs, cStringIO import sys class Person: def __init__(self, party, name, email): self.party = party self.name = name self.email = email class UnicodeWriter: """ A CSV writer which wi...
samuelskanberg/riksdagen-crawler
scraper.py
Python
unlicense
4,168
import matplotlib.pyplot as plt import numpy as np n = 50 x = np.random.randn(n) y = x * np.random.randn(n) fig, ax = plt.subplots(2, figsize=(6, 6)) ax[0].scatter(x, y, s=50) sizes = (np.random.randn(n) * 8) ** 2 ax[1].scatter(x, y, s=sizes) fig.show() """( ![Plot](/assets/img/pp/patterns/p0171_1.png "output") )"...
pythonpatterns/patterns
p0171.py
Python
unlicense
323
from django.apps import AppConfig class GroupInvitationsConfig(AppConfig): name = 'GroupInvitations' verbose_name = 'Group Invitations'
Yury191/brownstonetutors
GroupInvitations/apps.py
Python
unlicense
144
import enum class H264Trellis(enum.Enum): DISABLED = 'DISABLED' ENABLED_FINAL_MB = 'ENABLED_FINAL_MB' ENABLED_ALL = 'ENABLED_ALL'
bitmovin/bitmovin-python
bitmovin/resources/enums/h264_trellis.py
Python
unlicense
144
#!/usr/bin/env python # -*- coding: utf-8 -*- """Contains test cases for the utils.py module.""" from __future__ import unicode_literals import sys import os.path import unittest PATH = os.path.realpath(os.path.abspath(__file__)) sys.path.insert(0, os.path.dirname(os.path.dirname(PATH))) try: from youtube_dl_g...
Sofronio/youtube-dl-gui
tests/test_utils.py
Python
unlicense
1,981
# -*- 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 'Brand' db.create_table(u'automotive_brand', ( ...
mscam/django-automotive
automotive/south_migrations/0001_initial.py
Python
unlicense
2,513
class MyClass: '''This is the docstring for this class''' def __init__(self): # setup per-instance variables self.x = 1 self.y = 2 self.z = 3 class MySecondClass: '''This is the docstring for this second class''' def __init__(self): # setup per-instance varia...
dagostinelli/python-package-boilerplate
packagename/somemodule.py
Python
unlicense
382
#%matplotlib inline # All the imports from __future__ import print_function, division from math import * import random import sys import matplotlib.pyplot as plt # TODO 1: Enter your unity ID here __author__ = "magoff2" class O: """ Basic Class which - Helps dynamic updates - Pretty Prints ...
gbtimmon/ase16GBT
code/4/ga/magoff2.py
Python
unlicense
8,088
""" You get an array of numbers, return the sum of all of the positives ones. Example [1,-4,7,12] => 1 + 7 + 12 = 20 Note: array may be empty, in this case return 0. """ def positive_sum(arr): # Your code here sum = 0 for number in arr: if number > 0: sum += number return sum
aadithpm/code-a-day
py/Sum Of Positive.py
Python
unlicense
316
from __future__ import unicode_literals from django.apps import AppConfig class RewardsConfig(AppConfig): name = 'rewards'
bfrick22/monetary-rewards
mysite/rewards/apps.py
Python
unlicense
130
""" Python bindings for GLFW. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals __author__ = 'Florian Rhiem (florian.rhiem@gmail.com)' __copyright__ = 'Copyright (c) 2013-2016 Florian Rhiem' __license__ = 'MIT' __version__ = '1.3.1' # By default (ERROR_...
ronhandler/gitroot
pyglfw/glfw.py
Python
unlicense
77,583
a = 'a|b|c|d|e' b = a.split('|', 3) print(b) """< ['a', 'b', 'c', 'd|e'] >"""
pythonpatterns/patterns
p0081.py
Python
unlicense
81
"""Values export object module.""" class Values(object): """Class for Values export object.""" name = None document = None def save(self, section, document, graphics=True): """Get intro.""" self.document = document section = self.name return document def save_wit...
executive-consultants-of-los-angeles/rsum
rsum/export/sections/values.py
Python
unlicense
498
import StringIO from novaclient.v1_1 import servers from tests import utils from tests.v1_1 import fakes cs = fakes.FakeClient() class ServersTest(utils.TestCase): def test_list_servers(self): sl = cs.servers.list() cs.assert_called('GET', '/servers/detail') [self.assertTrue(isinstance...
rcbops/python-novaclient-buildpackage
tests/v1_1/test_servers.py
Python
apache-2.0
9,616
# -*- coding: utf-8 -*- from dateutil.parser import parse import json import os import yaml import db_old # TODO: This function is currently only used by the db.py module, # imported from serving.py via sys.path modification. Due to the new # sys.path content, db.py attempts to find the `yaml_load` function in # thi...
verejnedigital/verejne.digital
obstaravania/utils.py
Python
apache-2.0
7,620
# -*- coding: utf-8 -*- """ Created on Sun Sep 11 23:06:06 2016 @author: DIP """ from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer def build_feature_matrix(documents, feature_type='frequency', ngram_range=(1, 1), min_df=0.0, max_df=1.0): feature_type = featur...
dipanjanS/text-analytics-with-python
Old-First-Edition/Ch07_Semantic_and_Sentiment_Analysis/utils.py
Python
apache-2.0
3,381
# Copyright 2012 OpenStack Foundation. # Copyright 2015 Hewlett-Packard Development Company, L.P. # Copyright 2017 FUJITSU LIMITED # 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...
openstack/python-neutronclient
neutronclient/v2_0/client.py
Python
apache-2.0
115,185
""" Copyright 2017 Deepgram 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 writing, software distri...
deepgram/kur
tests/examples/modkurfile.py
Python
apache-2.0
1,380
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import textwrap imp...
areitz/pants
tests/python/pants_test/backend/python/tasks/checkstyle/test_noqa.py
Python
apache-2.0
3,397
''' "network": [ { "index": 0, "ipv4_gateway": "", "name": "", "veth_pair": "", "mtu": "", "ipv6_gateway": "", "flags": "up", ...
dealfonso/lxc-pm
networkmanager.py
Python
apache-2.0
8,801
# This Python module is part of the PyRate software package. # # Copyright 2022 Geoscience Australia # # 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/...
GeoscienceAustralia/PyRate
tests/test_mpi_vs_multiprocess_vs_single_process.py
Python
apache-2.0
18,387
# Copyright 2015 Isotoma 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 writing...
mitchellrj/touchdown
touchdown/ssh/connection.py
Python
apache-2.0
3,610
# @MUNTJAC_COPYRIGHT@ # @MUNTJAC_LICENSE@ class VOptionGroup(object): HTML_CONTENT_ALLOWED = "usehtml"
rwl/muntjac
muntjac/terminal/gwt/client/ui/v_option_group.py
Python
apache-2.0
110
# -*- coding: utf-8 -*- # Copyright (c) 2016 Ericsson AB # # 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 ...
les69/calvin-base
calvin/runtime/south/plugins/io/sensors/rotary_encoder/platform/ky040_rotary_impl/rotary_encoder.py
Python
apache-2.0
3,011
#!/usr/env python import sys #let's parse strings in python! options = [] with open("src/zopt.ggo.in") as fd: for l in fd: if l.startswith("option "): option = l.split()[1].lstrip('"').rstrip('"') options.append(option) man = open('src/zmap.1.ronn').read() failures = False for opt...
willscott/zmap
scripts/check_manfile.py
Python
apache-2.0
493
#coding=UTF-8 ''' Created on 2011-7-6 @author: Administrator ''' from urlparse import urlparse import cookielib from pyquery.pyquery import PyQuery #@UnresolvedImport import re import datetime #@UnusedImport import urllib2 from lxml import etree #@UnresolvedImport from lxml.cssselect import CSSSelector #@Unresolv...
ptphp/PyLib
src/webpy1/src/jjrspider/ganji.py
Python
apache-2.0
40,700
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2009,2010,2012,2013,2014,2015,2016 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licen...
guillaume-philippon/aquilon
tests/broker/test_del_user.py
Python
apache-2.0
1,774
input = """ supp(B) :- on(B,table,0). supp(B) :- on(B,B1,0), supp(B1). on(b0,table,0) :- true. on(b1,b0,0) :- true. on(B,L,0) | -on(B,L,0) :- block(B), location(L). true. location(L) :- block(L). location(table) :- true. block(b0). block(b1). block(b2). """ output = """ supp(B) :- on(B,table,0). s...
veltri/DLV2
tests/parser/grounding.7.test.py
Python
apache-2.0
559
import re import calendar from logs_analyzer.settings import * from logs_analyzer.validators import * from datetime import datetime def get_service_settings(service_name): """ Get default settings for the said service :param service_name: service name (example: nginx, apache2...) :return: service sett...
ddalu5/logs-analyzer
logs_analyzer/lib.py
Python
apache-2.0
11,644
import os from contextlib import contextmanager from OpenSSL import crypto, SSL import synapse.common as s_common from synapse.tests.common import * import synapse.lib.certdir as s_certdir class CertDirTest(SynTest): @contextmanager def getCertDir(self): ''' Get a test CertDir object. ...
vivisect/synapse
synapse/tests/test_lib_certdir.py
Python
apache-2.0
22,334
############################################################################## # Copyright 2017-2018 Rigetti Computing # # 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...
rigetticomputing/grove
grove/tests/tomography/test_process_tomography.py
Python
apache-2.0
6,859
# Copyright 2016 Mirantis 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 agreed to in writing, so...
SVilgelm/CloudFerry
cloudferry/model/storage.py
Python
apache-2.0
1,801
import logging from types import FunctionType import ray import ray.cloudpickle as pickle from ray.experimental.internal_kv import _internal_kv_initialized, \ _internal_kv_get, _internal_kv_put from ray.tune.error import TuneError TRAINABLE_CLASS = "trainable_class" ENV_CREATOR = "env_creator" RLLIB_MODEL = "rlli...
richardliaw/ray
python/ray/tune/registry.py
Python
apache-2.0
5,525
# Copyright (c) 2018-2021 Micro Focus or one of its affiliates. # Copyright (c) 2018 Uber Technologies, 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/licen...
uber/vertica-python
vertica_python/vertica/messages/frontend_messages/copy_data.py
Python
apache-2.0
2,393
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys im...
skuda/client-python
kubernetes/test/test_v1beta1_cluster_role_list.py
Python
apache-2.0
917
# -*- coding:utf-8 -*- from test_stub import * class HOST(MINI): def __init__(self, uri=None, initialized=False): self.host_name = None self.host_list = [] if initialized: # if initialized is True, uri should not be None self.uri = uri return su...
zstackio/zstack-woodpecker
integrationtest/vm/e2e_mini/host/host.py
Python
apache-2.0
1,882
#!/usr/bin/python """usage: python stylechecker.py /path/to/the/c/code""" import os import sys import string import re WHITE = '\033[97m' CYAN = '\033[96m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' ENDC = '\033[0m' def check_file(file): if re.search('\.[c|h]$', file) == None: ...
izenecloud/nginx
tengine/contrib/stylechecker.py
Python
apache-2.0
1,596
# Definition for singly-linked list. class ListNode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def removeNthFromEnd(self, head, n): """ :type head: ListNode :type n: int :rtype: ListNode """ fast = slow ...
rx2130/Leetcode
python/19 Remove Nth Node From End of List.py
Python
apache-2.0
1,039
import datetime from unittest import mock import unittest from django.utils import timezone from unittest.mock import Mock, PropertyMock from django.test import TestCase from django.contrib.sessions.models import Session # from core.tasks import send_outcome, check_anonymous from lti.tasks import send_outcome class ...
cjlee112/socraticqs2
mysite/mysite/tests/celery.py
Python
apache-2.0
3,119
# Copyright (c) 2014 Rackspace, 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 agreed to in wr...
obulpathi/cdn1
cdn/transport/validators/stoplight/exceptions.py
Python
apache-2.0
1,077
#!/usr/bin/python import sys # try to import from the default place Munki installs it try: from munkilib import FoundationPlist, munkicommon except: sys.path.append('/usr/local/munki') from munkilib import FoundationPlist, munkicommon import os from datetime import datetime FILE_LOCATION = "/Users/Shared...
grahamgilbert/munki-dnd
munki-dnd.py
Python
apache-2.0
1,572
import os from ..libs import xlrd_tools HERE = os.path.dirname(os.path.abspath(__file__)) def test_xlsx_xlrd(): with open(os.path.join(HERE, 'fixtures', 'test.xlsx')) as fp: headers, data = xlrd_tools.xlsx_xlrd(fp) assert headers[0] == {'field': 'one', 'id': 'one', 'name': 'one'} assert data[0] ...
chrisseto/modular-file-renderer
mfr/ext/tabular/tests/test_xlsx_tools.py
Python
apache-2.0
362
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complia...
Hybrid-Cloud/conveyor
conveyor/clone/drivers/openstack/driver.py
Python
apache-2.0
31,506
# Copyright 2021 DeepMind Technologies 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
deepmind/deepmind-research
ogb_lsc/mag/data_utils.py
Python
apache-2.0
18,032
""" Simple demo of a scatter plot. """ import numpy as np import matplotlib.pyplot as plt N = 50 x = np.random.rand(N) y = np.random.rand(N) colors = np.random.rand(N) area = np.pi * (15 * np.random.rand(N))**2 # 0 to 15 point radii plt.scatter(x, y, s=area, c=colors, alpha=0.5) plt.show()
ArmstrongYang/StudyShare
Python-matplotlib/scatter_demo.py
Python
apache-2.0
295
"""REST API for DP.LA Service Hub BIBCAT Aggregator Feed""" __author__ = "Jeremy Nelson, Mike Stabile" import click import datetime import json import math import os import pkg_resources import xml.etree.ElementTree as etree import requests import rdflib import urllib.parse import reports import bibcat.rml.processor ...
KnowledgeLinks/dpla-service-hub
api.py
Python
apache-2.0
14,727
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # 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...
tanglei528/nova
nova/db/api.py
Python
apache-2.0
65,070
#!/usr/bin/python3 import MySQLdb import os import re db = MySQLdb.connect("etos39.cn.ao.ericsson.se","automation","automation","gerrit_data_new") # db = MySQLdb.connect("localhost","root","root","work" ) cursor = db.cursor() cursor.execute('SELECT reviewer_username FROM comments GROUP BY reviewer_username') users...
KiviMao/kivi
Script/Show-Comments-story/Get-All-User.py
Python
apache-2.0
1,268
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (th...
Kami/libcloud
contrib/scrape-ec2-prices.py
Python
apache-2.0
9,128
import logging import pika import sys if sys.version[0] == '2': import Queue as queue else: import queue as queue from .. import rabbitutils import esgfpid.defaults as defaults from esgfpid.utils import loginfo, logdebug, logtrace, logerror, logwarn, log_every_x_times LOGGER = logging.getLogger(__name__) LOGGE...
IS-ENES-Data/esgf-pid
esgfpid/rabbit/asynchronous/thread_feeder.py
Python
apache-2.0
13,289
from typing import ClassVar, FrozenSet from ..config import Config from .dependency import IngressClassesDependency, SecretDependency, ServiceDependency from .k8sobject import KubernetesGVK, KubernetesObject from .k8sprocessor import ManagedKubernetesProcessor from .resource import NormalizedResource, ResourceManager...
datawire/ambassador
python/ambassador/fetch/ingress.py
Python
apache-2.0
11,005
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## This is a samples controller ## - index is the default action of any application ## - user is required for authentication and authorizatio...
dmnfarrell/epitopemap
controllers/default.py
Python
apache-2.0
49,804
# # Copyright (c) 2017 Juniper Networks, Inc. All rights reserved. # import argparse, os, ConfigParser, sys, re from pysandesh.sandesh_base import * from pysandesh.gen_py.sandesh.ttypes import SandeshLevel from sandesh_common.vns.constants import SERVICE_ALARM_GENERATOR, \ ServicesDefaultConfigurationFiles class ...
nischalsheth/contrail-controller
src/opserver/alarmgen_cfg.py
Python
apache-2.0
11,029
# Copyright 2011 OpenStack Foundation # Copyright 2011 - 2012, 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-...
redhat-cip/openstack-logcollector
openstack-logcollector/openstack/common/rpc/impl_qpid.py
Python
apache-2.0
29,688
## # Copyright (c) 2009-2014 Apple Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mod...
trevor/calendarserver
twistedcaldav/test/test_memcacheprops.py
Python
apache-2.0
14,385
# -*- coding: utf-8 -*- from selenium import webdriver from fixture.session import SessionHelper from fixture.group import GroupHelper from fixture.address import AddressHelper class Application(object): def __init__(self, browser, base_url): if browser == "firefox": self.wd = webdriver.Firef...
vpalex999/python_training
fixture/application.py
Python
apache-2.0
1,165
#!/usr/bin/python from __future__ import absolute_import, print_function import argparse import csv import os import re import sys try: from plistlib import load as load_plist # Python 3 from plistlib import dump as dump_plist except ImportError: from plistlib import readPlist as load_plist # Python 2 ...
nmcspadden/PrinterGenerator
print_generator.py
Python
apache-2.0
10,809
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
asomya/test
horizon/test.py
Python
apache-2.0
14,512
#!/usr/bin/env python # Copyright 2016 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 # # Unless required ...
shivanshu21/docker-volume-vsphere
esx_service/utils/vmdk_utils.py
Python
apache-2.0
19,851
# Copyright 2016 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 agreed to in writing...
stratis-storage/stratis-cli
src/stratis_cli/_parser/_physical.py
Python
apache-2.0
1,060
def write(es,body,index,doc_type): try: res = es.index(index=index, doc_type=doc_type, body=body) return res except Exception, e: return e def search(es,body,index,doc_type,size=None): if size is None: size=1000 try: res = es.search(index=index, doc_type=doc_type, body=body, size=size) return res exce...
TravisFSmith/SweetSecurity
apache/flask/webapp/es.py
Python
apache-2.0
1,377