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 |
|---|---|---|---|---|---|
# Copyright (c) 2014 Kontron Europe GmbH
#
# 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 2.1 of the License, or (at your option) any later version.
#
# This library is... | kontron/python-hpi | examples/resources.py | Python | lgpl-2.1 | 3,793 |
import sys, thread, time, traceback, Queue, os
import pymedia
import pymedia.muxer as muxer
import pymedia.audio.acodec as acodec
import pymedia.video.vcodec as vcodec
import pymedia.audio.sound as sound
if os.environ.has_key( 'PYCAR_DISPLAY' ) and os.environ[ 'PYCAR_DISPLAY' ]== 'directfb':
import pydfb as pygame... | pymedia/pymedia | examples/vplayer_threads.py | Python | lgpl-2.1 | 15,017 |
#!/usr/bin/python
"""Test of sayAll."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
#sequence.append(WaitForDocLoad())
sequence.append(PauseAction(5000))
sequence.append(KeyComboAction("<Shift>Tab"))
sequence.append(KeyComboAction("<Shift>Tab"))
sequence.append(KeyComboAction("<Control>H... | GNOME/orca | test/keystrokes/firefox/say_all_bugzilla_search.py | Python | lgpl-2.1 | 9,712 |
# This program is free software; you can redistribute it and/or modify
# 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 2.1 of the License, or (at your option) any later ... | mlba-team/open-lighting | python/ola/rpc/StreamRpcChannel.py | Python | lgpl-2.1 | 11,310 |
# GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# 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 2.1
# of the License, or (at you... | manojklm/pywinauto-x64 | pywinauto/controls/__init__.py | Python | lgpl-2.1 | 2,175 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
TUNE_VARIANTS = (
'none',
'cp2k-lmax-4',
'cp2k-lmax-5',
'cp2k-lmax-6',
... | rspavel/spack | var/spack/repos/builtin/packages/libint/package.py | Python | lgpl-2.1 | 7,364 |
from setuptools import setup, find_packages
with open("README.rst") as f:
description_text = f.read()
with open("LICENSE.txt") as f:
license_text = f.read()
setup(
name="gnodeclient",
version="0.4.0",
author="A. Stoewer, A. Sobolev",
author_email="adrian.stoewer@rz.ifi.lmu.de",
packages=f... | G-Node/python-gnode-client | setup.py | Python | lgpl-2.1 | 1,334 |
# -*- coding: utf-8 -*-
#
# PySPED - Python libraries to deal with Brazil's SPED Project
#
# Copyright (C) 2010-2012
# Copyright (C) Aristides Caldeira <aristides.caldeira at tauga.com.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lice... | aricaldeira/PySPED | pysped/nfe/leiaute/nfe_310.py | Python | lgpl-2.1 | 81,201 |
# typeclasses, an educational implementation of Haskell-style type
# classes, in Python
#
# Copyright (C) 2010 Nicolas Trangez <eikke eikke 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 Fou... | NicolasT/typeclasses | demo/eq.py | Python | lgpl-2.1 | 1,630 |
import threading
import stbt_core as stbt
class TruthyFrameObject(stbt.FrameObject):
"""
The simplest possible FrameObject
>>> frame = _load_frame("with-dialog")
>>> bool(TruthyFrameObject(frame))
True
>>> TruthyFrameObject(frame)
TruthyFrameObject(is_visible=True)
"""
@property
... | stb-tester/stb-tester | tests/test_frameobject.py | Python | lgpl-2.1 | 11,807 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This file contains everything needed to interface with JUnit"""
#####
# pyCheck
#
# Copyright 2012, erebos42 (https://github.com/erebos42/miscScripts)
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public... | m-wichmann/pyCheck | src/ifJUnit.py | Python | lgpl-3.0 | 1,199 |
import smtplib
import email.mime.text
mail_host = "" # "smtp.xxx.com"
mail_user = "" # "xxx@xxx.com"
mail_pass = "" # "xxx"
mail_postfix = "" # "xxx.com"
mailto_list = [""] # ["xxx@xxx.com"]
def send_mail(to_list, sub, content):
me = "hello"+"<"+mail_user+"@"+mail_postfix+">"
msg = email.mim... | followcat/predator | tools/mail.py | Python | lgpl-3.0 | 884 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A simulated world featuring 36 Casus and 36 bees.
"""
from assisipy import sim
from math import pi, sin, cos
from random import random
import threading
if __name__ == '__main__':
simctrl = sim.Control()
# Parameters of the CASU array.
casu_rows = 6
... | assisi/assisipy-examples | bees_in_casu_array/spawn_bees_in_casu_array.py | Python | lgpl-3.0 | 1,170 |
# -*- coding: utf-8 -*-
"""
pyxs
~~~~
Pure Python bindings for communicating with XenStore.
:copyright: (c) 2011 by Selectel, see AUTHORS for more details.
:license: LGPL, see LICENSE for more details.
"""
__all__ = ["Router", "Client", "Monitor",
"PyXSError", "ConnectionError", "Unexp... | selectel/pyxs | pyxs/__init__.py | Python | lgpl-3.0 | 966 |
from __future__ import print_function
#from collections import defaultdict
#from functools import reduce
from six import iteritems, string_types, PY2
#from six.moves import zip, range
import numpy as np
from numpy import (array, unique, arange, searchsorted,
setdiff1d, intersect1d, asarray)
from ... | saullocastro/pyNastran | pyNastran/bdf/mesh_utils/bdf_equivalence.py | Python | lgpl-3.0 | 12,362 |
#!/usr/bin/env python
""" Timeseries generator module """
from collections import Counter
import numpy
from supremm.plugin import Plugin
from supremm.subsample import TimeseriesAccumulator
from supremm.errors import ProcessingError
class ArmPowerUsageTimeseries(Plugin):
""" Generate the Power usage as a timeseri... | ubccr/supremm | src/supremm/plugins/ArmPowerUsageTimeseries.py | Python | lgpl-3.0 | 4,476 |
from pycp2k.inputsection import InputSection
class _rdf1(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self.Maxr = None
self.Nbin = None
self.Centers_file_name = None
self._name = "RDF"
self._keywords = {'Cente... | SINGROUP/pycp2k | pycp2k/classes/_rdf1.py | Python | lgpl-3.0 | 439 |
# Copyright 2013, Michael H. Goldwasser
#
# Developed for use with the book:
#
# Data Structures and Algorithms in Python
# Michael T. Goodrich, Roberto Tamassia, and Michael H. Goldwasser
# John Wiley & Sons, 2013
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | consultit/Ely | ely/direct/data_structures_and_algorithms/ch02/sequence_iterator.py | Python | lgpl-3.0 | 1,665 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2018 Célande Adrien
#
# This file is part of a weboob module.
#
# This weboob module 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 ... | vicnet/weboob | modules/bp/pages/subscription.py | Python | lgpl-3.0 | 6,761 |
from pycp2k.inputsection import InputSection
from ._each406 import _each406
class _restart14(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self.Add_last = None
self.Common_iteration_levels = None
self.Filename = None
s... | SINGROUP/pycp2k | pycp2k/classes/_restart14.py | Python | lgpl-3.0 | 665 |
"""Unit tests for FrameGetLocalTimeConfirmation."""
import unittest
from datetime import datetime, timezone
from pyvlx.api.frame_creation import frame_from_raw
from pyvlx.api.frames import FrameGetLocalTimeConfirmation
class TestFrameGetLocalTimeConfirmation(unittest.TestCase):
"""Test class for FrameGetLocalTim... | Julius2342/pyvlx | test/frame_get_local_time_cfm_test.py | Python | lgpl-3.0 | 1,743 |
from feedly.verbs import register
from feedly.verbs.base import Verb
class Pin(Verb):
id = 5
infinitive = 'pin'
past_tense = 'pinned'
register(Pin)
| azurefang/flask-zheye | app/main/verbs.py | Python | lgpl-3.0 | 163 |
def test_abs(a):
print "abs(" + str(a) + ") = [" + str(abs(a)) + "]"
test_abs(10)
test_abs(10.0)
test_abs(-10)
test_abs(-10.2)
test_abs(long(-10))
test_abs(0)
test_abs(0.0)
test_abs(-0)
test_abs(-0.0)
| fengbohello/practice | python/func/built-in/abs.py | Python | lgpl-3.0 | 207 |
# coding: utf8
from __future__ import unicode_literals
import unittest
import dotdot
from pubs.query import (AuthorFilter, CitekeyFilter, FieldFilter,
YearFilter, _query_block_to_filter,
get_paper_filter, InvalidQuery)
from pubs.paper import Paper
import fixtures
doe... | pubs/pubs | tests/test_queries.py | Python | lgpl-3.0 | 9,022 |
#!/usr/bin/env python3
"""
This module runs all the tests of the auxi package at once.
"""
import unittest
from auxi.core.objects_test import ObjectUnitTester
from auxi.core.objects_test import NamedObjectUnitTester
from auxi.core.time_test import ClockUnitTester
from auxi.tools.chemistry.stoichiometry_test import S... | christoffkok/auxi.0 | src/tests.py | Python | lgpl-3.0 | 2,865 |
# 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... | fabian-paul/PyEMMA | pyemma/coordinates/clustering/regspace.py | Python | lgpl-3.0 | 6,283 |
r"""
Packaging setup file for Pypi and installation via pip.
Notes
-----
#. Written by David C. Stauffer in January 2019.
"""
#%% Import
import os
from setuptools import setup
#%% Support functions - readme
def readme():
r"""Opens the README.rst file for additional descriptions."""
filename = os.path.join(... | DStauffman/dstauffman2 | setup.py | Python | lgpl-3.0 | 1,638 |
from collections import deque
class H2O:
def __init__(self):
self.h_queue = deque()
self.o_queue = deque()
def hydrogen(self, releaseHydrogen: "Callable[[], None]") -> None:
# releaseHydrogen() outputs "H". Do not change or remove this line.
self.h_queue.append(releaseHydroge... | chengzhoukun/LeetCode | 1117. Building H2O/solution.py | Python | lgpl-3.0 | 742 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | prezi/prezi-suds | suds/client.py | Python | lgpl-3.0 | 28,017 |
## Ragnarok Engine copyright 2010 Clinton Myers
## 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 of the License, or
## (at your option) any later ver... | Fireforge/RagnarokPy3.2 | Ragnarok.py | Python | lgpl-3.0 | 116,100 |
"""Command line tool for creating audioMD metadata."""
from __future__ import unicode_literals, print_function
import os
import sys
import click
import six
import audiomd
from siptools.mdcreator import MetsSectionCreator
from siptools.utils import fix_missing_metadata, scrape_file
click.disable_unicode_literals_war... | Digital-Preservation-Finland/dpres-siptools | siptools/scripts/create_audiomd.py | Python | lgpl-3.0 | 6,706 |
from bitmovin.resources.models import AbstractModel
from bitmovin.resources import AbstractNameDescriptionResource
from bitmovin.errors import InvalidTypeError
from bitmovin.utils import Serializable
from .encoding_output import EncodingOutput
class Sprite(AbstractNameDescriptionResource, AbstractModel, Serializable)... | bitmovin/bitmovin-python | bitmovin/resources/models/encodings/sprite.py | Python | unlicense | 2,500 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = 'pyramid_torque_engine',
version = '0.5.4',
description = 'Pyramid and nTorque based dual queue work engine system.',
author = 'James Arthur',
author_email = 'username: thruflo, domain: gmail.co... | thruflo/pyramid_torque_engine | setup.py | Python | unlicense | 1,368 |
#!/usr/bin/env python
import sys, time, random
# print >> sys.stderr, sys.argv
n = int(sys.argv[1])
sys.stdout.write(str(n*n))
sys.stdout.flush()
sys.exit(0) | jasonzliang/dcs | test_tasks/square.py | Python | unlicense | 158 |
import unittest
from typing import List
import sortedcontainers
import utils
class TweetCounts:
def __init__(self):
self.tweets = {}
def recordTweet(self, tweetName: str, time: int) -> None:
if tweetName in self.tweets:
times = self.tweets[tweetName]
else:
s... | chrisxue815/leetcode_python | problems/test_1348.py | Python | unlicense | 1,378 |
#
#crawl-ref/source/job-data.h
#
jobs={
"Abyssal Knight" : "AK",
"Air Elementalist" : "AE",
"Arcane Marksman" : "AM",
"Artificer" : "Ar",
"Assassin" : "As",
"Berserker" : "Be",
"Chaos Knight" : "CK",
"Conjurer" : "Cj",
"Earth Elementalist" : "EE",
"Enchanter" : "En",
"Fighter" : "Fi",
"Fire Elementalist" : "FE",
"Gla... | oschwab/dcss_stats | dcss_stats/core/dcss_data.py | Python | unlicense | 2,852 |
#! /usr/bin/env python
import argparse
import operator
import os
import sys
from collections import namedtuple
from functools import lru_cache
from functools import reduce
from pathlib import Path
from typing import Any
from typing import Dict
from typing import List
import addict
import arrow
import googleapiclient.e... | ipwnponies/youtube-sort-playlist | playlist_updates.py | Python | unlicense | 13,622 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 17 14:50:59 2012
@author: JHarston
"""
import os
os.environ['DJANGO_SETTINGS_MODULE']='settings'
from django import forms
from django.db import models
class genericInp(forms.Form):
chemical_name = forms.CharField(widget=forms.Textarea (attrs={'cols': 20, 'rows': 2}))... | puruckertom/poptox | poptox/generic/generic_parameters.py | Python | unlicense | 406 |
from time import sleep
import unittest
from bitcodin import create_input, get_input, get_async_input_status
from bitcodin import delete_input
from bitcodin import S3Input
from bitcodin.test.settings import s3_input_config
from bitcodin.test.bitcodin_test_case import BitcodinTestCase
class CreateS3InputTestCase(Bitco... | bitmovin/bitcodin-python | bitcodin/test/input/testcase_create_input_async.py | Python | unlicense | 1,634 |
#
# crowbar - a geometry manipulation program
# Copyright (C) 2020 Dylan Scott Grafmyre
#
# 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, ... | thorsummoner/crowbar | crowbar/baseextension.py | Python | unlicense | 2,406 |
# -*- coding: utf-8 -*-
"""pathobject.py - A utility class for operating on pathnames."""
import codecs
import fnmatch
import glob
import hashlib
import os
import shutil
import sys
import warnings
__all__ = ["Path"]
__version__ = "0.0.1"
## Some functional utilities to save code later on.
def update_wrapper(wrapp... | zacharyvoase/pathobject | src/pathobject.py | Python | unlicense | 15,069 |
"""
E261
Include at least two spaces before inline comment
"""
| landscape-test/all-messages | messages/pep8/E261.py | Python | unlicense | 64 |
#!/usr/bin/python
import requests
import argparse
import subprocess
import time
import json
import signal
import sys
import os
AdminToken=''
BackupFolderPath='./backup'
CookieFilePath='cookies.txt'
SavedFilesDB='.slut-bak.json'
TeamInfoDb='.team-bak.json'
LsDb='.ls-bak.json'
UserDb='.user-bak.json'
TeamName=''
shoul... | jeremyletang/slut | slut.py | Python | unlicense | 9,623 |
from __future__ import print_function
import ttfw_idf
TASK_ITERATION_LIMIT = 10
TASK_ITERATION_POSTING = 'posting TASK_EVENTS:TASK_ITERATION_EVENT to {}, iteration {} out of ' + str(TASK_ITERATION_LIMIT)
TASK_ITERATION_HANDLING = 'handling TASK_EVENTS:TASK_ITERATION_EVENT from {}, iteration {}'
@ttfw_idf.idf_examp... | espressif/esp-idf | examples/system/esp_event/user_event_loops/example_test.py | Python | apache-2.0 | 1,311 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use th... | thomasem/nova | nova/virt/netutils.py | Python | apache-2.0 | 6,132 |
#!/usr/bin/python
# *****************************************************************************
#
# Copyright (c) 2016, EPAM 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
#
#... | epam/DLab | infrastructure-provisioning/src/general/scripts/os/jupyter_dataengine_create_configs.py | Python | apache-2.0 | 7,919 |
import json,os,shelve
import asyncio,sys
DATAFILENAME="data"
def set_user_id(new_id):
_local_data["user_id"]=new_id
def set_login_token(token):
_local_data["login_token"]=token
def load_data():
global _local_data
if(os.path.exists(os.path.join(get_current_path(),DATAFILENAME))):
with open(os.pa... | dandfmd/Linfilesync | utils.py | Python | apache-2.0 | 2,486 |
from Server_GitHub import application
if __name__ == "__main__":
while True:
try:
application.run()
except Exception as e:
print e
| facoy/facoy | FrontEnd/wsgi.py | Python | apache-2.0 | 176 |
#
# 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... | mahabs/nitro | nssrc/com/citrix/netscaler/nitro/resource/config/ns/nspbr_args.py | Python | apache-2.0 | 1,045 |
import sys
from _pydevd_bundle import pydevd_xml
from os.path import basename
import traceback
try:
from urllib import quote, quote_plus, unquote, unquote_plus
except:
from urllib.parse import quote, quote_plus, unquote, unquote_plus #@Reimport @UnresolvedImport
#==============================================... | da1z/intellij-community | python/helpers/pydev/_pydevd_bundle/pydevd_referrers.py | Python | apache-2.0 | 8,753 |
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | tensorflow/neural-structured-learning | research/gam/gam/trainer/trainer_classification_gcn.py | Python | apache-2.0 | 38,149 |
# Toil documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 25 12:37:16 2015.
#
# 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.
#
# All configuration values have ... | BD2KGenomics/slugflow | docs/conf.py | Python | apache-2.0 | 6,375 |
# coding=UTF-8
#
# Copyright 2016 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 ap... | googlei18n/glyphsLib | tests/builder/instances_test.py | Python | apache-2.0 | 3,713 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'NodeGroup'
db.create_table('muparse_nodegroup', (
('url', self.gf('django.... | leopoul/mupy | muparse/migrations/0001_initial.py | Python | apache-2.0 | 7,178 |
#local
from message import MessageHeader
from base import Struct, StructArray
#standard
from datetime import datetime
from ctypes import LittleEndianStructure, Union, c_uint32
from six import iteritems, raise_from
import inspect
import config
import sys
class Error(Exception): pass
class InvalidTimestampError(Error):... | TeePaps/estreamer | estreamer/eventrequest.py | Python | apache-2.0 | 5,410 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 SolidFire 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/l... | rickerc/cinder_audit | cinder/volume/drivers/solidfire.py | Python | apache-2.0 | 29,104 |
# Copyright 2014-2018 The PySCF Developers. 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 appl... | gkc1000/pyscf | examples/local_orb/pmloc.py | Python | apache-2.0 | 8,521 |
from cuttsum.sentsim import SentenceLatentVectorsResource
from cuttsum.summarizer.ap import APSummarizer, APSalienceSummarizer
from cuttsum.summarizer.baseline import HACSummarizer
import os
import pandas as pd
import numpy as np
from datetime import datetime, timedelta
from sklearn.metrics.pairwise import cosine_simil... | kedz/cuttsum | trec2014/python/cuttsum/summarizer/filters.py | Python | apache-2.0 | 26,439 |
#
# Copyright 2012 Red Hat, Inc
#
# Author: Eoghan Glynn <eglynn@redhat.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | lcostantino/healing-os | external/ceilometer/compute/virt/libvirt/inspector.py | Python | apache-2.0 | 8,169 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import copy
import simplejson as json
attrs = {
'BC' : 'BirthCountry',
'G' : 'Gender',
'CC' : 'CitizenshipCountry',
'CB' : 'CitizenshipBasis',
'PC' : 'PassportCountry',
'CETP' : 'CurrentEmploymentType',
'CETT' : 'CurrentEmploymentTitle',
'MSB' : 'MilitaryServic... | Adward-R/InfoVis | Wang/email_relations/jsonsplit.py | Python | apache-2.0 | 2,100 |
def add_license(file, lineno, license):
pass
| healerkx/AdminBuildr | scripts/build_license.py | Python | apache-2.0 | 52 |
# Copyright 2020 Telstra Open Source
#
# 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 agre... | telstra/open-kilda | src-python/grpc-stub/server.py | Python | apache-2.0 | 6,031 |
import numpy as np
import pandas as pd
def train(df_train, tau, max_iters):
Xtrain = df_train.iloc[:, 1:].as_matrix()
ytrain = df_train.iloc[:, 0].as_matrix()
classifier = SVM(Xtrain, ytrain, tau, max_iters)
return classifier
class SVM:
def __init__(self, X, y, tau, max_iters):
"""
... | stallmanifold/cs229-machine-learning-stanford-fall-2016 | src/homework2/q3/svm_train.py | Python | apache-2.0 | 3,651 |
__author__ = 'Collin Day and Joe Kvedaras'
import random
# Example of how to implement an RPS player within the framework
import Player
import Message
class CDJKPlayer(Player.Player):
def __init__(self):
# Call super class constructor
Player.Player.__init__(self)
self.reset()
def pla... | geebzter/game-framework | CDJKPlayer.py | Python | apache-2.0 | 3,670 |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Sequence
@dataclass(frozen=True)
class JavaImport:
name: str
is_static: bool = False... | patricklaw/pants | src/python/pants/backend/java/dependency_inference/types.py | Python | apache-2.0 | 1,065 |
from twisted.internet import protocol, reactor
class Echo(protocol.Protocol):
def dataReceived(self, data):
self.transport.write(data)
class EchoFactory(protocol.Factory):
def buildProtocol(self, addr):
return Echo()
reactor.listenTCP(1234, EchoFactory())
reactor.run() | walterfan/snippets | python/exam/EchoServer.py | Python | apache-2.0 | 296 |
# 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... | brchiu/tensorflow | tensorflow/python/eager/backprop_test.py | Python | apache-2.0 | 39,550 |
import re
import sys
import subprocess
import json
def shell(command):
_ps = subprocess.Popen(
command.split(),
stdout=subprocess.PIPE
).communicate()[0].decode()
return _ps
def cut_option(_param, _options_list):
_option = "n/a"
_result_list = []
if _param in _options_list:
... | savex/spectra | tools/salt_networks.py | Python | apache-2.0 | 2,298 |
"""
sentry_javascript_lite.plugin
~~~~~~~~~~~~~~~~~~~~~
"""
import re
from django.conf import settings
from sentry.lang.javascript.plugin import JavascriptPlugin
from sentry.lang.javascript.processor import SourceProcessor
from sentry.interfaces.stacktrace import (Frame, Stacktrace)
from sentry_javascript_lite import... | Banno/getsentry-javascript-lite | sentry_javascript_lite/plugin.py | Python | apache-2.0 | 3,880 |
# Copyright 2014-2018 The PySCF Developers. 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 appl... | sunqm/pyscf | examples/local_orb/nlocal.py | Python | apache-2.0 | 6,720 |
import os
import shutil
import subprocess
import sys
import tempfile
import threading
_g_failed = []
def this_location():
return os.path.abspath(os.path.dirname(__file__))
def checkenv(sd_license, release, ssh_key_path):
required_vars = ['AWS_ACCESS_KEY_ID',
'AWS_SECRET_ACCESS_KEY',... | stardog-union/stardog-graviton | release/release.py | Python | apache-2.0 | 8,041 |
"""List the IP forwarding rules"""
from baseCmd import *
from baseResponse import *
class listIpForwardingRulesCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "false"
"""list resources by account. Must be used with the domainId parameter."""
self.account = None
... | MissionCriticalCloud/marvin | marvin/cloudstackAPI/listIpForwardingRules.py | Python | apache-2.0 | 4,977 |
#!/usr/bin/python
import apt
import apt.progress
import apt_pkg
import logging
import re
import sys
logging.basicConfig(filename1='/var/log/supervisor/rps.log',
format='%(asctime)s %(levelname)s: deb_install: %(message)s',
level=logging.INFO)
logging.getLogger().setLevel(logging.INFO)
class control_p... | bioothod/zbuilder | conf.d/deb_install_build_deps.py | Python | apache-2.0 | 3,249 |
import galaxyxml.tool.parameters as gxtp
from collections import Counter
from pydoc import locate
class ArgparseGalaxyTranslation(object):
def __gxtp_param_from_type(self, param, flag, label, num_dashes, gxparam_extra_kwargs, default=None):
from argparse import FileType
"""Based on a type, conver... | erasche/argparse2tool | argparse2tool/dropins/argparse/argparse_galaxy_translation.py | Python | apache-2.0 | 10,696 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Clione Software
# Copyright (c) 2010-2013 Cidadania S. Coop. Galega
#
# 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... | cidadania/e-cidadania | src/apps/thirdparty/smart_selects/urls.py | Python | apache-2.0 | 1,198 |
import time
import test_rnd as rnd
import random
import pysos
# initialize the data
N = 1234
items = [(rnd.utf8(20), rnd.utf8(200)) for i in range(N)]
start = time.time()
db = pysos.Dict('temp/sos_dict')
#import shelve
#db = shelve.open('temp.shelve')
print("%.2fs: %d items loaded" % (time.time() - start, len(db)... | dagnelies/pysos | test_dict.py | Python | apache-2.0 | 1,567 |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
# note that any print to stdout will break node manager because its uses
# stdout as communication channel and gratitious text there will break it.
# stderr should be fine
import sys
import gevent
from gevent import monkey
if not 'unittest' in sys.mo... | numansiddique/contrail-controller | src/discovery/client.py | Python | apache-2.0 | 15,569 |
#!/usr/bin/env python
from tdclient import (
bulk_import_model,
database_model,
job_model,
result_model,
schedule_model,
table_model,
user_model,
)
BulkImport = bulk_import_model.BulkImport
Database = database_model.Database
Schema = job_model.Schema
Job = job_model.Job
Result = result_mod... | treasure-data/td-client-python | tdclient/models.py | Python | apache-2.0 | 457 |
# -*- coding: utf-8 -*-
__author__ = 'Alan Tai'
'''
Created on Jun 24, 2014
@author: Alan Tai
'''
import logging
import jinja2
import webapp2
import json
from dictionaries.dict_keys_values import KeysVaulesGeneral
from handlers.handler_webapp2_extra_auth import BaseHandler
from models.models_video_info import VideoIn... | Gogistics/prjTWPublicMovements | prjUnlimitedKP/src/dispatchers/dispatchers_videos.py | Python | apache-2.0 | 2,200 |
# Copyright 2018 Google 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,... | google/differentiable-atomistic-potentials | dap/tests/test_tf_chebyshev.py | Python | apache-2.0 | 1,352 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import operator
from django.conf import settings
from django.utils import translation
from django.utils.translation import ugettext as _
from django.utils.lru_cache import lru_cache
from six.moves import urllib, zip_longest, zip, range
from typing import ... | verma-varsha/zulip | zerver/lib/i18n.py | Python | apache-2.0 | 2,570 |
# 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 under t... | rahulunair/nova | nova/tests/functional/test_server_faults.py | Python | apache-2.0 | 5,378 |
# -*- coding: utf-8 -*-
#
# 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
... | hamedhsn/incubator-airflow | airflow/jobs.py | Python | apache-2.0 | 90,563 |
#!/usr/bin/python
# coding: utf-8
# Copyright 2013 The Font Bakery 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... | vitalyvolkov/fontbakery | scripts/fix-ttf-ascii-name.py | Python | apache-2.0 | 1,671 |
#!/home/mjwtom/install/python/bin/python
# -*- coding: utf-8 -*-
'''
Created on Jan 12, 2015
@author: mjwtom
'''
import os
if __name__ == '__main__':
os.system('/home/mjwtom/bin/swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing download mjw home/mjwtom/file')
| mjwtom/swift | test/dedupe/bin/download-debug.py | Python | apache-2.0 | 283 |
# Copyright 2016 Dell 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 app... | bswartz/cinder | cinder/interface/volume_management_driver.py | Python | apache-2.0 | 3,264 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
import ConfigParser
from pprint import pformat
try:
from neutron.openstack.common import log as logging
except ImportError:
from oslo_log import log as logging
from neutron.common import exceptions
try:
from neutron.common.config import cfg
except ImportError:... | eonpatapon/contrail-neutron-plugin | neutron_plugin_contrail/plugins/opencontrail/quota/driver.py | Python | apache-2.0 | 9,119 |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | jlongever/redfish-client-python | on_http_redfish_1_0/models/power_1_0_0_power_supply.py | Python | apache-2.0 | 11,886 |
#!/usr/bin/env python
import urllib2
from bs4 import BeautifulSoup
from parsingLibrary import loadHtmlTags, parseChannel, remove_duplicate_elements
from pymongo import MongoClient
from mongoConfiguration import load_mongo_configuration
mongo_address, mongo_port = load_mongo_configuration()
client = MongoClient(mongo_... | tvlive/tv-crawler | tvChannelLoader.py | Python | apache-2.0 | 5,139 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Time-stamp: <2016-01-07 19:04:35 Thursday by zhangguhua>
################################################################################
# _ooOoo_
# o8888888o
# 88" . "88
# ... | iuyo5678/xiangyun_front | controller/api/data_process_wrap.py | Python | apache-2.0 | 1,559 |
import pymongo
import datetime
def shareFeedback():
client = pymongo.MongoClient('mongodb://54.86.201.60:27000/')
database = client['music']
collection = database['feedback']
post = {
"authorName" : "Jeremy Offer",
"authorMessage" : "Supper dooppeeer",
"mobileDevice" : "iOS",
... | groschovskiy/lerigos_music | Server/API/module/feedback.py | Python | apache-2.0 | 496 |
#!/bin/env python
import os
import logging
import json
from common.utils import Util
class Worker(object):
def __init__(self,db_name,hdfs_app_path,kafka_consumer,conf_type,processes):
self._initialize_members(db_name,hdfs_app_path,kafka_consumer,conf_type,processes)
def _initialize_members(self,db... | kpeiruza/incubator-spot | spot-ingest/pipelines/proxy/worker.py | Python | apache-2.0 | 2,534 |
# List of modules exported by mda.tutorial
# from mda.tutorial import *
__all__ = ['times2', 'pandastut']
| mattmcd/PyAnalysis | mda/tutorial/__init__.py | Python | apache-2.0 | 107 |
# coding = utf-8
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
tf.set_random_seed(1)
np.random.seed(1)
# Hyper Parameters
BATCH_SIZE = 128
TIME_... | paineliu/tflearn | rnn02.py | Python | apache-2.0 | 2,697 |
relative_music_path = "resources\\Music\\"
relative_textures_path = "resources\\Textures\\"
relative_text_files_path = "resources\\TextFiles\\"
relative_dependencies_path = "resources\\dependencies\\" | DarthThanatos/citySimNG | citySimNGView/CreatorView/RelativePaths.py | Python | apache-2.0 | 200 |
import hashlib
def get_hash(instance, abs_filename: str):
"""
得到特定文件十六进制哈希值
:param instance:
:param abs_filename: 文件绝对路径
:return: 十六进制哈希值字符串
"""
_value = instance.choose_hash_method_var.get()
m = None
if _value == 0:
m = hashlib.md5()
elif _value == 1:
m = hashl... | shifvb/hash_photos | _tools/get_hash.py | Python | apache-2.0 | 605 |
# Copyright 2016 David Lapsley
#
# 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... | delapsley/relman | relman/test.py | Python | apache-2.0 | 1,179 |
# -*- coding: utf-8 -*-
# 226. Invert Binary Tree
#
# Invert a binary tree.
#
# 4
# / \
# 2 7
# / \ / \
# 1 3 6 9
#
# to
#
# 4
# / \
# 7 2
# / \ / \
# 9 6 3 1
#
# Trivia:
# This problem was inspired by this original tweet by Max Howell:
#
# Google: 90% of our engineers u... | gengwg/leetcode | 226_invert_binary_tree.py | Python | apache-2.0 | 1,673 |
# ==============================================================================
# Copyright 2018-2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://ww... | tensorflow/ngraph-bridge | test/python/test_biasadd.py | Python | apache-2.0 | 3,990 |
import traceback
import os
import signal
from .import _executor
from .. import devices
from .. import worker
class SerialExecutor(
_executor.Executor,
):
def sigabrt_handler(
self,
signal_num,
frame,
):
try:
self.tasks_to_finish.remove(self.current_task)
... | wavenator/tasker | tasker/executor/serial.py | Python | apache-2.0 | 2,868 |