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 |
|---|---|---|---|---|---|
# GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or with... | pywinauto/pywinauto | pywinauto/controls/__init__.py | Python | bsd-3-clause | 2,480 |
import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
from PopularityMeter import *
from MeasureView import *
from PostsView import PostsView
from TVShow import Seis78TVShow
import unittest
imp... | mincem/ing2-grupo9 | tp1/src/test/testPopularityMeter.py | Python | gpl-3.0 | 1,958 |
#!/usr/bin/env python
# -*- coding: utf-8 -*
#
# File: cmdlib.py
#
# Copyright (C) 2012 Hsin-Yi Chen (hychen)
# Author(s): Hsin-Yi Chen (hychen) <ossug.hychen@gmail.com>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software... | hychen/boliau | boliau/cmdlib.py | Python | mit | 5,563 |
# -*- coding: utf-8 -*-
#
# This file is part of cclib (http://cclib.github.io), a library for parsing
# and interpreting the results of computational chemistry packages.
#
# Copyright (C) 2008-2014, the cclib development team
#
# The library is free software, distributed under the terms of
# the GNU Lesser Gen... | jchodera/cclib | src/cclib/parser/nwchemparser.py | Python | lgpl-2.1 | 49,345 |
"""
This contains all the constants needed for the daemons to run
"""
LOGGING_CONSTANTS = {
'LOGFILE' : 'summer.log',
'MAX_LOG_SIZE' : 1048576, # 1 MEG
'BACKUP_COUNT' : 5
}
def getLoggingConstants(constant):
"""
Returns various constants needing by the logging module
"""
return ... | DIVERSIFY-project/SMART-GH | sensor_processing/constants.py | Python | apache-2.0 | 359 |
"""Tests for views of tracker application."""
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import TestCase
from tracker.models import (Expenditure, Purse)
User = get_user_model()
class HomeTest(TestCase):
"""Test home view."""
def setUp(self):
... | orontee/porte-monnaie | site/tracker/tests/test_views.py | Python | gpl-3.0 | 19,399 |
from django.http import HttpResponse
import xlwt
import xlwt
from datetime import datetime
import time
style0 = xlwt.easyxf('font: name Times New Roman, color-index red, bold on',
num_format_str='#,##0.00')
style1 = xlwt.easyxf(num_format_str='D-MMM-YY')
def excel_export_scholen(request,scholen):
response = Htt... | mtwestra/akvo-wandelenvoorwater | wvw/W4W/excel.py | Python | agpl-3.0 | 5,770 |
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.contrib.contenttypes.models import ContentType
from django_hats.bootstrap import Bootstrapper
from django_hats.utils import check_membership, cleanup_roles, migrate_role, synchronize_roles
from tests im... | GenePeeks/django-hats | tests/test_utils.py | Python | mit | 3,404 |
#!/usr/bin/env python
import sys
from queue import Queue
def read_ints():
return [int(x) for x in sys.stdin.readline().split(" ")]
def build_graph(N, M):
node_edges = [0]
while (N > 0):
node_edges.append([])
N -= 1
while (M > 0):
(x, y) = read_ints()
node_edges[x].ap... | andreimaximov/algorithms | hacker-rank/algorithms/graph-theory/bfs-shortest-reach/bfs-shortest-reach.py | Python | mit | 1,385 |
#!/usr/bin/env python
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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.or... | jaloren/robotframework | src/robot/rebot.py | Python | apache-2.0 | 22,941 |
# -*- coding: utf-8 -*-
import os
import re
import urllib
import urlparse
import requests
import cookielib
import socket
from HTMLParser import HTMLParser
from fileUtils import fileExists, setFileContent, getFileContent
#------------------------------------------------------------------------------
socket.setdefaultt... | afonsinoguimaraes/repository.magellan | plugin.video.SportsDevil/lib/utils/webUtils.py | Python | gpl-2.0 | 9,173 |
#!/usr/bin/env python3
# Python libs
import os.path
import sys
import icebox
# FIXME: Move this into icebox
parts = [
# LP Series (Low Power)
"lp384",
"lp1k",
"lp8k",
# Unsupported: "lp640", "lp4k" (alias for lp8k),
# LM Series (Low Power, Embedded IP)
# Unsupported: "lm1k", "lm2k",
... | SymbiFlow/symbiflow-arch-defs | ice40/utils/ice40_list_layout_in_icebox.py | Python | isc | 972 |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/network/vrid_binding.py | Python | apache-2.0 | 3,836 |
from django.db import models
from django.contrib.auth.models import User, Group
from django.db.models import signals
from django.conf import settings
from apiclient.discovery import build as Apiclient
import requests
import urllib
import soundcloud
from requests import HTTPError
import datetime
import re
import json
fr... | L8pR/L8pR | app/l8pr/models.py | Python | lgpl-3.0 | 9,387 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'preload2subs.ui'
#
# Created: Fri May 29 16:34:25 2015
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except A... | miha-skalic/ITEKA | qt_design/twosubstr/preload2subs.py | Python | gpl-3.0 | 6,536 |
### Namespace IDs for attributes
BLIZZARD = 999
| Blizzard/s2protocol | s2protocol/namespaces.py | Python | mit | 48 |
from core.himesis import Himesis
import uuid
class HFather2Man(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the DSLTrans rule Father2Man.
"""
# Flag this instance as compiled now
self.is_compiled = True
super(HFather2Ma... | levilucio/SyVOLT | ExFamToPerson/transformation/HFather2Man.py | Python | mit | 3,154 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import getdate, validate_email_add, cstr
from webnotes.model.doc import make_autoname
from webnotes import msgprint, _
sql = web... | Yellowen/Owrang | hr/doctype/employee/employee.py | Python | agpl-3.0 | 7,472 |
# vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Copyright 2014 Dave Jones <dave@waveform.org.uk>.
#
# This file is part of umansysprop.
#
# umansysprop 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 v... | loftytopping/UManSysProp_public | umansysprop/forms.py | Python | gpl-3.0 | 31,975 |
from itertools import groupby
import json
from receipts.models import Expense, Shop
from django.contrib.auth.decorators import login_required
from django.db.models import Sum
from django.views.decorators.csrf import csrf_exempt
from geopy.geocoders import GoogleV3
from tokenapi.decorators import token_required
from tok... | rolisz/receipt_budget | receipts/rest_receipts/views.py | Python | bsd-3-clause | 3,419 |
#
# OpenUpgrade documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 30 10:38:00 2011.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module import... | OCA/OpenUpgrade | docsource/conf.py | Python | agpl-3.0 | 5,996 |
from rv import (probability, expectation, density, where, given, pspace, cdf,
sample, sample_iter, random_symbols, independent, dependent)
from sympy import sqrt
__all__ = ['P', 'E', 'density', 'where', 'given', 'sample', 'cdf', 'pspace',
'sample_iter', 'variance', 'std', 'skewness', 'covariance', 'dep... | ichuang/sympy | sympy/stats/rv_interface.py | Python | bsd-3-clause | 2,337 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | HBEE/odoo-addons | sale_restrict_partners/__openerp__.py | Python | agpl-3.0 | 1,762 |
from dreaml.dataframe.transform import ContinuousTransform
from time import sleep
import numpy as np
class Metrics(ContinuousTransform):
""" Computes the given metrics
"""
def __init__(self,metrics_list,*args,**kwargs):
self.metrics_names = kwargs.pop('metrics_names',\
... | locuslab/dreaml | dreaml/transformations/metrics.py | Python | apache-2.0 | 1,250 |
# -*- coding: utf-8 -*-
"""add impersonate_user to dbs
Revision ID: a9c47e2c1547
Revises: ca69c70ec99b
Create Date: 2017-08-31 17:35:58.230723
"""
# revision identifiers, used by Alembic.
revision = 'a9c47e2c1547'
down_revision = 'ca69c70ec99b'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.... | dmigo/incubator-superset | superset/migrations/versions/a9c47e2c1547_add_impersonate_user_to_dbs.py | Python | apache-2.0 | 463 |
#!/usr/bin/python3
# requirements: partition /dev/sdc1 with ext4
from storage import *
from storageitu import *
set_logger(get_logfile_logger())
environment = Environment(False)
storage = Storage(environment)
storage.probe()
staging = storage.get_staging()
print(staging)
sdc1 = BlkDevice.find_by_name(staging,... | openSUSE/libstorage-bgl-eval | integration-tests/filesystems/set-label.py | Python | lgpl-2.1 | 446 |
#!/usr/bin/python
import os, sys, signal, random
from datetime import datetime, timedelta
VLC_POOL_SIZE = 10 #number of vlc client to keep open
SPAWN_TIMER = 5 #number of seconds between vlc spawn
MAX_VLC_LIFE_TIME = 60 #max life time in seconds of a vlc client
VLC_COMMAND = '/usr/bin/vlc'
class Vlc(object):
def __i... | lscube/feng | contrib/feng_destroyer.py | Python | lgpl-2.1 | 2,136 |
from argparse import ArgumentParser
from typing import Any
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = """Send some stats to statsd."""
def add_arguments(self, parser: ArgumentParser) -> None:
parser.add_argument('operation',... | tommyip/zulip | zerver/management/commands/send_stats.py | Python | apache-2.0 | 940 |
"""
This module contains configuration settings via waffle flags
for the Video Pipeline app.
"""
from openedx.core.djangoapps.waffle_utils import WaffleFlagNamespace, CourseWaffleFlag
# Videos Namespace
WAFFLE_NAMESPACE = 'videos'
# Waffle flag telling whether youtube is deprecated.
DEPRECATE_YOUTUBE = 'deprecate_you... | ahmedaljazzar/edx-platform | openedx/core/djangoapps/video_pipeline/config/waffle.py | Python | agpl-3.0 | 681 |
import asyncio
import aioredis
async def main():
redis = aioredis.from_url("redis://localhost")
await redis.delete("foo", "bar")
async with redis.pipeline(transaction=True) as pipe:
res = await pipe.incr("foo").incr("bar").execute()
print(res)
if __name__ == "__main__":
asyncio.run(main... | aio-libs/aioredis | docs/examples/transaction.py | Python | mit | 324 |
from __future__ import division
import numpy as np
import utils
import pdb
lammy = 0.1
verbose = 1
maxEvals = 10000
X = 0
y = 0
iteration = 1
alpha = 1e-2
d = 0
hist_grad = 0
def init(dataset):
global X
X = utils.load_dataset(dataset)['X']
global y
y = utils.load_dataset(dataset)['y']
global d
... | DistributedML/TorML | ML/code/linear_model.py | Python | mit | 2,805 |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Script to create Chrome Installer archive.
This script is used to create an archive of all the files required for a
Chrome ... | cvsuser-chromium/chromium | chrome/tools/build/win/create_installer_archive.py | Python | bsd-3-clause | 26,354 |
"""
Load multiple pp diagnostic files, aggregate by year, day etc, calcualte mean, sum etc and pickle
"""
import os, sys
import datetime
import iris
import iris.unit as unit
diag = '3217'
cube_name='surface_upward_sensible_heat_flux'
experiment_ids = ['djzns', 'djznq', 'djzny', 'djznw', 'dkhgu', 'dkjxq', 'dklyu', '... | peterwilletts24/Monsoon-Python-Scripts | templates/pp_load_mean.py | Python | mit | 2,033 |
"""
Field Types
Spiders extracts items of a given type. These item types are defined by a
schema, which specifies the type of each field in the item. This module
contains FieldProcessor implementations, which are the classes responsible for
custom processing of these types.
We keep the types of scrapers supported fl... | flip111/portia | slybot/slybot/fieldtypes/__init__.py | Python | bsd-3-clause | 1,838 |
""" Maintains current state and also the last acked state """
from queue import Queue
import numpy as np
class State:
"""initiallize the current state map and per region queue"""
def __init__(self, regionSize):
self.currentState = dict()
self.regionQueues = dict()
self.lastAckedRegions = dict()
self.lastA... | netsecIITK/moVi | movi/image/state.py | Python | apache-2.0 | 1,593 |
from twisted.trial.unittest import SkipTest, TestCase
from pyutil.jsonutil import decoder
from pyutil.jsonutil import encoder
class TestSpeedups(TestCase):
def test_scanstring(self):
if not encoder.c_encode_basestring_ascii:
raise SkipTest("no C extension speedups available to test")
s... | heathseals/CouchPotatoServer | libs/pyutil/test/current/json_tests/test_speedups.py | Python | gpl-3.0 | 835 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Google Inc. All Rights Reserved.
#
# Authors:
# Arkadiusz Socała <as277575@mimuw.edu.pl>
# Michael Cohen <scudette@google.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the... | dsweet04/rekall | tools/layout_expert/layout_expert/preprocessing_visitors/preprocessing_visitor_test.py | Python | gpl-2.0 | 2,498 |
#!/usr/bin/env python
import os
import MySQLdb
import sys
import re
import wikipedia
from bs4 import BeautifulSoup
PROJECT_DIR = os.path.abspath(
os.path.join(os.path.dirname(os.path.abspath(__file__)),
'..'))
DATA_DIR = os.path.abspath(
os.path.join(PROJECT_DIR, '..', 'data'))
sys.path.insert(0, PR... | luster/is-pepsi-okay | IsPepsiOkay/database/populate.py | Python | mit | 12,965 |
# Copyright (c) 2016,2017 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
===========================
Upper Air Sounding Tutorial
===========================
Upper air analysis is a staple of many synoptic and mesoscale analysis
problems. In this... | metpy/MetPy | v0.8/_downloads/upperair_soundings.py | Python | bsd-3-clause | 7,536 |
# Copyright 2018 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... | tensorflow/tpu | models/hyperparameters/common_hparams_flags.py | Python | apache-2.0 | 4,334 |
"""
Given two witness sets for two pure dimensional solution sets,
a diagonal homotopy computes a sets of witness sets for all components
of the intersection of the two pure dimensional solution sets.
"""
def top_diagonal_dimension(kdm, dim1, dim2):
r"""
Returns the number of slack variables at the top in the ... | janverschelde/PHCpack | src/Python/PHCpy2/phcpy/diagonal.py | Python | gpl-3.0 | 26,573 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks
# 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... | psiwczak/openstack | nova/network/quantum/quantum_connection.py | Python | apache-2.0 | 6,150 |
import logging
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn.naive_bayes import MultinomialNB
from brain4k.transforms import PipelineStage
class NaiveBayes(PipelineStage):
name = "org.scikit-learn.naive_bayes.MultinomialNB"
def train(self):
logging.debug(
... | wkal/brain4k | brain4k/transforms/sklearn/__init__.py | Python | apache-2.0 | 4,927 |
import ubjson
with open("/tmp/data.json", "rb") as f:
serialized = f.read()
data = ubjson.loadb(serialized)
print(data)
assert(data["name"] == "python-ubjson")
assert(data["versions"] == ["1", "2"])
assert(data["group"]["is_a_package"] is True)
assert(data["group"]["value"] == 42)
| masahir0y/buildroot-yamada | support/testing/tests/package/sample_python_ubjson_dec.py | Python | gpl-2.0 | 287 |
def _pdbrc_init():
# Save history across sessions
import readline
histfile = ".pdb-pyhist"
try:
readline.read_history_file(histfile)
except IOError:
pass
import atexit
atexit.register(readline.write_history_file, histfile)
readline.set_history_length(500)
_pdbrc_init()... | lpenz/ansible-playbooks | roles/user-term/files/dotfiles/pdb_rc.py | Python | apache-2.0 | 337 |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | nrwahl2/ansible | lib/ansible/module_utils/basic.py | Python | gpl-3.0 | 112,326 |
#!/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 (the
"License")... | arenadata/ambari | ambari-server/src/test/python/stacks/2.1/STORM/test_storm_base.py | Python | apache-2.0 | 6,733 |
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# wger W... | rolandgeider/wger | wger/manager/tests/test_schedule.py | Python | agpl-3.0 | 23,910 |
# Copyright 2013 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, s... | nebril/fuel-web | fuelmenu/fuelmenu/common/__init__.py | Python | apache-2.0 | 574 |
# coding=utf-8
# Copyright 2014 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)
from pants.backend.j... | dbentley/pants | src/python/pants/backend/jvm/targets/java_tests.py | Python | apache-2.0 | 2,769 |
#!/usr/bin/env python3
#
# Reverse : Generate an indented asm code (pseudo-C) with colored syntax.
# Copyright (C) 2015 Joel
#
# 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... | dnet/reverse | lib/fileformat/pe.py | Python | gpl-3.0 | 9,239 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py | Python | mit | 24,898 |
import datetime
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.contrib.messages.views import SuccessMessageMixin
from django.shortcuts import render, get_object_or_404, redirect
from django.views.generic import ListView, DetailView
from django.views.generic.edit import CreateView, UpdateVie... | chrisbay/library.kdhx.org | albums/views.py | Python | gpl-3.0 | 7,792 |
import multiprocessing
import psutil
import configparser
import os
import sys
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '../../main/python/')))
from rlbot.setup_manager import SetupManager
from rlbot.parsing.rlbot_config_parser import create_bot_config_layout
from rlbot.utils.logging... | drssoccer55/RLBot | src/test/python/integration_test/gather_data.py | Python | mit | 2,388 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-03-31 19:00
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('base', '0001_initial'),
]
operations = [
m... | cmjatai/cmj | sapl/base/migrations/0002_auto_20170331_1900.py | Python | gpl-3.0 | 1,991 |
#!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... | jacky-young/crosswalk-test-suite | stability/stability-embeddingapi-android-tests/inst.em.py | Python | bsd-3-clause | 2,906 |
# ISO-8601:
# http://www.cl.cam.ac.uk/~mgk25/iso-time.html
import calendar, datetime, re, time
def iso_utc_date(now=None, t=time.time):
if now is None:
now = t()
return datetime.datetime.utcfromtimestamp(now).isoformat()[:10]
def iso_utc(now=None, sep='_', t=time.time):
if now is None:
no... | gsb-eng/tahoe-lafs | src/allmydata/util/time_format.py | Python | gpl-2.0 | 2,209 |
#
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | xkollar/spacewalk | client/tools/osad/src/osad_client.py | Python | gpl-2.0 | 10,084 |
# Licensed to the StackStorm, Inc ('StackStorm') 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
# (the "License"); you may not use th... | alfasin/st2 | st2api/st2api/controllers/v1/ruletypes.py | Python | apache-2.0 | 2,613 |
import re
from fabric.api import env, run, hide, task
from envassert import detect, file, port, process, service, user
from hot.utils.test import get_artifacts
def magento_is_responding():
with hide('running', 'stdout'):
wget_cmd = ("wget --quiet --output-document - "
"--header='Host: ... | chrishultin/magento-small | test/fabric/magento.py | Python | apache-2.0 | 2,185 |
#coding:utf8
from __future__ import print_function
def generate_label(segments):
segments = segments.rstrip('\n')
words = [word.decode('utf8') for word in segments.split()]
label = ''
for word in words:
if len(word) == 1:
label += 'S'
else:
y = ['M' for i in range(len(word))]
y[0] = 'B'
y[-1] = 'E'
... | 3rduncle/knowledgeflow | knowledgeflow/utility/ws_utils.py | Python | mit | 1,492 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_generated_aiplatform_v1_dataset_service_list_datasets_async.py | Python | apache-2.0 | 1,540 |
# 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 versi... | marscher/PyEMMA | pyemma/coordinates/tests/test_datainmemory.py | Python | lgpl-3.0 | 11,289 |
# ===========================================================================
# eXe
# Copyright 2004-2005, University of Auckland
#
# 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... | kohnle-lernmodule/exeLearningPlus1_04 | exe/xului/propertiespage.py | Python | gpl-2.0 | 9,245 |
# -*- coding: utf-8 -*-
"""
SwarmOps.utils.tool
~~~~~~~~~~~~~~
Common function.
:copyright: (c) 2018 by staugur.
:license: MIT, see LICENSE for more details.
"""
import re, hashlib, datetime, time, random, hmac
from uuid import uuid4
from log import Logger
from base64 import b32encode
from config... | staugur/SwarmOps | src/utils/tool.py | Python | bsd-3-clause | 5,340 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.4.1)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x01\xf1\
\x00\
\x00\x09\x00\x78\x9c\xdd\x96\x51\x6f\x9b\x30\x10\xc7\xdf\xfb\x29\
\x3c\x1e\x9a\x4... | testmana2/test | Helpviewer/Bookmarks/DefaultBookmarks_rc.py | Python | gpl-3.0 | 2,920 |
from django import forms
from .models import PO, Line_PO, Cost_Center
from vendor.models import Supplier, Publisher
from quote.models import Quote
from django.contrib.auth.models import User
class POForm(forms.Form):
supplier = forms.ModelChoiceField(queryset=Supplier.objects.all())
blanket = forms.BooleanFi... | inspectorbean/spat | po/forms.py | Python | gpl-3.0 | 1,543 |
from .scheduler import main
__all__ = [
'main',
]
| mikemill/rq_retry_scheduler | rq_retry_scheduler/cli/__init__.py | Python | mit | 56 |
# -*- coding: utf-8 -*-
import sys
from itertools import chain
from django import forms
from django.conf import settings
from django.db.models.query import QuerySet
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from django.utils.html import conditional_escape, escape
f... | MathieuDuponchelle/django-sortedm2m | sortedm2m/forms.py | Python | bsd-3-clause | 4,713 |
from __future__ import unicode_literals
import datetime
import re
from django.db import models
from django_extensions.db import fields as djefields
class QuestionSet(models.Model):
title = models.CharField(max_length=255)
slug = djefields.AutoSlugField(populate_from='title', overwrite=True)
def __unicode... | koebbe/homeworks | qa/models.py | Python | mit | 6,756 |
import asyncio
import enum
import logging
import concurrent.futures
logger = logging.getLogger("cloudbot")
@enum.unique
class EventType(enum.Enum):
message = 0
action = 1
# TODO: Do we actually want to have a 'notice' event type? Should the NOTICE command be a 'message' type?
notice = 2
join = 3
... | jkramarz/zuombot | cloudbot/event.py | Python | gpl-3.0 | 15,299 |
İsim =input("İsim Giriniz:")
if İsim == ("bora"):
print ("Doğrudur")
elif İsim == ("muge"):
print ("Doğrudur")
else:
print ("Diğerleri Yanlıştır")
| boraklavun/python- | bora_if.py | Python | gpl-3.0 | 174 |
#!/usr/bin/env python
#
# Merge multiple JavaScript source code files into one.
#
# Usage:
# This script requires source files to have dependencies specified in them.
#
# Dependencies are specified with a comment of the form:
#
# // @requires <file path>
#
# e.g.
#
# // @requires Geo/DataSource.js
#
# This scri... | d-nox/iHummeln | iHummeln/www/js/OpenLayers/tools/mergejs.py | Python | mit | 8,901 |
# The Hazard Library
# Copyright (C) 2014, GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# T... | mmpagani/oq-hazardlib | openquake/hazardlib/tests/gsim/convertito_2012_test.py | Python | agpl-3.0 | 1,218 |
# 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
# distributed unde... | tengqm/senlin-container | senlin/policies/lb_policy.py | Python | apache-2.0 | 18,833 |
import logging
import socket
import datetime
import sys
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from celery.task import Task
from celery.registry import tasks
from app.torrents.models import Torrent, Check
from app.trackers.helpers import *
from... | viswimmer1/PythonGenerator | data/python_files/32993071/tasks.py | Python | gpl-2.0 | 2,160 |
"""
.. _tutorial-nnvm-quick-start:
Quick Start Tutorial for Compiling Deep Learning Models
=======================================================
**Author**: `Yao Wang <https://github.com/kevinthesun>`_
This example shows how to build a neural network with NNVM python frontend and
generate runtime library for Nvidia... | mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/tutorials/nnvm_quick_start.py | Python | apache-2.0 | 5,248 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013, 2014 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... | MSusik/invenio | invenio/legacy/bibexport/registry.py | Python | gpl-2.0 | 1,408 |
import requests
import re
from pyvirtualdisplay import Display
from selenium import webdriver
BASE_URL = "https://www.google.es"
SEARCH_URL = "http://www.google.hr/searchbyimage/upload"
FILE_PATH = "/home/emilio/emeraldmorainelake.jpg"
SEARCH_REGEX = re.compile("(\/search\?tbs\=simg.*?)\"")
IMAGE_FULL_REGEX = re.comp... | emilioagonzalez/TFM | script/rev.py | Python | mit | 1,714 |
#!/usr/bin/env python2.6
import cgi
import time
import os
import subprocess
"""
problem: cgi scripts run as user 'nobody'
how can we handle signaling the daemon ?
"""
form = cgi.FieldStorage()
print "Content-Type: text/html" # HTML is following
print
print "<TITLE>CGI script output</TITLE>"
print "Hey... | danduggan/hltd | cgi/harakiri_cgi.py | Python | lgpl-3.0 | 593 |
# -*- coding: utf-8 -*-
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='epicduels',
version='0.1',
description='Python Version of Epic Duels',
author='Taz E... | aelkikhia/pyduels27 | setup.py | Python | apache-2.0 | 637 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-04-13 15:26
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 = [
('produc... | martinstastny/django-simplestore | simplestore/cart/migrations/0001_initial.py | Python | mit | 2,204 |
#!/usr/bin/env python
"""
Static Analyzer qualification infrastructure: adding a new project to
the Repository Directory.
Add a new project for testing: build it and add to the Project Map file.
Assumes it's being run from the Repository Directory.
The project directory should be added inside the Repository D... | Bootz/multicore-opimization | llvm/tools/clang/utils/analyzer/SATestAdd.py | Python | gpl-3.0 | 2,950 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'HistoricalUprawnienie.druzyna'
db.add_column('registry_historicaluprawnienie', 'druzyna',
... | wnt-zhp/hufce | registry/migrations/0003_auto__add_field_historicaluprawnienie_druzyna__add_field_uprawnienie_d.py | Python | gpl-3.0 | 15,550 |
# Copyright (c) 2012 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.
from __future__ import print_function
import copy
import json_parse
def DeleteNodes(item, delete_key=None, matcher=None):
"""Deletes certain nodes ... | endlessm/chromium-browser | tools/json_schema_compiler/json_schema.py | Python | bsd-3-clause | 1,837 |
#!/usr/bin/env python
#
#author: Hailey Bureau
#latest edits: 15 April 2014
#
import pprint, pickle
filename=raw_input('Hi! What file would you like to unpickle? (Example: 01-wc.pkl) ')#asks for the filename
pkl_file = open(filename, 'rb')#plugs in user input and "rb"= read only
data1 = pickle.load(pkl_file)#load th... | haileybureau/analysis_scripts | viewpick.py | Python | mit | 464 |
##
# Copyright (c) 2007-2014 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | trevor/calendarserver | twistedcaldav/util.py | Python | apache-2.0 | 14,893 |
import MySQLdb
import MySQLdb.cursors
from airflow.hooks.dbapi_hook import DbApiHook
class MySqlHook(DbApiHook):
'''
Interact with MySQL.
You can specify charset in the extra field of your connection
as ``{"charset": "utf8"}``. Also you can choose cursor as
``{"cursor": "SSCursor"}``. Refer to th... | jason-z-hang/airflow | airflow/hooks/mysql_hook.py | Python | apache-2.0 | 2,281 |
##
# Copyright 2012-2019 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | gppezzi/easybuild-framework | easybuild/tools/github.py | Python | gpl-2.0 | 85,434 |
# Copyright 2019 Open Source Robotics Foundation, 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... | ros2/launch | launch_pytest/test/launch_pytest/examples/executables/talker.py | Python | apache-2.0 | 1,381 |
# This file is part of Booktype.
# Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org>
#
# Booktype is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | btat/Booktype | lib/booki/editor/templatetags/booki_tags.py | Python | agpl-3.0 | 7,663 |
#Copyright 2011 Dan Klinedinst
#
#This file is part of Gibson.
#
#Gibson 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 any
#later version.
#Gibson is distributed in the hop... | robscetury/gibson | lib/gibson/config.py | Python | gpl-3.0 | 3,065 |
#-*- coding: UTF-8 -*-
'''
Created on Dec 19, 2017
@Author: hjp
Description: Extracting EnWikipedia files into single text.
'''
import time
import datetime
from gensim.corpora import WikiCorpus
def enwiki(srcPath, tarPath):
index = 0
space = " "
output = open(tarPath, 'w')
wiki = WikiCor... | hjpwhu/Python | src/hjp.edu.nlp.data.wiki/main.py | Python | mit | 915 |
# This file is part of masbpy.
# masbpy 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.
# masbpy is distributed in the hope that it w... | tudelft3d/masbpy | masbpy/io_las.py | Python | gpl-3.0 | 1,018 |
from authentication.models import db
class Build:
def get_build_data(self, build):
query = """
SELECT
*
FROM `todo_list` as `tl`
LEFT JOIN
`issues` as `i`
ON
`tl`.`issue_id` = `i`.`i... | ventsi34/support_forum | app/authentication/services/build.py | Python | gpl-2.0 | 1,681 |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 VMware, 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/lic... | devoid/nova | nova/virt/vmwareapi/host.py | Python | apache-2.0 | 8,021 |
__author__ = 'jeffye'
# https://github.com/tensorflow/fold/blob/master/tensorflow_fold/g3doc/quick.ipynb
# fold block
# https://github.com/tensorflow/fold/blob/master/tensorflow_fold/g3doc/blocks.md#using-tensorflow-tensors
# boilerplate
import random
import tensorflow_learning as tf
sess = tf.InteractiveSession()
im... | jeffzhengye/pylearn | tensorflow_learning/tensor_fold.py | Python | unlicense | 958 |
from chill import *
source('mm.c')
procedure('mm')
#format: rose
loop(0)
known('ambn > 0')
known('an > 0')
known('bm > 0')
permute([3,1,2])
print_code()
| ztuowen/chill-dev | Manual/tests/test_permute.py | Python | gpl-3.0 | 155 |
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.pyplot import pie, axis
import sys #check Python vers num
from scipy import stats
import statsmodels.api as sm
import seaborn as sns
sns.set_style("whitegrid")
sns.set_context("notebook")
sns.set_palette('Set2', 1... | matthapenney/Some-IGN-review-analysis | ignreview/igndata.py | Python | mit | 8,523 |
from django.http import HttpResponse
from django.shortcuts import render
from collections import OrderedDict
import yaml, copy
from .utils.yaml_include_loader import Loader
try:
# This import fails for django 1.9
from django.views import View
except Exception as error:
print("failed to [from django.views... | jmons/ramlwrap | ramlwrap/views.py | Python | mit | 12,345 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.