text
stringlengths
5.09k
178k
domain
stringclasses
106 values
import java import unittest from test import test_support import errno import jarray import Queue import platform import select import socket import struct import sys import time import thread, threading from weakref import proxy from StringIO import StringIO PORT = 50100 HOST = 'localhost' MSG = 'Michael Gilfix was...
codeparrot/github-code-clean
# -*- test-case-name: twisted.words.test.test_irc -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Internet Relay Chat protocol for client and server. Future Plans ============ The way the IRCClient class works here encourages people to implement IRC clients by subclassing the ephemera...
codeparrot/github-code-clean
############################################################################## # pymbar: A Python Library for MBAR # # Copyright 2010-2014 University of Virginia, Memorial Sloan-Kettering Cancer Center # Portions of this software are Copyright (c) 2006-2007 The Regents of the University of California. All Rights Reser...
codeparrot/github-code-clean
#!/usr/bin/python -u # Copyright (c) 2010-2012 OpenStack 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.org/licenses/LICENSE-2.0 # # Unless required by ap...
codeparrot/github-code-clean
# ----------------------------------------------------------------------------- # ply: yacc.py # # Copyright (C) 2001-2009, # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
codeparrot/github-code-clean
""" High-level libvirt test utility functions. This module is meant to reduce code size by performing common test procedures. Generally, code here should look like test code. More specifically: - Functions in this module should raise exceptions if things go wrong - Functions in this module typically use funct...
codeparrot/github-code-clean
#!/usr/bin/python #-*- coding: utf-8 -*- # =========================================================================== # eXe # Copyright 2004-2006, University of Auckland # Copyright 2004-2008 eXe Project, http://eXeLearning.org/ # # This program is free software; you can redistribute it and/or modify # it unde...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsGeometry. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __aut...
codeparrot/github-code-clean
#---------------------------------------------------------------------- # This file was generated by C:\Python27\Scripts\img2py-script.py # from wx.lib.embeddedimage import PyEmbeddedImage ToolBarBitmaps_2 = PyEmbeddedImage( "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKQ2lDQ1BJQ0MgcHJvZmlsZQAA" "eNq...
codeparrot/github-code-clean
# Paperwork - Using OCR to grep dead trees the easy way # Copyright (C) 2012-2014 Jerome Flesch # Copyright (C) 2012 Sebastien Maccagnoni-Munch # # Paperwork 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 Soft...
codeparrot/github-code-clean
#!/usr/bin/python # Gscreen a GUI for linuxcnc cnc controller # Chris Morley copyright 2012 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or...
codeparrot/github-code-clean
# ccm node from __future__ import absolute_import, with_statement import errno import glob import os import re import shutil import signal import stat import subprocess import sys import time import tempfile import warnings from collections import namedtuple from datetime import datetime from distutils.version import ...
codeparrot/github-code-clean
#! /usr/bin/python """ Copyright (c) 2012 The Ohio State University. 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 require...
codeparrot/github-code-clean
# -*- coding:utf-8 -*- # # Copyright (C) 2008 The Android Open Source Project # # 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 re...
codeparrot/github-code-clean
import IPython import bluesky.plan_stubs as bps import matplotlib.pyplot as plt import numpy as np import os from scipy.optimize import curve_fit from scipy import ndimage import sys from datetime import datetime import shutil from scipy import signal from scipy.ndimage.filters import gaussian_filter def focusmerl...
codeparrot/github-code-clean
# being a bit too dynamic # pylint: disable=E1101 from __future__ import division import warnings import re from collections import namedtuple from distutils.version import LooseVersion import numpy as np from pandas.util._decorators import cache_readonly from pandas.core.base import PandasObject from pandas.core.dt...
codeparrot/github-code-clean
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Puzzle NSMBU # This is Puzzle 0.6, ported to Python 3 & PyQt5, and then ported to support the New Super Mario Bros. U tileset format. # Puzzle 0.6 by Tempus; all improvements for Python 3, PyQt5 and NSMBU by RoadrunnerWMC and AboodXD import json import os import os.pat...
codeparrot/github-code-clean
# Copyright (c) 2010-2012 OpenStack 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.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
codeparrot/github-code-clean
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2011 OpenStack Foundation # Copyright 2013 IBM Corp. # # 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.a...
codeparrot/github-code-clean
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( _fastCopyAndTranspose as fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, arr...
codeparrot/github-code-clean
#!/usr/bin/env python # --------------------------------------------------------------------------------------------- # docs and latest version available for download at # https://support.shotgunsoftware.com/forums/48807-developer-api-info # ----------------------------------------------------------------------------...
codeparrot/github-code-clean
# # Copyright 2013 Intel Corp. # # 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 writin...
codeparrot/github-code-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # This is a port of the original in testprogs/ejs/ldap.js import optparse import sys import os sys.path.insert(0, "bin/python") import samba samba.ensure_external_module("testtools", "testtools") samba.ensure_external_module("subunit", "subunit/python") import samba.geto...
codeparrot/github-code-clean
""" Color data and pre-defined cmap objects. This is a helper for cm.py, originally part of that file. Separating the data (this file) from cm.py makes both easier to deal with. Objects visible in cm.py are the individual cmap objects ('autumn', etc.) and a dictionary, 'datad', including all of these objects. """ im...
codeparrot/github-code-clean
# 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 ...
codeparrot/github-code-clean
# coding=utf-8 import numpy as np from mpi4py import MPI from petsc4py import PETSc from numpy import pi from src import stokes_flow as sf from src import geo from tqdm import tqdm # from multiprocessing import cpu_count, Pool # from numba import jit # import numexpr as ne # from numpy import linalg as LA def delta...
codeparrot/github-code-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of QNIB. QNIB 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, version 2. # # This program is distributed in the hope that it will be useful,...
codeparrot/github-code-clean
#=========================================================================== # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope tha...
codeparrot/github-code-clean
#-*- coding:utf-8 -*- from builtins import range from future.utils import viewitems, viewvalues import logging from pyparsing import * from miasm.expression import expression as m2_expr from miasm.core.cpu import * from collections import defaultdict from miasm.core.bin_stream import bin_stream from miasm.arch.aarch6...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # Resource object code # # Created: Sat 29. Sep 14:35:09 2012 # by: The Resource Compiler for PyQt (Qt v4.8.3) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x0f\x21\ \x3c\ \x3f\x78\x6d\x6c\x20\x76\x65\x72\x7...
codeparrot/github-code-clean
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any...
codeparrot/github-code-clean
#!/usr/bin/env python # # git-p4.py -- A tool for bidirectional operation between a Perforce depot and git. # # Author: Simon Hausmann <simon@lst.de> # Copyright: 2007 Simon Hausmann <simon@lst.de> # 2007 Trolltech ASA # License: MIT <http://www.opensource.org/licenses/mit-license.php> # import sys if sys.he...
codeparrot/github-code-clean
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for the Decim...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt4 (Qt v4.8.7) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x01\xbb\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x20\x00...
codeparrot/github-code-clean
# 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...
codeparrot/github-code-clean
''' Provides the core API for Cheetah. See the docstring in the Template class and the Users' Guide for more information ''' ################################################################################ ## DEPENDENCIES import sys # used in the error handling code import re ...
codeparrot/github-code-clean
#!/usr/bin/env python # Substitutions are applied in the order listed. This is important in cases # where multiple substitutions could match, or when one substitution matches # the result of a previous substitution. For example, these rules are correct # in this order: # # ('real', 'double precision', 'real', '...
codeparrot/github-code-clean
## pylint: disable=W0212,C0103,W0633,W0611,W0201,C0301,R0915,R0912 """ Main BDF class. Defines: - BDF see https://docs.plm.automation.siemens.com/tdoc/nxnastran/10/help/#uid:index """ from __future__ import (nested_scopes, generators, division, absolute_import, print_function, unicode_litera...
codeparrot/github-code-clean
# Copyright 2015 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...
codeparrot/github-code-clean
"""Test for smart home alexa support.""" import pytest from homeassistant.core import Context, callback from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT from homeassistant.components.alexa import smart_home, messages from homeassistant.components.media_player.const import ( SUPPORT_NEXT_TRACK, SUP...
codeparrot/github-code-clean
# -*- 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 ...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # Copyright (c) 2013 OpenStack 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.org/licenses/LICENSE-2.0 # # Unless required by appl...
codeparrot/github-code-clean
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/flowables.py __version__=''' $Id$ ''' __doc__=""" A flowable is a "floating element" in a document whose exact position is determined by the o...
codeparrot/github-code-clean
#!/usr/bin/python # $Id$ # 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 "Li...
codeparrot/github-code-clean
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file...
codeparrot/github-code-clean
# # Copyright (C) 2011 EADS France, Fabrice Desclaux <fabrice.desclaux@eads.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any late...
codeparrot/github-code-clean
# pylint: disable-msg=W0611, W0612, W0511 """Tests suite for MaskedArray. Adapted from the original test_ma by Pierre Gerard-Marchant :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: test_extras.py 3473 2007-10-29 15:18:13Z jarrod.millman $ """ from __future__ import division, absolute...
codeparrot/github-code-clean
#!/usr/bin/python # # Copyright (c) 2009 Google Inc. 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 copyright # notice, this list of ...
codeparrot/github-code-clean
# sqlite/base.py # Copyright (C) 2005-2022 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php r""" .. dialect:: sqlite :name: SQLite :full_support: 3.21, 3.28+ :norma...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- try: # Python 2.7 from collections import OrderedDict except: # Python 2.6 from gluon.contrib.simplejson.ordered_dict import OrderedDict from datetime import timedelta from gluon import current, Field from gluon.html import * from gluon.storage import Storage from gluon.valida...
codeparrot/github-code-clean
# 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 ...
codeparrot/github-code-clean
""" Module contains tools for processing files into DataFrames or other objects """ from __future__ import print_function from pandas.compat import range, lrange, StringIO, lzip, zip, string_types, map from pandas import compat import re import csv import warnings import numpy as np from pandas.core.index import Inde...
codeparrot/github-code-clean
# Small Genome Tools # Copyright (C) 2015 University of the Witwatersrand, Johannesburg, South Africa # Author: Dr Trevor G. Bell, TrevorGrahamBell@gmail.com # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software...
codeparrot/github-code-clean
#Tam Ekran Kamera v4.6 Beta Tasarimi #Urun: N70, N70 ME #Dil: Uluslararası #FullScreen Camera V4.6 Beta Building #Produced for: N70, N70 ME #Language: International try: import miso except: appuifw.note(u"cannot import miso module") try: miso.set_process_priority(150) except: pass import app...
codeparrot/github-code-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # test-btcr.py -- unit tests for btcrecovery.py # Copyright (C) 2014, 2015 Christopher Gurnee # # This file is part of btcrecover. # # btcrecover is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by th...
codeparrot/github-code-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # # This module is also sponsored by E.T.A.I. (www.etai.fr) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_versio...
codeparrot/github-code-clean
# 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...
codeparrot/github-code-clean
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Piston Cloud Computing, Inc. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
codeparrot/github-code-clean
# Copyright 2012 OpenStack 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.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
codeparrot/github-code-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # 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 (...
codeparrot/github-code-clean
"""Tests for user-friendly public interface to polynomial functions. """ from sympy.polys.polytools import ( Poly, PurePoly, poly, parallel_poly_from_expr, degree, degree_list, LC, LM, LT, pdiv, prem, pquo, pexquo, div, rem, quo, exquo, half_gcdex, gcdex, invert, subresultants, resu...
codeparrot/github-code-clean
""" Test functions for linalg module """ from __future__ import division, absolute_import, print_function import os import sys import itertools import traceback import textwrap import subprocess import pytest import numpy as np from numpy import array, single, double, csingle, cdouble, dot, identity, matmul from num...
codeparrot/github-code-clean
import numpy as np import warnings import math from scipy.optimize import minimize import sklearn from sklearn import tree from sklearn import linear_model from sklearn import ensemble from sklearn import neural_network from sklearn.model_selection import KFold import statsmodels.api as sm import warnings import time ...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # # S3Query Unit Tests # # To run this script use: # python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3/s3query.py # import unittest import datetime from lxml import etree from gluon import * from gluon.storage import Storage from s3 import * try: import pyparsing except...
codeparrot/github-code-clean
from __future__ import unicode_literals from collections import OrderedDict import datetime from operator import attrgetter import pickle import unittest import warnings from django.core.exceptions import FieldError from django.db import connection, DEFAULT_DB_ALIAS from django.db.models import Count, F, Q from djang...
codeparrot/github-code-clean
# workflows integrating epigenomic datasets import os import gzip import glob import logging import numpy as np import pandas as pd from ggr.util.utils import run_shell_cmd from ggr.analyses.bioinformatics import make_deeptools_heatmap from ggr.analyses.bioinformatics import run_bioinformatics_on_bed from ggr.util...
codeparrot/github-code-clean
#!/usr/bin/env python # # Copyright (c) 2009 Google Inc. 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 copyright # notice, this list...
codeparrot/github-code-clean
<<<<<<< HEAD <<<<<<< HEAD import base64 import re import os import sys import urllib.request, urllib.parse, urllib.error PY3 = sys.version_info[0] == 3 if PY3: from io import StringIO str = str else: from io import StringIO try: import json except ImportError: import simplejson as json from .r...
codeparrot/github-code-clean
# Copyright (C) 2001-2004 Python Software Foundation # Contact: email-sig@python.org # email package unit tests import os import sys import time import base64 import difflib import unittest import warnings from cStringIO import StringIO import email from email.Charset import Charset from email.Header import Header, ...
codeparrot/github-code-clean
import collections import copy from typing import Optional from supriya import BinaryOperator, SignalRange, UnaryOperator from supriya.system.SupriyaObject import SupriyaObject class UGenMethodMixin(SupriyaObject): ### CLASS VARIABLES ### __documentation_section__: Optional[str] = "SynthDef Internals" ...
codeparrot/github-code-clean
# mock.py # Test tools for mocking and patching. # E-mail: fuzzyman AT voidspace DOT org DOT uk # # mock 1.0.1 # http://www.voidspace.org.uk/python/mock/ # # Copyright (c) 2007-2013, Michael Foord & the mock team # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modificatio...
codeparrot/github-code-clean
# A python3 code # This is a single-zone closed-box galaxy chemical evolution module. # It is coupled with a variable galaxy-wide IMF that depends on the galactic property at the time of star formation. # The stellar population forms at every 10 Myr (the shortest time step) over 10 Gyr; # with each stellar population a...
codeparrot/github-code-clean
from __future__ import unicode_literals import json import sure # noqa import boto3 from moto import mock_iot from botocore.exceptions import ClientError import pytest def generate_thing_group_tree(iot_client, tree_dict, _parent=None): """ Generates a thing group tree given the input tree structure. :p...
codeparrot/github-code-clean
# pylint: disable=W0231,E1101 import collections import warnings import operator import weakref import gc import json import numpy as np import pandas as pd from pandas._libs import tslib, lib, properties from pandas.core.dtypes.common import ( _ensure_int64, _ensure_object, is_scalar, is_number, ...
codeparrot/github-code-clean
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2010 OpenStack Foundation # Copyright 2012 University Of Minho # # 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 # # ...
codeparrot/github-code-clean
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
codeparrot/github-code-clean
# Version: 0.15+dev """The Versioneer - like a rocketeer, but for versions. The Versioneer ============== * like a rocketeer, but for versions! * https://github.com/warner/python-versioneer * Brian Warner * License: Public Domain * Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, and pypy * [![Latest Version] (https...
codeparrot/github-code-clean
from calendar import monthrange from collections import OrderedDict import base64 import collections import csv from datetime import date, datetime, timedelta from easy_pdf.rendering import render_to_pdf_response import logging from math import ceil, pi, sqrt from operator import itemgetter import operator import os im...
codeparrot/github-code-clean
# 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 u...
codeparrot/github-code-clean
from test import support from tokenize import (tokenize, _tokenize, untokenize, NUMBER, NAME, OP, STRING, ENDMARKER, ENCODING, tok_name, detect_encoding, open as tokenize_open, Untokenizer, generate_tokens, NEWLINE) from io import BytesIO import unittest fr...
codeparrot/github-code-clean
#!/usr/bin/python # -*- coding: utf-8 -*- import numpy as np import scipy.ndimage from scipy import stats from scipy.fftpack import fft, fftfreq, fftshift import os, sys import gc from os import listdir from os.path import isfile,join import gtk import matplotlib as mpl import matplotlib.pyplot as plt #mpl.use('GtkAgg'...
codeparrot/github-code-clean
# encoding: utf-8 """ Tests of verify_student views. """ import json import urllib from datetime import timedelta, datetime from uuid import uuid4 import ddt import httpretty import mock import pytz from bs4 import BeautifulSoup from mock import patch, Mock, ANY from django.conf import settings from django.core.urlr...
codeparrot/github-code-clean
# Author: Steven J. Bethard <steven.bethard@gmail.com>. """Command-line parsing library This module is an optparse-inspired command-line parsing library that: - handles both optional and positional arguments - produces highly informative usage messages - supports parsers that dispatch to sub-parsers The...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- from django.conf import settings if __name__ == '__main__': # When running this file in isolation, we need to set up the configuration # before importing 'template'. settings.configure() from datetime import datetime, timedelta import time import os import sys import traceback impo...
codeparrot/github-code-clean
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
codeparrot/github-code-clean
#!/usr/bin/env python # Python Module to work with ROMS # Owner: Rafael Soutelino - rsoutelino@gmail.com # Committers: Andre Lobato - andrefelipelobato@gmail.com # Last modification: Mar, 2012 ##################################################################### from dateutil.parser import parse import numpy as np impo...
codeparrot/github-code-clean
#!python #-*- encoding=utf-8 -*- import sys, sqlite3, logging, os, os.path import wx, time, re, copy, webbrowser import wx.grid, wx.html import json, math # cfg start # class Config: def __init__(self): self.environment = ('production','dev')[1] self.expiration = 20 self.rootdir = r'C:\xux' self....
codeparrot/github-code-clean
import pkg_resources pkg_resources.require( "twill==0.9" ) import StringIO, os, sys, random, filecmp, time, unittest, urllib, logging, difflib, tarfile, zipfile, tempfile, re, shutil from itertools import * import twill import twill.commands as tc from twill.other_packages._mechanize_dist import ClientForm pkg_resour...
codeparrot/github-code-clean
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module provides classes to perform analyses of the local environments (e.g., finding near neighbors) of single sites in molecules and structures. """ import math import warnings import os import json ...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # Copyright (c) 2002 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the debugger UI. """ from __future__ import unicode_literals import os from PyQt5.QtCore import pyqtSignal, QObject, Qt from PyQt5.QtGui import QKeySequence from PyQt5.QtWidgets import QMenu, Q...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # HORTON: Helpful Open-source Research TOol for N-fermion systems. # Copyright (C) 2011-2016 The HORTON Development Team # # This file is part of HORTON. # # HORTON is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by th...
codeparrot/github-code-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018-21 SHS-AV s.r.l. (<http://ww.zeroincombenze.it>) # # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # # All Rights Reserved # """Aihoaih stands for "am I human or am I heap", tribute to a song of American rock band "The Killers". Acrony...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # # archipelVirtualMachine.py # # Copyright (C) 2010 Antoine Mercadal <antoine.mercadal@inframonde.eu> # Copyright, 2011 - Franck Villaume <franck.villaume@trivialdev.com> # This file is part of ArchipelProject # http://archipelproject.org # # This program is free software: you can redistribute ...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import datetime import json import pycountry import pytz import six import time from celery.app.task import Task from decimal import Decimal from django.conf import settings from django.contrib.auth.models import User, Group from djang...
codeparrot/github-code-clean
# # (C) Copyright 2006-2007 Novell, Inc. # # 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 program is ...
codeparrot/github-code-clean
from django.shortcuts import render from django.db.models import Q, F, Prefetch, Avg, StdDev, IntegerField, Sum, Case, When, Min, Max from django.db.models.functions import Concat from django.views.decorators.cache import cache_page from django.views.decorators.csrf import csrf_exempt from django.core.cache import cach...
codeparrot/github-code-clean
# # Copyright (c) 2017 Intel Corporation # SPDX-License-Identifier: BSD-2-Clause # from math import sqrt import numbers import re import sys import dis import platform import types as pytypes import warnings from functools import reduce import numpy as np from numpy.random import randn import operator from collection...
codeparrot/github-code-clean
""" Second quantization operators and states for bosons. This follow the formulation of Fetter and Welecka, "Quantum Theory of Many-Particle Systems." """ from __future__ import print_function, division from collections import defaultdict from sympy import (Add, Basic, cacheit, Dummy, Expr, Function, I, ...
codeparrot/github-code-clean
import numpy as np from scipy.sparse import csgraph, csr_matrix, triu from . import PointCloud class Graph(object): r""" Abstract class for Graph definitions and manipulation. Parameters ---------- adjacency_matrix : ``(n_vertices, n_vertices, )`` `ndarray` or `csr_matrix` The adjacency ...
codeparrot/github-code-clean
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as AddressProvider class Provider(AddressProvider): building_number_formats = ('#', '##', '###', '#', '##', '###') street_suffixes = ( 'baan', 'boulevard', 'dreef', 'hof', 'laan', 'lei', 'pad', 'ring', 'singel', '...
codeparrot/github-code-clean