hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7ee137f194bc07b4f04dd287337983f434793b54 | 208 | py | Python | files.py | CodeBreaker444/python3_basics-snippets-cheatsheets | ac62760602e168e485d0b930df7d5d14a854de6f | [
"MIT"
] | 5 | 2018-01-31T00:58:07.000Z | 2021-09-27T19:39:58.000Z | files.py | CodeBreaker444/python3_basics-snippets-cheatsheets | ac62760602e168e485d0b930df7d5d14a854de6f | [
"MIT"
] | null | null | null | files.py | CodeBreaker444/python3_basics-snippets-cheatsheets | ac62760602e168e485d0b930df7d5d14a854de6f | [
"MIT"
] | null | null | null | import os
file=open("test.txt","wb")
print(file.mode)
print(file.name)
file.write(bytes("Hello i am ready\n",'UTF-8'))
file.close()
file=open("test.txt","r+")
print(file.read())
#os.remove("test.txt") | 23.111111 | 48 | 0.653846 |
1e7c71a8ee5e5dab7c627ceaa397fe780b40dc68 | 62,267 | py | Python | python/ccxt/base/exchange.py | angyvolin/ccxt | 180208c273c567242938cf2ad14fddb84c798624 | [
"MIT"
] | null | null | null | python/ccxt/base/exchange.py | angyvolin/ccxt | 180208c273c567242938cf2ad14fddb84c798624 | [
"MIT"
] | null | null | null | python/ccxt/base/exchange.py | angyvolin/ccxt | 180208c273c567242938cf2ad14fddb84c798624 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Base exchange class"""
# -----------------------------------------------------------------------------
__version__ = '1.17.214'
# -----------------------------------------------------------------------------
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NotSuppo... | 40.146357 | 185 | 0.596865 |
42557a451eda1befec198667b0055a44bd2717e8 | 8,315 | py | Python | tests/test_build.py | joelostblom/jupyter-book | 9a2c8e7149e0184c0d0924e7d3b54b7c720bfd5e | [
"BSD-3-Clause"
] | null | null | null | tests/test_build.py | joelostblom/jupyter-book | 9a2c8e7149e0184c0d0924e7d3b54b7c720bfd5e | [
"BSD-3-Clause"
] | null | null | null | tests/test_build.py | joelostblom/jupyter-book | 9a2c8e7149e0184c0d0924e7d3b54b7c720bfd5e | [
"BSD-3-Clause"
] | 1 | 2021-07-02T17:34:18.000Z | 2021-07-02T17:34:18.000Z | from pathlib import Path
import pytest
from bs4 import BeautifulSoup
from click.testing import CliRunner
import sphinx
from jupyter_book import commands
def test_version(cli: CliRunner):
result = cli.invoke(commands.main, "--version")
assert result.exit_code == 0, result.output
assert "Jupyter Book" in... | 40.560976 | 87 | 0.678172 |
414ede1a67253d42970e133b115f9e0ed12bc56b | 5,947 | py | Python | pyInstaller/dash/dash_html_components/Iframe.py | rianawillers/dash-lineplot | b72c3e4799d39bdc33bbcae2202fdefd6f4af00e | [
"MIT"
] | 3 | 2020-02-04T21:39:20.000Z | 2020-11-17T19:07:07.000Z | pyInstaller/dash/dash_html_components/Iframe.py | rianawillers/dash-lineplot | b72c3e4799d39bdc33bbcae2202fdefd6f4af00e | [
"MIT"
] | 12 | 2020-06-06T01:22:26.000Z | 2022-03-12T00:13:42.000Z | pyInstaller/dash/dash_html_components/Iframe.py | rianawillers/dash-lineplot | b72c3e4799d39bdc33bbcae2202fdefd6f4af00e | [
"MIT"
] | 1 | 2020-01-25T20:08:59.000Z | 2020-01-25T20:08:59.000Z | # AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class Iframe(Component):
"""An Iframe component.
Iframe is a wrapper for the <iframe> HTML5 element.
For detailed attribute info see:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
Keyw... | 84.957143 | 749 | 0.740541 |
42e0288d869232372c634f2a8773dd922c1a41f1 | 3,715 | py | Python | dash_daq/PowerButton.py | luiztauffer/dash-daq | 4975093449bdc4d7ff4cd366ac82a847cdf24c34 | [
"MIT"
] | null | null | null | dash_daq/PowerButton.py | luiztauffer/dash-daq | 4975093449bdc4d7ff4cd366ac82a847cdf24c34 | [
"MIT"
] | null | null | null | dash_daq/PowerButton.py | luiztauffer/dash-daq | 4975093449bdc4d7ff4cd366ac82a847cdf24c34 | [
"MIT"
] | null | null | null | # AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class PowerButton(Component):
"""A PowerButton component.
A power button component can be
turned on and off.
Keyword arguments:
- id (string; optional):
The ID used to identify this compnent in Dash... | 43.705882 | 419 | 0.700673 |
adbf4983dc42973726f775ca74bd7dc6ef4270e1 | 9,366 | py | Python | pyscf/semiempirical/rmindo3_grad.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 1 | 2021-11-12T11:55:25.000Z | 2021-11-12T11:55:25.000Z | pyscf/semiempirical/rmindo3_grad.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 36 | 2018-08-22T19:44:03.000Z | 2020-05-09T10:02:36.000Z | pyscf/semiempirical/rmindo3_grad.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 4 | 2018-02-14T16:28:28.000Z | 2019-08-12T16:40:30.000Z | #!/usr/bin/env python
import numpy
from pyscf import lib
from pyscf import gto
from pyscf.grad import rhf as rhf_grad
from pyscf.semiempirical import mindo3
from pyscf.semiempirical import mopac_param
def grad_nuc(mol, atmlst=None):
atom_charges = mol.atom_charges()
atom_coords = mol.atom_coords()
natm =... | 34.433824 | 83 | 0.595985 |
785af27ba506dcde617ca51b5415e918b4d72b82 | 2,810 | py | Python | src/primaires/joueur/commandes/module/__init__.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/primaires/joueur/commandes/module/__init__.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/primaires/joueur/commandes/module/__init__.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | # -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# 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
# l... | 42.575758 | 79 | 0.727402 |
a3ca279e204af31e5c267fe4b7ca0d73a7cc6f49 | 42,273 | py | Python | src/metpy/calc/kinematics.py | gerritholl/MetPy | 3f08b770485835982989f34aedb87791af250301 | [
"BSD-3-Clause"
] | null | null | null | src/metpy/calc/kinematics.py | gerritholl/MetPy | 3f08b770485835982989f34aedb87791af250301 | [
"BSD-3-Clause"
] | null | null | null | src/metpy/calc/kinematics.py | gerritholl/MetPy | 3f08b770485835982989f34aedb87791af250301 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2009,2017,2018,2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Contains calculation of kinematic parameters (e.g. divergence or vorticity)."""
import numpy as np
from . import coriolis_parameter
from .tools import first_deriva... | 40.375358 | 95 | 0.651811 |
598b5ecaf403fea94c4c8ff07343df7f3a784ba9 | 451 | py | Python | flask_app/clock/views.py | julien-bonnefoy/website | a00d70697cc3a367dcdb32ca62ed29493029cf91 | [
"Apache-2.0"
] | null | null | null | flask_app/clock/views.py | julien-bonnefoy/website | a00d70697cc3a367dcdb32ca62ed29493029cf91 | [
"Apache-2.0"
] | null | null | null | flask_app/clock/views.py | julien-bonnefoy/website | a00d70697cc3a367dcdb32ca62ed29493029cf91 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
""" CLOCK VIEWS
BLUEPRINT: clock_bp
ROUTES FUNCTIONS: clock
OTHER FUNCTIONS:
"""
from flask import Blueprint, render_template
# Blueprint Configuration
clock_bp = Blueprint(
'clock_bp',
__name__,
template_folder='../templates/',
static_folder='../static/'
)
@clock_bp.route('/... | 18.791667 | 44 | 0.656319 |
7f5641a63849cfec25fa2f560d50e92dc78576c3 | 8,529 | py | Python | pydiffvg/save_svg.py | 13952522076/diffvg | 2c5af9ecf470b1c7071e821583e5ba09cb2c4622 | [
"Apache-2.0"
] | null | null | null | pydiffvg/save_svg.py | 13952522076/diffvg | 2c5af9ecf470b1c7071e821583e5ba09cb2c4622 | [
"Apache-2.0"
] | null | null | null | pydiffvg/save_svg.py | 13952522076/diffvg | 2c5af9ecf470b1c7071e821583e5ba09cb2c4622 | [
"Apache-2.0"
] | null | null | null | import torch
import pydiffvg
import xml.etree.ElementTree as etree
from xml.dom import minidom
def prettify(elem):
"""Return a pretty-printed XML string for the Element.
"""
rough_string = etree.tostring(elem, 'utf-8')
reparsed = minidom.parseString(rough_string)
return reparsed.toprettyxml(indent="... | 50.767857 | 96 | 0.528315 |
5507698333305cc7e9b4dcffbb38bac994bfb22c | 6,529 | py | Python | asclepias_broker/config.py | diegodelemos/asclepias-broker | 363ebf620ceea8cd4bd387d414c9cfaca226ce35 | [
"MIT"
] | null | null | null | asclepias_broker/config.py | diegodelemos/asclepias-broker | 363ebf620ceea8cd4bd387d414c9cfaca226ce35 | [
"MIT"
] | null | null | null | asclepias_broker/config.py | diegodelemos/asclepias-broker | 363ebf620ceea8cd4bd387d414c9cfaca226ce35 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2018 CERN.
#
# Asclepias Broker is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Default configuration for Asclepias Broker."""
from __future__ import absolute_import, print_function
from d... | 27.782979 | 77 | 0.65906 |
b44a1ad4bc67115b72b8566662c258e214525316 | 22,748 | py | Python | nova/network/api.py | venusource/nova | 0c6e6f180eebe71a3431abf726a0fd0c66578162 | [
"Apache-2.0"
] | 7 | 2015-09-22T11:27:16.000Z | 2015-11-02T12:33:46.000Z | nova/network/api.py | venusource/nova | 0c6e6f180eebe71a3431abf726a0fd0c66578162 | [
"Apache-2.0"
] | 2 | 2015-09-07T22:14:46.000Z | 2020-08-12T08:51:56.000Z | nova/network/api.py | venusource/nova | 0c6e6f180eebe71a3431abf726a0fd0c66578162 | [
"Apache-2.0"
] | 4 | 2015-09-09T16:48:56.000Z | 2022-03-15T20:52:57.000Z | # 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.
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you... | 41.97048 | 79 | 0.6361 |
b11bdf1b5bf73c81d6610521638b9269830a3ab0 | 4,592 | py | Python | ltfx/functions/train.py | laguro-developers/tfx-utils | af85352ea0046ba60b429b37680da6878e7ee0e5 | [
"MIT"
] | 1 | 2021-01-09T16:38:44.000Z | 2021-01-09T16:38:44.000Z | ltfx/functions/train.py | laguro-developers/tfx-utils | af85352ea0046ba60b429b37680da6878e7ee0e5 | [
"MIT"
] | null | null | null | ltfx/functions/train.py | laguro-developers/tfx-utils | af85352ea0046ba60b429b37680da6878e7ee0e5 | [
"MIT"
] | null | null | null | import tensorflow as tf
import tensorflow_transform as tft
from tensorflow.python.ops import lookup_ops
from ltfx.models.resnet50 import build_resnet50
from ltfx.functions.input import _input_fn
from ltfx.functions.serving import _serving_receiver_fn
from ltfx.functions.eval import _eval_input_receiver_fn
def _train_... | 45.92 | 117 | 0.583841 |
1db4df96f4313ba5fc8ec70c3b73bdbad9653708 | 14,408 | py | Python | libtbx/scheduling/process_pool.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | libtbx/scheduling/process_pool.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | libtbx/scheduling/process_pool.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | """
Process Pool
Pools offer lower control over execution, as it is not possible to know the
state of individual workers
Common methods:
has_results(): returns whether there are any results available
results(): return an iterator yielding ( identifier, result ) tuples
submit(target, args = (), kwargs = {}): sub... | 20.671449 | 90 | 0.665672 |
e7547417be62e339404962802bd1fa2b1e7e5daa | 1,465 | py | Python | day_ok/schedule/data_classes/lessons.py | bostud/day_ok | 2bcee68252b698f5818808d1766fb3ec3f07fce8 | [
"MIT"
] | null | null | null | day_ok/schedule/data_classes/lessons.py | bostud/day_ok | 2bcee68252b698f5818808d1766fb3ec3f07fce8 | [
"MIT"
] | 16 | 2021-02-27T08:36:19.000Z | 2021-04-07T11:43:31.000Z | day_ok/schedule/data_classes/lessons.py | bostud/day_ok | 2bcee68252b698f5818808d1766fb3ec3f07fce8 | [
"MIT"
] | null | null | null | from typing import List, Optional
from dataclasses import dataclass
from datetime import datetime, date
from ..models import Teacher, Lessons
class Base:
def to_dict(self, key_prefix: str = '') -> dict:
return {
self.get_key_name(k, key_prefix): v
for k, v in self.__dict__.items()
... | 20.347222 | 64 | 0.666894 |
fac39f104c0a7146fbdb377cf06ceb3842dedf2c | 11,162 | py | Python | chrome/test/functional/find_in_page.py | Gitman1989/chromium | 2b1cceae1075ef012fb225deec8b4c8bbe4bc897 | [
"BSD-3-Clause"
] | 2 | 2017-09-02T19:08:28.000Z | 2021-11-15T15:15:14.000Z | chrome/test/functional/find_in_page.py | Gitman1989/chromium | 2b1cceae1075ef012fb225deec8b4c8bbe4bc897 | [
"BSD-3-Clause"
] | null | null | null | chrome/test/functional/find_in_page.py | Gitman1989/chromium | 2b1cceae1075ef012fb225deec8b4c8bbe4bc897 | [
"BSD-3-Clause"
] | 1 | 2020-04-13T05:45:10.000Z | 2020-04-13T05:45:10.000Z | #!/usr/bin/python
# Copyright (c) 2010 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 codecs
import os
import unittest
import pyauto_functional
import pyauto
import test_utils
class FindMatchTests(pyauto.PyUITes... | 44.47012 | 79 | 0.687153 |
0b10804851ab7ad560b0b5f187ae112beb911167 | 139 | py | Python | app/phising_Dataset_Generator.py | chimeyrock999/PhishingURLDetection | 9b854845e90644b839d7ffd981f53fe005e2788d | [
"MIT"
] | 3 | 2021-06-26T11:19:36.000Z | 2021-11-19T16:43:06.000Z | app/phising_Dataset_Generator.py | chimeyrock999/PhishingURLDetection | 9b854845e90644b839d7ffd981f53fe005e2788d | [
"MIT"
] | null | null | null | app/phising_Dataset_Generator.py | chimeyrock999/PhishingURLDetection | 9b854845e90644b839d7ffd981f53fe005e2788d | [
"MIT"
] | null | null | null | from feature_extractor import extract
extract.generate_dataset('dataset_gender/phising_urls.csv', 'dataset_gender/phising_dataset.csv', 1) | 46.333333 | 100 | 0.856115 |
52df0b1919a9b73c5d2505b8994193cf73e65843 | 145 | py | Python | src/namespace_metadata.py | sscu-budapest/dataset-template | cbaa42a16e8692bc8248780ae0609c0808514af6 | [
"MIT"
] | null | null | null | src/namespace_metadata.py | sscu-budapest/dataset-template | cbaa42a16e8692bc8248780ae0609c0808514af6 | [
"MIT"
] | 2 | 2021-06-19T21:24:36.000Z | 2021-09-23T16:10:10.000Z | src/namespace_metadata.py | sscu-budapest/dataset-template | cbaa42a16e8692bc8248780ae0609c0808514af6 | [
"MIT"
] | 1 | 2021-09-29T12:13:15.000Z | 2021-09-29T12:13:15.000Z | from sscutils import ScruTable, TableFeaturesBase
class RecordFeatures(TableFeaturesBase):
pass
record_table = ScruTable(RecordFeatures)
| 16.111111 | 49 | 0.82069 |
80782a15aa8f0cf867f76dc8b16f20474ef0e94f | 4,594 | py | Python | qcloud-dns.py | szlytlyt/certbot-dns-qcloud-hook | 5f5123e7d53854de2adc1274f01e8a5e76d42ce6 | [
"MIT"
] | null | null | null | qcloud-dns.py | szlytlyt/certbot-dns-qcloud-hook | 5f5123e7d53854de2adc1274f01e8a5e76d42ce6 | [
"MIT"
] | null | null | null | qcloud-dns.py | szlytlyt/certbot-dns-qcloud-hook | 5f5123e7d53854de2adc1274f01e8a5e76d42ce6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import hmac
import time
import random
import hashlib
import binascii
import requests
# @home2 https://setq.me/1024
class Client(object):
def __init__(self, secret_id, secret_key, host, uri, **params):
self.secret_id = secret_id
se... | 28.358025 | 88 | 0.53744 |
1bc079665bd2009203f917c92e3fd598f5a2d920 | 5,755 | py | Python | src/tests/test_decoder.py | dailai/quick-nlp | d27ae90c0788d0899af7f45b323ca64ed0c33868 | [
"MIT"
] | null | null | null | src/tests/test_decoder.py | dailai/quick-nlp | d27ae90c0788d0899af7f45b323ca64ed0c33868 | [
"MIT"
] | null | null | null | src/tests/test_decoder.py | dailai/quick-nlp | d27ae90c0788d0899af7f45b323ca64ed0c33868 | [
"MIT"
] | null | null | null | from types import SimpleNamespace
import numpy as np
import pytest
from fastai.core import T, V, to_np, to_gpu
from numpy.testing import assert_allclose
from quicknlp.modules import EmbeddingRNNDecoder, RNNAttentionDecoder, Projection, AttentionProjection
from quicknlp.modules.basic_decoder import select_hidden_by_in... | 50.929204 | 112 | 0.649522 |
baf230f60f94414e85a33e86afb5d46ed7780393 | 3,020 | py | Python | setup.py | jma/invenio-circulation | d93be872ab8673eb9a37b0e183fe42ec3116c252 | [
"MIT"
] | 1 | 2022-03-17T09:23:10.000Z | 2022-03-17T09:23:10.000Z | setup.py | jma/invenio-circulation | d93be872ab8673eb9a37b0e183fe42ec3116c252 | [
"MIT"
] | null | null | null | setup.py | jma/invenio-circulation | d93be872ab8673eb9a37b0e183fe42ec3116c252 | [
"MIT"
] | 1 | 2022-03-17T09:23:12.000Z | 2022-03-17T09:23:12.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2018 CERN.
#
# Invenio-Circulation is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Invenio module for the circulation of bibliographic items."""
import os
from setuptools import find_packa... | 27.706422 | 80 | 0.615232 |
b590392bed0a24510abc8eb796698a8b7f5b17e1 | 1,794 | py | Python | gravur/main.py | F483/gravur | 575c268d9ac28aa0ba00f1e5109bd74c3b7b69a5 | [
"MIT"
] | 3 | 2015-07-20T17:56:21.000Z | 2017-10-22T05:52:13.000Z | gravur/main.py | F483/gravur | 575c268d9ac28aa0ba00f1e5109bd74c3b7b69a5 | [
"MIT"
] | null | null | null | gravur/main.py | F483/gravur | 575c268d9ac28aa0ba00f1e5109bd74c3b7b69a5 | [
"MIT"
] | null | null | null | # coding: utf-8
# Copyright (c) 2015 Fabian Barkhau <fabian.barkhau@gmail.com>
# License: MIT (see LICENSE file)
import os
import sys
import argparse
# kivy setup
os.environ["KIVY_NO_ARGS"] = "1"
#os.environ["KIVY_NO_CONSOLELOG"] = "1"
os.environ["KIVY_NO_FILELOG"] = "1"
# min supported resolution
from kivy.config... | 27.181818 | 74 | 0.672241 |
2885cea08d6b2216c8f19e5cec9ff707fd444ee8 | 1,217 | py | Python | indonesian_dot/envs/tests/puzzle_tests.py | Ra-Ni/Indonesian-Dot-Solver | 2baf507d23816b686f046f89d4c833728b25f2dc | [
"MIT"
] | null | null | null | indonesian_dot/envs/tests/puzzle_tests.py | Ra-Ni/Indonesian-Dot-Solver | 2baf507d23816b686f046f89d4c833728b25f2dc | [
"MIT"
] | null | null | null | indonesian_dot/envs/tests/puzzle_tests.py | Ra-Ni/Indonesian-Dot-Solver | 2baf507d23816b686f046f89d4c833728b25f2dc | [
"MIT"
] | 1 | 2020-03-18T15:23:24.000Z | 2020-03-18T15:23:24.000Z | import unittest
import agents
from envs.puzzle import Puzzle
class MyTestCase(unittest.TestCase):
def test_bfs(self):
bfs = agents.make('bfs')
p = Puzzle('1010101110000000000000000')
p.max_depth = 7
p.max_length = 5
sol, search = p.traverse(bfs)
print(sol)
... | 23.862745 | 122 | 0.578472 |
cfc528487c2f09d697eca1b0a7a489d118353bf2 | 6,825 | py | Python | TEST_DATA.py | GundlackFelixDEV/pdf-template-service | ccd5133b00fed88ca60063fa4e22401c78bb18cb | [
"MIT"
] | null | null | null | TEST_DATA.py | GundlackFelixDEV/pdf-template-service | ccd5133b00fed88ca60063fa4e22401c78bb18cb | [
"MIT"
] | null | null | null | TEST_DATA.py | GundlackFelixDEV/pdf-template-service | ccd5133b00fed88ca60063fa4e22401c78bb18cb | [
"MIT"
] | null | null | null | PROFILE = {
"reciepientsFullName": "Max Mustermann",
"lastName": "Mustermann",
"title": "Mr.",
"reciepientsAddress": "Musterstraße 11",
"zipCode": "123456",
"city": "Musterhausen",
"IBAN": "DE07123412341234123412"
}
NF_FORM = {
"proc_agency": "USAG Grafenwoehr,<br>HQUSAG Grafenwoer,<... | 31.164384 | 117 | 0.490256 |
8593379da3374253072a96a363ddb10cea992979 | 5,664 | py | Python | tests/unit/pillar_test.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | 1 | 2016-12-20T20:11:21.000Z | 2016-12-20T20:11:21.000Z | tests/unit/pillar_test.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | null | null | null | tests/unit/pillar_test.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
tests.unit.pillar_test
~~~~~~~~~~~~~~~~~~~~~~
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
'''
import tempfile
# Import Salt Testing ... | 32.930233 | 78 | 0.558439 |
da3abf8a45b79a88d01ddee22f3413bbe76752f4 | 5,791 | py | Python | envdsys/shared/data/datafile.py | NOAA-PMEL/envDataSystem | 4db4a3569d2329658799a3eef06ce36dd5c0597d | [
"Unlicense"
] | 1 | 2021-11-06T19:22:53.000Z | 2021-11-06T19:22:53.000Z | envdsys/shared/data/datafile.py | NOAA-PMEL/envDataSystem | 4db4a3569d2329658799a3eef06ce36dd5c0597d | [
"Unlicense"
] | 25 | 2019-06-18T20:40:36.000Z | 2021-07-23T20:56:48.000Z | envdsys/shared/data/datafile.py | NOAA-PMEL/envDataSystem | 4db4a3569d2329658799a3eef06ce36dd5c0597d | [
"Unlicense"
] | null | null | null | import asyncio
from shared.utilities.util import time_to_next
from shared.data.message import Message
# from datetime import datetime
# from data.data import Data
import json
import os
# from utilities.timer import Timer
class DataFile():
def __init__(
self,
base_path='./envdata/',
save_... | 25.737778 | 88 | 0.520808 |
8f6d7e6d2b48ebc4efe1939ee9cc5634eb0be37b | 84 | py | Python | data/__init__.py | saralajew/robustNPCs | 41f2ce5618003a10db11601cded71ec3ba538bcc | [
"BSD-3-Clause"
] | 1 | 2020-11-02T09:05:44.000Z | 2020-11-02T09:05:44.000Z | data/__init__.py | saralajew/robust_NPCs | 41f2ce5618003a10db11601cded71ec3ba538bcc | [
"BSD-3-Clause"
] | null | null | null | data/__init__.py | saralajew/robust_NPCs | 41f2ce5618003a10db11601cded71ec3ba538bcc | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .data import *
| 16.8 | 38 | 0.702381 |
be5818e03c31a5c6888bf8eb6d2a46b1ebf33cc5 | 130 | py | Python | collection/exceptions/__init__.py | Chansazm/Project_20_Money_Transfer_App | f215c9f6fa4004ec44bc9009d717adaede4d98a9 | [
"MIT"
] | null | null | null | collection/exceptions/__init__.py | Chansazm/Project_20_Money_Transfer_App | f215c9f6fa4004ec44bc9009d717adaede4d98a9 | [
"MIT"
] | null | null | null | collection/exceptions/__init__.py | Chansazm/Project_20_Money_Transfer_App | f215c9f6fa4004ec44bc9009d717adaede4d98a9 | [
"MIT"
] | null | null | null | __all__ = [
'api_exception',
'token_post_401_application_json_response_exception',
'error_reason_error_exception',
] | 26 | 58 | 0.753846 |
0450d502fea094ae410d1f006696b90e63e2f0bd | 5,930 | py | Python | src/sos/targets_python.py | pgcudahy/sos | ee902841003c7630db501101038f370650955ef9 | [
"BSD-3-Clause"
] | 90 | 2019-06-25T15:33:22.000Z | 2022-03-31T03:50:58.000Z | src/sos/targets_python.py | pgcudahy/sos | ee902841003c7630db501101038f370650955ef9 | [
"BSD-3-Clause"
] | 223 | 2019-06-24T13:47:38.000Z | 2022-03-29T21:37:10.000Z | src/sos/targets_python.py | pgcudahy/sos | ee902841003c7630db501101038f370650955ef9 | [
"BSD-3-Clause"
] | 26 | 2019-06-27T19:24:23.000Z | 2022-03-24T03:41:37.000Z | #!/usr/bin/env python3
#
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
from .targets import BaseTarget
from .utils import env, textMD5
class Py_Module(BaseTarget):
'''A target for a Python module.'''
LIB_STATUS_CACHE ... | 42.661871 | 110 | 0.498145 |
7ae411aaa716d9eac6096c34418f5393cbfa7480 | 2,421 | py | Python | tests/test_config.py | shuohan/singleton-config | e7a38006dbc50f10afadeea57274826ca4233e82 | [
"MIT"
] | null | null | null | tests/test_config.py | shuohan/singleton-config | e7a38006dbc50f10afadeea57274826ca4233e82 | [
"MIT"
] | null | null | null | tests/test_config.py | shuohan/singleton-config | e7a38006dbc50f10afadeea57274826ca4233e82 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from enum import IntEnum
from singleton_config import Config as Config_
class Mode(IntEnum):
M1 = 1
M2 = 2
class Config(Config_):
def __init__(self):
super().__init__()
self.add_config('a', 1)
self.add_config('b', '2')
... | 23.057143 | 78 | 0.551838 |
ddc7c707439dbda5e3eb4832f231e3480716f2f1 | 2,672 | py | Python | class-1/lsa.py | Xiaoyu-Xing/learning-nlp | 804a32b99aa45a59ac852ea7e1d3d5366f638256 | [
"MIT"
] | null | null | null | class-1/lsa.py | Xiaoyu-Xing/learning-nlp | 804a32b99aa45a59ac852ea7e1d3d5366f638256 | [
"MIT"
] | null | null | null | class-1/lsa.py | Xiaoyu-Xing/learning-nlp | 804a32b99aa45a59ac852ea7e1d3d5366f638256 | [
"MIT"
] | null | null | null | import nltk
import numpy as np
import matplotlib.pyplot as plt
from nltk.stem import WordNetLemmatizer
from sklearn.decomposition import TruncatedSVD
wordnet_lemmatizer = WordNetLemmatizer()
titles = [line.rstrip() for line in open('../dataset/books/all_book_titles.txt')]
stopwords = set(w.rstrip() for w in open('../d... | 32.987654 | 113 | 0.654192 |
d38a0dc031315fb8b6ba2328ec22f75db1003afa | 1,552 | py | Python | mpld3/tests/test_figure.py | odidev/mpld3 | 7bb37b9a9e6d1c90dd9f83075d1987541bb087d5 | [
"BSD-3-Clause"
] | 1,101 | 2016-04-20T18:35:09.000Z | 2022-03-31T10:52:22.000Z | mpld3/tests/test_figure.py | odidev/mpld3 | 7bb37b9a9e6d1c90dd9f83075d1987541bb087d5 | [
"BSD-3-Clause"
] | 172 | 2016-04-20T18:19:21.000Z | 2022-03-16T13:44:08.000Z | mpld3/tests/test_figure.py | odidev/mpld3 | 7bb37b9a9e6d1c90dd9f83075d1987541bb087d5 | [
"BSD-3-Clause"
] | 195 | 2016-04-21T17:39:12.000Z | 2022-03-16T05:10:09.000Z | """
Test creation of a figure
"""
import matplotlib.pyplot as plt
from .. import fig_to_dict
from numpy.testing import assert_equal
def test_basic_figure():
size = (8, 6)
dpi = 80
fig = plt.figure(figsize=size, dpi=dpi)
rep = fig_to_dict(fig)
plt.close(fig)
assert_equal(list(sorted(rep.keys()... | 26.758621 | 79 | 0.563144 |
544343605fb507db05d07f76bbdd04435946066a | 939 | py | Python | APICanalLuciernaga/programacion/models.py | YarlingB/canal-luciernaga | a90ff4115bfd4c050c9b9b507c8a6df18a4dad5e | [
"MIT"
] | null | null | null | APICanalLuciernaga/programacion/models.py | YarlingB/canal-luciernaga | a90ff4115bfd4c050c9b9b507c8a6df18a4dad5e | [
"MIT"
] | 12 | 2020-02-12T01:04:09.000Z | 2022-02-10T12:22:14.000Z | APICanalLuciernaga/programacion/models.py | YarlingB/canal-luciernaga | a90ff4115bfd4c050c9b9b507c8a6df18a4dad5e | [
"MIT"
] | 3 | 2019-07-04T19:51:17.000Z | 2019-07-30T17:23:13.000Z | from django.db import models
from noticias.models import Categoria
# Create your models here.
class Programacion(models.Model):
titulo = models.CharField(max_length = 225)
link = models.URLField(null=True,blank=True)
fecha = models.DateField()
def __str__(self):
return self.titulo
class Meta:
verbose_name ... | 29.34375 | 106 | 0.776358 |
709a0647a6550b75c591cc4264598a87951bd5aa | 834 | py | Python | mockbcrypt/plugin.py | boneyao/mock-bcrypt | 669bf7257974b85404fcccf40b5bd865607f1e7f | [
"MIT"
] | null | null | null | mockbcrypt/plugin.py | boneyao/mock-bcrypt | 669bf7257974b85404fcccf40b5bd865607f1e7f | [
"MIT"
] | null | null | null | mockbcrypt/plugin.py | boneyao/mock-bcrypt | 669bf7257974b85404fcccf40b5bd865607f1e7f | [
"MIT"
] | null | null | null | import logging
import os
from mock import patch
from nose.plugins import Plugin
log = logging.getLogger('nose.plugins.mockbcrypt')
class MockBcryptPlugin(Plugin):
name = 'mockbcrypt'
def options(self, parser, env=os.environ):
super(MockBcryptPlugin, self).options(parser, env=env)
def configure(... | 27.8 | 62 | 0.673861 |
d2990af46ea36fca13048e3ba55dcdb3ed9129d7 | 1,153 | py | Python | November/Week3/Range Sum of BST.py | vinaykumar7686/Leetcode-August_Challenge | fe1928d8b10a63d7aa561118a70eeaec2f3a2f36 | [
"MIT"
] | 1 | 2020-08-02T13:41:38.000Z | 2020-08-02T13:41:38.000Z | November/Week3/Range Sum of BST.py | vinaykumar7686/Leetcode-August_Challenge | fe1928d8b10a63d7aa561118a70eeaec2f3a2f36 | [
"MIT"
] | null | null | null | November/Week3/Range Sum of BST.py | vinaykumar7686/Leetcode-August_Challenge | fe1928d8b10a63d7aa561118a70eeaec2f3a2f36 | [
"MIT"
] | null | null | null | # Range Sum of BST
'''
Given the root node of a binary search tree, return the sum of values of all nodes with a value in the range [low, high].
Example 1:
Input: root = [10,5,15,3,7,null,18], low = 7, high = 15
Output: 32
Example 2:
Input: root = [10,5,15,3,7,13,18,1,null,6], low = 6, high = 10
Output: 23
... | 25.065217 | 121 | 0.607112 |
b7edfb5ae46312138af4155c4a27207e0bc6b53a | 3,801 | py | Python | tests/core/test_walltime.py | intdata-bsc/idact | 54cb65a711c145351e205970c27c83e6393cccf5 | [
"MIT"
] | 5 | 2018-12-06T15:40:34.000Z | 2019-06-19T11:22:58.000Z | tests/core/test_walltime.py | garstka/idact | b9c8405c94db362c4a51d6bfdf418b14f06f0da1 | [
"MIT"
] | 9 | 2018-12-06T16:35:26.000Z | 2019-04-28T19:01:40.000Z | tests/core/test_walltime.py | intdata-bsc/idact | 54cb65a711c145351e205970c27c83e6393cccf5 | [
"MIT"
] | 2 | 2019-04-28T19:18:58.000Z | 2019-06-17T06:56:28.000Z | """Tests for :class:`.Walltime`."""
import pytest
from idact.core.walltime import Walltime
def test_walltime_values():
"""Basic walltime values."""
walltime = Walltime(days=1, hours=2, minutes=3, seconds=4)
assert walltime.days == 1
assert walltime.hours == 2
assert walltime.minutes == 3
ass... | 29.929134 | 62 | 0.60563 |
a5863760c4d946d644ace5882684c6bcb8f4b3ee | 2,283 | py | Python | demo/messaging/demo_ping_pong.py | keszybz/pelita | 081329340b61e73436fb860f66882ffa47d0009e | [
"BSD-2-Clause"
] | null | null | null | demo/messaging/demo_ping_pong.py | keszybz/pelita | 081329340b61e73436fb860f66882ffa47d0009e | [
"BSD-2-Clause"
] | null | null | null | demo/messaging/demo_ping_pong.py | keszybz/pelita | 081329340b61e73436fb860f66882ffa47d0009e | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from datetime import datetime
from pelita.messaging import DispatchingActor, expose, actor_of, actor_registry, StopProcessing, RemoteConnection
class Ping(DispatchingActor):
def on_start(self):
self.pong = None
self.pings_left = 2000
@expose
def connect(self, acto... | 24.031579 | 113 | 0.60841 |
a8533c91c633fe80e7c776d7e08dfa0f0180de27 | 2,105 | py | Python | python/cm/api_context.py | arenadata/adcm | a499caa30adc2a53e7b3f46c96a865f9e4079e4e | [
"Apache-2.0"
] | 16 | 2019-11-28T18:05:21.000Z | 2021-12-08T18:09:18.000Z | python/cm/api_context.py | arenadata/adcm | a499caa30adc2a53e7b3f46c96a865f9e4079e4e | [
"Apache-2.0"
] | 1,127 | 2019-11-29T08:57:25.000Z | 2022-03-31T20:21:32.000Z | python/cm/api_context.py | arenadata/adcm | a499caa30adc2a53e7b3f46c96a865f9e4079e4e | [
"Apache-2.0"
] | 10 | 2019-11-28T18:05:06.000Z | 2022-01-13T06:16:40.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 32.384615 | 98 | 0.686461 |
ab2fdcd30fc354431069de20650ba9e262ca6a1a | 2,571 | py | Python | UserModel/pcauth_views.py | CryptoCompetition2019-RNG/AuthServer | c22e2b13af2cc51f62fdc55e3f682eb344d4fbcb | [
"Apache-2.0"
] | null | null | null | UserModel/pcauth_views.py | CryptoCompetition2019-RNG/AuthServer | c22e2b13af2cc51f62fdc55e3f682eb344d4fbcb | [
"Apache-2.0"
] | 10 | 2020-06-05T23:28:04.000Z | 2022-03-12T00:02:52.000Z | UserModel/pcauth_views.py | CryptoCompetition2019-RNG/AuthServer | c22e2b13af2cc51f62fdc55e3f682eb344d4fbcb | [
"Apache-2.0"
] | null | null | null | from django.views.decorators.http import require_POST
from django.views.decorators.csrf import csrf_exempt
from AuthServer.method import json_response_zh, get_json_ret, decrypt_ecb, encrypt_ecb
from Crypto.Util.number import long_to_bytes
from .models import UserModel
@csrf_exempt
@require_POST
def pcauth_api1(reque... | 32.961538 | 86 | 0.694282 |
f5b100b6564b122297d403e7152dcf1debc77fbe | 2,058 | py | Python | pylearn2/scripts/datasets/make_cifar10_whitened.py | yingzha/pylearn2 | 9132584e906d4af0f0255a9d7e6bc160fbe11e65 | [
"BSD-3-Clause"
] | null | null | null | pylearn2/scripts/datasets/make_cifar10_whitened.py | yingzha/pylearn2 | 9132584e906d4af0f0255a9d7e6bc160fbe11e65 | [
"BSD-3-Clause"
] | null | null | null | pylearn2/scripts/datasets/make_cifar10_whitened.py | yingzha/pylearn2 | 9132584e906d4af0f0255a9d7e6bc160fbe11e65 | [
"BSD-3-Clause"
] | null | null | null | """
This script makes a dataset of 32x32 approximately whitened CIFAR-10 images.
"""
from __future__ import print_function
from pylearn2.utils import serial
from pylearn2.datasets import preprocessing
from pylearn2.utils import string_utils
import numpy as np
from pylearn2.datasets.cifar10 import CIFAR10
data_dir =... | 30.716418 | 83 | 0.788144 |
85304c4699f5d0a89452771f343bb448e8a6a109 | 6,364 | py | Python | Model.py | IshfaqMalik/ImageClassifier | 672e2f0ae97bdb96720b62fb6ed013cbfc6e39fa | [
"MIT"
] | null | null | null | Model.py | IshfaqMalik/ImageClassifier | 672e2f0ae97bdb96720b62fb6ed013cbfc6e39fa | [
"MIT"
] | null | null | null | Model.py | IshfaqMalik/ImageClassifier | 672e2f0ae97bdb96720b62fb6ed013cbfc6e39fa | [
"MIT"
] | null | null | null | import torch
from torch import nn, optim
from torchvision import models
from collections import OrderedDict
import torch.nn.functional as F
import time
import utils
import numpy as np
def network ( output_units, hidden_units, drop_p):
classifier = nn.Sequential(OrderedDict([
('fc1', nn.Linear(250... | 28.410714 | 107 | 0.520742 |
049277f880c2175ed3f968394651b503972b28b7 | 4,564 | py | Python | py/ate/atet_fixture.py | aevri/phabricator-tools | ef7501bcaee83e98d168d16f64b3f73e744d3336 | [
"Apache-2.0"
] | 150 | 2015-01-21T15:52:22.000Z | 2021-11-09T05:53:36.000Z | py/ate/atet_fixture.py | aevri/phabricator-tools | ef7501bcaee83e98d168d16f64b3f73e744d3336 | [
"Apache-2.0"
] | 72 | 2015-05-08T04:33:08.000Z | 2017-01-27T09:37:36.000Z | py/ate/atet_fixture.py | aevri/phabricator-tools | ef7501bcaee83e98d168d16f64b3f73e744d3336 | [
"Apache-2.0"
] | 38 | 2015-01-30T10:33:47.000Z | 2021-11-09T05:53:30.000Z | """Creates a fixture with Arcyd setup to perform tests."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# atet_fixture
#
# Public Classes:
# Fixture
# .setup_arcyds
# .close
# .launch... | 31.260274 | 79 | 0.521253 |
db40e3b10c3cf63c5f1a5934fa721fd71b8fe458 | 30,631 | py | Python | BaseTools/Source/Python/Workspace/BuildClassObject.py | BenjaminYou/edk2 | fd30b0070773ac4ac5f49abca8f5b3afbeece158 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | 3,861 | 2019-09-04T10:10:11.000Z | 2022-03-31T15:46:28.000Z | BaseTools/Source/Python/Workspace/BuildClassObject.py | BenjaminYou/edk2 | fd30b0070773ac4ac5f49abca8f5b3afbeece158 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | 494 | 2018-09-18T19:31:55.000Z | 2022-03-30T16:52:52.000Z | BaseTools/Source/Python/Workspace/BuildClassObject.py | BenjaminYou/edk2 | fd30b0070773ac4ac5f49abca8f5b3afbeece158 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | 654 | 2019-09-05T11:42:37.000Z | 2022-03-30T02:42:32.000Z | ## @file
# This file is used to define each component of the build database
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
from collections import OrderedDict, namedtuple
from Common.DataType import *
import collections
import re
f... | 48.237795 | 314 | 0.617512 |
e1aa462135298655b2a2d2afc1e759fd214cae73 | 5,907 | py | Python | release/stubs.min/System/ComponentModel/__init___parts/CustomTypeDescriptor.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/ComponentModel/__init___parts/CustomTypeDescriptor.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/ComponentModel/__init___parts/CustomTypeDescriptor.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class CustomTypeDescriptor(object):
""" Provides a simple default implementation of the System.ComponentModel.ICustomTypeDescriptor interface. """
def ZZZ(self):
"""hardcoded/mock instance of the class"""
return CustomTypeDescriptor()
instance=ZZZ()
"""hardcoded/returns an instance of the class"""
def G... | 48.02439 | 215 | 0.753851 |
4f454830864ff998ab86e6e4881796a310a53cba | 2,859 | py | Python | 103_edge_filters.py | Data-Laboratory/WorkExamples | 27e58207e664da7813673e6792c0c30c0a5bf74c | [
"MIT"
] | 1 | 2021-12-15T22:27:27.000Z | 2021-12-15T22:27:27.000Z | 103_edge_filters.py | Data-Laboratory/WorkExamples | 27e58207e664da7813673e6792c0c30c0a5bf74c | [
"MIT"
] | null | null | null | 103_edge_filters.py | Data-Laboratory/WorkExamples | 27e58207e664da7813673e6792c0c30c0a5bf74c | [
"MIT"
] | null | null | null | #Ref: Sreenivas Sarwar Anik
"""
Roberts
The idea behind the Roberts cross operator is to approximate the gradient of an
image through discrete differentiation which is achieved by computing the sum of the squares of the
differences between diagonally adjacent pixels. It highlights regions of high spatial gradient whi... | 31.766667 | 106 | 0.765652 |
445d5729b04195dd7f9af832eda61dfc6ee3255d | 458 | py | Python | data/scripts/templates/object/tangible/dungeon/shared_terminal_free_s1.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/dungeon/shared_terminal_free_s1.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/dungeon/shared_terminal_free_s1.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/dungeon/shared_terminal_free_s1.iff"
result.attribute_template_id =... | 26.941176 | 72 | 0.733624 |
3ad073c9ff62a482c353a6b06528f1efbe4aa173 | 18,119 | py | Python | trt_pose/coco.py | tucachmo2202/trt_pose | b847fc197c32219dc2d719c2b42906603da0988a | [
"MIT"
] | null | null | null | trt_pose/coco.py | tucachmo2202/trt_pose | b847fc197c32219dc2d719c2b42906603da0988a | [
"MIT"
] | null | null | null | trt_pose/coco.py | tucachmo2202/trt_pose | b847fc197c32219dc2d719c2b42906603da0988a | [
"MIT"
] | null | null | null | import torch
import torch.utils.data
import torch.nn
import os
import PIL.Image
import json
import tqdm
import trt_pose
import trt_pose.plugins
import glob
import torchvision.transforms.functional as FT
import numpy as np
from trt_pose.parse_objects import ParseObjects
import pycocotools
import pycocotools.coco
import ... | 34.381404 | 201 | 0.52111 |
e5ec58cc659539fb11eed47288489b71f1e0b8c2 | 553 | py | Python | modelbased-rl/BMPO/static/hoppernt.py | TJU-DRL-LAB/ai-optimizer | f558cc524c66460913989519779873b371bf78bc | [
"MIT"
] | 19 | 2020-09-02T05:58:09.000Z | 2021-08-23T11:03:00.000Z | modelbased-rl/BMPO/static/hoppernt.py | TJU-DRL-LAB/ai-optimizer | f558cc524c66460913989519779873b371bf78bc | [
"MIT"
] | 4 | 2020-07-19T13:57:56.000Z | 2021-11-10T19:42:58.000Z | static/hoppernt.py | apexrl/bmpo | d065cf195b942c3e534d4c789a0982e0ec09957c | [
"MIT"
] | 3 | 2020-09-28T11:21:24.000Z | 2020-12-28T23:27:25.000Z | import numpy as np
class StaticFns:
@staticmethod
def termination_fn(obs, act, next_obs):
assert len(obs.shape) == len(next_obs.shape) == len(act.shape) == 2
height = next_obs[:, 0]
angle = next_obs[:, 1]
not_done = np.isfinite(next_obs).all(axis=-1) \
* n... | 27.65 | 75 | 0.500904 |
fca9df063f53254a7f545528459b38ec718cd45d | 1,734 | py | Python | Learning PyTorch/WHAT IS TORCH.NN REALLY/Using torch.nn.functional.py | LbsIrving/PyTorch | 314dbe9efc9e0116a7342d4ae3ab168c1c3afa32 | [
"MIT"
] | null | null | null | Learning PyTorch/WHAT IS TORCH.NN REALLY/Using torch.nn.functional.py | LbsIrving/PyTorch | 314dbe9efc9e0116a7342d4ae3ab168c1c3afa32 | [
"MIT"
] | null | null | null | Learning PyTorch/WHAT IS TORCH.NN REALLY/Using torch.nn.functional.py | LbsIrving/PyTorch | 314dbe9efc9e0116a7342d4ae3ab168c1c3afa32 | [
"MIT"
] | null | null | null | from pathlib import Path
import requests
DATA_PATH = Path("data")
PATH = DATA_PATH / "mnist"
PATH.mkdir(parents=True, exist_ok=True)
URL = "https://github.com/pytorch/tutorials/raw/master/_static/"
FILENAME = "mnist.pkl.gz"
if not (PATH / FILENAME).exists():
content = requests.get(URL + FILENAME).co... | 23.432432 | 85 | 0.607843 |
82f06048e7fe5e645c48b3b0842d4c4acc622068 | 4,604 | py | Python | volatility/volatility/plugins/linux/process_hollow.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | 2 | 2018-07-16T13:30:40.000Z | 2018-07-17T12:02:05.000Z | volatility/volatility/plugins/linux/process_hollow.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | null | null | null | volatility/volatility/plugins/linux/process_hollow.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | null | null | null | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation. You may not use, modify or
# distribu... | 37.129032 | 155 | 0.568636 |
b434c5f64f1c3b41161fd432907d9d84d416e328 | 51,042 | py | Python | frappe/__init__.py | DigiThinkIT/frappe | de30abb5e32051de8b87bcb390e18b778a2032ad | [
"MIT"
] | 3 | 2021-03-01T08:52:59.000Z | 2021-12-15T10:17:59.000Z | frappe/__init__.py | DigiThinkIT/frappe | de30abb5e32051de8b87bcb390e18b778a2032ad | [
"MIT"
] | 212 | 2017-08-16T13:03:18.000Z | 2020-10-06T12:26:21.000Z | frappe/__init__.py | Bloomstack/frappe | de30abb5e32051de8b87bcb390e18b778a2032ad | [
"MIT"
] | 14 | 2020-11-04T11:22:44.000Z | 2022-02-01T20:59:37.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
"""
globals attached to frappe module
+ some utility functions that should probably be moved
"""
from __future__ import unicode_literals, print_function
from six import iteritems, binary_type, text_type, string_types
fr... | 30.711191 | 180 | 0.730634 |
bc5ecafb0621cf814426c024118e7091f41f1084 | 1,436 | py | Python | src/423. Reconstruct Original Digits from English.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null | src/423. Reconstruct Original Digits from English.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null | src/423. Reconstruct Original Digits from English.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null | from collections import Counter
class Solution(object):
def originalDigits(self, s):
"""
:type s: str
:rtype: str
"""
C = Counter(s)
C2 = [0] * 10
if C['x']: # get six
n = C['x']
C2[6] = n
C['s'] -= n
C['i'] -= n
C['x'] -= n
if C['z']: # get zero
n = C['z']
C2[0] = n
C['z'] -= ... | 15.115789 | 69 | 0.344708 |
11165f4cff5da0aa0da70cdf8c4228d97c0af667 | 23,304 | py | Python | lib.py | silkyanteater/cue | 3987d5cd08d1e0795df657ad5a81e48bc2aca782 | [
"MIT"
] | null | null | null | lib.py | silkyanteater/cue | 3987d5cd08d1e0795df657ad5a81e48bc2aca782 | [
"MIT"
] | null | null | null | lib.py | silkyanteater/cue | 3987d5cd08d1e0795df657ad5a81e48bc2aca782 | [
"MIT"
] | null | null | null | import json
import requests
import urllib.parse
import yaml
import toml
import dateutil.parser
import re
import os
import sys
import subprocess
import platform
from const import *
req = requests.models.PreparedRequest()
jira_instance_url = None
jira_request_headers = None
queries_definition_file = None
result_files... | 46.983871 | 210 | 0.6365 |
1ce21d190c851537db2da78148fce090dea3564e | 15,238 | py | Python | synapse/storage/events_bg_updates.py | whitemike889/synapse | 97bf3077550915161765fdd1cf9290d8039a55f9 | [
"Apache-2.0"
] | null | null | null | synapse/storage/events_bg_updates.py | whitemike889/synapse | 97bf3077550915161765fdd1cf9290d8039a55f9 | [
"Apache-2.0"
] | null | null | null | synapse/storage/events_bg_updates.py | whitemike889/synapse | 97bf3077550915161765fdd1cf9290d8039a55f9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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... | 38.095 | 87 | 0.575272 |
824fbe99d6b76f245b03d8996c1f15c1b38cfeee | 10,457 | py | Python | audioled/colors.py | Utrisoft/modular-led-controller-workstation | c6f42e63b51c52a9832b78855c67bff5358a22ee | [
"MIT"
] | 20 | 2019-04-22T07:34:18.000Z | 2021-12-30T07:01:20.000Z | audioled/colors.py | Utrisoft/modular-led-controller-workstation | c6f42e63b51c52a9832b78855c67bff5358a22ee | [
"MIT"
] | 90 | 2019-04-19T18:14:11.000Z | 2022-03-12T00:14:23.000Z | audioled/colors.py | Utrisoft/modular-led-controller-workstation | c6f42e63b51c52a9832b78855c67bff5358a22ee | [
"MIT"
] | 7 | 2019-04-20T07:12:15.000Z | 2021-11-13T13:38:42.000Z | from __future__ import (absolute_import, division, print_function, unicode_literals)
import colorsys
import math
from collections import OrderedDict
import numpy as np
from PIL import Image
from audioled.effect import Effect
import logging
logger = logging.getLogger(__name__)
blend_modes = ['lightenOnly', 'darkenO... | 29.456338 | 123 | 0.563642 |
e8d7cee092ea4797a19753a075532d7886413e2c | 1,033 | py | Python | tests/kubernetes/checks/test_ApiServerAuditLogMaxBackup.py | niradler/checkov | 2628c6f28a5604efe3877d6eacc3044d2b66b7b1 | [
"Apache-2.0"
] | 4,013 | 2019-12-09T13:16:54.000Z | 2022-03-31T14:31:01.000Z | tests/kubernetes/checks/test_ApiServerAuditLogMaxBackup.py | niradler/checkov | 2628c6f28a5604efe3877d6eacc3044d2b66b7b1 | [
"Apache-2.0"
] | 1,258 | 2019-12-17T09:55:51.000Z | 2022-03-31T19:17:17.000Z | tests/kubernetes/checks/test_ApiServerAuditLogMaxBackup.py | niradler/checkov | 2628c6f28a5604efe3877d6eacc3044d2b66b7b1 | [
"Apache-2.0"
] | 638 | 2019-12-19T08:57:38.000Z | 2022-03-30T21:38:37.000Z | import os
import unittest
from checkov.kubernetes.checks.ApiServerAuditLogMaxBackup import check
from checkov.kubernetes.runner import Runner
from checkov.runner_filter import RunnerFilter
class TestApiServerProfiling(unittest.TestCase):
def test_summary(self):
runner = Runner()
current_dir = os... | 32.28125 | 101 | 0.71152 |
cc6ca31b200e48bc2ed3f5a89fc17ba43200e23a | 679 | py | Python | napari_image_quality_analyzer/_tests/test_dock_widget.py | haesleinhuepf/napari-image-quality-analyzer | 9dbf6162df1d93fff3b9e7b4a67a1a173db58ea2 | [
"BSD-3-Clause"
] | null | null | null | napari_image_quality_analyzer/_tests/test_dock_widget.py | haesleinhuepf/napari-image-quality-analyzer | 9dbf6162df1d93fff3b9e7b4a67a1a173db58ea2 | [
"BSD-3-Clause"
] | null | null | null | napari_image_quality_analyzer/_tests/test_dock_widget.py | haesleinhuepf/napari-image-quality-analyzer | 9dbf6162df1d93fff3b9e7b4a67a1a173db58ea2 | [
"BSD-3-Clause"
] | null | null | null | from napari_image_quality_analyzer import napari_experimental_provide_dock_widget
import pytest
# this is your plugin name declared in your napari.plugins entry point
MY_PLUGIN_NAME = "napari-image-quality-analyzer"
# the name of your widget(s)
MY_WIDGET_NAMES = ["Example Q Widget", "example_magic_widget"]
@pytest.m... | 37.722222 | 81 | 0.79676 |
ebe6ed7478dbc8af6f2fa63c6c9276e5888eac96 | 224 | py | Python | meiduo_mall/meiduo_mall/apps/oauth/urls.py | 00wsmart00/meiduo_project_all | 43af3685aa847705154d0a1982a9ed8a1432fc43 | [
"MIT"
] | 1 | 2019-06-08T15:56:14.000Z | 2019-06-08T15:56:14.000Z | meiduo_mall/meiduo_mall/apps/oauth/urls.py | 00wsmart00/meiduo_project | d0bb785c4f882eb41721130d7e54f0f5c473cb10 | [
"MIT"
] | 9 | 2020-05-11T20:24:01.000Z | 2022-02-26T15:05:53.000Z | meiduo_mall/meiduo_mall/apps/oauth/urls.py | 00wsmart00/meiduo_project_all | 43af3685aa847705154d0a1982a9ed8a1432fc43 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
# 获取QQ扫码登录链接
url(r'^qq/authorization/$', views.QQURLView.as_view()),
# QQ用户部分接口:
url(r'^oauth_callback/$', views.QQUserView.as_view()),
]
| 22.4 | 59 | 0.674107 |
21ee0a5aafac4029cdfcbb130e86db063d434ba1 | 1,835 | py | Python | test.py | DaviDarkFire/cumb_yolo | 70a846593a5c45235f2aba20d5dd73c1e0d96271 | [
"MIT"
] | null | null | null | test.py | DaviDarkFire/cumb_yolo | 70a846593a5c45235f2aba20d5dd73c1e0d96271 | [
"MIT"
] | null | null | null | test.py | DaviDarkFire/cumb_yolo | 70a846593a5c45235f2aba20d5dd73c1e0d96271 | [
"MIT"
] | null | null | null | import sys
import argparse
from yolo import YOLO, detect_video
from PIL import Image
import os
def detect_img(annotation_path_val, yolo):
with open(annotation_path_val) as f:
lines_val = f.readlines()
n = len(lines_val)
all_time = []
for i in range(n):
#img = '/home/lavicom/datasets/da... | 27.80303 | 101 | 0.614714 |
1afeb0643e188ac29cf48faf94fd9dd5156d8422 | 5,015 | py | Python | tests/helpers/fake_backend.py | dr-strangecode/signalfx-agent | e4bfc33bb22f848501311e7e99c188346a4075bc | [
"Apache-2.0"
] | null | null | null | tests/helpers/fake_backend.py | dr-strangecode/signalfx-agent | e4bfc33bb22f848501311e7e99c188346a4075bc | [
"Apache-2.0"
] | null | null | null | tests/helpers/fake_backend.py | dr-strangecode/signalfx-agent | e4bfc33bb22f848501311e7e99c188346a4075bc | [
"Apache-2.0"
] | null | null | null | import asyncio
import gzip
import socket
import threading
from collections import defaultdict
from contextlib import contextmanager
from queue import Queue
from google.protobuf import json_format
from sanic import Sanic, response
from signalfx.generated_protocol_buffers import signal_fx_protocol_buffers_pb2 as sf_pbuf... | 31.740506 | 89 | 0.675573 |
077e236bcd843b09444484fb2a869e0bf03037d7 | 677 | py | Python | makahiki/apps/widgets/participation/management/commands/award_participation.py | justinslee/Wai-Not-Makahiki | 4b7dd685012ec64758affe0ecee3103596d16aa7 | [
"MIT"
] | 1 | 2015-07-22T11:31:20.000Z | 2015-07-22T11:31:20.000Z | makahiki/apps/widgets/participation/management/commands/award_participation.py | justinslee/Wai-Not-Makahiki | 4b7dd685012ec64758affe0ecee3103596d16aa7 | [
"MIT"
] | null | null | null | makahiki/apps/widgets/participation/management/commands/award_participation.py | justinslee/Wai-Not-Makahiki | 4b7dd685012ec64758affe0ecee3103596d16aa7 | [
"MIT"
] | null | null | null | """Invocation: python manage.py award_participation
Checks whether or not each team's participation rate, and awards points to team members if meets
certain criteria."""
import datetime
from apps.managers.challenge_mgr.challenge_mgr import MakahikiBaseCommand
from apps.widgets.participation import participation
c... | 32.238095 | 98 | 0.735598 |
f42cbc2f13ecd5fc133ca0e70cc4f8477165017a | 7,110 | py | Python | hashid_field/lookups.py | nshafer/django-hashids-field | 053a02992f48267f407b63ef9ffa617210932a46 | [
"MIT"
] | 310 | 2016-10-04T20:26:01.000Z | 2022-03-30T05:10:20.000Z | hashid_field/lookups.py | nshafer/django-hashids-field | 053a02992f48267f407b63ef9ffa617210932a46 | [
"MIT"
] | 64 | 2016-12-27T18:29:01.000Z | 2022-02-12T01:37:20.000Z | hashid_field/lookups.py | nshafer/django-hashids-field | 053a02992f48267f407b63ef9ffa617210932a46 | [
"MIT"
] | 35 | 2017-06-05T14:48:31.000Z | 2022-03-17T14:34:00.000Z | import itertools
from django.db.models.lookups import Lookup, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual
from django.utils.datastructures import OrderedSet
from django.core.exceptions import EmptyResultSet
from .hashid import Hashid
from .conf import settings
def _is_int_representation(number):
... | 39.94382 | 119 | 0.656681 |
6518fe40e6059c4a3be4fb7eb4633c656e73e661 | 810 | py | Python | SIGNUS/app/models/mongodb/category.py | 837477/SIGNUS | cd395dfd45d2c36d09ec9a8069e6e52e19f058e8 | [
"MIT"
] | null | null | null | SIGNUS/app/models/mongodb/category.py | 837477/SIGNUS | cd395dfd45d2c36d09ec9a8069e6e52e19f058e8 | [
"MIT"
] | null | null | null | SIGNUS/app/models/mongodb/category.py | 837477/SIGNUS | cd395dfd45d2c36d09ec9a8069e6e52e19f058e8 | [
"MIT"
] | null | null | null | '''
MongoDB Category Collection Model
'''
from flask import current_app
class Category:
"""SIGNUS DB category Model"""
def __init__(self, client):
self.col = client[current_app.config['MONGODB_DB_NAME']]['category']
def find_one(self, category_name, projection=None):
''' 특정 Document 반환 ''... | 25.3125 | 76 | 0.569136 |
405d5c527d1e4caf7cb9ac404e4d5fb8e12ea8e6 | 3,182 | py | Python | airflow/example_dags/example_xcom.py | takuti/airflow | 0ac3b8c3dd749c59e60cf0169580b9e7c5049d9e | [
"Apache-2.0"
] | 15,947 | 2019-01-05T13:51:02.000Z | 2022-03-31T23:33:16.000Z | airflow/example_dags/example_xcom.py | takuti/airflow | 0ac3b8c3dd749c59e60cf0169580b9e7c5049d9e | [
"Apache-2.0"
] | 14,603 | 2019-01-05T09:43:19.000Z | 2022-03-31T23:11:59.000Z | airflow/example_dags/example_xcom.py | takuti/airflow | 0ac3b8c3dd749c59e60cf0169580b9e7c5049d9e | [
"Apache-2.0"
] | 8,429 | 2019-01-05T19:45:47.000Z | 2022-03-31T22:13:01.000Z | #
# 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... | 33.145833 | 99 | 0.715588 |
1769d3020ff39e6ecf86b7d75f74eb266af0a37e | 5,970 | py | Python | pyspedas/mms/fpi/fpi.py | shihikoo/pyspedas | 5251c52d074c4f2c3d91f2f8a457d36f3ad2ddb4 | [
"MIT"
] | null | null | null | pyspedas/mms/fpi/fpi.py | shihikoo/pyspedas | 5251c52d074c4f2c3d91f2f8a457d36f3ad2ddb4 | [
"MIT"
] | null | null | null | pyspedas/mms/fpi/fpi.py | shihikoo/pyspedas | 5251c52d074c4f2c3d91f2f8a457d36f3ad2ddb4 | [
"MIT"
] | null | null | null |
from pyspedas.mms.mms_load_data import mms_load_data
from pyspedas.mms.fpi.mms_fpi_set_metadata import mms_fpi_set_metadata
from pyspedas.mms.fpi.mms_load_fpi_calc_pad import mms_load_fpi_calc_pad
from pyspedas.mms.print_vars import print_vars
from pyspedas.mms.mms_config import CONFIG
@print_vars
def mms_load_fpi(tr... | 42.340426 | 137 | 0.635176 |
6f2958843bc73d8afc81973f1eb13f75b637c4e1 | 46,634 | py | Python | src/utils/parser/COOL_parser.py | BeginnerCompilers/cool-compiler-2021 | fe8c4dbbbaff9dc855322c2df2892dcfc5d449f9 | [
"MIT"
] | null | null | null | src/utils/parser/COOL_parser.py | BeginnerCompilers/cool-compiler-2021 | fe8c4dbbbaff9dc855322c2df2892dcfc5d449f9 | [
"MIT"
] | null | null | null | src/utils/parser/COOL_parser.py | BeginnerCompilers/cool-compiler-2021 | fe8c4dbbbaff9dc855322c2df2892dcfc5d449f9 | [
"MIT"
] | null | null | null | from utils.parser.shift_reduce_parser import ShiftReduceParser
'''
Las tablas action y goto del parser lalr1 se precompilaron porque demora mucho su calculo
El algoritmo para copiarlas fue el siguiente:
###code###
parser = LALR1_Parser(G)
with open('action.txt','w') as action:
for key,value in parser.action.item... | 35.734866 | 89 | 0.317772 |
d3cf1ff55a512295988cf6c1a8758e6d20b27b68 | 2,751 | py | Python | PyInstaller/hooks/hook-gi.repository.Gio.py | hawkhai/pyinstaller | 016a24479b34de161792c72dde455a81ad4c78ae | [
"Apache-2.0"
] | 9,267 | 2015-01-01T04:08:45.000Z | 2022-03-31T11:42:38.000Z | PyInstaller/hooks/hook-gi.repository.Gio.py | hawkhai/pyinstaller | 016a24479b34de161792c72dde455a81ad4c78ae | [
"Apache-2.0"
] | 5,150 | 2015-01-01T12:09:56.000Z | 2022-03-31T18:06:12.000Z | PyInstaller/hooks/hook-gi.repository.Gio.py | hawkhai/pyinstaller | 016a24479b34de161792c72dde455a81ad4c78ae | [
"Apache-2.0"
] | 2,101 | 2015-01-03T10:25:27.000Z | 2022-03-30T11:04:42.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2005-2021, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... | 41.681818 | 120 | 0.683751 |
65f4e4fac326e267d044a088997085e9a150dda2 | 5,375 | py | Python | provider.py | FrankCAN/ShufflePointNet | db4856088c210895327f5bb2c2a8faf33108bd3a | [
"MIT"
] | 13 | 2019-09-26T03:20:06.000Z | 2020-11-30T18:06:06.000Z | provider.py | jtpils/ShufflePointNet | 30cb1ab1e43ef042b8fbe3d9b6f82312320dd967 | [
"MIT"
] | 7 | 2019-10-09T02:12:07.000Z | 2020-12-30T03:06:56.000Z | provider.py | jtpils/ShufflePointNet | 30cb1ab1e43ef042b8fbe3d9b6f82312320dd967 | [
"MIT"
] | 4 | 2019-11-12T15:28:58.000Z | 2021-03-17T10:42:12.000Z | import os
import sys
import numpy as np
import h5py
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
# Download dataset for point cloud classification
DATA_DIR = os.path.join(BASE_DIR, 'data')
if not os.path.exists(DATA_DIR):
os.mkdir(DATA_DIR)
if not os.path.exists(os.path.join(DATA_D... | 31.617647 | 83 | 0.657488 |
55027e91b2abf028f4a6704c7f6152fe8315c339 | 6,207 | py | Python | sdk/python/core/tests/test_on_demand.py | geordish/ydk-gen | eb95b2a86f61180a773b18d0c65b6b906ed542ee | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/core/tests/test_on_demand.py | geordish/ydk-gen | eb95b2a86f61180a773b18d0c65b6b906ed542ee | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/core/tests/test_on_demand.py | geordish/ydk-gen | eb95b2a86f61180a773b18d0c65b6b906ed542ee | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # ----------------------------------------------------------------
# Copyright 2017 Cisco Systems
#
# 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/LICENS... | 32.160622 | 126 | 0.631867 |
ff38ea12e5311af84d28fea8091183a78ace56d7 | 375 | py | Python | framework/test/utils/test_add_user.py | RuhuiCheng/cheetah | a113cdd2c48db51822f8c8eb3abe374383875202 | [
"Apache-2.0"
] | null | null | null | framework/test/utils/test_add_user.py | RuhuiCheng/cheetah | a113cdd2c48db51822f8c8eb3abe374383875202 | [
"Apache-2.0"
] | null | null | null | framework/test/utils/test_add_user.py | RuhuiCheng/cheetah | a113cdd2c48db51822f8c8eb3abe374383875202 | [
"Apache-2.0"
] | null | null | null | from airflow import models, settings
from airflow.contrib.auth.backends.password_auth import PasswordUser
def test_add_user():
user = PasswordUser(models.User())
user.username = 'admin'
user.email = 'admin@test.cn'
user.password = 'admin'
user.superuser = 1
session = settings.Session()
ses... | 26.785714 | 68 | 0.701333 |
bef9371b044329703308f0108f8199397b26bb55 | 8,469 | py | Python | test/functional/feature_assumevalid.py | opteron-coin/opteron | a88fca12413879ed70058d91e2d53a0faf4719c3 | [
"MIT"
] | 1 | 2018-12-03T14:46:25.000Z | 2018-12-03T14:46:25.000Z | test/functional/feature_assumevalid.py | opteron-coin/opteron | a88fca12413879ed70058d91e2d53a0faf4719c3 | [
"MIT"
] | null | null | null | test/functional/feature_assumevalid.py | opteron-coin/opteron | a88fca12413879ed70058d91e2d53a0faf4719c3 | [
"MIT"
] | 4 | 2018-12-04T14:53:43.000Z | 2020-08-05T04:31:00.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2018 The Astral Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test logic for skipping signature validation on ol... | 41.514706 | 107 | 0.629236 |
9bcdd546302fb7b8945c3e8d6eb15b6fe444e032 | 57 | py | Python | cortex/server/__init__.py | chib0/asd-winter2019 | c7d95305b1e8b99013fd40da1e7ebe01c2d0102a | [
"Apache-2.0"
] | null | null | null | cortex/server/__init__.py | chib0/asd-winter2019 | c7d95305b1e8b99013fd40da1e7ebe01c2d0102a | [
"Apache-2.0"
] | 4 | 2021-02-02T22:38:53.000Z | 2022-01-13T02:32:33.000Z | cortex/server/__init__.py | chib0/asd-winter2019 | c7d95305b1e8b99013fd40da1e7ebe01c2d0102a | [
"Apache-2.0"
] | null | null | null | from .server import get_server, _run_server as run_server | 57 | 57 | 0.859649 |
f20ed4b50d61cb02306993b0da254f5bc9a77436 | 3,300 | py | Python | convolutional_neural_network.py | ascvorcov/z80-ddqn | 407de1a4231dd298eb1e749aaa65f498dcdf6958 | [
"MIT"
] | 3 | 2020-03-30T17:08:29.000Z | 2020-04-29T13:35:07.000Z | convolutional_neural_network.py | ascvorcov/z80-ddqn | 407de1a4231dd298eb1e749aaa65f498dcdf6958 | [
"MIT"
] | 11 | 2020-01-28T22:19:44.000Z | 2022-03-12T00:03:42.000Z | convolutional_neural_network.py | ascvorcov/z80-ddqn | 407de1a4231dd298eb1e749aaa65f498dcdf6958 | [
"MIT"
] | null | null | null | from keras.models import Sequential
from keras.layers.convolutional import Conv2D
from keras.layers import Dense, Flatten, Input, Lambda, Add
from keras.optimizers import RMSprop
from keras.models import Model
from keras import backend as K
from keras.utils import plot_model
def huber_loss(q, y_pred):
error = K.ab... | 44 | 125 | 0.541818 |
547f4927656312817e381e8fdbd9611eec873fc1 | 730 | py | Python | meetup-pyar-2018-cython/testing-cases/pure-python-numpy/difference.py | tzulberti/charlas | d73a1ad7b4f5f7fd6578a8dc79a5143629044e12 | [
"MIT"
] | 1 | 2018-11-24T13:06:51.000Z | 2018-11-24T13:06:51.000Z | meetup-pyar-2018-cython/testing-cases/pure-python-numpy/difference.py | tzulberti/charlas | d73a1ad7b4f5f7fd6578a8dc79a5143629044e12 | [
"MIT"
] | 1 | 2018-11-28T01:43:22.000Z | 2018-11-28T01:43:22.000Z | meetup-pyar-2018-cython/testing-cases/pure-python-numpy/difference.py | tzulberti/charlas | d73a1ad7b4f5f7fd6578a8dc79a5143629044e12 | [
"MIT"
] | 2 | 2018-11-24T01:10:19.000Z | 2022-02-14T02:21:03.000Z | # -*- coding: utf-8 -*-
import numpy
def levenshtein(seq1, seq2):
size_x = len(seq1) + 1
size_y = len(seq2) + 1
matrix = numpy.zeros((size_x, size_y))
for x in range(size_x):
matrix[x, 0] = x
for y in range(size_y):
matrix[0, y] = y
for x in range(1, size_x):
for y... | 24.333333 | 67 | 0.484932 |
7b66ec3e8081b04ef6986b8a18071d47bd4058c8 | 13,020 | py | Python | jans-pycloudlib/jans/pycloudlib/persistence/sql.py | duttarnab/jans | b4ae02f9cb60433a44a2b889268525532d82a247 | [
"Apache-2.0"
] | null | null | null | jans-pycloudlib/jans/pycloudlib/persistence/sql.py | duttarnab/jans | b4ae02f9cb60433a44a2b889268525532d82a247 | [
"Apache-2.0"
] | null | null | null | jans-pycloudlib/jans/pycloudlib/persistence/sql.py | duttarnab/jans | b4ae02f9cb60433a44a2b889268525532d82a247 | [
"Apache-2.0"
] | null | null | null | """
jans.pycloudlib.persistence.sql
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains various helpers related to SQL persistence.
"""
import logging
import os
from collections import defaultdict
from sqlalchemy import create_engine
from sqlalchemy import MetaData
from sqlalchemy import func
from sqlalchemy import... | 30.208817 | 116 | 0.59278 |
9e82fc55b1def371b6df4e8c5d123ad37b357a1d | 1,942 | py | Python | kda/graphql/meta/types.py | larrykamau/delivery-server | 4155f16e1dec313eeddfbe10c268714fa9bbe783 | [
"MIT"
] | null | null | null | kda/graphql/meta/types.py | larrykamau/delivery-server | 4155f16e1dec313eeddfbe10c268714fa9bbe783 | [
"MIT"
] | null | null | null | kda/graphql/meta/types.py | larrykamau/delivery-server | 4155f16e1dec313eeddfbe10c268714fa9bbe783 | [
"MIT"
] | null | null | null | import graphene
from ...core.models import ModelWithMetadata
from .resolvers import (
resolve_metadata,
resolve_object_with_metadata_type,
resolve_private_metadata,
)
class MetadataItem(graphene.ObjectType):
key = graphene.String(required=True, description="Key of a metadata item.")
value = graph... | 30.825397 | 84 | 0.667868 |
e2f1d6d6c2117e500d92396d6e7e1fe54a1251e8 | 766 | py | Python | SnookR/invites/urls.py | eSmelser/SnookR | 39b841e9a3e9e6b5d94904e0ccf37faef0ec712d | [
"MIT"
] | null | null | null | SnookR/invites/urls.py | eSmelser/SnookR | 39b841e9a3e9e6b5d94904e0ccf37faef0ec712d | [
"MIT"
] | 12 | 2017-07-12T02:41:32.000Z | 2017-12-30T23:08:00.000Z | SnookR/invites/urls.py | eSmelser/SnookR | 39b841e9a3e9e6b5d94904e0ccf37faef0ec712d | [
"MIT"
] | 1 | 2017-07-17T14:56:16.000Z | 2017-07-17T14:56:16.000Z | from django.conf.urls import include, url
from invites import views
session_event_patterns = ([
url(r'^session-event/step-1/$', views.SessionEventStartView.as_view(), name='start'),
url(r'^session-event/step-2/team/(?P<team_id>\d+)/$', views.SessionSelectView.as_view(), name='session-select'),
url(r'^sessi... | 51.066667 | 147 | 0.715405 |
a14b100c3cfe1ccf97e0981732def29402bc49e9 | 8,741 | py | Python | btu/btu_core/doctype/btu_task_schedule/btu_task_schedule.py | Govind-Jangid/btu | 856cce48fbf2fd349c064af67b2fc2d85918c61c | [
"MIT"
] | 7 | 2021-08-30T16:55:01.000Z | 2022-02-16T02:30:30.000Z | btu/btu_core/doctype/btu_task_schedule/btu_task_schedule.py | Govind-Jangid/btu | 856cce48fbf2fd349c064af67b2fc2d85918c61c | [
"MIT"
] | null | null | null | btu/btu_core/doctype/btu_task_schedule/btu_task_schedule.py | Govind-Jangid/btu | 856cce48fbf2fd349c064af67b2fc2d85918c61c | [
"MIT"
] | 6 | 2021-11-04T13:25:48.000Z | 2022-02-22T11:11:46.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Codrotech Inc. and contributors
#
# Copyright (c) 2021, Datahenge LLC and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import calendar
from calendar import monthrange, timegm
from datetime import datetime
from time... | 33.109848 | 122 | 0.7363 |
c5aaa8ec556cfc07a7ab789e9586e4ec49ca75fd | 16,844 | py | Python | sdk/python/pulumi_gcp/storage/bucket_acl.py | sisisin/pulumi-gcp | af6681d70ea457843409110c1324817fe55f68ad | [
"ECL-2.0",
"Apache-2.0"
] | 121 | 2018-06-18T19:16:42.000Z | 2022-03-31T06:06:48.000Z | sdk/python/pulumi_gcp/storage/bucket_acl.py | sisisin/pulumi-gcp | af6681d70ea457843409110c1324817fe55f68ad | [
"ECL-2.0",
"Apache-2.0"
] | 492 | 2018-06-22T19:41:03.000Z | 2022-03-31T15:33:53.000Z | sdk/python/pulumi_gcp/storage/bucket_acl.py | sisisin/pulumi-gcp | af6681d70ea457843409110c1324817fe55f68ad | [
"ECL-2.0",
"Apache-2.0"
] | 43 | 2018-06-19T01:43:13.000Z | 2022-03-23T22:43:37.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 48.125714 | 432 | 0.662076 |
e18dc4a97db7201d7a2fbdf99363a33c2a4329a8 | 2,048 | py | Python | plugins/change_settings/start_wavelength.py | manuelprogramming/OSA | 3a57ea944eef3e8680055a35e8cebd36b93dac51 | [
"MIT",
"Unlicense"
] | 1 | 2022-01-06T21:00:01.000Z | 2022-01-06T21:00:01.000Z | plugins/change_settings/start_wavelength.py | manuelprogramming/OSA | 3a57ea944eef3e8680055a35e8cebd36b93dac51 | [
"MIT",
"Unlicense"
] | null | null | null | plugins/change_settings/start_wavelength.py | manuelprogramming/OSA | 3a57ea944eef3e8680055a35e8cebd36b93dac51 | [
"MIT",
"Unlicense"
] | null | null | null | from dataclasses import dataclass
from osa import factory
from handlers.file import set_setting, get_setting
from handlers.result import BaseResult
@dataclass
class ChangeStartWavelength:
"""
Change the start_wavelength in the settings.json file,
wavelength (nm): 600.0 to 1750.0 Specify smaller value tha... | 37.236364 | 111 | 0.702637 |
3088d42badf362d7b71c5a63dc3e1a3f2a1f8fa5 | 5,063 | py | Python | CNN_Datasets/O_A/datasets/MFPTFFT.py | MasterXin2020/DL-based-Intelligent-Diagnosis-Benchmark | dd49b077984d15802681a9be723937342d6b59e3 | [
"MIT"
] | 200 | 2019-12-01T16:20:14.000Z | 2022-03-31T05:52:06.000Z | CNN_Datasets/O_A/datasets/MFPTFFT.py | MasterXin2020/DL-based-Intelligent-Diagnosis-Benchmark | dd49b077984d15802681a9be723937342d6b59e3 | [
"MIT"
] | 9 | 2020-06-03T02:30:25.000Z | 2022-03-18T08:50:10.000Z | CNN_Datasets/O_A/datasets/MFPTFFT.py | MasterXin2020/DL-based-Intelligent-Diagnosis-Benchmark | dd49b077984d15802681a9be723937342d6b59e3 | [
"MIT"
] | 84 | 2019-12-12T03:46:19.000Z | 2022-03-21T09:11:31.000Z | import os
import numpy as np
import pandas as pd
from scipy.io import loadmat
from sklearn.model_selection import train_test_split
from datasets.SequenceDatasets import dataset
from datasets.sequence_aug import *
from tqdm import tqdm
#Digital data was collected at 50,000 samples per second
signal_size=1024... | 38.067669 | 132 | 0.603595 |
4f1627c2087d411d912e9988640bc9359a267222 | 1,589 | py | Python | test/core_parallel_actions.py | MaxSac/build | 482c25f3a26171073c7e6c59f0427f2259a63fec | [
"BSL-1.0"
] | 11,356 | 2017-12-08T19:42:32.000Z | 2022-03-31T16:55:25.000Z | test/core_parallel_actions.py | MaxSac/build | 482c25f3a26171073c7e6c59f0427f2259a63fec | [
"BSL-1.0"
] | 2,402 | 2017-12-08T22:31:01.000Z | 2022-03-28T19:25:52.000Z | test/core_parallel_actions.py | MaxSac/build | 482c25f3a26171073c7e6c59f0427f2259a63fec | [
"BSL-1.0"
] | 1,343 | 2017-12-08T19:47:19.000Z | 2022-03-26T11:31:36.000Z | #!/usr/bin/python
# Copyright 2006 Rene Rivera.
# Copyright 2011 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester(["-d1"], pass_toolset=0)
t.write("sleep.bat", """\
:... | 15.278846 | 81 | 0.541221 |
bed4b22c8f87383d22acb11ba932121590c75cf0 | 25,562 | py | Python | utils/atlasUtility.py | varun-invent/feature-extractor | 82a4f2e0a0523e0e6bcd5d7cd0d434e6d76951f0 | [
"MIT"
] | null | null | null | utils/atlasUtility.py | varun-invent/feature-extractor | 82a4f2e0a0523e0e6bcd5d7cd0d434e6d76951f0 | [
"MIT"
] | null | null | null | utils/atlasUtility.py | varun-invent/feature-extractor | 82a4f2e0a0523e0e6bcd5d7cd0d434e6d76951f0 | [
"MIT"
] | null | null | null | # coding: utf-8
import pandas as pd
import nibabel as nib
import numpy as np
import math
import xml.etree.ElementTree as ET
from tqdm import tqdm
import argparse
# In[66]:
# Improved
class queryAtlas:
'''
atlasPaths : List of paths to the nii files to be considered in order of preference
atlasLabelsPa... | 41.767974 | 144 | 0.539081 |
42301322b281030a4aad4bc3bf6865f483fb6049 | 3,550 | py | Python | sdem/experiment.py | defaultobject/sdem | 3e2c913454d45eb8c9d111fd9b80eae18905d164 | [
"MIT"
] | null | null | null | sdem/experiment.py | defaultobject/sdem | 3e2c913454d45eb8c9d111fd9b80eae18905d164 | [
"MIT"
] | null | null | null | sdem/experiment.py | defaultobject/sdem | 3e2c913454d45eb8c9d111fd9b80eae18905d164 | [
"MIT"
] | null | null | null | """ Wrapper around SacredExperiment. """
from sacred import Experiment as SacredExperiment
from sacred.observers import FileStorageObserver
import argparse
from pathlib import Path
import sys
from .computation import manager
from .computation import metrics
import inspect
import os
class Experiment(SacredExperime... | 34.803922 | 109 | 0.644507 |
fc5614afb08b8b51e3aef599927897ec62a58f4c | 6,648 | py | Python | origin/origin_service.py | DanAustinGH/fHDHR_Locast | 002117b666ad650c523aedb0209f1c996d576169 | [
"WTFPL"
] | null | null | null | origin/origin_service.py | DanAustinGH/fHDHR_Locast | 002117b666ad650c523aedb0209f1c996d576169 | [
"WTFPL"
] | null | null | null | origin/origin_service.py | DanAustinGH/fHDHR_Locast | 002117b666ad650c523aedb0209f1c996d576169 | [
"WTFPL"
] | null | null | null | import datetime
import re
import fHDHR.tools
import fHDHR.exceptions
class OriginService():
def __init__(self, fhdhr):
self.fhdhr = fhdhr
self.status_dict = {"donateExp": None}
self.location = {
"latitude": None,
"longitude": None,
... | 41.55 | 121 | 0.584988 |
c1547b1d9c4f119b7180d9d34765805bdfb88e87 | 548 | py | Python | lesson_2_task_3.py | anihorta/selenium_st | 57a8e205ba1bc745b5b34e1bd6c0b0362f3c52f9 | [
"Apache-2.0"
] | null | null | null | lesson_2_task_3.py | anihorta/selenium_st | 57a8e205ba1bc745b5b34e1bd6c0b0362f3c52f9 | [
"Apache-2.0"
] | null | null | null | lesson_2_task_3.py | anihorta/selenium_st | 57a8e205ba1bc745b5b34e1bd6c0b0362f3c52f9 | [
"Apache-2.0"
] | null | null | null | import pytest
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
@pytest.fixture
def driver(request):
wd = webdriver.Chrome()
request.addfinalizer(wd.quit)
return wd
def test_example(driver):
driver.... | 26.095238 | 64 | 0.770073 |
4e9b0a70a57111f838130aa599ceb877557bf664 | 1,003 | py | Python | pandapower/control/__init__.py | junmuz/pandapower | 06dac12afb5725332ec497c2eda239d178e4882b | [
"BSD-3-Clause"
] | 104 | 2017-02-21T17:13:51.000Z | 2022-03-21T13:52:27.000Z | pandapower/control/__init__.py | junmuz/pandapower | 06dac12afb5725332ec497c2eda239d178e4882b | [
"BSD-3-Clause"
] | 126 | 2017-02-15T17:09:08.000Z | 2018-07-16T13:25:15.000Z | pandapower/control/__init__.py | junmuz/pandapower | 06dac12afb5725332ec497c2eda239d178e4882b | [
"BSD-3-Clause"
] | 57 | 2017-03-08T13:49:32.000Z | 2022-02-28T10:36:55.000Z | import pandapower.control.basic_controller
import pandapower.control.controller
# --- Controller ---
from pandapower.control.controller.const_control import ConstControl
from pandapower.control.controller.characteristic_control import CharacteristicControl
from pandapower.control.controller.trafo.ContinuousTapControl i... | 52.789474 | 91 | 0.881356 |
4e9237ea55e094e003b07c9e70821c06d7103535 | 132,417 | py | Python | autotest/ogr/ogr_geojson.py | ajolma/gdal | 19d847c8519919fcd1e7e7247644d28771034317 | [
"MIT"
] | null | null | null | autotest/ogr/ogr_geojson.py | ajolma/gdal | 19d847c8519919fcd1e7e7247644d28771034317 | [
"MIT"
] | null | null | null | autotest/ogr/ogr_geojson.py | ajolma/gdal | 19d847c8519919fcd1e7e7247644d28771034317 | [
"MIT"
] | 1 | 2019-11-01T15:17:09.000Z | 2019-11-01T15:17:09.000Z | #!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: GeoJSON driver test suite.
# Author: Mateusz Loskot <mateusz@loskot.net>
#
################################################################... | 35.653473 | 450 | 0.585129 |
b6b7eb9186d818cb0c80bd98cdfd75ed91c96f42 | 402 | py | Python | leetcode/june-challenge/Day25-Find_the_Duplicate_Number.py | youngchaena/Problem-Solving | 93995f96954e7e2fba3ba383c7bd43912e19e07d | [
"MIT"
] | null | null | null | leetcode/june-challenge/Day25-Find_the_Duplicate_Number.py | youngchaena/Problem-Solving | 93995f96954e7e2fba3ba383c7bd43912e19e07d | [
"MIT"
] | null | null | null | leetcode/june-challenge/Day25-Find_the_Duplicate_Number.py | youngchaena/Problem-Solving | 93995f96954e7e2fba3ba383c7bd43912e19e07d | [
"MIT"
] | null | null | null | # Day 25 - Find the Duplicate Number
class Solution:
def findDuplicate(self, nums: List[int]) -> int:
slow = fast = finder = 0
while True:
slow = nums[slow]
fast = nums[nums[fast]]
if slow == fast:
while finder != slow:
finder ... | 30.923077 | 52 | 0.475124 |
de7973fa45dd18150b317f1ebdea474989ffb553 | 6,077 | py | Python | pysnmp/SYSLOG-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/SYSLOG-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/SYSLOG-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module SYSLOG-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SYSLOG-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:06:54 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:... | 129.297872 | 708 | 0.766332 |
451bc4291b23607b5954e5508057021389d01f38 | 10,512 | py | Python | tests/csa_json_to_stix/test_class.py | krishna2345/stix-shifter | f1315cbfb25216db6e3348b0ef1220d920d29f2e | [
"Apache-2.0"
] | null | null | null | tests/csa_json_to_stix/test_class.py | krishna2345/stix-shifter | f1315cbfb25216db6e3348b0ef1220d920d29f2e | [
"Apache-2.0"
] | null | null | null | tests/csa_json_to_stix/test_class.py | krishna2345/stix-shifter | f1315cbfb25216db6e3348b0ef1220d920d29f2e | [
"Apache-2.0"
] | 2 | 2019-06-26T19:23:52.000Z | 2019-07-09T15:33:16.000Z | from stix_shifter.stix_translation.src.json_to_stix import json_to_stix_translator
from stix_shifter.stix_translation.src.utils import transformers
from stix_shifter.stix_translation.src.modules.csa import csa_translator
import json
import unittest
from os import path
interface = csa_translator.Translator()
map_file =... | 46.513274 | 139 | 0.564688 |
a4d48f5a18b76e4b0585fb1165ca4a0d43a9bba2 | 60,921 | py | Python | fortnitepy/http.py | Luc1412/fortnitepy | 08825ede2226f02f4047cfed63d5f1e153a5bb62 | [
"MIT"
] | 127 | 2019-07-15T15:55:30.000Z | 2022-03-22T07:39:29.000Z | fortnitepy/http.py | Luc1412/fortnitepy | 08825ede2226f02f4047cfed63d5f1e153a5bb62 | [
"MIT"
] | 65 | 2019-07-15T22:48:35.000Z | 2022-01-30T05:18:36.000Z | fortnitepy/http.py | Luc1412/fortnitepy | 08825ede2226f02f4047cfed63d5f1e153a5bb62 | [
"MIT"
] | 83 | 2019-07-18T12:37:58.000Z | 2022-03-19T20:56:47.000Z | # -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2019-2021 Terbau
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, including without limitation the rights
to use, copy, ... | 36.09064 | 110 | 0.511006 |
9ecf081ed0b079a370968a8c10ace03c3012852f | 108 | py | Python | example3.py | touilleMan/pythecode | 84da4b3d9de87c4c1ec5daf285028a61fcf7e80e | [
"WTFPL"
] | 2 | 2021-11-08T02:45:12.000Z | 2021-11-08T09:41:04.000Z | example3.py | touilleMan/pythecode | 84da4b3d9de87c4c1ec5daf285028a61fcf7e80e | [
"WTFPL"
] | null | null | null | example3.py | touilleMan/pythecode | 84da4b3d9de87c4c1ec5daf285028a61fcf7e80e | [
"WTFPL"
] | null | null | null | def k(x, a=1, b=2, c=3):
print(x, a, b, c)
d = (a + b) * c
return 'res', d, x
print(k(10, 20))
| 15.428571 | 24 | 0.416667 |
c52bbb00d23df7037698c3a747adb61e86903a19 | 90,576 | py | Python | srunner/scenariomanager/scenarioatomics/atomic_behaviors.py | Soolek/scenario_runner | 7a50628b50e9458ab2895ce252cf882f55731717 | [
"MIT"
] | null | null | null | srunner/scenariomanager/scenarioatomics/atomic_behaviors.py | Soolek/scenario_runner | 7a50628b50e9458ab2895ce252cf882f55731717 | [
"MIT"
] | null | null | null | srunner/scenariomanager/scenarioatomics/atomic_behaviors.py | Soolek/scenario_runner | 7a50628b50e9458ab2895ce252cf882f55731717 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2018-2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
This module provides all atomic scenario behaviors required to realize
complex, realistic scenarios such as "follow a leading veh... | 38.62516 | 120 | 0.650989 |
66014bda2cc91b85af8020a1218d790c90f75fc9 | 1,108 | py | Python | gans/discriminator_model.py | slaily/deep-learning-bits | cb9ce7ec539efbdfcaa023d141466f919bd31b71 | [
"MIT"
] | null | null | null | gans/discriminator_model.py | slaily/deep-learning-bits | cb9ce7ec539efbdfcaa023d141466f919bd31b71 | [
"MIT"
] | null | null | null | gans/discriminator_model.py | slaily/deep-learning-bits | cb9ce7ec539efbdfcaa023d141466f919bd31b71 | [
"MIT"
] | null | null | null | """
The GAN discriminator network
"""
import keras
import numpy as np
from keras import layers
discriminator_input = layers.Input(shape=(height, width, channels))
x = layers.Conv2D(128, 3)(discriminator_input)
x = layers.LeakyReLU()(x)
x = layers.Conv2D(128, 4, strides=2)(x)
x = layers.LeakyReLU()(x)
x = layers.Conv... | 29.945946 | 72 | 0.733755 |
7dfe45820236f1804aeec2a8774835ca59d63c24 | 1,375 | py | Python | openweave/tlv/schema/error.py | robszewczyk/openweave-tlv-schema | c0acbccce4fcaf213a09261f79d6a141ae94f7e8 | [
"Apache-2.0"
] | 1 | 2020-05-19T22:52:27.000Z | 2020-05-19T22:52:27.000Z | openweave/tlv/schema/error.py | robszewczyk/openweave-tlv-schema | c0acbccce4fcaf213a09261f79d6a141ae94f7e8 | [
"Apache-2.0"
] | null | null | null | openweave/tlv/schema/error.py | robszewczyk/openweave-tlv-schema | c0acbccce4fcaf213a09261f79d6a141ae94f7e8 | [
"Apache-2.0"
] | 1 | 2021-02-15T16:14:17.000Z | 2021-02-15T16:14:17.000Z | #
# Copyright (c) 2020 Google LLC.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 31.976744 | 77 | 0.648727 |
2facd8f817078d4ea3f04615f6f581489a870ffd | 14,944 | py | Python | skimage/util/dtype.py | portugueslab/scikit-image | 0fa3bcb118bb208a0cc7d3e8b96cd96c1ce7a75b | [
"BSD-3-Clause"
] | 2 | 2020-02-24T02:24:43.000Z | 2021-12-19T11:44:34.000Z | skimage/util/dtype.py | portugueslab/scikit-image | 0fa3bcb118bb208a0cc7d3e8b96cd96c1ce7a75b | [
"BSD-3-Clause"
] | null | null | null | skimage/util/dtype.py | portugueslab/scikit-image | 0fa3bcb118bb208a0cc7d3e8b96cd96c1ce7a75b | [
"BSD-3-Clause"
] | 2 | 2019-06-16T06:38:28.000Z | 2021-12-19T11:44:48.000Z | from __future__ import division
import numpy as np
from warnings import warn
__all__ = ['img_as_float32', 'img_as_float64', 'img_as_float',
'img_as_int', 'img_as_uint', 'img_as_ubyte',
'img_as_bool', 'dtype_limits']
dtype_range = {np.bool_: (False, True),
np.bool8: (False, True),
... | 32.206897 | 93 | 0.561229 |
ebb1fd4d04a78b923252181bfd4441d1e1cda4ad | 8,610 | py | Python | tensorflow_probability/python/distributions/exponential_test.py | sanket-kamthe/probability | c22b6201155c2e58d08a4ad30641d1aff59fbe7c | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/exponential_test.py | sanket-kamthe/probability | c22b6201155c2e58d08a4ad30641d1aff59fbe7c | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/exponential_test.py | sanket-kamthe/probability | c22b6201155c2e58d08a4ad30641d1aff59fbe7c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability 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 applicable law o... | 37.598253 | 109 | 0.692567 |
312873a453df4cdfba6c0b25f900bc4a3d61c322 | 993 | py | Python | subMenus/miscMenu.py | PeterVeltman/ArduinoLGServiceRemote | 9f990ef2ddcaf963ffdb52c201fdbbdd3731c743 | [
"MIT"
] | 7 | 2019-10-08T02:48:27.000Z | 2021-12-02T15:46:09.000Z | subMenus/miscMenu.py | PeterVeltman/ArduinoLGServiceRemote | 9f990ef2ddcaf963ffdb52c201fdbbdd3731c743 | [
"MIT"
] | null | null | null | subMenus/miscMenu.py | PeterVeltman/ArduinoLGServiceRemote | 9f990ef2ddcaf963ffdb52c201fdbbdd3731c743 | [
"MIT"
] | null | null | null | global remoteObj
def pressStill():
remoteObj.setKey(18)
def pressRatio():
remoteObj.setKey(19)
def pressUSB():
remoteObj.setKey(20)
def pressHelp():
remoteObj.setKey(21)
def pressKeySUp():
remoteObj.setKey(22)
def pressKeySDown():
remoteObj.setKey(23)
def pressRed():
remoteObj.setKey(... | 20.265306 | 48 | 0.58711 |
fd10a8afa1aec1a66a980c58f5aa564aa4f91de3 | 6,955 | py | Python | sdk/python/pulumi_azure_nextgen/servicebus/migration_config.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/servicebus/migration_config.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/servicebus/migration_config.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
__al... | 43.198758 | 279 | 0.656794 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.