text
stringlengths
5.09k
178k
domain
stringclasses
106 values
# Copyright (C) 2012 Nippon Telegraph and Telephone 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 appli...
codeparrot/github-code-clean
import datetime import gzip import json import locale import logging import os import random import shutil import sys import warnings from pathlib import Path from typing import Dict, List, Optional, Union import numpy as np import pandas as pd import pytest from freezegun import freeze_time from ruamel.yaml import YA...
codeparrot/github-code-clean
# 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 except in compliance with the License. You may obtain # a ...
codeparrot/github-code-clean
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, print_function import errno import filecmp import functools import glob import itertools import json import multiprocessing import os import re imp...
codeparrot/github-code-clean
#!/usr/bin/env python """Tests for export converters.""" import json import os import socket from grr.client.client_actions import grr_rekall from grr.lib import action_mocks from grr.lib import aff4 from grr.lib import export from grr.lib import flags from grr.lib import flow from grr.lib import queues from grr.l...
codeparrot/github-code-clean
#!/usr/bin/env python3 # Copyright 2016-2017 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 ...
codeparrot/github-code-clean
#!/usr/bin/env python """AFF4 interface implementation. This contains an AFF4 data model implementation. """ import __builtin__ import abc import itertools import StringIO import threading import time import zlib import logging from grr.lib import access_control from grr.lib import config_lib from grr.lib import d...
codeparrot/github-code-clean
#!/usr/bin/python2.4 # -*- encoding: utf-8 -*- # This is pncconf, a graphical configuration editor for LinuxCNC # Chris Morley copyright 2009 # This is based from stepconf, a graphical configuration editor for linuxcnc # Copyright 2007 Jeff Epler <jepler@unpythonic.net> # # This program is free software;...
codeparrot/github-code-clean
#=============================================================================== # # SpecificPopulation.py # # This file is part of ANNarchy. # # Copyright (C) 2013-2016 Julien Vitay <julien.vitay@gmail.com>, # Helge Uelo Dinkelbach <helge.dinkelbach@gmail.com> # # This program is free software: yo...
codeparrot/github-code-clean
#!/usr/bin/env python ''' Fly Copter in SITL AP_FLAKE8_CLEAN ''' from __future__ import print_function import copy import math import os import shutil import time import numpy from pymavlink import mavutil from pymavlink import mavextra from pymavlink import rotmat from pysim import util from pysim import vehiclei...
codeparrot/github-code-clean
""" Test functions for stats module WRITTEN BY LOUIS LUANGKESORN <lluang@yahoo.com> FOR THE STATS MODULE BASED ON WILKINSON'S STATISTICS QUIZ https://www.stanford.edu/~clint/bench/wilk.txt Additional tests by a host of SciPy developers. """ import os import warnings from collections import namedtuple ...
codeparrot/github-code-clean
from mozdef_util.utilities.toUTC import toUTC from mq.plugins.guardDuty import message class TestGuardDuty(object): def setup(self): self.plugin = message() self.metadata = {"index": "events"} # Should never match and be modified by the plugin def test_nosource_log(self): metadata...
codeparrot/github-code-clean
# Copyright (c) 2013 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 ...
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 Results for discrete models from Stata """ import os import numpy as np class Namespace(object): pass # Discrete Model Tests # Note that there is a slight refactor of the classes, so that one dataset # might be used for more than one model cur_dir = os.path.abspath(os.path.dirname(__file__)) class A...
codeparrot/github-code-clean
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
codeparrot/github-code-clean
""" numpy.ma : a package to handle missing or invalid values. This package was initially written for numarray by Paul F. Dubois at Lawrence Livermore National Laboratory. In 2006, the package was completely rewritten by Pierre Gerard-Marchant (University of Georgia) to make the MaskedArray class a subclass of ndarray,...
codeparrot/github-code-clean
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- from error import * import autocompletiondlg import cfgdlg import characterreport import charmapdlg import commandsdlg import config import dialoguechart import finddlg import gutil import headersdlg import locationreport import locationsdlg import misc import myimpor...
codeparrot/github-code-clean
"""Module for performing sequence and read alignment operations. This module is part of the ``mapmuts`` package. Written by Jesse Bloom. List of functions ------------------- `AlignReads` : Aligns overlapping ungapped paired-end reads with known adaptors. `AlignReadToGene` : aligns read to a gene, does not handle ...
codeparrot/github-code-clean
#!/usr/bin/env python # # Authors: # rafael@postgresql.org.es / http://www.postgresql.org.es/ # # Copyright (c) 2014-2015 USIT-University of Oslo # # This file is part of Zabbix-CLI # https://github.com/rafaelma/zabbix-cli # # Zabbix-CLI is free software: you can redistribute it and/or modify # it under the terms of th...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from typing import Any, Callable, Dict, Iterable, List, Mapping, Tuple, TypeVar from mock import patch, MagicMock from django.http import HttpResponse from django.test import TestCase, override_settings from zerver.l...
codeparrot/github-code-clean
from __future__ import absolute_import from __future__ import print_function from typing import ( AbstractSet, Any, AnyStr, Callable, Dict, Iterable, Mapping, MutableMapping, Optional, Sequence, Set, Text, Tuple, TypeVar, Union ) from django.utils.html import escape from django.utils.translation import ugettex...
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 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 # (c) Copyright 2013 Hewlett-Pa...
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
# Copyright 2010-2011 OpenStack Foundation # 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 # not use this file except in compliance with the License. You may obtain # a copy of the Li...
codeparrot/github-code-clean
import xraylib import numpy import scipy.constants as codata toangstroms = codata.h * codata.c / codata.e * 1e10 #======================================================================================================================= # GENERIC UTILITIES #=============================================================...
codeparrot/github-code-clean
#!/usr/bin/env python # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """MB - the Meta-Build wrapper around GN. MB is a wrapper script for GN that can be used to generate build files for sets of canned co...
codeparrot/github-code-clean
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals, print_function import glob import itertools import logging import math import os import re import warnings import xml.etree.cElementTree as ET from collection...
codeparrot/github-code-clean
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
codeparrot/github-code-clean
from __future__ import print_function from __future__ import absolute_import import os import sys import math try: import cPickle as pickle except ImportError: import pickle import itertools try: from collections import OrderedDict except ImportError: from .oldpymodules import OrderedDict from .exceptio...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # # 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...
codeparrot/github-code-clean
#!/usr/bin/env python # # types_extras.py - tests for extras types conversions # # Copyright (C) 2008-2010 Federico Di Gregorio <fog@debian.org> # # psycopg2 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 Foundat...
codeparrot/github-code-clean
#!/usr/bin/env python3 # Copyright (c) 2015-2019 TurboCoin # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test block processing.""" import copy import struct import time from test_framework.blocktools import ( create_block...
codeparrot/github-code-clean
#!/usr/bin/env python3 import tempfile, sys, os, re import traceback import custom_arguments from argparse_compat import argparse from replace_imports import include_imports, normalize_requires, get_required_contents, recursively_get_requires_from_file, absolutize_and_mangle_libname from import_util import get_file, ge...
codeparrot/github-code-clean
# coding: utf-8 from __future__ import unicode_literals import itertools import json import os.path import random import re import traceback from .common import InfoExtractor, SearchInfoExtractor from ..compat import ( compat_chr, compat_HTTPError, compat_parse_qs, compat_str, compat_urllib_parse...
codeparrot/github-code-clean
################################################################################################################ # GEF - Multi-Architecture GDB Enhanced Features for Exploiters & Reverse-Engineers # # by @_hugsy_ # # GEF provides additional functions to GDB using its powerful Python API. Some # functions were inspired...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- #!/usr/bin/env python # # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Johan Gonqvist <johan.gronqvist@gmail.com> # Copyright (C) 2007-2009 Gary Burton <gary.burton@zen.co.uk> # Copyright (C) 2007-2009 Stephane Charet...
codeparrot/github-code-clean
# GemRB - Infinity Engine Emulator # Copyright (C) 2003-2004 The GemRB Project # # 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 ...
codeparrot/github-code-clean
""" :mod: SRM2Storage ================= .. module: python :synopsis: SRM v2 interface to StorageElement """ # # imports import os import re import time import errno from types import StringType, StringTypes, ListType, IntType from stat import S_ISREG, S_ISDIR, S_IMODE, ST_MODE, ST_SIZE # # from DIRAC from ...
codeparrot/github-code-clean
from __future__ import print_function, unicode_literals import logging import pytz import regex import six import time import traceback from datetime import datetime, timedelta from django.conf import settings from django.contrib.auth.models import User from django.contrib.postgres.fields import ArrayField from djang...
codeparrot/github-code-clean
# Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2010 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...
codeparrot/github-code-clean
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 Univer...
codeparrot/github-code-clean
# Copyright 2013-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 agree...
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 # # Copyright (c) 2019 by VMware, Inc. ("VMware") # Used Copyright (c) 2018 by Network Device Education Foundation, Inc. ("NetDEF") # in this file. # # Permission to use, copy, modify, and/or distribute this software # for any purpose with or without fee is hereby granted, provided # that the abov...
codeparrot/github-code-clean
"""Unit tests for hil.api Some general notes: Probably most of our technical debt is in this module; about 75% of it was written in one day by one person, way back when the HIL codebase was somewhat embarassing, we basically didn't have a test suite, and we decided we needed one in a hurry. The biggest problem is tha...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
codeparrot/github-code-clean
"""Gradient Boosted Regression Trees This module contains methods for fitting gradient boosted regression trees for both classification and regression. The module structure is the following: - The ``BaseGradientBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regressio...
codeparrot/github-code-clean
""" parser.http.movieParser module (imdb package). This module provides the classes (and the instances), used to parse the IMDb pages on the akas.imdb.com server about a movie. E.g., for Brian De Palma's "The Untouchables", the referred pages would be: combined details: http://akas.imdb.com/title/tt0094226/combi...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- """ @authors: tomasz marchlewski (marchlewski.tomasz@gmail.com, marchlewski@slcj.uw.edu.pl) roman szenborn (romanszenborn@gmail.com) @version: beta 2.0 --Quick guide-- 1. General info 2. MakeMyGate requirements 3. Installing python and modules a. Anaconda distribution b. Mi...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- defineDict = {} typedefDict = {} # ////////////////////////////////////////////////////////////////////// # @system 新一代交易所系统 # @company 上海期货信息技术有限公司 # @file ThostFtdcUserApiDataType.h # @brief 定义了客户端接口使用的业务数据类型 # @history # 20060106 赵鸿昊 创建该文件 # ////////////////////////////////////////////////...
codeparrot/github-code-clean
from __future__ import with_statement import binascii import datetime import pytest import aredis import time from string import ascii_letters from aredis.utils import (b, iteritems, iterkeys, itervalues) from aredis.commands.server import parse_info from aredis.exceptions import (RedisError,...
codeparrot/github-code-clean
from openmesh import * import writemesh as wr import ioutils as io from ioutils import omvec, OrderedSet import numpy as np from numpy.linalg import norm, eig import scipy.integrate as integrate import matplotlib.pyplot as plt from collections import OrderedDict from scipy.spatial import Delaunay from tmp_read_data...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # Nano Basket # Copyright (C) 2011 Roy Vegard Ovesen <roy.vegard.ovesen@gmail.com> # This file is part of Nano Basket. # # Nano Basket 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
#!/usr/bin/env python2 import os, sys, getopt, re import serial #pyserial from PIL import Image # from PIL import ImageTk # from PIL import ImageFilter import time, glob, math module_info = { 'NAME': "pyLaser", 'ORIGINAL_AUTHOR': "Applied Ellippsis", # leave this 'AUTHOR': "Applied Ellipsis", # change this to you 'D...
codeparrot/github-code-clean
# # This source file is part of the EdgeDB open source project. # # Copyright 2017-present MagicStack Inc. and the EdgeDB authors. # # 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...
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
# is it a good idea to put it on a top-level here?.. maybe some singleton would be nicer or something... from cffi import FFI ffi = FFI() ffi.cdef(''' //typedef ... Treal; // damn, stuff like this doesn't work with cffi yet... structs are fine, but not the basic types :( // so, we stick to 'double' here: void cffti(i...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): # Flag to indicate if this migration is too risky # to run online and needs to be coordinated for offline ...
codeparrot/github-code-clean
""" Calculate the solar position using the NREL SPA algorithm either using numpy arrays or compiling the code to machine language with numba. """ # Contributors: # Created by Tony Lorenzo (@alorenzo175), Univ. of Arizona, 2015 from __future__ import division import os import threading import warnings import logging p...
codeparrot/github-code-clean
from django.core.exceptions import FieldDoesNotExist from django.db import ( IntegrityError, connection, migrations, models, transaction, ) from django.db.migrations.migration import Migration from django.db.migrations.operations.fields import FieldOperation from django.db.migrations.state import ModelState, Projec...
codeparrot/github-code-clean
from contextlib import contextmanager import pickle import sqlalchemy as tsa from sqlalchemy import ARRAY from sqlalchemy import bindparam from sqlalchemy import BLANK_SCHEMA from sqlalchemy import Boolean from sqlalchemy import CheckConstraint from sqlalchemy import Column from sqlalchemy import ColumnDefault from sq...
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
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the...
codeparrot/github-code-clean
dice = { 65536: 'vexingly', 65541: 'viability', 65542: 'viable', 65543: 'vibes', 65544: 'vice', 65545: 'vicinity', 65546: 'victory', 65551: 'video', 65552: 'viewable', 65553: 'viewer', 65554: 'viewing', 65555: 'viewless', 65556: 'viewpoint', 65561: 'vigorous', 65562: 'village', 65563: 'villain', 65564:...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # # gPrime - A web-based genealogy program # # Copyright (C) 2009 Brian G. Matherly # Copyright (C) 2010 Jakim Friant # Copyright (C) 2011 Vlada Perić <vlada.peric@gmail.com> # Copyright (C) 2011 Matt Keenan <matt.keenan@gmail.com> # Copyright (C) 2011 Tim G L Lyons...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # Resource object code # # Created: Mon Feb 9 23:22:18 2015 # by: The Resource Compiler for PyQt (Qt v4.8.4) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x27\x14\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\...
codeparrot/github-code-clean
#!/usr/bin/env python # # cmlconfigure.py -- CML2 configurator front ends # by Eric S. Raymond, <esr@thyrsus.com> # # Here is the actual code for the configurator front ends. # import sys if sys.version[0] < '2': print "Python 2.0 or later is required for this program." raise SystemExit, 1 import os, string, ...
codeparrot/github-code-clean
#!/usr/bin/env python # This file is part of the Burner suite. # # Burner 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. # # Burner i...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # lmoments3 library # Copyright (C) 2012, 2014 J. R. M. Hosking, William Asquith, # Sam Gillespie, Pierre Gérard-Marchant, Florenz A. P. Hollebrandse # # 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 ...
codeparrot/github-code-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011-2013 Codernity (http://codernity.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/L...
codeparrot/github-code-clean
############################################################################### ## ## Copyright 2011,2012 Tavendo GmbH ## ## 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
# -*- coding: utf-8 -*- """ ########## # Fields # ########## Each Field class does some sort of validation. Each Field has a clean() method, which either raises django.forms.ValidationError or returns the "clean" data -- usually a Unicode object, but, in some rare cases, a list. Each Field's __init__() takes at least...
codeparrot/github-code-clean
#__docformat__ = "restructuredtext en" # ******NOTICE*************** # optimize.py module by Travis E. Oliphant # # You may copy and use this module as you see fit with no # guarantee implied provided you keep this notice in all copies. # *****END NOTICE************ # A collection of optimization algorithms. Version ...
codeparrot/github-code-clean
""" Define a ``targname_dict`` that is used as a look up table for resolving target names. The ``targname_dict`` is comrpised of two major sets of key/value pairs: (1) Target names that need resolving (2) Target names that do not need resolving The target names that need resolving are typically those that us...
codeparrot/github-code-clean
from __future__ import unicode_literals import datetime import pickle import unittest from collections import OrderedDict from operator import attrgetter from django.core.exceptions import FieldError from django.db import DEFAULT_DB_ALIAS, connection from django.db.models import Count, F, Q from django.db.models.sql....
codeparrot/github-code-clean
# -*- test-case-name: twisted.test.test_ftp -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ An FTP protocol implementation """ # System Imports import os import time import re import operator import stat import errno import fnmatch import warnings try: import pwd, grp except Impor...
codeparrot/github-code-clean
#!/usr/bin/env python # # Copyright 2007 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 o...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # # (c) 2016, Yanis Guenane <yanis+ansible@guenane.org> # # 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 vers...
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
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2014 Glencoe Software, Inc. All Rights Reserved. # Use is subject to license terms supplied in LICENSE.txt # # 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 # th...
codeparrot/github-code-clean
""" This module defines tensors with abstract index notation. The abstract index notation has been first formalized by Penrose. Tensor indices are formal objects, with a tensor type; there is no notion of index range, it is only possible to assign the dimension, used to trace the Kronecker delta; the dimension can be...
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
#!/usr/bin/env python """ A linting tool to check if templates are safe """ from __future__ import print_function import argparse import ast from enum import Enum import os import re import sys import textwrap class StringLines(object): """ StringLines provides utility methods to work with a string in terms o...
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
# coding: utf-8 """ Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path opera...
codeparrot/github-code-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011-2013 Codernity (http://codernity.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/L...
codeparrot/github-code-clean
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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...
codeparrot/github-code-clean
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- # # Impressive, a fancy presentation tool # Copyright (C) 2005-2008 Martin J. Fiedler <martin.fiedler@gmx.net> # portions Copyright (C) 2005 Rob Reid <rreid@drao.nrc.ca> # portions Copyright (C) 2006 Ronan Le Hy <rlehy@free.fr> # portions Copyright (C) 2007 Luke Campag...
codeparrot/github-code-clean
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Feb 10 15:39:33 2017 @author: kostenko & der sarkissian *********** Pilot for the new tomobox ************* """ #%% Initialization import matplotlib.pyplot as plt from scipy import misc # Reading BMPs import os import numpy import re import t...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # pylint: disable=E1101 # pylint: disable=W0212 import copy import mock import shutil import lxml from datetime import timedelta from fs.osfs import OSFS from json import loads from path import path from tempdir import mkdtemp_clean from textwrap import dedent from uuid import uuid4 from djan...
codeparrot/github-code-clean
import datetime import time import csv import copy from operator import itemgetter, attrgetter, methodcaller from django.db.models import Q from django.http import HttpResponse, HttpResponseServerError, Http404, HttpResponseNotFound, HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from djan...
codeparrot/github-code-clean
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # # test cases for new-style fields # import base64 from collections import OrderedDict from datetime import date, datetime, time import io from PIL import Image import psycopg2 from odoo import models, fields from odoo...
codeparrot/github-code-clean
import struct import unittest import json from manticore.platforms import evm from manticore.core import state from manticore.core.smtlib import Operators, ConstraintSet import os class EVMTest_ADDMOD(unittest.TestCase): _multiprocess_can_split_ = True maxDiff = None def _execute(self, new_vm): l...
codeparrot/github-code-clean
import re from django.contrib.auth.decorators import login_required from django.forms import model_to_dict import json import logging from copy import deepcopy from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, redirect from django.template import Context from django.templa...
codeparrot/github-code-clean
''' setup dataset for ATLAS ''' import re import sys import time import types import urllib import hashlib import datetime import commands import threading import traceback import ErrorCode import TaskAssigner from DDM import ddm from DDM import toa from DDM import rucioAPI from dataservice.DDM import dq2Common from ...
codeparrot/github-code-clean
# Copyright 2016 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 (c) 2014, Fundacion Dr. Manuel Sadosky # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this # list of condit...
codeparrot/github-code-clean