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) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it and/or modify # it under the terms of t...
capoe/espressopp.soap
src/tools/topology.py
Python
gpl-3.0
6,258
# -*- coding: utf-8 -*- """build_manpage command -- Generate man page from setup()""" import datetime from distutils.command.build import build from distutils.core import Command from distutils.errors import DistutilsOptionError import optparse class build_manpage(Command): description = 'Generate man page fro...
andialbrecht/crunchyfrog
utils/command/build_manpage.py
Python
gpl-3.0
4,464
#!/usr/bin/env python ''' ZCR Shellcoder ZeroDay Cyber Research Z3r0D4y.Com Ali Razmjoo ''' import random,binascii,string chars = string.digits + string.ascii_letters def start(shellcode,job): if 'chmod(' in job: t = True eax = str('0x0f') while t: eax_1 = binascii.b2a_hex(''.join(random.choice(chars) for i...
firebitsbr/ZCR-Shellcoder
lib/encoder/linux_x86/xor_random.py
Python
gpl-3.0
2,327
from textwrap import dedent def get_definition_and_inference_state(Script, source): first, = Script(dedent(source)).infer() return first._name._value, first._inference_state def test_function_execution(Script): """ We've been having an issue of a mutable list that was changed inside the function...
snakeleon/YouCompleteMe-x64
third_party/ycmd/third_party/jedi_deps/jedi/test/test_inference/test_representation.py
Python
gpl-3.0
1,014
# Copyright (c) 2017, Frappe and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.model.utils.rename_field import * from frappe.model.mapper import get_mapped_doc def execute(): # for converting student batch into student group ...
emmuchira/kps_erp
erpnext/patches/v8_0/merge_student_batch_and_student_group.py
Python
gpl-3.0
3,030
""" En este modulo se encuentran definida el decorador encargado de comprobar en las vistas de la aplicacion que el usuario que intenta acceder a la vista, esta logueado y tiene los permisos de superusuario. """ __author__ = 'llerena'
jmllerena/django-easydata
easydata/decorators/__init__.py
Python
gpl-3.0
236
# -*- coding: utf-8 -*- #------------------------------------------------------------ # Canal YouPeliculas.co by EpNiebla # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os, sys from core import config from ...
Hernanarce/pelisalacarta
python/main-classic/channels/youpeliculas.py
Python
gpl-3.0
11,272
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible 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. # # Ansible is d...
rmfitzpatrick/ansible
lib/ansible/plugins/action/nxos.py
Python
gpl-3.0
4,638
# # The Python Imaging Library. # $Id$ # # TIFF file handling # # TIFF is a flexible, if somewhat aged, image file format originally # defined by Aldus. Although TIFF supports a wide variety of pixel # layouts and compression methods, the name doesn't really stand for # "thousands of incompatible file formats," it jus...
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/PIL/TiffImagePlugin.py
Python
gpl-3.0
64,902
# # (c) 2017 Red Hat Inc. # # This file is part of Ansible # # Ansible 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. # # Ansible is d...
jimi-c/ansible
lib/ansible/plugins/cliconf/junos.py
Python
gpl-3.0
7,917
from ImageScripter import * from elan import * if Viewer.shudder.Exists() ==True: Viewer.shudder.Click() else: pass #Viewer.homeicon9.Click() #Viewer.homeicon9.Click() Viewer.media10items.Click() try: Viewer.audiogroup.Click() except Exception as e: print(e) if Viewer.irtester.Exists() == True: ...
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/elan/Pools/Frank/2_speakercraft_lms.py
Python
gpl-3.0
1,883
# # Copyright (C) 2012-2014, Quarkslab. # # This file is part of qb-sync. # # qb-sync 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. ...
nihilus/qb-sync
ext_gdb/sync.py
Python
gpl-3.0
16,046
# This file is part of Indico. # Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
nop33/indico
indico/web/fields/base.py
Python
gpl-3.0
5,600
import os from celery import Celery # This makes sure celery knows where settings are, so we don't need to set it # when calling it from the command line os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ad_main.settings') app = Celery( "ad_main", broker=os.getenv("CELERY_BROKER_URL"), backend=os.getenv(...
AlertaDengue/AlertaDengue
AlertaDengue/ad_main/celeryapp.py
Python
gpl-3.0
465
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, erpnext import frappe.defaults from frappe import msgprint, _ from frappe.utils import cstr, flt, cint from erpnext.stock.stock_ledger im...
patilsangram/erpnext
erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
Python
gpl-3.0
11,573
# Copyright 2016 The Chromium Authors. All rights reserved. # Copyright (c) 2017-2018 the Volcano Authors. All rights reserved. # Licensed under the GPLv3. import os import sys # Usage: python get_tool_mtime.py path/to/file1.py path/to/file2.py # # Prints a GN scope with the variable name being the basename sans-exte...
ndsol/volcano
src/gn/toolchain/mac/get_tool_mtime.py
Python
gpl-3.0
608
#!/usr/bin/python # # This file is part of Ansible # # Ansible 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. # # Ansible is distribut...
konstruktoid/ansible-upstream
lib/ansible/modules/network/eos/eos_config.py
Python
gpl-3.0
19,251
import os from lutris.util import http from lutris.util import extract from lutris import settings LOCAL_VERSION_PATH = os.path.join(settings.RUNTIME_DIR, "VERSION") def parse_version(version_content): try: version = int(version_content) except ValueError: version = 0 return version def...
malkavi/lutris
lutris/util/runtime.py
Python
gpl-3.0
1,774
import json from pprint import pprint with open('family_853.aln.codon.FUBAR.json') as data_file: data = json.load(data_file) pprint(data["MLE"]["content"]['0'][0]) pprint(data["MLE"]["headers"]) pprint(data["MLE"]["headers"][0])
tijeco/Fuster
utils/jason_parser.py
Python
gpl-3.0
235
# Copyright 2011 David Malcolm <dmalcolm@redhat.com> # Copyright 2011 Red Hat, Inc. # # This 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) a...
ruediger/gcc-python-plugin
tests/plugin/functions/script.py
Python
gpl-3.0
3,300
# # Copyright 2015-2016 Free Software Foundation, Inc. # # This file is part of PyBOMBS # # PyBOMBS 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, or (at your option) # any later version. # ...
gnuradio/pybombs
pybombs/packagers/zypper.py
Python
gpl-3.0
6,420
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
XeCycle/indico
indico/MaKaC/webinterface/rh/trackModif.py
Python
gpl-3.0
39,643
from ctypes import c_void_p from ert.test import ExtendedTestCase from ert.util import Hash, StringHash, DoubleHash, IntegerHash class HashTest(ExtendedTestCase): def test_string_hash(self): hash = StringHash() self.assertEqual(len(hash), 0) hash["hipp"] = "" self.assertEqual(l...
arielalmendral/ert
python/tests/core/util/test_hash.py
Python
gpl-3.0
1,507
# This is a script to convert ms output file(s) (with the '.msout' extension) # either specified as a single file or as a directory containing multiple files, # along with the msFlagFile used to create the ms simulations in the ms output files # and the dummy population coordinate file to create necessary input # files...
geohouse/msLandscape
msLandscape_toolboxScripts/msLandscape_convert_msOutputFor_SpaceMix_EEMS.py
Python
gpl-3.0
32,369
import httplib import json import urlparse import error class Response(object): """Describes an HTTP response received from a remote en"Describes an HTTP response received from a remote end whose body has been read and parsed as appropriate.""" def __init__(self, status, body): self.status = s...
mhaessig/servo
tests/wpt/web-platform-tests/tools/webdriver/webdriver/transport.py
Python
mpl-2.0
3,140
# #!/usr/bin/env python # -*- coding: utf-8 -*- # <HTTPretty - HTTP client mock for Python> # Copyright (C) <2011-2013> Gabriel Falcão <gabriel@nacaolivre.org> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to d...
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/httpretty/__init__.py
Python
agpl-3.0
1,914
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('website', '0005_auto_20151107_2021'), ] operations = [ migrations.AddField( model_name='issue', name...
CoderBounty/coderbounty
website/migrations/0006_auto_20151115_0005.py
Python
agpl-3.0
397
# This file is part of Shuup. # # Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. import pytest from django.db.models import ProtectedError from shuup.core.models import (...
shoopio/shoop
shuup_tests/core/test_foreignkeys.py
Python
agpl-3.0
4,853
# coding: utf-8 # The Hazard Library # Copyright (C) 2013-2016 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 ...
rcgee/oq-hazardlib
openquake/hazardlib/mfd/youngs_coppersmith_1985.py
Python
agpl-3.0
15,232
from django import forms from django.contrib.auth import get_user_model from . import widgets User = get_user_model() class PageForm(forms.Form): @classmethod def setup(cls, page, data): cls.base_fields = { question.field_id: question.make_field() for question in page.mock_questions ...
project-callisto/callisto-core
callisto_core/wizard_builder/forms.py
Python
agpl-3.0
1,434
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can redis...
mohierf/mod-webui
module/plugins/eltdetail/eltdetail.py
Python
agpl-3.0
2,612
import json from datetime import datetime, timedelta from flask import abort, Blueprint, current_app, jsonify, request from functools import wraps from sqlalchemy.exc import IntegrityError from os import path from uuid import UUID from werkzeug.exceptions import default_exceptions # type: ignore from db import db fr...
ehartsuyker/securedrop
securedrop/journalist_app/api.py
Python
agpl-3.0
13,022
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackman import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import utilFunctions as UF def TWM (pfreq, p...
acmaheri/sms-tools
lectures/6-Harmonic-model/plots-code/f0-TWM-errors-1.py
Python
agpl-3.0
3,586
""" Helper methods for working with learning contexts """ from edx_django_utils.plugins import PluginManager from opaque_keys import OpaqueKey from opaque_keys.edx.keys import LearningContextKey, UsageKeyV2 from openedx.core.djangoapps.xblock.apps import get_xblock_app_config class LearningContextPluginManager(Plugi...
stvstnfrd/edx-platform
openedx/core/djangoapps/xblock/learning_context/manager.py
Python
agpl-3.0
1,895
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), migrations.swappable_dependency(settings.AUTH_USER_...
lafactura/datea-api
datea_api/apps/follow/migrations/0001_initial.py
Python
agpl-3.0
1,483
"""AWS environment variables unique to the instructor plugin.""" from __future__ import absolute_import import warnings def plugin_settings(settings): """Settings for the instructor plugin.""" # Analytics Dashboard settings.ANALYTICS_DASHBOARD_URL = settings.ENV_TOKENS.get( "ANALYTICS_DASHBOARD_U...
ESOedX/edx-platform
lms/djangoapps/instructor/settings/production.py
Python
agpl-3.0
888
from datetime import datetime from datetime import time from django.core.urlresolvers import NoReverseMatch from django.template import Context from django.template import loader from alert.opinion_page.views import make_citation_string class InvalidDocumentError(Exception): """The document could not be formed"""...
shashi792/courtlistener
alert/search/search_indexes.py
Python
agpl-3.0
4,089
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals import json import random...
suutari-ai/shoop
shuup_tests/default_reports/test_default_reports.py
Python
agpl-3.0
36,452
import os import glob import operator import errno import filecmp import shutil import numpy from .smac_output_readers import * def find_largest_file (glob_pattern): """ Function to find the largest file matching a glob pattern. Old SMAC version keep several versions of files as back-ups. This helper ...
sfalkner/pySMAC
pysmac/utils/state_merge.py
Python
agpl-3.0
11,573
""" Tests course_creators.admin.py. """ from django.test import TestCase from django.contrib.auth.models import User from django.contrib.admin.sites import AdminSite from django.http import HttpRequest import mock from course_creators.admin import CourseCreatorAdmin from course_creators.models import CourseCreator fr...
kalebhartje/schoolboost
cms/djangoapps/course_creators/tests/test_admin.py
Python
agpl-3.0
2,658
# 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) from spack import * class Alquimia(CMakePackage): """Alquimia is an interface that exposes the capabilities of m...
iulian787/spack
var/spack/repos/builtin/packages/alquimia/package.py
Python
lgpl-2.1
2,700
#!/usr/bin/python # -*- coding: utf-8 -*- """Module with the Archive Interface Error class.""" class ArchiveInterfaceError(Exception): """ ArchiveInterfaceError. Basic exception class for this module. Will be used to throw exceptions up to the top level of the application """
dmlb2000/pacifica-archiveinterface
pacifica/archiveinterface/exception.py
Python
lgpl-3.0
300
import csv, os def adding(lemma_noun, file_noun, tags_noun, lemma_verb, file_verb, tags_verb): """ Creates a file with final results: lemmas for unknown words and Zaliznyak's tags for them.""" outfile = open('predicted.csv', 'w', encoding = 'utf-8') writer = csv.writer(outfile, lineterminator='\n...
azilya/Zaliznyak-s-grammatical-dictionary
gdictionary/getfinal.py
Python
lgpl-3.0
1,310
""" Created on 04.07.2017 :author: Humbert Moreaux Tuleap REST API Client for Python Copyright (c) Humbert Moreaux, All rights reserved. This Python 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;...
djurodrljaca/tuleap-rest-api-client
Tuleap/RestClient/PullRequests.py
Python
lgpl-3.0
6,833
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ class CaseInsensitiveDict(dict): '''''' @property def lower_keys(self): if not hasattr(self, '_lower_keys') or not self._lower_keys: self._lower_keys = dict((k.lower(), k) ...
DarthMaulware/EquationGroupLeaks
Leak #1 - Equation Group Cyber Weapons Auction - Invitation/EQGRP-Free-File/Firewall/EXPLOITS/ELCO/fosho/requests/structures.py
Python
unlicense
1,453
import logging import re import requests from datetime import timedelta, date as vanilla_date from calexicon.calendars import JulianDayNumber logging.basicConfig(level=logging.INFO) URL = "http://aa.usno.navy.mil/cgi-bin/aa_jdconv.pl?form=1&year=%d&month=%d&day=%d&era=1&hr=0&min=0&sec=0.0" def get_navy_day_number(...
jwg4/qual
tools/compare_navy_day_numbers.py
Python
apache-2.0
1,862
"""Models for WLED.""" from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DOMAIN from .coordinator import WLEDDataUpdateCoordinator class WLEDEntity(CoordinatorEntity): """Defines a base WLED entity.""" coordinator: W...
jawilson/home-assistant
homeassistant/components/wled/models.py
Python
apache-2.0
875
# 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...
jiaphuan/models
research/object_detection/utils/shape_utils_test.py
Python
apache-2.0
13,659
""" 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"); you may not use this ...
sekikn/ambari
ambari-common/src/main/python/ambari_commons/repo_manager/generic_manager.py
Python
apache-2.0
7,285
# -*- coding: utf-8 -*- import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) import pyxb.binding.generate import pyxb.utils.domutils from xml.dom import Node import os.path xsd='''<?xml version="1.0" encoding="utf-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLS...
CantemoInternal/pyxb
tests/trac/test-trac-0116.py
Python
apache-2.0
834
# -*- encoding: utf-8 -*- # Copyright (c) 2019 ZTE Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
openstack/watcher
watcher/api/controllers/v1/data_model.py
Python
apache-2.0
2,661
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for rsyslog state checks.""" from grr.lib import flags from grr.lib import test_lib from grr.lib.checks import checks_test_lib from grr.parsers import config_file class RsyslogCheckTests(checks_test_lib.HostCheckTest): """Test the rsyslog checks.""" @class...
pidydx/grr
grr/checks/rsyslog_test.py
Python
apache-2.0
1,801
# -*- coding: utf-8 -*- """Preprocessing related functions and classes for testing.""" from artifacts import reader as artifacts_reader from artifacts import registry as artifacts_registry from dfvfs.helpers import fake_file_system_builder from dfvfs.helpers import file_system_searcher from dfvfs.lib import definition...
joachimmetz/plaso
tests/preprocessors/test_lib.py
Python
apache-2.0
5,825
# -*- coding: utf-8 -*- from nose.tools import * from claw import utils def test_get_delimiter(): eq_('\r\n', utils.get_delimiter('abc\r\n123')) eq_('\n', utils.get_delimiter('abc\n123')) eq_('\n', utils.get_delimiter('abc'))
ad-m/claw
tests/utils_test.py
Python
apache-2.0
242
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2013 Contributor # # 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 t...
stdweird/aquilon
lib/python2.6/aquilon/worker/commands/show_principal_principal.py
Python
apache-2.0
1,490
# -*- coding: utf-8 -*- # # 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 #...
adamhaney/airflow
airflow/operators/bash_operator.py
Python
apache-2.0
5,565
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 Openstack, LLC. # 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 # # ...
superstack/nova
nova/vnc/proxy.py
Python
apache-2.0
4,135
# Copyright 2015 Mirantis, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
VTabolin/networking-vsphere
networking_vsphere/common/vmware_conf.py
Python
apache-2.0
3,247
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
pwong-mapr/private-hue
desktop/libs/hadoop/setup.py
Python
apache-2.0
1,344
# Copyright 2012 OpenStack Foundation. # 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 requ...
cernops/python-neutronclient
neutronclient/tests/unit/test_cli20_port.py
Python
apache-2.0
21,891
"""-0.75/(1+x**2)-(0.65*x*math.atan(1/x))+0.65 (-4* x**2 - 20*x - 100) + (1 - x)**4 3*x**2+ 12/(x**3) - 5 3*x**4 + x**2 - 2*x + 1 10+x**3-2*x-5*(np.finfo(float).eps)**x x**2- 10*(np.finfo(float).eps)**(0.1*x) (10*x**3+3*x**2+5)**2 0.5/math.sqrt(1+x**2)- math.sqrt(1+x**2)*(1-0.5/(1+x**2))+x (np.finfo(float).eps)**x-x**3...
jresendiz27/EvolutionaryComputing
practices/first/evolutionaryStrategies/functions.py
Python
apache-2.0
1,490
# 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 agreed to in writing, s...
pair-code/lit
lit_nlp/lib/wsgi_serving.py
Python
apache-2.0
4,652
# Copyright 2013 dotCloud 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 t...
kpavel/docker-py
docker/auth/auth.py
Python
apache-2.0
6,366
# Copyright 2014 Cloudbase Solutions Srl # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
telerik/cloudbase-init
cloudbaseinit/plugins/windows/userdataplugins/cloudboothook.py
Python
apache-2.0
1,051
from django.http import HttpRequest from django.utils.translation import gettext as _ from zerver.decorator import webhook_view from zerver.lib.actions import check_send_stream_message from zerver.lib.exceptions import JsonableError from zerver.lib.request import REQ, get_request_notes, has_request_variables from zerv...
punchagan/zulip
zerver/webhooks/slack/view.py
Python
apache-2.0
1,503
from django.http import * import os, sys, logging from vt_manager.common.rpc4django import rpcmethod from vt_manager.common.rpc4django import * from vt_manager.communication.geni.v3.configurators.handlerconfigurator import HandlerConfigurator #URL_NAME GAPI3_URL = "gapi" # Parameter Types CREDENTIALS_TYPE = 'array' #...
dana-i2cat/felix
vt_manager/src/python/vt_manager/communication/gapi3communication.py
Python
apache-2.0
2,654
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: cockroach/proto/log.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflecti...
abhishekgahlot/cockroach-python
cockroach/proto/log_pb2.py
Python
apache-2.0
8,487
# Copyright 2014: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
varunarya10/rally
rally/deploy/engines/fuel.py
Python
apache-2.0
6,902
#!/usr/bin/python import socket import struct import sys import zlib from google.protobuf import service import rpc_pb2 import rpcservice_pb2 def encode(message): body = "RPC0" + message.SerializeToString() cksum = zlib.adler32(body) return "".join((struct.pack(">l", len(body) + 4), body, struct.pack(">...
frankee/cetty2
cetty-zurg/client/rpc.py
Python
apache-2.0
3,571
#!/usr/bin/env python # Copyright 2013 Brett Slatkin # # 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...
gBritz/dpxdt
tests/workers_test.py
Python
apache-2.0
14,717
# 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
pyscf/geomopt/__init__.py
Python
apache-2.0
977
# Copyright 2018 The Meson development team # 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 ...
QuLogic/meson
mesonbuild/ast/introspection.py
Python
apache-2.0
15,829
# # 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"); you may not us...
jbonofre/beam
sdks/python/apache_beam/io/gcp/gcsio.py
Python
apache-2.0
31,218
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # Copyright 2013 Canonical Corp. # 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 ...
pombredanne/MOG
nova/tests/virt/vmwareapi/test_vmwareapi_vm_util.py
Python
apache-2.0
14,359
# # 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 # ...
miguelgrinberg/heat
heat/common/heat_keystoneclient.py
Python
apache-2.0
25,387
# 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 (c) 2011 Piston Cloud Computing, Inc # Copyright (c) 2012 University Of Minho # Copyright (c) 2013 Hewlett-Pa...
JioCloud/nova
nova/virt/libvirt/guest.py
Python
apache-2.0
6,242
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2013 PolyBeacon, 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...
gorocacher/payload
payload/api/controllers/v1/queue/__init__.py
Python
apache-2.0
3,397
exec(open('functional/tests/_standalone_rst_defaults.py').read()) # Source and destination file names. test_source = "standalone_rst_docutils_xml.txt" test_destination = "standalone_rst_docutils_xml.xml" # Keyword parameters passed to publish_file. writer_name = "docutils_xml" # Settings # enable INFO-level system m...
kawamon/hue
desktop/core/ext-py/docutils-0.14/test/functional/tests/standalone_rst_docutils_xml.py
Python
apache-2.0
461
"""Test the solarlog config flow.""" from unittest.mock import patch import pytest from homeassistant import data_entry_flow from homeassistant import config_entries, setup from homeassistant.components.solarlog import config_flow from homeassistant.components.solarlog.const import DEFAULT_HOST, DOMAIN from homeassist...
joopert/home-assistant
tests/components/solarlog/test_config_flow.py
Python
apache-2.0
4,982
""" odtreader.py Contains class ODTFile for reading OOMMF ODT data into a Pandas dataframe Author: Ryan Pepper (2016) University of Southampton """ import pandas as pd import tempfile import re class ODTFile(object): def __init__(self, filename): f = open(filename) # Can't use 'w+b' for compatibility...
fangohr/oommf-python
joommf/odtreader.py
Python
bsd-2-clause
1,380
# -*- coding: utf-8 -*- # from __future__ import absolute_import, division, print_function from __future__ import unicode_literals import nose from nose.tools import * import numpy as np from sknano.structures import Graphene, PrimitiveCellGraphene, \ ConventionalCellGraphene, GraphenePrimitiveCell, GrapheneConv...
androomerrill/scikit-nano
sknano/structures/tests/test_graphene.py
Python
bsd-2-clause
1,925
""" The ``LineEdit`` and ``MultiLineEdit`` widgets provide a way for the user to input text. .. UIExample:: 100 from flexx import app, event, ui class Example(ui.Widget): def init(self): with ui.VBox(): self.line = ui.LineEdit(placeholder_text='type here') ...
zoofIO/flexx
flexx/ui/widgets/_lineedit.py
Python
bsd-2-clause
7,452
class BaseTestFile(object): def test_create_file(self): path = '/hello world' data = 'my hello world' self.assertIs(self.redis.get(':'.join((self.uid, path))), None) self.f.createfile(path, data) self.assertEqual(self.redis.get(':'.join((self.uid, path, 'content'))), ...
pombredanne/prerepo
tests/shared/models/test_file.py
Python
bsd-2-clause
3,978
#!/usr/bin/env python3 from contextlib import contextmanager import time from main import has_subset_sum_zero class Duration: def __init__(self, elapsed=None): self.elapsed = elapsed @contextmanager def timeit(): duration = Duration() tic = time.time() yield duration elapsed = time.time...
vigojug/reto
201705/peque/biggest_set.py
Python
bsd-3-clause
1,385
def somefunc(): pass
level12/blazeweb
tests/apps/nlsupporting/components/news/__init__.py
Python
bsd-3-clause
26
import json from datetime import datetime, timedelta from django.contrib.contenttypes.models import ContentType from nose.tools import eq_ from kitsune import search as constants from kitsune.access.tests import permission from kitsune.forums.tests import forum, post, restricted_forum, thread from kitsune.products.t...
Osmose/kitsune
kitsune/search/tests/test_search_advanced.py
Python
bsd-3-clause
31,926
""" XML serializer. """ from xml.dom import pulldom from xml.sax import handler from xml.sax.expatreader import ExpatParser as _ExpatParser from django.apps import apps from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.core.serializers import base from django.db import...
theo-l/django
django/core/serializers/xml_serializer.py
Python
bsd-3-clause
16,785
import numpy as np from numpy.testing import assert_almost_equal, assert_equal import pandas as pd import pytest from statsmodels.iolib.table import SimpleTable from statsmodels.stats.descriptivestats import ( Describe, Description, describe, sign_test, ) pytestmark = pytest.mark.filterwarnings( "...
jseabold/statsmodels
statsmodels/stats/tests/test_descriptivestats.py
Python
bsd-3-clause
6,216
### # Copyright (c) 2002-2004, Jeremiah Fincher # Copyright (c) 2010, James Vega # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyri...
mazaclub/mazabot-core
plugins/ChannelStats/test.py
Python
bsd-3-clause
4,460
"""Functionality related with filters in a PyTables file.""" import warnings import numpy as np from . import utilsextension, blosc_compressor_list, blosc_compcode_to_compname from .exceptions import FiltersWarning from packaging.version import Version import tables as tb blosc_version = Version(tb.which_lib_versio...
avalentino/PyTables
tables/filters.py
Python
bsd-3-clause
16,149
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Create the RenderWindow, Renderer and both Actors # ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteractor(...
hlzz/dotfiles
graphics/VTK-7.0.0/Imaging/Hybrid/Testing/Python/shepards.py
Python
bsd-3-clause
1,608
import os # This module should be kept compatible with Python 2.1. __revision__ = "$Id: debug.py,v 1.1.1.1 2006/05/30 06:04:31 hhzhou Exp $" # If DISTUTILS_DEBUG is anything other than the empty string, we run in # debug mode. DEBUG = os.environ.get('DISTUTILS_DEBUG')
kontais/EFI-MIPS
ToolKit/cmds/python/Lib/distutils/debug.py
Python
bsd-3-clause
272
#!/usr/bin/env python2.6 import lxml.html, re, HTMLParser class InvalidArguments(Exception): pass class MetaHeaders: def __init__(self, url=None, page=None,name='name',content='content', unescape_entities=False): if page: self.root = lxml.html.document_fromstring(page) elif url: self.root = lxml.html.pa...
OAButton/tricorder
plugins/python/metaheaders.py
Python
bsd-3-clause
2,791
""" desispec.fiberflat ================== Utility functions to compute a fiber flat correction and apply it We try to keep all the (fits) io separated. """ from __future__ import absolute_import, division import numpy as np from desispec.io import read_frame from desispec.io import write_fiberflat from desispec.fibe...
gdhungana/desispec
py/desispec/scripts/fiberflat.py
Python
bsd-3-clause
2,238
import re from django import template from django.conf import settings from django.template import TemplateSyntaxError from django.template.base import FilterExpression from django.template.defaulttags import URLNode from django.utils.encoding import iri_to_uri, smart_str from django.urls import set_urlconf, get_urlco...
jezdez/django-hosts
django_hosts/templatetags/hosts.py
Python
bsd-3-clause
5,070
import django_filters from django.utils.translation import gettext as _ from wagtail.admin.filters import WagtailFilterSet from wagtail.admin.widgets import ButtonSelect from wagtail.core.models import Site class RedirectsReportFilterSet(WagtailFilterSet): is_permanent = django_filters.ChoiceFilter( labe...
rsalmaso/wagtail
wagtail/contrib/redirects/filters.py
Python
bsd-3-clause
828
from mcpi.minecraft import Minecraft from mcpi import block from mcmodels import ISS, Stairs, Rocket, LaunchPad from mcsensors import DisplayTube from time import sleep, time from mcclock import Clock """ SpaceCRAFT - Astro Pi competition[http://astro-pi.org/] entry Conceived by Hannah Belshaw Created by Martin O'Hanl...
astro-pi/SpaceCRAFT
spacecraft/mcdisplays.py
Python
bsd-3-clause
5,395
VERSION = (1,0,0) __version__ = "1.0.0"
MegaMark16/django-cms-wunderground
cmsplugin_wunderground/__init__.py
Python
bsd-3-clause
41
# http://code.activestate.com/recipes/577263-numerical-integration-using-monte-carlo-method/ # Numerical Integration using Monte Carlo method # FB - 201006137 #pythran export montecarlo_integration(float, float, int, float list, int) #runas montecarlo_integration(1.,10.,100,[x/100. for x in range(100)],100) #bench mont...
serge-sans-paille/pythran
pythran/tests/cases/monte_carlo.py
Python
bsd-3-clause
1,346
""" Command handler This module contains the infrastructure for accepting commands on the command line. The process is as follows: 1) The calling object (caller) inputs a string and triggers the command parsing system. 2) The system checks the state of the caller - loggedin or not 3) If no command string was supplied...
GhostshipSoftware/avaloria
src/commands/cmdhandler.py
Python
bsd-3-clause
20,996