text stringlengths 2 999k |
|---|
#!/usr/bin/env python
import os
import os.path
import platform
import shutil
import sys
if 'build_ext' in sys.argv:
sys.argv.insert(sys.argv.index('build_ext') + 1, '--inplace')
from distutils.core import setup, Command
from Cython.Build import cythonize
from Cython.Distutils import build_ext, extension
ECHOMESH_... |
"""
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
"""
from builtins import zip, str, range
import pdb, os, csv, re, io, string
import url... |
import _plotly_utils.basevalidators
class NticksValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="nticks", parent_name="funnel.marker.colorbar", **kwargs
):
super(NticksValidator, self).__init__(
plotly_name=plotly_name,
parent_n... |
# Copyright 2013 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.
"""Runs a Google Maps pixel test.
Performs several common navigation actions on the map (pan, zoom, rotate) then
captures a screenshot and compares selected ... |
urls =["https://oulunmei.en.alibaba.com/it_IT/productgrouplist-818789095/Tabella_di_preparazione.html?spm=a2700.icbuShop.98.5.30023686ZPFxuv","https://italian.alibaba.com/product-detail/modern-nordic-light-luxury-style-wooden-makeup-dressers-table-with-glass-mirror-and-5-storage-dreawer-for-bedroom-furniture-1600058974... |
"""Alert on any Duo auth logs marked as a failure due to an Anonymous IP."""
from streamalert.shared.rule import rule
@rule(logs=['duo:authentication'])
def duo_anonymous_ip_failure(rec):
"""
author: airbnb_csirt
description: Alert on Duo auth logs marked as a failure due to an Anonymous IP.
re... |
import faceRecorgnize.cropFaces as cropFaces
import faceRecorgnize.faceRecorgnize as faceRecorgnize
import utils.ImageUtils as ImageUtils
import utils.Constants as Constants
import utils.FaceUtils as FaceUtils
import cv2 as cv
import os
import numpy as np
import db.FaceData as FaceData
rawImageRootPath = "/Users/i3264... |
# -*- coding: utf-8 -*-
#This code is adaped from
# https://github.com/dfm/corner.py
# git hash 5c2cd63 on May 25
# Modifications by John Baker NASA-GSFC (2016-18)
#Copyright (c) 2013-2016 Daniel Foreman-Mackey
#All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#modification, a... |
from baby_steps import then, when
from district42 import optional, schema
from district42_exp_types.sdict import SDictSchema, schema_sdict
def test_sdict_declaration():
with when:
sch = schema_sdict
with then:
assert isinstance(sch, SDictSchema)
def test_sdict_nested_declaration():
wit... |
# Copyright 2010-2021, 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 conditions and ... |
# Generated by Django 2.0.9 on 2019-01-05 03:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('medical', '0001_initial'),
('personnel', '0008_auto_20181125_1536'),
]
operations = [
migrations.AddField(
model_name='e... |
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX
from django.test import TestCase
from django_fire.hashers import (
FIRED_PASSWORD_PREFIX,
is_password_fired, make_fired_password,
)
class TestHashers(TestCase):
def test_is_password_fired(self):
# unusable password made by django_fi... |
from collections import defaultdict
import humanize
import mercantile
from .mbtiles import MBTiles
def all_descendant_tiles(x, y, zoom, max_zoom):
"""Return all subtiles contained within a tile"""
if zoom < max_zoom:
for child_tile in mercantile.children(x, y, zoom):
yield child_tile
... |
# Copyright 2014-2016, A10 Networks
# 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... |
import numpy as np
from scipy.special import erfinv
from scipy.special._ufuncs import xlogy, erf, log1p, stdtrit, gammaln, stdtr, \
btdtri, betaln, btdtr, gammaincinv, gammainc
from .base import Prior
from ..utils import logger
class DeltaFunction(Prior):
def __init__(self, peak, name=None, latex_label=None... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import filer.fields.image
import cms.models.fields
class Migration(migrations.Migration):
dependencies = [
('cms', '0003_auto_20140926_2347'),
('filer', '0001... |
from setuptools import find_packages, setup
install_requires = ('django-admin-sso', 'django-crispy-forms')
setup(
name='incuna-auth',
version='10.0.0',
url='http://github.com/incuna/incuna-auth',
packages=find_packages(),
include_package_data=True,
install_requires=install_requires,
descr... |
import os
import re
import pickle
import random
import pylab
import os.path as osp
import numpy as np
from collections import defaultdict
from sklearn.feature_extraction.text import CountVectorizer
from scipy.sparse import coo_matrix
from utils import count_all_paths_with_mp, count_paths, get_path_dict_and_length, one_... |
#!/usr/bin/env python
# -*-coding:utf-8-*-
import os
import shutil
import sys
from setuptools import setup, find_packages
is_windows = 'win32' == sys.platform.lower()
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f... |
import pytest
from .main_spider import MainSpider
from scrapy.http import Response, Request
from tempfile import NamedTemporaryFile
import json
SAMPLE_HEADERS = {
"Server": "Apache",
"X-Content-Type-Options": "nosniff, nosniff",
"Link": '<https://www.cisa.gov/>; rel="shortlink", <https://www.cisa.gov/>; re... |
# imports - compatibility imports
from __future__ import absolute_import
# imports - standard imports
import os.path as osp
import traceback
from fluxml.commands.util import cli_format
from bpyutils.util._dict import merge_dict
from bpyutils.util.system import touch
from bpyutils.config import enviro... |
# -*- coding: utf-8 -*-
from ..fixtures import parametrize
from korona.html.tags import Cite
from korona.templates.html.tags import cite
@parametrize('attributes', [
({'text': 'abcd'}),
])
def test_construct_cite_tag(attributes):
"""Test for validating whether the citation tag is constructed correctly or
... |
from dsbox.template.template import DSBoxTemplate
from d3m.metadata.problem import TaskKeyword
from dsbox.template.template_steps import TemplateSteps
from dsbox.schema import SpecializedProblem
import typing
import numpy as np # type: ignore
class RegressionWithSelection(DSBoxTemplate):
def __init__(self):
... |
# from flask import Flask
from flask import Flask, request, render_template
import sqlite3
import io
import csv
import redis
app = Flask(__name__)
tem = sqlite3.connect('cloud.db')
tem.execute('CREATE TABLE if not exists equake(time VARCHAR(100),latitude DECIMAL,longitude DECIMAL,depth DECIMAL,mag DECIMAL,magType VARC... |
"""
Arithmetic operations for PandasObjects
This is not a public API.
"""
# necessary to enforce truediv in Python 2.X
from __future__ import division
import datetime
import operator
import textwrap
import warnings
import numpy as np
import pandas as pd
from pandas._libs import lib, algos as libalgos, ops as libops
... |
import tensorflow as tf
import kerastuner as kt
from sacred import Experiment
from model.training import sharpe_loss, fit
from util.data import load_data, preprocess, split_train_test_validation, make_dataset, create_full_datasets
ex = Experiment()
@ex.config
def config():
data_dir = 'data'
alpha = 0.01
... |
#from Common.IO.DirInfo.IDirInfo import IDirInfo
from abc import *
from pathlib import Path
import os
import datetime
class DirInfo(ABC):
__length: int = 0
__path_orig: str = ''
__path_abs: str = ''
__dir_name: str = ''
__dir_path: str = ''
__dir_root: str = ''
__name: str = ''
__is_ab... |
"""
API user class
"""
class APIUser:
"""
Information about an api user.
"""
def __init__(self, token, username, email, user_id):
self.token = token
self.username = username
self.email = email
self.is_admin = False
self.clockify_id = user_id
def get_token(... |
# -*- coding: utf-8 -*-
import io
import os
import subprocess
import sys
from distutils.version import LooseVersion
import numpy as np
import pandas as pd
try:
from pandas.tslib import Timestamp
except ImportError:
from pandas import Timestamp
import pytest
from .util import tempdir
import fastparquet
from fa... |
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... |
import itertools
import math
import numbers
import re
import functools
from typing import List
from collections import OrderedDict
from opentrons.util.vector import Vector
SUPPORTED_MODULES = ['magdeck', 'tempdeck']
def unpack_location(location):
"""
Returns (:Placeable:, :Vector:) tuple
If :location:... |
# -*- coding: utf-8 -*-
import pytest
from sqlalchemy import inspect
from h.models import GroupScope
class TestGroupScope:
def test_save_and_retrieve_scope(self, db_session, factories):
scope = "http://example.com"
factories.GroupScope(scope=scope)
group_scope = db_session.query(GroupS... |
__version__ = '0.10.9a1'
|
import pandas as pd
import numpy as np
import sys
import matplotlib.pyplot as plt
import math
import Mesh_node
class Dis(object):
def __init__(self):
self.dis
@classmethod
def cal_dis(self, node1, node2):
self.dis = math.sqrt((node1.x_pos-node2.x_pos)**2+(node1.y_pos-node2.y_pos)**2)
return s... |
import py
from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC
from pypy.module.pypyjit.test_pypy_c.model import OpMatcher
class TestCall(BaseTestPyPyC):
def test_recursive_call(self):
def fn():
def rec(n):
if n == 0:
return 0
... |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 Eldar Nugaev
# 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://... |
from kaa.keyboard import *
# Todo: Splitting key bind table does not make sense.
# Put them together.
# application commands
app_keys = {
(alt, 'm'): 'app.mainmenu',
(alt, '/'): 'app.mainmenu',
f1: 'app.mainmenu',
f9: 'app.global.prev',
f10: 'app.global.next',
(alt, 'w'): 'menu.window',
(a... |
from unittest import TestCase
from fastapi.testclient import TestClient
from testing.postgresql import Postgresql
from testing.redis import RedisServer
from app.entrypoints.api.client import create_app
class TestAPI(TestCase):
@classmethod
def setUpClass(cls):
cls.pg = Postgresql(
host='... |
from .mountainclient import MountainClient, client
|
import numpy as np
from scipy.special import expit
from constants import *
class NeuralNetMLP(object):
def __init__(self, layers, random_state=None):
""" Initialise the layers as list(input_layer, ...hidden_layers..., output_layer) """
np.random.seed(random_state)
self.num_layers = len(layers)
self.layers = l... |
from ..search import Search
from .settings import BAIDU_URLS
from bs4 import BeautifulSoup
import re
class BASearch(Search):
'''
BASearch is a class to gather result from Baidu Search Engine.
Search -> Inherited.
'''
URL = BAIDU_URLS['BAIDU_SEARCH']
LABELS = ['title', 'description', 'author', 'aut... |
#!/usr/bin/env python
#
# Copyright 2012 The Closure Linter 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
#
#... |
import textwrap
def test_day01():
"""Tests that the simple test case for 2020 day 01 works"""
from advent_of_code.y2020.day01 import report_repair
data = textwrap.dedent("""
1721
979
366
299
675
1456
""")
data = data.strip().split("\n")
result = ... |
"""
Retrieve Pillar data by doing a SQL query
This module is not meant to be used directly as an ext_pillar.
It is a place to put code common to PEP 249 compliant SQL database adapters.
It exposes a python ABC that can be subclassed for new database providers.
:maturity: new
:platform: all
Theory of sql_base ext_pil... |
#!/usr/bin/python
# -*- coding: utf8 -*-
# cp936
#
# The MIT License (MIT)
#
# Copyright (c) 2010-2017 fasiondog
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... |
def main():
trick.real_time_enable()
trick.exec_set_software_frame(0.1)
trick.sim_control_panel_set_enabled(True)
if __name__ == "__main__":
main()
|
import file_hasher as f
import unittest
import sys
import os
testdir = os.path.dirname(__file__)
srcdir = '../lib'
sys.path.insert(0, os.path.abspath(os.path.join(testdir, srcdir)))
class TestFileHasher(unittest.TestCase):
def setUp(self):
self.file_hasher = f.FileHasher("./test_file.txt", "sha1")
d... |
#!/usr/bin/python
##Joseph Greenfield
##jsgreenfield@my.uri.edu
##
import argparse
import hashlib
import time
import datetime
# for multi-threaded
from Queue import Queue
from threading import Thread
#for CASE/UCO Output
import case
#To add the INDXParse library
import sys
sys.path.insert(0, "/home/joe/INDXParse")... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
from .sql_updates import check_and_insert_user_agent
from .sql_updates import get_username_random, get_username_to_unfollow_random
from .sql_updates import (
get_usernames_first,
get_usernames,
get_username_row_count,
... |
__author__ = 'patras'
from domain_searchAndRescue import *
from timer import DURATION
from state import state
def GetCostOfMove(r, l1, l2, dist):
return dist
DURATION.TIME = {
'giveSupportToPerson': 15,
'clearLocation': 5,
'inspectPerson': 20,
'moveEuclidean': GetCostOfMove,
'moveCurved': GetC... |
import time
import pcap
import struct
import threading
import subprocess as sp
import Queue
from scapy.all import *
# def parse(tup):
# time, data = tup
# class BtPacket(object):
# @classmethod
# def is_valid(cls, tup):
# return len(tup[1]) == 15+8
# def __init__(tup):
# t, data = ... |
import unittest
from pyats.topology import loader
from genie.libs.sdk.apis.iosxe.interface.configure import configure_interface_span_portfast
class TestConfigureInterfaceSpanPortfast(unittest.TestCase):
@classmethod
def setUpClass(self):
testbed = """
devices:
m4a:
conne... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from typing import Any, List, Sized, Tuple
import torch as torch
import torch.nn as nn
from pytext.utils.cuda import FloatTensor
from pytext.utils.tensor import xaviervar
from pytext.utils.torch import reverse_tensor_list
... |
from rest_framework import status
from uuid import uuid4
import datetime;
import csv
# Create your views here.
from rest_framework.decorators import api_view
from datetime import datetime
from django.utils.encoding import smart_str
from rest_framework import generics
from rest_framework import generics
from rest_frame... |
import os
from getArgs import getArgs
from modules import python, javascript, html, php, bootstrap, cca
# from folder import file
# code-buddy.py create (file type) (directory name)
# Checks for "create"
if getArgs(1) == "create":
# Checks for which file type
projectType = getArgs(2)
# Checks for file name
... |
import json
import os
import datetime
import threading
from subprocess import check_output
import time
class MetricsPooler:
def __init__(self):
self.logFolder = "logs"
self.delay_between_temp_check: float = None
self.max_number_timestamp_displayed: int = None
self.current_day: str ... |
from __future__ import absolute_import
import codecs
import copy
import re
from ._form import parse_forms
from ._headersutil import is_html as _is_html
from ._headersutil import split_header_words
from ._rfc3986 import clean_url, urljoin
from .polyglot import is_string
DEFAULT_ENCODING = "utf-8"
def elem_text(elem... |
from data_science_layer.reporting.abstract_report import AbstractReport
from data_science_layer.pipeline.abstract_pipline import AbstractPipeline
import matplotlib.pyplot as plt
import pkg_resources
class ActualVsPredictionPlot(AbstractReport):
sub_folder = 'reports'
def report(self, pipeline: AbstractPipel... |
import unittest
from unittest.mock import MagicMock
from tests.test_base import TestBase
from timerecorder import timerecord
from timerecorder.receiver import Receiver
from timerecorder.statsProcessor import StatsProcessor
class TestTimeRecord(TestBase):
def __init__(self, methodName):
TestBase.__init__(s... |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
from six import string_types
class CashewException(Exception):
pass
class InternalCashewException(CashewException):
pass
class UserFeedback(CashewException):
pass
class InactivePlugin(UserFeedback):
def __init__(self, plugin_instance_or_alias):
if isinstance(plugin_instance_or_alias, string_... |
from flask_philo import app
from flask_philo.db.postgresql.orm import BaseModel
from flask_philo.db.postgresql import syncdb
from flask_philo.db.postgresql.connection import get_pool
from flask_philo.db.redis.connection import get_pool as get_redis_pool
from flask_philo.db.elasticsearch.connection import get_pool as ge... |
# -*- coding: utf-8 -*-
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
import collections
from pylint.exceptions import UnknownMessageError
from pylint.message.message_id_store import MessageIdStore
class MessageDe... |
import discord
from discord.ext import commands
from discord.ext.commands.core import has_permissions
from Tools.utils import getConfig, updateConfig
class AntiSpamCog(commands.Cog, name="Anti Spamming"):
"""
Enable or Disable Anti-Spam Property of Garuda.
When enabled, Garuda will warn or kick member i... |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import Survey, Question, Feedback, Assignment
class QuestionInline(admin.StackedInline):
model = Question
extra = 1
class AssignmentInline(admin.TabularInline):
model = Assignment
extra = 1
class SurveyA... |
import numpy as np
# from matplotlib import pyplot
from pySOT import *
# import pySOT.gp_regression as GPRegression
# import pySOT.mars_interpolant as MARSInterpolant
# from pySOT import MARSInterpolant
import pandas as pd
from pandas.tools.plotting import parallel_coordinates
import matplotlib.pyplot as plt
f... |
import os
import time
import boto3
import logging
from botocore.client import Config
from botocore.exceptions import ClientError
from src.config import Config as AppConfig
logger = logging.getLogger("GW:s3")
class S3Client:
def __init__(self, url, access_key, secret_key):
self.url = url
self.s3 =... |
#!/usr/bin/env python
import sys
import numpy
import logging
import kernel_tuner
from collections import OrderedDict
import gc
def tune(device_name, strategy="bayes_opt_GPyTorch_lean", strategy_options=None, verbose=True, quiet=False, simulation_mode=True):
#input dimensions and data
image_width = 4096
... |
import pandas as pd
import numpy as np
from scipy.stats import norm
import pdb as pdb
import os
# Last updated on 5/01/2022 19:08
#######
# Data Extraction
#######
def path_data():
# Path parsing to make it work across computers
path_directory = os.path.dirname(os.getcwd())
path_data = pat... |
# 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... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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... |
# 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... |
import time
# decorator to time the function
def timer(func):
def wrapper(*args, **kwargs):
start = time.perf_counter()
result = func(*args, **kwargs)
end = time.perf_counter()
print(f'{func.__name__} took {end - start} seconds')
return result
return wrapper |
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import codecs
import errno
import os
import sys
import warnings
from tempfile import mkdtemp
import six
__all__ = [
"Path",
"get_terminal_size",
"finalize",
"partialmethod",
"JSONDecodeError",
"F... |
import pytest
from bencode import decode_int, decode_str, decode_lst
class TestClass:
def test_int(self):
bencode = [b'i42e', b'i-42e', b'i238327832e']
real = [42, -42, 238327832]
for (bencode, real) in list(zip(bencode, real)):
assert decode_int(bencode, 0)[0] == ... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='home'),
path('delete/<list_id>', views.delete, name='delete'),
path('cross_off/<list_id>', views.cross_off, name='cross_off'),
path('uncross/<list_id>', views.uncross, name='uncross'),
path('edit/<list_id>',... |
# -*- coding: utf-8 -*-
import info
class subinfo(info.infoclass):
def registerOptions(self):
if CraftCore.compiler.isMinGW():
self.options.dynamic.setDefault("buildType", "Release")
def setTargets(self):
self.versionInfo.setDefaultValues()
self.svnTargets["5.212"] = "http... |
from PIL.PcfFontFile import *
|
import xml.etree.ElementTree as ET
from os import getcwd
sets=[('2007', 'train')]
classes = ["Plant"]
def convert_annotation(year, image_id, list_file):
in_file = open('VOCdevkit/VOC%s/Annotations/%s.xml'%(year, image_id))
tree=ET.parse(in_file)
root = tree.getroot()
for obj in root.iter('object'):... |
import unittest
from platform import python_version
from algoliasearch.user_agent import UserAgent
from algoliasearch.version import VERSION
class TestUserAgent(unittest.TestCase):
default = 'Algolia for Python ({}); Python ({})'.format(
VERSION, str(python_version()))
def tearDown(self):
Us... |
from twisted.web.server import Site
from twisted.web.static import File
from twisted.internet import reactor
resource = File('/opt/WebServerApacheFull/httpd-2.2.22/htdocs/')
factory = Site(resource)
reactor.listenTCP(8080, factory)
reactor.run()
|
# This file is part of the Reproducible and Reusable Data Analysis Workflow
# Server (flowServ).
#
# Copyright (C) 2019-2021 NYU.
#
# flowServ is free software; you can redistribute it and/or modify it under the
# terms of the MIT License; see LICENSE file for more details.
"""Unit test for creating workflow runs."""
... |
#!/usr/bin/env python
import os
import sys
import socket
import time
try:
from urllib.parse import urlparse # Python 3
except ImportError:
from urlparse import urlparse # Python 2
import posixpath
import json
import requests
import classad
TOKEN_DIR_ENV_NAME = '_CONDOR_CREDS'
TOKEN_FILE_EXT = '.use'
DEFAULT... |
import hashlib
import os
os.chdir('D:\\MyProjects\\cursos-dio\\seguranca-da-informacao\\tools1')
file1 = 'a.txt'
file2 = 'b.txt'
hash1 = hashlib.new('ripemd160')
hash1.update(open(file1, 'rb').read())
hash2 = hashlib.new('ripemd160')
hash2.update(open(file2, 'rb').read())
if hash1.digest() != hash2.digest():
p... |
# Copyright 2019 TerraPower, 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 writi... |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import logging
import os
import posixpath
from environment import IsPreviewServer
from extensions_paths import (
API, API_FEATURES, JSON... |
from . import *
class BoerseArdArticle(Article):
SUFFIX = ''
domain = 'boerse.ard.de'
fetcher_url = 'http://www.tagesschau.de/newsticker.rdf'
@classmethod
def fetch_urls(self):
''' Article urls for a single website. '''
import feedparser
feed = feedparser.parse(self.fetcher... |
from django.http import HttpResponse
from django.urls import path
from . import views
app_name = 'vroombaby'
urlpatterns = [
path('', views.index, name='index'),
path('googleeb914ff572b518f7', views.googleeb914ff572b518f7),
] |
import time
from common.scene import Scene
from common.tool import *
from ext.serverchan import program_exit_alert
from games.azurelane.scenes.enemy_search import EnemySearch
def battle_fighting(prefix):
s = Scene("检测战斗进行时",
identify_image=load_resource("stop_auto_battle_detection.png", p... |
from dataclasses import asdict, dataclass
import asyncio
import base64
import binascii
import chevron
import hashlib
import json
import logging
import re
from aiohttp import ClientConnectionError, ClientSession, ClientTimeout
from arq import Retry, cron
from arq.utils import to_unix_ms
from arq.worker import run_worke... |
import numpy as np
import argparse
import cv2 as cv
try:
import cv2 as cv
except ImportError:
raise ImportError('Can\'t find OpenCV Python module. If you\'ve built it from sources without installation, '
'configure environemnt variable PYTHONPATH to "opencv_build_dir/lib" directory (with "... |
"""Monte Carlo simulations of accuracy"""
import numpy as np
import scipy.stats as stats
from modelmodel.misc import process_prng
def accuracy(p, prng=None):
prng = process_prng(prng)
N = len(p)
return prng.binomial(1, p, N), prng
|
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 05 14:45:48 2015
@author: ryan
"""
import pandas as pd
import pytz
import datetime as DT
import numpy as np
import cPickle as pickle
import os
import logging
import pdb
import pathos
import helper_multiprocess
from csvdb import CsvDatabase
import config as cfg
from energ... |
import os
import shutil
import subprocess
from copy import deepcopy
from exceptions import TypeError
from django.test import TestCase
from django.utils import simplejson
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from test_utils import create_test_user
from jetpack.models... |
import random
import re
# lets create a board object to represent the minesweeper game
# this is so that we can just say "create a new board object", or
# "dig here", or "render this game for this object"
class Board:
def __init__(self, dim_size, num_bombs):
# let's keep track of these parameters. ... |
"""
Errors that Grizzly throws.
"""
class GrizzlyError(Exception):
pass
|
# Copyright 2012-2014 Brian May
#
# This file is part of python-tldap.
#
# python-tldap 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.... |
"""Julia set generator without optional PIL-based image drawing"""
import time
# area of complex space to investigate
x1, x2, y1, y2 = -1.8, 1.8, -1.8, 1.8
c_real, c_imag = -0.62772, -.42193
@profile
def calculate_z_serial_purepython(maxiter, zs, cs):
"""Calculate output list using Julia update rule"""
outpu... |
#!/usr/bin/env python2.5
#
# Copyright 2009 the Melange 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.10.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
from aio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.