hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
85a5bb3b8a4a849f94d769e158d72a3910b9e363 | 4,458 | py | Python | benchmark/startQiskit_Class3409.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class3409.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class3409.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=49
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_... | 34.55814 | 140 | 0.645805 |
26653c5c6db9706bdb527e064b20b882adbef1a5 | 8,662 | py | Python | TDSFunctions.py | Ivanfdezr/CentralSoftware | 8681fedd4814dc60deb527a370411350b40c994c | [
"MIT"
] | null | null | null | TDSFunctions.py | Ivanfdezr/CentralSoftware | 8681fedd4814dc60deb527a370411350b40c994c | [
"MIT"
] | 44 | 2021-02-10T23:58:28.000Z | 2021-12-14T02:38:21.000Z | TDSFunctions.py | Ivanfdezr/CentralSoftware | 8681fedd4814dc60deb527a370411350b40c994c | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import InputWindow_Mdl as mdl
import CtrlUtilities as cu
import PlotUtilities as pu
import MdlUtilities as mu
def calculateAndDraw_torque_drag_sideforce(self):
for field in self.v4TorqueDragForces_fields:
print(field.headerName, le... | 37.497835 | 136 | 0.744632 |
de39e0f290e211f84487a545a05bd1277c1357cb | 6,269 | py | Python | lib/googlecloudsdk/api_lib/dns/transaction_util.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/api_lib/dns/transaction_util.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/googlecloudsdk/api_lib/dns/transaction_util.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-25T18:17:57.000Z | 2020-07-25T18:17:57.000Z | # -*- coding: utf-8 -*- #
# Copyright 2014 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 requir... | 32.481865 | 79 | 0.742224 |
22e44367e3ff867fbdbf67e14ec832e4b78e5702 | 7,120 | py | Python | Sketches/PO/Forwarder/forwarder.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/PO/Forwarder/forwarder.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/PO/Forwarder/forwarder.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ver... | 30.55794 | 95 | 0.685955 |
f7bd39daedb297198a6ba4baeb4d429f58c2273f | 501 | py | Python | org/tact/phone_number_or_not.py | purnimasurya/python-personal-archive | d0198f1d35b5a62efb392f134a8341e8063c9df5 | [
"MIT"
] | null | null | null | org/tact/phone_number_or_not.py | purnimasurya/python-personal-archive | d0198f1d35b5a62efb392f134a8341e8063c9df5 | [
"MIT"
] | null | null | null | org/tact/phone_number_or_not.py | purnimasurya/python-personal-archive | d0198f1d35b5a62efb392f134a8341e8063c9df5 | [
"MIT"
] | null | null | null | def is_phone_2(ph):
l = len(ph)
if (l != 10):
return False
if not (ph.isdigit()):
return False
p_first = ph[0]
p = int(p_first)
if (p == 7 or p == 8 or p == 9):
#print("the phone number is valid")
return True
#print("this is not a v... | 17.892857 | 43 | 0.510978 |
891438455ddb67a0cde1e1384e68a5b7c71c5271 | 3,298 | py | Python | lint-svg.py | sethfischer/mundo-flags | 20e5ad68d760b6c736701f6e43551c738456098d | [
"MIT"
] | null | null | null | lint-svg.py | sethfischer/mundo-flags | 20e5ad68d760b6c736701f6e43551c738456098d | [
"MIT"
] | 1 | 2021-09-06T01:48:18.000Z | 2021-09-06T08:47:36.000Z | lint-svg.py | sethfischer/mundo-flags | 20e5ad68d760b6c736701f6e43551c738456098d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Lint SVG files."""
import difflib
import logging
import os
import sys
from argparse import Namespace
from typing import Optional
from manage_flags.scour import Scour
FLAG_DIRECTORY = os.path.join("flags", "iso3166-1")
logging.basicConfig(format="%(levelname)s:%(message)s")
def list_files(... | 24.42963 | 81 | 0.614615 |
dad26ef5b9af7d315dab9a95d8947ab2e8cff2ce | 6,912 | py | Python | plaid/model/signal_decision_report_response.py | Aky87/plaid-python | af56d445a9e0178b33fb0443f8399dd51c024fe1 | [
"MIT"
] | 289 | 2015-01-21T20:13:18.000Z | 2022-03-30T18:33:50.000Z | plaid/model/signal_decision_report_response.py | Aky87/plaid-python | af56d445a9e0178b33fb0443f8399dd51c024fe1 | [
"MIT"
] | 203 | 2015-01-06T22:00:50.000Z | 2022-03-24T21:28:55.000Z | plaid/model/signal_decision_report_response.py | Aky87/plaid-python | af56d445a9e0178b33fb0443f8399dd51c024fe1 | [
"MIT"
] | 144 | 2015-01-02T22:42:05.000Z | 2022-02-18T20:00:58.000Z | """
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | 39.724138 | 169 | 0.588831 |
e346aed9de4d54f888bc66527bde7f1caaa32a90 | 11,091 | py | Python | ybnexport.py | Adobe12327/Sollumz | 783e6d5d9f90ec455100f3d75e97a7d5d52fc534 | [
"MIT"
] | 131 | 2020-12-13T14:05:06.000Z | 2022-03-27T13:33:33.000Z | ybnexport.py | Adobe12327/Sollumz | 783e6d5d9f90ec455100f3d75e97a7d5d52fc534 | [
"MIT"
] | 163 | 2021-03-17T01:06:16.000Z | 2022-03-31T22:51:19.000Z | ybnexport.py | Adobe12327/Sollumz | 783e6d5d9f90ec455100f3d75e97a7d5d52fc534 | [
"MIT"
] | 61 | 2020-12-20T04:21:04.000Z | 2022-03-19T11:11:52.000Z | import bpy
from bpy_extras.io_utils import ExportHelper
from bpy.types import Operator
from xml.etree import ElementTree
from xml.etree.ElementTree import Element, SubElement, Comment, tostring
from xml.dom import minidom
from mathutils import Vector
import os
import sys
import shutil
import ntpath
from datetime impo... | 28.293367 | 103 | 0.659273 |
f306097f1d4fae96db93eb5a6074e8be7393079d | 370,375 | py | Python | salt/modules/vsphere.py | tschmittni/salt | ccfcd5ed1272576799797ec7f259b676fd130585 | [
"Apache-2.0"
] | 2 | 2018-11-08T02:59:24.000Z | 2021-01-04T00:30:50.000Z | salt/modules/vsphere.py | tschmittni/salt | ccfcd5ed1272576799797ec7f259b676fd130585 | [
"Apache-2.0"
] | 4 | 2020-09-04T10:19:34.000Z | 2020-11-09T12:55:59.000Z | salt/modules/vsphere.py | tschmittni/salt | ccfcd5ed1272576799797ec7f259b676fd130585 | [
"Apache-2.0"
] | 5 | 2017-06-16T23:48:13.000Z | 2021-04-08T17:43:48.000Z | # -*- coding: utf-8 -*-
'''
Manage VMware vCenter servers and ESXi hosts.
.. versionadded:: 2015.8.4
:codeauthor: Alexandru Bleotu <alexandru.bleotu@morganstaley.com>
Dependencies
============
- pyVmomi Python Module
- ESXCLI
pyVmomi
-------
PyVmomi can be installed via pip:
.. code-block:: bash
pip install... | 37.441872 | 130 | 0.626854 |
1b47945222b847cae5f03acc59205ff53d5b5c70 | 878 | py | Python | leetcode/reverse-integer.py | federicoemartinez/problem_solving | d0352f76bc21ed67d6851a159a00f70a892934b9 | [
"MIT"
] | null | null | null | leetcode/reverse-integer.py | federicoemartinez/problem_solving | d0352f76bc21ed67d6851a159a00f70a892934b9 | [
"MIT"
] | null | null | null | leetcode/reverse-integer.py | federicoemartinez/problem_solving | d0352f76bc21ed67d6851a159a00f70a892934b9 | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/reverse-integer/description/
"""
Given a 32-bit signed integer, reverse digits of an integer.
Example 1:
Input: 123
Output: 321
Example 2:
Input: -123
Output: -321
Example 3:
Input: 120
Output: 21
Note:
Assume we are dealing with an environment which could only store integers within ... | 22.512821 | 132 | 0.569476 |
433096e7048c164162b472baf6ac0dbe7fee2b1e | 3,166 | py | Python | src/providerhub/azext_providerhub/vendored_sdks/providerhub/aio/_configuration.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 2 | 2021-06-05T17:51:26.000Z | 2021-11-17T11:17:56.000Z | src/providerhub/azext_providerhub/vendored_sdks/providerhub/aio/_configuration.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 3 | 2020-05-27T20:16:26.000Z | 2020-07-23T19:46:49.000Z | src/providerhub/azext_providerhub/vendored_sdks/providerhub/aio/_configuration.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 5 | 2020-09-08T22:46:48.000Z | 2020-11-08T14:54:35.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 46.558824 | 134 | 0.693936 |
5e943a31eea034f19e751e70d015cd0ad22bb470 | 155 | py | Python | apps/enquiries/apps.py | FancyKat/django-portfolio | f261f8d3a37e5771f9f48a74a769b6e9b479d49d | [
"MIT"
] | null | null | null | apps/enquiries/apps.py | FancyKat/django-portfolio | f261f8d3a37e5771f9f48a74a769b6e9b479d49d | [
"MIT"
] | 9 | 2022-03-22T04:30:50.000Z | 2022-03-22T04:49:13.000Z | apps/enquiries/apps.py | FancyKat/django-portfolio | f261f8d3a37e5771f9f48a74a769b6e9b479d49d | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class EnquiriesConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "apps.enquiries"
| 22.142857 | 56 | 0.767742 |
dc909002531031cbdd561c7e14a2559f25f0e21d | 5,796 | py | Python | data/data_tools/ezData.py | jasonzutty/ezCGP | ee44425e4835f9d7ca5651bbea3340cf9466840a | [
"MIT"
] | 5 | 2019-01-18T20:33:54.000Z | 2021-08-24T17:02:07.000Z | data/data_tools/ezData.py | jasonzutty/ezCGP | ee44425e4835f9d7ca5651bbea3340cf9466840a | [
"MIT"
] | 188 | 2019-01-22T21:56:42.000Z | 2022-03-31T21:23:58.000Z | data/data_tools/ezData.py | jasonzutty/ezCGP | ee44425e4835f9d7ca5651bbea3340cf9466840a | [
"MIT"
] | 3 | 2019-01-27T04:32:50.000Z | 2021-04-20T17:28:42.000Z | '''
root/data/data_tools/ezData.py
Overview:
Rules:
'''
### packages
import os
import numpy as np
import importlib
'''
### sys relative to root dir
import sys
from os.path import dirname, realpath
sys.path.append(dirname(dirname(dirname(realpath(__file__)))))
### absolute imports wrt root
'''
class ezData():
... | 37.153846 | 118 | 0.655625 |
f559fb213866e66b80d310517c011d7bd85bac73 | 2,431 | py | Python | test/test_existdb/test_templatetags.py | zmbq/pyexistdb | 679e4fc18d80704a9d2c4ba0ec3773c5c6eb4dbe | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2018-04-12T19:58:21.000Z | 2021-10-04T19:57:47.000Z | test/test_existdb/test_templatetags.py | zmbq/pyexistdb | 679e4fc18d80704a9d2c4ba0ec3773c5c6eb4dbe | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/test_existdb/test_templatetags.py | zmbq/pyexistdb | 679e4fc18d80704a9d2c4ba0ec3773c5c6eb4dbe | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-02-26T02:44:08.000Z | 2021-12-09T13:07:27.000Z | # file test_existdb/test_templatetags.py
#
# Copyright 2011 Emory University Libraries
#
# 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... | 42.649123 | 116 | 0.727273 |
0a2e4774240d66e2e435a70a80e0ddb898e31375 | 57,128 | py | Python | recbole/model/layers.py | 2017pxy/Multimodal-Meta-Learning-for-Cold-Start-Sequential-Recommendation | 43cd9d6f6b737dea220723bab27ab3f922818fb5 | [
"MIT"
] | null | null | null | recbole/model/layers.py | 2017pxy/Multimodal-Meta-Learning-for-Cold-Start-Sequential-Recommendation | 43cd9d6f6b737dea220723bab27ab3f922818fb5 | [
"MIT"
] | null | null | null | recbole/model/layers.py | 2017pxy/Multimodal-Meta-Learning-for-Cold-Start-Sequential-Recommendation | 43cd9d6f6b737dea220723bab27ab3f922818fb5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2020/6/27 16:40
# @Author : Shanlei Mu
# @Email : slmu@ruc.edu.cn
# @File : layers.py
# UPDATE:
# @Time : 2020/8/24 14:58, 2020/9/16, 2020/9/21, 2020/10/9, 2021/05/01
# @Author : Yujie Lu, Xingyu Pan, Zhichao Feng, Hui Wang, Xinyan Fan
# @Email : yujielu1998@gmail.com, panxy@r... | 42.411284 | 134 | 0.647931 |
cfcfc938431a625918b4b0cdf01586df230746ad | 7,421 | py | Python | projects/Web_page_summation/utils/model.py | rossi2018/python-mini-projects | a85c140b990ec9d0fd491da5508fe188278032b0 | [
"MIT"
] | 9,957 | 2020-09-25T14:38:36.000Z | 2022-03-31T09:17:18.000Z | projects/Web_page_summation/utils/model.py | rossi2018/python-mini-projects | a85c140b990ec9d0fd491da5508fe188278032b0 | [
"MIT"
] | 159 | 2020-09-24T20:47:58.000Z | 2022-03-29T07:51:37.000Z | projects/Web_page_summation/utils/model.py | rossi2018/python-mini-projects | a85c140b990ec9d0fd491da5508fe188278032b0 | [
"MIT"
] | 2,883 | 2020-09-25T13:25:46.000Z | 2022-03-31T22:51:23.000Z | import tensorflow as tf
from tensorflow.contrib import rnn
from utils import get_init_embedding
class Model(object):
def __init__(self, reversed_dict, article_max_len, summary_max_len, args, forward_only=False):
self.vocabulary_size = len(reversed_dict)
self.embedding_size = args.embedding_size
... | 56.219697 | 137 | 0.607331 |
fee1eb108e84ab0225fcbf4aaee172542b0654ab | 53,236 | py | Python | core/domain/skill_domain.py | Eblanken/oppia | a4a3a7266858efb54ae7ceba3a7c834837744911 | [
"Apache-2.0"
] | null | null | null | core/domain/skill_domain.py | Eblanken/oppia | a4a3a7266858efb54ae7ceba3a7c834837744911 | [
"Apache-2.0"
] | null | null | null | core/domain/skill_domain.py | Eblanken/oppia | a4a3a7266858efb54ae7ceba3a7c834837744911 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Oppia 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 applicable ... | 40.117558 | 80 | 0.643625 |
9e2bb830c213bee5ca8805a4dcaba04dd6515726 | 1,854 | py | Python | nova/auth/rbac.py | joshuamckenty/yolo-octo-wookie | 8e078e91d367f3deaf1785c46ee7734dd7907f24 | [
"Apache-2.0"
] | 1 | 2021-06-09T17:58:53.000Z | 2021-06-09T17:58:53.000Z | nova/auth/rbac.py | joshuamckenty/yolo-octo-wookie | 8e078e91d367f3deaf1785c46ee7734dd7907f24 | [
"Apache-2.0"
] | null | null | null | nova/auth/rbac.py | joshuamckenty/yolo-octo-wookie | 8e078e91d367f3deaf1785c46ee7734dd7907f24 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | 34.333333 | 78 | 0.643474 |
5f237d51180908b31ae53cb59789bb872cd2ce43 | 2,556 | py | Python | stocks/helper.py | arminbhy/stock-market-analysis | 3b560674c1da29aa8ebbf3b56b975c787f0e5fd8 | [
"WTFPL"
] | 1 | 2017-02-27T13:11:46.000Z | 2017-02-27T13:11:46.000Z | stocks/helper.py | arminbhy/stock-market-analysis | 3b560674c1da29aa8ebbf3b56b975c787f0e5fd8 | [
"WTFPL"
] | null | null | null | stocks/helper.py | arminbhy/stock-market-analysis | 3b560674c1da29aa8ebbf3b56b975c787f0e5fd8 | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python
import numpy
import pystache
def _direction_to_str(direction):
if direction == 1:
return "Positive"
if direction == -1:
return "Negative"
return "None"
def _direction(a,b):
if a > b:
return 1
if a == b:
return 0
return -1
def _rsi(v):
... | 26.350515 | 158 | 0.564945 |
b6345f801f6d5cf867ac7e8e1ff165a17cbf148d | 1,090 | py | Python | Project:-Student-Management-System/code.py | srthakor/ga-learner-dsmp-repo | 40119a8c2bdfd1ff4694cd1e0b5699871a734411 | [
"MIT"
] | null | null | null | Project:-Student-Management-System/code.py | srthakor/ga-learner-dsmp-repo | 40119a8c2bdfd1ff4694cd1e0b5699871a734411 | [
"MIT"
] | null | null | null | Project:-Student-Management-System/code.py | srthakor/ga-learner-dsmp-repo | 40119a8c2bdfd1ff4694cd1e0b5699871a734411 | [
"MIT"
] | null | null | null | # --------------
# Code starts here
class_1=['Geoffrey Hinton','Andrew Ng','Sebastian Raschka','Yoshua Bengio']
class_2=['Hilary Mason','Carla Gentry','Corinna Cortes']
new_class=class_1+class_2
print(new_class)
new_class=class_1+class_2+['Peter Warden']
print(new_class)
del new_class[5]
print(new_class)
# Code ends ... | 20.185185 | 147 | 0.699083 |
59c879610859e183261d6cfe9a982f5f3210e88b | 2,556 | py | Python | src/visualization/visualize_classification_results.py | Calychas/peap-project | 14eb75cdaa60842dd9b530c10c47985aa77f8ff7 | [
"MIT"
] | null | null | null | src/visualization/visualize_classification_results.py | Calychas/peap-project | 14eb75cdaa60842dd9b530c10c47985aa77f8ff7 | [
"MIT"
] | null | null | null | src/visualization/visualize_classification_results.py | Calychas/peap-project | 14eb75cdaa60842dd9b530c10c47985aa77f8ff7 | [
"MIT"
] | null | null | null | import os
from typing import List
import click
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
def visualize_results(model_name: str, model_name_to_file: str, path: str, labels: List[str], directory_for_plots: str,
columns_to_plot: List[str]):
if not os.path.exists... | 42.6 | 128 | 0.680751 |
6caafc361f0c5909c6e58c9b70b9396efbe5161c | 8,759 | py | Python | sherlock/sites.py | arrudagates/sherlock | f29a87a3115899231b857255d20093530c4e6b41 | [
"MIT"
] | 3 | 2020-09-03T17:53:31.000Z | 2021-09-08T05:53:39.000Z | sherlock/sites.py | arrudagates/sherlock | f29a87a3115899231b857255d20093530c4e6b41 | [
"MIT"
] | null | null | null | sherlock/sites.py | arrudagates/sherlock | f29a87a3115899231b857255d20093530c4e6b41 | [
"MIT"
] | 1 | 2020-10-28T04:39:03.000Z | 2020-10-28T04:39:03.000Z | """Sherlock Sites Information Module
This module supports storing information about web sites.
This is the raw data that will be used to search for usernames.
"""
import os
import json
import operator
import requests
import sys
class SiteInformation():
def __init__(self, name, url_home, url_username_format, user... | 40.929907 | 126 | 0.471287 |
9179d87f7629316f07c05c32bbce9c54b1257dfd | 5,790 | py | Python | app/touim/views.py | tatiana-kim/archeo-app-autotests | 086e81a7fa7a5fbdfc95a628ea79247934f93d2f | [
"MIT"
] | null | null | null | app/touim/views.py | tatiana-kim/archeo-app-autotests | 086e81a7fa7a5fbdfc95a628ea79247934f93d2f | [
"MIT"
] | null | null | null | app/touim/views.py | tatiana-kim/archeo-app-autotests | 086e81a7fa7a5fbdfc95a628ea79247934f93d2f | [
"MIT"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.contrib.auth.models import User
from django.views.generic import (
ListView,
DetailView,
CreateView,
UpdateView,
DeleteView
)
from .models import Si... | 31.98895 | 83 | 0.621244 |
471572172bce8fc4ec4914a2390d200535a0877d | 460 | py | Python | anuncios/migrations/0007_alter_anuncio_estate.py | Hercita/vss | 5f316c0b125d700268cc0afed2821af6a907118d | [
"Apache-2.0"
] | null | null | null | anuncios/migrations/0007_alter_anuncio_estate.py | Hercita/vss | 5f316c0b125d700268cc0afed2821af6a907118d | [
"Apache-2.0"
] | 1 | 2021-05-16T16:46:07.000Z | 2021-05-16T16:46:07.000Z | anuncios/migrations/0007_alter_anuncio_estate.py | Hercita/vss | 5f316c0b125d700268cc0afed2821af6a907118d | [
"Apache-2.0"
] | 1 | 2021-05-16T16:37:44.000Z | 2021-05-16T16:37:44.000Z | # Generated by Django 3.2 on 2021-05-02 08:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('anuncios', '0006_auto_20210501_1933'),
]
operations = [
migrations.AlterField(
model_name='anuncio',
name='estate',
... | 24.210526 | 124 | 0.604348 |
742e1235ecbc63b8e7a51049993af33a739e83cd | 4,851 | py | Python | noxfile.py | bluetech/urllib3 | 186e7f91c058d8a04e3b894d5580001e09666ee3 | [
"MIT"
] | null | null | null | noxfile.py | bluetech/urllib3 | 186e7f91c058d8a04e3b894d5580001e09666ee3 | [
"MIT"
] | null | null | null | noxfile.py | bluetech/urllib3 | 186e7f91c058d8a04e3b894d5580001e09666ee3 | [
"MIT"
] | null | null | null | import os
import shutil
import subprocess
import nox
# Whenever type-hints are completed on a file it should be added here so that
# this file will continue to be checked by mypy. Errors from other files are
# ignored.
TYPED_FILES = {
"src/urllib3/contrib/__init__.py",
"src/urllib3/__init__.py",
"src/urll... | 27.87931 | 81 | 0.622346 |
10cee54e88a93e875fc28e414151c935730ce043 | 8,803 | py | Python | transnetv2.py | shallwe999/TransNetV2-SBD-Visualize | 3d1186ae30f135da546a8f19af99c2ee5201729e | [
"MIT"
] | 2 | 2021-09-06T13:07:42.000Z | 2022-02-27T08:53:04.000Z | transnetv2.py | shallwe999/TransNetV2-SBD-Visualize | 3d1186ae30f135da546a8f19af99c2ee5201729e | [
"MIT"
] | null | null | null | transnetv2.py | shallwe999/TransNetV2-SBD-Visualize | 3d1186ae30f135da546a8f19af99c2ee5201729e | [
"MIT"
] | null | null | null | import os
import numpy as np
import tensorflow as tf
class TransNetV2:
def __init__(self, model_dir=None):
if model_dir is None:
model_dir = os.path.join(os.path.dirname(__file__), "transnetv2-weights/")
if not os.path.isdir(model_dir):
raise FileNotFoundError(f"[T... | 40.75463 | 120 | 0.586164 |
32da6a422832bb3577444f4f0a36c799ad41f22c | 215 | py | Python | tests/test.py | BurhanH/paket | f08c94f5d97e945eb2118233f2d81517c2673b71 | [
"MIT"
] | null | null | null | tests/test.py | BurhanH/paket | f08c94f5d97e945eb2118233f2d81517c2673b71 | [
"MIT"
] | 1 | 2021-07-14T02:09:30.000Z | 2021-07-14T02:09:30.000Z | tests/test.py | BurhanH/paket | f08c94f5d97e945eb2118233f2d81517c2673b71 | [
"MIT"
] | null | null | null | import paket
import unittest
class Test(unittest.TestCase):
def test_paket(self):
self.assertEqual(paket.get(), u'Here is our message for an example!')
if __name__ == '__main__':
unittest.main()
| 17.916667 | 77 | 0.693023 |
053c0600a33d6ab0151ecc8879cbc68fe731dbe5 | 8,937 | py | Python | tensorflow/python/keras/_impl/keras/utils/layer_utils.py | harunpehlivan/tensorflow | 376e2cfdab31f4da251ea2e50992a9bf97fd171b | [
"Apache-2.0"
] | 22 | 2018-01-13T14:52:47.000Z | 2018-07-05T01:00:28.000Z | tensorflow/python/keras/_impl/keras/utils/layer_utils.py | hamzabekkouri/tensorflow | d87a9fbbc5f49ec5ae8eb52c62628f0b1a0bf67f | [
"Apache-2.0"
] | 3 | 2018-05-09T11:31:58.000Z | 2021-01-27T12:26:21.000Z | tensorflow/python/keras/_impl/keras/utils/layer_utils.py | hamzabekkouri/tensorflow | d87a9fbbc5f49ec5ae8eb52c62628f0b1a0bf67f | [
"Apache-2.0"
] | 13 | 2018-02-22T21:04:13.000Z | 2020-11-17T11:38:36.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.464286 | 106 | 0.660736 |
f0632738573086c2866dda2fd3d348d7ef5c0c48 | 1,633 | py | Python | setup.py | Hezeh/django-admin-honeypot | 9c9884b19d41711372c3cf02ce18e4103173d314 | [
"MIT"
] | null | null | null | setup.py | Hezeh/django-admin-honeypot | 9c9884b19d41711372c3cf02ce18e4103173d314 | [
"MIT"
] | null | null | null | setup.py | Hezeh/django-admin-honeypot | 9c9884b19d41711372c3cf02ce18e4103173d314 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
from admin_honeypot import __version__, __description__, __license__
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
setup(
name='django-admin-honeypot',
version=__version__,
description=__descrip... | 36.288889 | 95 | 0.638089 |
424f76800b900e397f5438b4c31f0341f8c532be | 5,632 | py | Python | sprox/providerselector.py | TurboGears/sprox | 98bd4808d7fa8debe1cc5511db745cf55cb7d67a | [
"MIT"
] | 3 | 2015-07-03T16:31:22.000Z | 2018-04-19T04:26:02.000Z | sprox/providerselector.py | TurboGears/sprox | 98bd4808d7fa8debe1cc5511db745cf55cb7d67a | [
"MIT"
] | 8 | 2015-02-23T23:01:50.000Z | 2021-07-06T14:10:26.000Z | sprox/providerselector.py | TurboGears/sprox | 98bd4808d7fa8debe1cc5511db745cf55cb7d67a | [
"MIT"
] | 7 | 2015-06-14T04:07:53.000Z | 2020-04-28T13:50:50.000Z | """
Provider Locator Module
a module to help dbsprockets automatically find providers
Copyright (c) 2008 Christopher Perkins
Original Version by Christopher Perkins 2007
Released under MIT license.
"""
import inspect
try:
from sqlalchemy import MetaData
from sqlalchemy.engine import Engine
from sqlalchem... | 29.957447 | 103 | 0.667614 |
a72e3739981ce9cf06746cbfe6e860e127d99c20 | 1,486 | py | Python | pyscreenshot/plugins/gnome_screenshot.py | gatoatigrado/pyscreenshot | 40233cf17492f2f6b2f7e0950ac42317e9487b40 | [
"BSD-2-Clause"
] | null | null | null | pyscreenshot/plugins/gnome_screenshot.py | gatoatigrado/pyscreenshot | 40233cf17492f2f6b2f7e0950ac42317e9487b40 | [
"BSD-2-Clause"
] | null | null | null | pyscreenshot/plugins/gnome_screenshot.py | gatoatigrado/pyscreenshot | 40233cf17492f2f6b2f7e0950ac42317e9487b40 | [
"BSD-2-Clause"
] | null | null | null | from easyprocess import EasyProcess
from easyprocess import extract_version
from PIL import Image
import tempfile
PROGRAM = 'gnome-screenshot'
class GnomeScreenshotWrapper(object):
"""
Plugin for ``pyscreenshot`` that uses ``gnome-screenshot``
https://git.gnome.org/browse/gnome-screenshot/
This plu... | 29.137255 | 80 | 0.635262 |
991a0585245ccbc22304d046297d3880e840ae32 | 4,775 | py | Python | imageio/plugins/fits.py | jond01/imageio | e467b7a7b03d8d8843fe0c2cdbdb37fd6a48b331 | [
"BSD-2-Clause"
] | 11 | 2019-06-19T03:44:05.000Z | 2021-07-30T10:28:14.000Z | imageio/plugins/fits.py | jond01/imageio | e467b7a7b03d8d8843fe0c2cdbdb37fd6a48b331 | [
"BSD-2-Clause"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | imageio/plugins/fits.py | jond01/imageio | e467b7a7b03d8d8843fe0c2cdbdb37fd6a48b331 | [
"BSD-2-Clause"
] | 6 | 2019-10-25T17:11:06.000Z | 2021-12-02T16:05:20.000Z | # -*- coding: utf-8 -*-
# imageio is distributed under the terms of the (new) BSD License.
""" Plugin for reading FITS files.
"""
from .. import formats
from ..core import Format
_fits = None # lazily loaded
def load_lib():
global _fits
try:
from astropy.io import fits as _fits
except ImportEr... | 37.304688 | 86 | 0.628691 |
8c696f9cd81d0810997cdbfb54eceb9e656ff2a9 | 32,280 | py | Python | test/functional/fundrawtransaction.py | s-crow-project/s-crow | f1e1b2d61a5f61367b6b70acdd4e9a91c2b619f3 | [
"MIT"
] | null | null | null | test/functional/fundrawtransaction.py | s-crow-project/s-crow | f1e1b2d61a5f61367b6b70acdd4e9a91c2b619f3 | [
"MIT"
] | null | null | null | test/functional/fundrawtransaction.py | s-crow-project/s-crow | f1e1b2d61a5f61367b6b70acdd4e9a91c2b619f3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the fundrawtransaction RPC."""
from test_framework.test_framework import BitcoinTestFramework, BI... | 44.524138 | 223 | 0.570353 |
90e0601c1310e4a5f156d40baaa0c9c4b82fe856 | 4,782 | py | Python | chainer_chemistry/training/extensions/auto_print_report.py | naototachibana/chainer-chemistry | 785f68232d43fe98cb2c79f5b5e22b7d5a971738 | [
"MIT"
] | 1 | 2019-09-13T07:31:38.000Z | 2019-09-13T07:31:38.000Z | chainer_chemistry/training/extensions/auto_print_report.py | nd-02110114/chainer-chemistry | 04577ba920b46c7141d4f01e212f7040eb91db19 | [
"MIT"
] | null | null | null | chainer_chemistry/training/extensions/auto_print_report.py | nd-02110114/chainer-chemistry | 04577ba920b46c7141d4f01e212f7040eb91db19 | [
"MIT"
] | null | null | null | from copy import deepcopy
import os
import sys
from chainer.training import extension
from chainer.training.extensions import log_report as log_report_module
from chainer.training.extensions import util
def create_header_and_templates(entries):
# format information
entry_widths = [max(10, len(s)) for s in en... | 34.157143 | 79 | 0.600795 |
ab1b693c8fab33d75daa4593781f92f212fd1a76 | 5,708 | py | Python | Code Generation/test3.py | obiwit/musicinator | fde52469a957928803e4e3feb6cb1acbf9c8d15f | [
"MIT"
] | null | null | null | Code Generation/test3.py | obiwit/musicinator | fde52469a957928803e4e3feb6cb1acbf9c8d15f | [
"MIT"
] | null | null | null | Code Generation/test3.py | obiwit/musicinator | fde52469a957928803e4e3feb6cb1acbf9c8d15f | [
"MIT"
] | null | null | null | from midiutil import MIDIFile
from itertools import repeat
from math import ceil
import sys
import copy
bpm = 60 #to be defined by user
vartrack = 2 #to be defined by user
longest = 0
####
toadd = [[1,10,15,25,36],[(64,0.5,2,3),(62,0.25,25,4)],1]
toadd2 = [[1,10,15,25,36],[(64,0.5,2,3),(62,0.25,25,4)]]
toadd3 = [(6... | 29.729167 | 287 | 0.532761 |
93ee8a99fc0ac6ef67a9474c3ec4e4a88f232478 | 767 | py | Python | src/clims/api/serializers/models/transition.py | commonlims/commonlims | 36a02ed244c7b59ee1f2523e64e4749e404ab0f7 | [
"BSD-3-Clause"
] | 4 | 2019-05-27T13:55:07.000Z | 2021-03-30T07:05:09.000Z | src/clims/api/serializers/models/transition.py | commonlims/commonlims | 36a02ed244c7b59ee1f2523e64e4749e404ab0f7 | [
"BSD-3-Clause"
] | 99 | 2019-05-20T14:16:33.000Z | 2021-01-19T09:25:15.000Z | src/clims/api/serializers/models/transition.py | commonlims/commonlims | 36a02ed244c7b59ee1f2523e64e4749e404ab0f7 | [
"BSD-3-Clause"
] | 1 | 2020-08-10T07:55:40.000Z | 2020-08-10T07:55:40.000Z | from __future__ import absolute_import
from rest_framework import serializers
from clims.models.transition import TransitionType
class PositionSerializer(serializers.Serializer):
container_id = serializers.IntegerField()
index = serializers.CharField()
class TransitionSerializer(serializers.Serializer):
... | 29.5 | 72 | 0.769231 |
9111988ebe35c7bfa96c6e764a789cc013bf9130 | 27,176 | py | Python | intersight/model/cloud_sku_container_type.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/cloud_sku_container_type.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/cloud_sku_container_type.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 68.110276 | 5,987 | 0.663416 |
e42e9bc2f80ffe8133c1e30521b54de0b0688253 | 5,536 | py | Python | Solutions/mailroom/mailroom_meta/json_save/json_save/saveables.py | UWPCE-PythonCert/InstructorResources | 13b1cfa4cad6a8c3491f8a602c8afda5400c9ac7 | [
"Unlicense"
] | null | null | null | Solutions/mailroom/mailroom_meta/json_save/json_save/saveables.py | UWPCE-PythonCert/InstructorResources | 13b1cfa4cad6a8c3491f8a602c8afda5400c9ac7 | [
"Unlicense"
] | 1 | 2020-12-20T17:07:17.000Z | 2020-12-20T17:07:17.000Z | Solutions/mailroom/mailroom_meta/json_save/json_save/saveables.py | UWPCE-PythonCert/InstructorResources | 13b1cfa4cad6a8c3491f8a602c8afda5400c9ac7 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
"""
The Saveable objects used by both the metaclass and decorator approach.
"""
import ast
# import json
__all__ = ['Bool',
'Dict',
'Float',
'Int',
'List',
'Saveable',
'String',
'Tuple',
]
class Saveable()... | 25.163636 | 83 | 0.561416 |
9bf74327be05e6a2ce83a6428dc44a1bb985a22d | 5,691 | py | Python | LicenseAnalysis/LicenseModel/models.py | JiananHe/LicenseAnalysis | c34e02378e294d4ac0e27ee06b2dc47687e281e0 | [
"Apache-2.0"
] | 1 | 2020-10-28T07:09:41.000Z | 2020-10-28T07:09:41.000Z | LicenseAnalysis/LicenseModel/models.py | JiananHe/LicenseAnalysis | c34e02378e294d4ac0e27ee06b2dc47687e281e0 | [
"Apache-2.0"
] | 1 | 2018-11-25T14:08:54.000Z | 2018-11-25T14:08:54.000Z | LicenseAnalysis/LicenseModel/models.py | JiananHe/LicenseAnalysis | c34e02378e294d4ac0e27ee06b2dc47687e281e0 | [
"Apache-2.0"
] | 1 | 2022-03-20T16:37:41.000Z | 2022-03-20T16:37:41.000Z | from django.db import models
# Create your models here.
class license_description(models.Model):
name = models.CharField(max_length=20)
abbreviation = models.CharField(max_length=10)
synopsis = models.TextField(null=True)
content = models.TextField(null=True)
permissions = models.IntegerField(null... | 29.184615 | 102 | 0.665788 |
5a351a66da6af509eb4dc5d2a0c9a27d8f32ab15 | 2,182 | py | Python | CFN-S3PreSignedURL/LambdaCreateS3PreSignedURL.py | DanielEIlie/short-examples | f917297cefa95c6fc812dab596e15d595b69574f | [
"Apache-2.0"
] | null | null | null | CFN-S3PreSignedURL/LambdaCreateS3PreSignedURL.py | DanielEIlie/short-examples | f917297cefa95c6fc812dab596e15d595b69574f | [
"Apache-2.0"
] | null | null | null | CFN-S3PreSignedURL/LambdaCreateS3PreSignedURL.py | DanielEIlie/short-examples | f917297cefa95c6fc812dab596e15d595b69574f | [
"Apache-2.0"
] | null | null | null | import boto3
from botocore.exceptions import ClientError
from urllib.parse import unquote_plus
from os import environ
from LambdaExceptions import PublishMessageRaiseException
region = environ['REGION']
costCenter = environ['COSTCENTER']
snsArn = environ['SNSALERT']
timeLimit = environ['TIMELIMIT']
def lambda_handler... | 25.97619 | 57 | 0.63428 |
7e9f1a465a06b5cbcbd956c368b8610c5c06cdd2 | 5,969 | py | Python | objectModel/Python/cdm/objectmodel/projections/cdm_operation_add_supporting_attribute.py | MiguelSHS/microsoftCDM | d8df31fa455fcc6afd698e3ca7ec0f8c4a6716fd | [
"CC-BY-4.0",
"MIT"
] | 1 | 2021-07-06T17:08:15.000Z | 2021-07-06T17:08:15.000Z | objectModel/Python/cdm/objectmodel/projections/cdm_operation_add_supporting_attribute.py | MiguelSHS/microsoftCDM | d8df31fa455fcc6afd698e3ca7ec0f8c4a6716fd | [
"CC-BY-4.0",
"MIT"
] | null | null | null | objectModel/Python/cdm/objectmodel/projections/cdm_operation_add_supporting_attribute.py | MiguelSHS/microsoftCDM | d8df31fa455fcc6afd698e3ca7ec0f8c4a6716fd | [
"CC-BY-4.0",
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
from typing import Optional, TYPE_CHECKING
from cdm.enums import CdmAttributeContextType, CdmObjectType, CdmOperationType, CdmLogCode
from cdm.objectmodel import C... | 54.761468 | 204 | 0.759591 |
cf4d8c0c7fa356cbba16827c9caeb9fd9eb3f2f4 | 3,266 | py | Python | core/settings.py | YakhyaevRasul/the-voice.uz | 9abe0030c2fca39b5b11641ccf97ff8469785fe6 | [
"MIT"
] | null | null | null | core/settings.py | YakhyaevRasul/the-voice.uz | 9abe0030c2fca39b5b11641ccf97ff8469785fe6 | [
"MIT"
] | null | null | null | core/settings.py | YakhyaevRasul/the-voice.uz | 9abe0030c2fca39b5b11641ccf97ff8469785fe6 | [
"MIT"
] | null | null | null | """
Django settings for core project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib im... | 25.515625 | 91 | 0.698102 |
23ebf8aefbc0e6bff9e3e072767fc0e8f53077bc | 2,425 | py | Python | homeassistant/components/recollect_waste/__init__.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/recollect_waste/__init__.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/recollect_waste/__init__.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """The ReCollect Waste integration."""
from __future__ import annotations
from datetime import date, timedelta
from aiorecollect.client import Client, PickupEvent
from aiorecollect.errors import RecollectError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassi... | 33.680556 | 89 | 0.73732 |
34c9a12e2378b2f786ce5e4cb1e1590a8fcf191a | 38,789 | py | Python | venv/lib/python3.6/site-packages/cssutils/css/value.py | Amirh24/monKey-s | 10afccb07dc47c9239de07c5bbcdb95008f5f0e5 | [
"MIT"
] | 53 | 2018-10-02T05:58:54.000Z | 2020-09-15T08:58:26.000Z | venv/Lib/site-packages/cssutils/css/value.py | DoesArt-Studios/RamBrowse | a81da53e04d265d17e76855e7affc11130ee6120 | [
"MIT"
] | 52 | 2018-09-26T05:16:09.000Z | 2022-03-11T23:51:14.000Z | venv/Lib/site-packages/cssutils/css/value.py | DoesArt-Studios/RamBrowse | a81da53e04d265d17e76855e7affc11130ee6120 | [
"MIT"
] | 10 | 2019-03-11T16:35:14.000Z | 2019-10-23T08:03:54.000Z | """Value related classes.
DOM Level 2 CSS CSSValue, CSSPrimitiveValue and CSSValueList are **no longer**
supported and are replaced by these new classes.
"""
__all__ = ['PropertyValue',
'Value',
'ColorValue',
'DimensionValue',
'URIValue',
'CSSFunction',
... | 38.866733 | 91 | 0.420532 |
45907280f30d3c52c36c78d87d403acb39b9d021 | 1,506 | py | Python | tests/unit/dao/test_with.py | vollov/python-test | 864896f8ccedb28e15c4962d8983862e9a0e6d77 | [
"MIT"
] | 1 | 2015-12-22T21:33:22.000Z | 2015-12-22T21:33:22.000Z | tests/unit/dao/test_with.py | vollov/python-test | 864896f8ccedb28e15c4962d8983862e9a0e6d77 | [
"MIT"
] | null | null | null | tests/unit/dao/test_with.py | vollov/python-test | 864896f8ccedb28e15c4962d8983862e9a0e6d77 | [
"MIT"
] | null | null | null | import os, unittest, logging
logger = logging.getLogger('pytest')
# Prototype for with cluse
class MySessionQueryException(Exception):
'''if query = lana, raise Exception :)'''
pass
class MySession:
def __init__(self):
logger.debug('init MySession')
self.dbType='mysql'
def close(sel... | 22.818182 | 67 | 0.61089 |
115d865e9e2097865992963211a6bff9920ad8f7 | 10,560 | py | Python | omega/logic/lexyacc.py | tichakorn832/omega | 93aeda273dcd997b52921c48fd8813be6139b350 | [
"BSD-3-Clause"
] | 24 | 2018-07-19T20:04:33.000Z | 2021-07-18T09:48:28.000Z | omega/logic/lexyacc.py | tichakorn832/omega | 93aeda273dcd997b52921c48fd8813be6139b350 | [
"BSD-3-Clause"
] | 7 | 2016-07-12T21:45:28.000Z | 2018-01-01T07:52:38.000Z | omega/logic/lexyacc.py | tichakorn832/omega | 93aeda273dcd997b52921c48fd8813be6139b350 | [
"BSD-3-Clause"
] | 4 | 2018-11-06T13:55:38.000Z | 2021-07-11T18:17:35.000Z | #!/usr/bin/env python
"""Parser for past and future linear temporal logic.
The syntax is based on that of SPIN.
"""
# Copyright 2014 by California Institute of Technology
# All rights reserved. Licensed under BSD-3.
#
# the parser is based on that of `tulip`
from __future__ import absolute_import
from omega.logic.ast ... | 25.945946 | 71 | 0.472064 |
92f219ac51e0a20a7bf810738c3cead92608242a | 457 | py | Python | mayan/apps/documents/tests/test_statistics.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 343 | 2015-01-05T14:19:35.000Z | 2018-12-10T19:07:48.000Z | mayan/apps/documents/tests/test_statistics.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 191 | 2015-01-03T00:48:19.000Z | 2018-11-30T09:10:25.000Z | mayan/apps/documents/tests/test_statistics.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 257 | 2019-05-14T10:26:37.000Z | 2022-03-30T03:37:36.000Z | from mayan.apps.testing.tests.base import BaseTestCase
from ..statistics import namespace
class DocumentStatisticsTestCase(BaseTestCase):
def test_namespace(self):
for statistic in namespace.statistics:
try:
statistic.execute()
except Exception as exception:
... | 28.5625 | 75 | 0.588621 |
c8abd9ebece16f1a94f7bbf9e1503c6d20a02681 | 2,825 | py | Python | google/ads/googleads/v6/resources/types/ad_group_extension_setting.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/resources/types/ad_group_extension_setting.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/resources/types/ad_group_extension_setting.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 35.3125 | 103 | 0.700531 |
1eafdfff9f618072798e5e549fb898c9928ebdfb | 558 | py | Python | chapter_01/example_1-3.py | XiangLiK/primary_cv_cource | bf8c69facc7437851984e7b7f101fe3e67575717 | [
"MIT"
] | 2 | 2020-09-06T07:37:21.000Z | 2021-04-03T15:08:10.000Z | chapter_01/example_1-3.py | XiangLiK/primary_cv_cource | bf8c69facc7437851984e7b7f101fe3e67575717 | [
"MIT"
] | 1 | 2021-04-03T15:23:36.000Z | 2021-04-07T14:19:56.000Z | chapter_01/example_1-3.py | XiangLiK/primary_cv_cource | bf8c69facc7437851984e7b7f101fe3e67575717 | [
"MIT"
] | 1 | 2021-07-01T13:47:45.000Z | 2021-07-01T13:47:45.000Z | #-*-coding:utf-8-*-
# date:2020-03-28
# Author: X.L.Eric
# function: image pixel - float (0.~1.)
import cv2 # 加载 OpenCV 库
import numpy as np # 加载 numpy 库
if __name__ == "__main__":
img_h = 480
img_w = 640
img = np.zeros([img_h,img_w], dtype = np.float)
cv2.namedWindow('image_0', 1)
cv2.imshow('ima... | 21.461538 | 51 | 0.611111 |
9f217f2715602d5225f07c52275284f34abf6d29 | 6,486 | py | Python | jvc_projector/__init__.py | jaysoffian/jvc_projector | 433ea2bbb68884c9ec40b6226056af489fb6080f | [
"MIT"
] | null | null | null | jvc_projector/__init__.py | jaysoffian/jvc_projector | 433ea2bbb68884c9ec40b6226056af489fb6080f | [
"MIT"
] | null | null | null | jvc_projector/__init__.py | jaysoffian/jvc_projector | 433ea2bbb68884c9ec40b6226056af489fb6080f | [
"MIT"
] | null | null | null | import socket
from enum import Enum
from time import sleep
import datetime
class Commands(Enum):
# power commands
power_on = b"\x21\x89\x01\x50\x57\x31\x0A"
power_off = b"\x21\x89\x01\x50\x57\x30\x0A"
# lens memory commands
memory1 = b"\x21\x89\x01\x49\x4E\x4D\x4C\x30\x0A"
memory2 = b"\x21\x8... | 35.25 | 91 | 0.649553 |
7591e8ea34f1a7a4de418ca7db160316b61d4def | 7,980 | py | Python | qcodes/tests/drivers/test_keysight_b220x.py | LGruenhaupt/Qcodes | ffb74dae53c13c4885e61b5a2df3f833d524de04 | [
"MIT"
] | 223 | 2016-10-29T15:00:24.000Z | 2022-03-20T06:53:34.000Z | qcodes/tests/drivers/test_keysight_b220x.py | Dominik-Vogel/Qcodes | b4cf7d58bc1bf3be97af6bf48f57cb6b87d588bb | [
"MIT"
] | 3,406 | 2016-10-25T10:44:50.000Z | 2022-03-31T09:47:35.000Z | qcodes/tests/drivers/test_keysight_b220x.py | Dominik-Vogel/Qcodes | b4cf7d58bc1bf3be97af6bf48f57cb6b87d588bb | [
"MIT"
] | 263 | 2016-10-25T11:35:36.000Z | 2022-03-31T08:53:20.000Z | import pytest
from pyvisa.errors import VisaIOError
from qcodes.instrument_drivers.Keysight.keysight_b220x import KeysightB220X
@pytest.fixture
def uut():
try:
resource_name = 'insert_Keysight_B2200_VISA_resource_name_here'
instance = KeysightB220X('switch_matrix',
... | 26.959459 | 79 | 0.648997 |
bb1e5ae02957d998dcff2aee5d0a35deaec3480d | 17,338 | py | Python | insidergm.py | SisterMiy/InsiderGameGM4Discord | c812f96210a3bdd439f9c607120fb7fabad4f583 | [
"MIT"
] | null | null | null | insidergm.py | SisterMiy/InsiderGameGM4Discord | c812f96210a3bdd439f9c607120fb7fabad4f583 | [
"MIT"
] | null | null | null | insidergm.py | SisterMiy/InsiderGameGM4Discord | c812f96210a3bdd439f9c607120fb7fabad4f583 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import discord
from discord.ext import commands
from enum import IntEnum, auto
import random
import time
import asyncio
import csv
import glob
import pathlib
import os
# 設定
LimitTime = 300
# 役職Enum
class Role(IntEnum):
Master = auto()
People = auto()
Insider = auto()
# ゲームステータス
cla... | 25.839046 | 136 | 0.614431 |
ab5a932ade41cec0411b08f3c2723e92b8155f9d | 14,212 | py | Python | tests/test_cache_jobs.py | IMTMarburg/pypipegraph2 | 182f04481f0b0b6b1c05cfbe23549714af5cfbcc | [
"MIT"
] | null | null | null | tests/test_cache_jobs.py | IMTMarburg/pypipegraph2 | 182f04481f0b0b6b1c05cfbe23549714af5cfbcc | [
"MIT"
] | null | null | null | tests/test_cache_jobs.py | IMTMarburg/pypipegraph2 | 182f04481f0b0b6b1c05cfbe23549714af5cfbcc | [
"MIT"
] | 1 | 2021-09-01T11:20:46.000Z | 2021-09-01T11:20:46.000Z | import pytest
import pickle
from pathlib import Path
import pypipegraph2 as ppg
from .shared import read, write, append, Dummy, counter
@pytest.mark.usefixtures("ppg2_per_test")
class TestCachedDataLoadingJob:
def test_simple(self):
o = Dummy()
def calc():
return ", ".join(str(x) for... | 32.521739 | 143 | 0.570645 |
2cfaa3ef01cf5db0983f2c9fab5399f4e9c4e2d0 | 222 | py | Python | tests/src/__init__.py | U8NWXD/scorevideo_lib | 2af8c9ce6adc43af502aaa2a987ecc349b8ac16c | [
"BSD-3-Clause"
] | null | null | null | tests/src/__init__.py | U8NWXD/scorevideo_lib | 2af8c9ce6adc43af502aaa2a987ecc349b8ac16c | [
"BSD-3-Clause"
] | 1 | 2018-08-06T00:00:43.000Z | 2018-08-06T00:00:43.000Z | tests/src/__init__.py | U8NWXD/scorevideo_lib | 2af8c9ce6adc43af502aaa2a987ecc349b8ac16c | [
"BSD-3-Clause"
] | 1 | 2020-06-05T00:38:23.000Z | 2020-06-05T00:38:23.000Z | # This file is part of scorevideo_lib: A library for working with scorevideo
# Use of this file is governed by the license in LICENSE.txt.
"""Defines constants and helpers shared by all tests
"""
TEST_RES = "tests/res"
| 24.666667 | 76 | 0.752252 |
da5b6965120bb0bdd2335b2a7cadc5b707d70ff0 | 1,046 | py | Python | mindspore/ops/_op_impl/akg/gpu/logical_and.py | unseenme/mindspore | 4ba052f0cd9146ac0ccc4880a778706f1b2d0af8 | [
"Apache-2.0"
] | 7 | 2020-05-24T03:19:26.000Z | 2020-05-24T03:20:00.000Z | mindspore/ops/_op_impl/akg/gpu/logical_and.py | unseenme/mindspore | 4ba052f0cd9146ac0ccc4880a778706f1b2d0af8 | [
"Apache-2.0"
] | null | null | null | mindspore/ops/_op_impl/akg/gpu/logical_and.py | unseenme/mindspore | 4ba052f0cd9146ac0ccc4880a778706f1b2d0af8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 34.866667 | 88 | 0.739962 |
a3047feac73c56af28f4804ebff827ea09aef2bd | 1,169 | py | Python | tests/test_svm.py | KEVINYZY/plume | ae7b688d0d7b5f3dd5eeb975a302e8a5524d4255 | [
"MIT"
] | 22 | 2018-03-06T18:01:22.000Z | 2020-11-09T16:17:02.000Z | tests/test_svm.py | liuslnlp/plume | dbd523861bfb9abad8a52b1de28de85c0f128807 | [
"MIT"
] | null | null | null | tests/test_svm.py | liuslnlp/plume | dbd523861bfb9abad8a52b1de28de85c0f128807 | [
"MIT"
] | 21 | 2017-08-12T10:24:17.000Z | 2020-11-27T03:15:30.000Z | from plume.svm import LinearSVC, SVC, ExpSVC
from plume.utils import plot_decision_boundary
import sklearn.datasets
import numpy as np
np.random.seed(0)
def test_linearsvc():
X, y = sklearn.datasets.make_moons(200, noise=0.20)
y = 2 * y - 1
clf = LinearSVC(C=3)
clf.fit(X, y)
plot_decision_boundar... | 28.512195 | 87 | 0.609923 |
dd388ab8f0e11af7869ded5b83d3ae97ca0d4c18 | 764 | py | Python | operator_number_sys (25mar2016)/clean.py | jamtot/DailyChallenge | 2cb073837620ad57f064f5befca77d4994abf091 | [
"MIT"
] | null | null | null | operator_number_sys (25mar2016)/clean.py | jamtot/DailyChallenge | 2cb073837620ad57f064f5befca77d4994abf091 | [
"MIT"
] | null | null | null | operator_number_sys (25mar2016)/clean.py | jamtot/DailyChallenge | 2cb073837620ad57f064f5befca77d4994abf091 | [
"MIT"
] | null | null | null | from itertools import product
def add(x,y):
return x+y
def sub(x,y):
return x-y
def mult(x,y):
return x*y
def getnext(n=0):
while True:
yield n
n+=1
def nos2dec(nos):
i = getnext()
return reduce(lambda x,y: [add, sub, mult][y](x, next(i)), map(int, nos), next(i))
# counts u... | 18.190476 | 86 | 0.54712 |
51363ae577b76c3ac8ad783e8bddce5c24b5ccb1 | 129 | py | Python | src_old/tests/scripts/core/ex9.py | toddrme2178/pyccel | deec37503ab0c5d0bcca1a035f7909f7ce8ef653 | [
"MIT"
] | null | null | null | src_old/tests/scripts/core/ex9.py | toddrme2178/pyccel | deec37503ab0c5d0bcca1a035f7909f7ce8ef653 | [
"MIT"
] | null | null | null | src_old/tests/scripts/core/ex9.py | toddrme2178/pyccel | deec37503ab0c5d0bcca1a035f7909f7ce8ef653 | [
"MIT"
] | null | null | null | # coding: utf-8
x = 1
while x > 1:
y = x + 1
for i in range(0, 4):
z = x + 1
x = z/2.0
x = x + 0.2
| 11.727273 | 25 | 0.356589 |
9248ca67aeb1bd741bf32417b3f72d82e59e8ed7 | 132 | py | Python | TEP_2017_2/UVA/10359.py | icaropires/Titanic | bb0d9507b0cbfac37dc09add69424d71ace634c5 | [
"MIT"
] | 1 | 2017-06-27T03:05:41.000Z | 2017-06-27T03:05:41.000Z | TEP_2017_2/UVA/10359.py | icaropires/Titanic | bb0d9507b0cbfac37dc09add69424d71ace634c5 | [
"MIT"
] | null | null | null | TEP_2017_2/UVA/10359.py | icaropires/Titanic | bb0d9507b0cbfac37dc09add69424d71ace634c5 | [
"MIT"
] | null | null | null | from sys import stdin
dp= [1,1]
for i in range(300):
dp.append(dp[-2]*2 + dp[-1])
for n in stdin:
n = int(n)
print(dp[n])
| 12 | 30 | 0.568182 |
07a6f91718c0ac78b031e2ce27cbd143f6aa5df5 | 1,343 | py | Python | Construct Binary Tree from Preorder and Inorder Traversal.py | frank0215/Leetcode_python | 9428ded4f9abd347b12bfef8aa1dd2d177f3afea | [
"MIT"
] | null | null | null | Construct Binary Tree from Preorder and Inorder Traversal.py | frank0215/Leetcode_python | 9428ded4f9abd347b12bfef8aa1dd2d177f3afea | [
"MIT"
] | null | null | null | Construct Binary Tree from Preorder and Inorder Traversal.py | frank0215/Leetcode_python | 9428ded4f9abd347b12bfef8aa1dd2d177f3afea | [
"MIT"
] | null | null | null | def bt(preorder, inorder, pleft, pright, ileft, iright):
if pleft >= pright or ileft >= iright:
return None
root = TreeNode(preorder[pleft])
inorderRootIndex = 0
while inorderRootIndex < iright and inorder[inorderRootIndex] != root.val:
inorderRootIndex += 1
root.l... | 33.575 | 106 | 0.662695 |
813b2d5b2526ba0881b816f627f6ea3cddfd9a84 | 789 | py | Python | Practice/PythonApplication/LeetCode/Array/27.py | kushalbhola/MyStuff | 3f1064866487e489af41f8662a875b9954d5d8b0 | [
"Apache-2.0"
] | null | null | null | Practice/PythonApplication/LeetCode/Array/27.py | kushalbhola/MyStuff | 3f1064866487e489af41f8662a875b9954d5d8b0 | [
"Apache-2.0"
] | 1 | 2020-04-29T23:00:26.000Z | 2020-04-29T23:00:26.000Z | Practice/PythonApplication/LeetCode/Array/27.py | kushalbhola/MyStuff | 3f1064866487e489af41f8662a875b9954d5d8b0 | [
"Apache-2.0"
] | null | null | null | def main():
input = [0,1,2,2,3,0,4,2]
output = removeElement(input, 2)
print(output)
def removeElement(nums, val):
#slow = -1
#fast = 0
#while(fast < len(nums) and len(nums) > 1):
# if(nums[fast] == val):
# fast += 1
# else:
# slow+=1
# if(slow != f... | 20.763158 | 47 | 0.423321 |
cfc7d726f0d3a4532cdcaaf71f8a2932351e7b11 | 1,198 | py | Python | 01-Image_processing/05.1_Histogram_equalization.py | myghact-1/complete-opencv | f89f7edce9d8ad1adde882e12d2e4eea91ea9155 | [
"MIT"
] | null | null | null | 01-Image_processing/05.1_Histogram_equalization.py | myghact-1/complete-opencv | f89f7edce9d8ad1adde882e12d2e4eea91ea9155 | [
"MIT"
] | null | null | null | 01-Image_processing/05.1_Histogram_equalization.py | myghact-1/complete-opencv | f89f7edce9d8ad1adde882e12d2e4eea91ea9155 | [
"MIT"
] | null | null | null |
# Image credits
# https://www.pexels.com/@arnie-watkins-1337313
import cv2
import numpy as np
import matplotlib.pyplot as plt
image = cv2.imread("images\\desert.jpg")
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
# -----------------------------------------------... | 26.043478 | 80 | 0.595159 |
eba896dd09b20b53bb79a71ac4f784e3ce1aa528 | 6,769 | py | Python | src/primaires/temps/config.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 14 | 2015-08-21T19:15:21.000Z | 2017-11-26T13:59:17.000Z | src/primaires/temps/config.py | vincent-lg/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 20 | 2015-09-29T20:50:45.000Z | 2018-06-21T12:58:30.000Z | src/primaires/temps/config.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 3 | 2015-05-02T19:42:03.000Z | 2018-09-06T10:55:00.000Z | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 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
# ... | 36.392473 | 79 | 0.719161 |
4c7cdaa842be0da498dd1114869b4f7b79c04529 | 1,990 | py | Python | DeepEBM/Torture/Models/GAN/eval_inception_score.py | taufikxu/FD-ScoreMatching | 9df0789bb98bb798b3de57072f63ee4b2f19947f | [
"MIT"
] | 12 | 2020-05-23T10:02:12.000Z | 2021-03-25T19:54:00.000Z | DeepEBM/Torture/Models/GAN/eval_inception_score.py | taufikxu/FD-ScoreMatching | 9df0789bb98bb798b3de57072f63ee4b2f19947f | [
"MIT"
] | 6 | 2021-03-19T15:30:28.000Z | 2022-03-12T00:51:16.000Z | DeepEBM/Torture/Models/GAN/eval_inception_score.py | taufikxu/FD-ScoreMatching | 9df0789bb98bb798b3de57072f63ee4b2f19947f | [
"MIT"
] | 4 | 2020-11-04T03:52:45.000Z | 2021-12-28T16:07:08.000Z | import torch
from torch import nn
from torch.nn import functional as F
import torch.utils.data
from torchvision.models.inception import inception_v3
import numpy as np
from scipy.stats import entropy
def inception_score(imgs, device=None, batch_size=32, resize=False, splits=1):
"""Computes the inception score o... | 28.84058 | 78 | 0.622613 |
7e516a510f667cc3634718c2181f3129260324c5 | 898 | py | Python | python/tvm/meta_schedule/testing/__init__.py | Xuyuanjia2014/tvm | 892f8305e77ad506660b851f9ce4c81be0f95d9d | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2,084 | 2020-11-25T02:31:53.000Z | 2022-03-31T11:33:47.000Z | python/tvm/meta_schedule/testing/__init__.py | Xuyuanjia2014/tvm | 892f8305e77ad506660b851f9ce4c81be0f95d9d | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3,022 | 2020-11-24T14:02:31.000Z | 2022-03-31T23:55:31.000Z | python/tvm/meta_schedule/testing/__init__.py | Xuyuanjia2014/tvm | 892f8305e77ad506660b851f9ce4c81be0f95d9d | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 977 | 2020-11-25T00:54:52.000Z | 2022-03-31T12:47:08.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 u... | 44.9 | 62 | 0.778396 |
bbfaab44667b6f98d6e84fa4e48bae097c093b6e | 1,482 | py | Python | src/coordinate_converter.py | fumiyanll23/2021-advanced-stochastic-analysis-1 | ceabc631ed4617c0f4ca4fe18ee6c1c75518d551 | [
"MIT"
] | null | null | null | src/coordinate_converter.py | fumiyanll23/2021-advanced-stochastic-analysis-1 | ceabc631ed4617c0f4ca4fe18ee6c1c75518d551 | [
"MIT"
] | null | null | null | src/coordinate_converter.py | fumiyanll23/2021-advanced-stochastic-analysis-1 | ceabc631ed4617c0f4ca4fe18ee6c1c75518d551 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
# データ点数
data_num = 250
# データ点格納用
### 格納配列
points = np.zeros([2,data_num,2],dtype = int)
### 要素地点管理
pt = np.array([0,0,0])
# マウスイベント処理 (leftimg)
def mouse_event_l(event, x, y, flags, param):
## 配列外参照回避
if pt[0] > (data_num-1):
return
## クリック地点を配列に格納
if event == cv... | 22.119403 | 65 | 0.624831 |
5a1a4ccfb4132588db01f0957a1acff7726e3303 | 2,648 | py | Python | braille/Main.py | sulealothman/arbraille | 80cf33bfc0368814778c76e3fd82da27042235f1 | [
"MIT"
] | 1 | 2020-11-29T17:08:19.000Z | 2020-11-29T17:08:19.000Z | braille/Main.py | sulealothman/arbraille | 80cf33bfc0368814778c76e3fd82da27042235f1 | [
"MIT"
] | null | null | null | braille/Main.py | sulealothman/arbraille | 80cf33bfc0368814778c76e3fd82da27042235f1 | [
"MIT"
] | null | null | null | import sys, argparse
from .AlphabetToBraille import AlphabetToBraille
from .BrailleToAlphabet import BrailleToAlphabet
from .BrailleFile import BrailleFile
class Main:
def __init__(self):
self.args = self.arguments()
self.alphaBraille = AlphabetToBraille()
self.brailleAlpha = BrailleToAlphabet()
self.braileFi... | 29.422222 | 100 | 0.689199 |
25a78b83f712ea617bc2407911575171d89667c7 | 428 | py | Python | problems/643.py | mengshun/Leetcode | 8bb676f2fff093e1417a4bed13d9ad708149be78 | [
"MIT"
] | null | null | null | problems/643.py | mengshun/Leetcode | 8bb676f2fff093e1417a4bed13d9ad708149be78 | [
"MIT"
] | null | null | null | problems/643.py | mengshun/Leetcode | 8bb676f2fff093e1417a4bed13d9ad708149be78 | [
"MIT"
] | null | null | null | """
643. 子数组最大平均数 I
给定 n 个整数,找出平均数最大且长度为 k 的连续子数组,并输出该最大平均数。
"""
def findMaxAverage(nums, k):
n = len(nums)
if k == 1:
return max(nums)
sum_value = sum(nums[:k])
max_average = sum_value / k
for i in range(n - k):
sum_value = sum_value - nums[i] + nums[i+k]
max_average = ma... | 19.454545 | 53 | 0.598131 |
a30cdd6292aa492bc416dd67c01e8faab47854df | 30,811 | py | Python | vendor-local/lib/python/whoosh/highlight.py | Koenkk/popcorn_maker | 0978b9f98dacd4e8eb753404b24eb584f410aa11 | [
"BSD-3-Clause"
] | 15 | 2015-03-23T02:55:20.000Z | 2021-01-12T12:42:30.000Z | vendor-local/lib/python/whoosh/highlight.py | Koenkk/popcorn_maker | 0978b9f98dacd4e8eb753404b24eb584f410aa11 | [
"BSD-3-Clause"
] | null | null | null | vendor-local/lib/python/whoosh/highlight.py | Koenkk/popcorn_maker | 0978b9f98dacd4e8eb753404b24eb584f410aa11 | [
"BSD-3-Clause"
] | 16 | 2015-02-18T21:43:31.000Z | 2021-11-09T22:50:03.000Z | # Copyright 2008 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | 35.212571 | 99 | 0.611697 |
22c7b2ab56522fa302819c2fa747cad6d70c0703 | 3,377 | py | Python | orcha/properties.py | Javinator9889/orcha | 61716e42f4b07ae50521251da623d24bb348cf43 | [
"MIT"
] | null | null | null | orcha/properties.py | Javinator9889/orcha | 61716e42f4b07ae50521251da623d24bb348cf43 | [
"MIT"
] | null | null | null | orcha/properties.py | Javinator9889/orcha | 61716e42f4b07ae50521251da623d24bb348cf43 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2021 Javier Alonso <jalonso@teldat.com>
#
# 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... | 36.706522 | 99 | 0.71602 |
f07da020926eed5e6b0f6b38ffb9a7966f08ca6d | 400 | py | Python | saleor/account/migrations/0051_user_last_jwt_iat.py | valcome-analytics/saleor | f41b5d0de897b3914fe8bfd19c4f0b3c15448fa0 | [
"CC-BY-4.0"
] | null | null | null | saleor/account/migrations/0051_user_last_jwt_iat.py | valcome-analytics/saleor | f41b5d0de897b3914fe8bfd19c4f0b3c15448fa0 | [
"CC-BY-4.0"
] | null | null | null | saleor/account/migrations/0051_user_last_jwt_iat.py | valcome-analytics/saleor | f41b5d0de897b3914fe8bfd19c4f0b3c15448fa0 | [
"CC-BY-4.0"
] | null | null | null | # Generated by Django 3.0.6 on 2020-09-15 08:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0050_auto_20200904_1128'),
]
operations = [
migrations.AddField(
model_name='user',
name='last_jwt_iat',
... | 21.052632 | 62 | 0.605 |
b775449361e6f699f2a58abe7f73b689bc6b8f38 | 208 | py | Python | 00_translation/_translate.py | Mon-ius/Compiling-principle | 02ca432c3db143c02871fbca781654f9782ee464 | [
"MIT"
] | null | null | null | 00_translation/_translate.py | Mon-ius/Compiling-principle | 02ca432c3db143c02871fbca781654f9782ee464 | [
"MIT"
] | 17 | 2020-01-28T22:21:54.000Z | 2020-03-30T20:29:39.000Z | 04_Syntax-directed-translation/_lexer.py | Mon-ius/Compiling-principle | 02ca432c3db143c02871fbca781654f9782ee464 | [
"MIT"
] | null | null | null | from app import create_app
from app.models import Post
app = create_app()
@app.shell_context_processor
def make_shell_context():
return {'Post':Post}
if __name__ == '__main__':
app.run(debug=True)
| 17.333333 | 28 | 0.735577 |
052a98370f6ab21283b1563aa6d602a4bd9012de | 1,905 | py | Python | paperbot/mail/send.py | vmenezio/paperbot | 6b6ec881900c7af35f7ed0d5e21bd6ba56e98fa7 | [
"MIT"
] | null | null | null | paperbot/mail/send.py | vmenezio/paperbot | 6b6ec881900c7af35f7ed0d5e21bd6ba56e98fa7 | [
"MIT"
] | null | null | null | paperbot/mail/send.py | vmenezio/paperbot | 6b6ec881900c7af35f7ed0d5e21bd6ba56e98fa7 | [
"MIT"
] | 1 | 2020-11-04T04:20:04.000Z | 2020-11-04T04:20:04.000Z | import os
import json
from smtplib import SMTP
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
DATA = os.path.dirname(__file__)+"/data/"
def send_mail(plain_text, html_text, date, credentials_json=DATA+"creds.json",
recipients_json=DATA+"recips.json"):
"""Sends an email... | 36.634615 | 78 | 0.720735 |
cb0b04e4ada8e67a5e52545f61c4f496e21937c7 | 6,527 | py | Python | redash/utils/__init__.py | immersa-co/redash | 155573995242858ed56db609b92f09abcb7a24c9 | [
"BSD-2-Clause"
] | null | null | null | redash/utils/__init__.py | immersa-co/redash | 155573995242858ed56db609b92f09abcb7a24c9 | [
"BSD-2-Clause"
] | null | null | null | redash/utils/__init__.py | immersa-co/redash | 155573995242858ed56db609b92f09abcb7a24c9 | [
"BSD-2-Clause"
] | null | null | null | import codecs
import io
import csv
import datetime
import decimal
import hashlib
import os
import random
import re
import uuid
import binascii
import pystache
import pytz
import simplejson
import sqlparse
from flask import current_app
from funcy import select_values
from redash import settings
from sqlalchemy.orm.quer... | 30.35814 | 119 | 0.650682 |
b8a803c36344f180b3b35c3bc1ace834bad9854c | 3,753 | py | Python | sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/_apache_avro_encoder.py | kazrael2119/azure-sdk-for-python | 485dd7b1b5ac41c1a5b9991e402b4035b55f437a | [
"MIT"
] | 1 | 2022-02-18T01:17:27.000Z | 2022-02-18T01:17:27.000Z | sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/_apache_avro_encoder.py | kazrael2119/azure-sdk-for-python | 485dd7b1b5ac41c1a5b9991e402b4035b55f437a | [
"MIT"
] | null | null | null | sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/_apache_avro_encoder.py | kazrael2119/azure-sdk-for-python | 485dd7b1b5ac41c1a5b9991e402b4035b55f437a | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 37.158416 | 105 | 0.631495 |
445bd5940ec533d6c24f79fd0c3b423aac41a7cd | 661 | py | Python | tools/models.py | pieterlange/archerysec | dd4eae689dbc5eb1a260e0e2d12dc0272a45c6e2 | [
"BSD-3-Clause"
] | 1 | 2018-11-10T22:34:27.000Z | 2018-11-10T22:34:27.000Z | tools/models.py | pieterlange/archerysec | dd4eae689dbc5eb1a260e0e2d12dc0272a45c6e2 | [
"BSD-3-Clause"
] | null | null | null | tools/models.py | pieterlange/archerysec | dd4eae689dbc5eb1a260e0e2d12dc0272a45c6e2 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
# SSLScan Model.
class sslscan_result_db(models.Model):
scan_id = models.TextField(blank=True, null=True)
project_id = models.TextField(blank=True, null=True)
scan_url = models.TextField(blank=True, null=True)
... | 33.05 | 63 | 0.74584 |
d54fedcbc811f401080c05394746ac22e528f438 | 6,460 | py | Python | fairseq/criterions/soft_cross_entropy.py | violet-zct/fairseq | 5fd9b555428f004f72d4fe89e2a9d2c863c07581 | [
"MIT"
] | 8 | 2020-04-12T20:23:17.000Z | 2022-01-18T08:28:24.000Z | fairseq/criterions/soft_cross_entropy.py | violet-zct/fairseq | 5fd9b555428f004f72d4fe89e2a9d2c863c07581 | [
"MIT"
] | null | null | null | fairseq/criterions/soft_cross_entropy.py | violet-zct/fairseq | 5fd9b555428f004f72d4fe89e2a9d2c863c07581 | [
"MIT"
] | 1 | 2020-04-13T01:21:48.000Z | 2020-04-13T01:21:48.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch.nn.functional as F
from fairseq import utils
from . import FairseqCriterion, register_criterion
import torch
def ... | 43.648649 | 116 | 0.583437 |
db3dde576a41cec1c266c7d68388eac3c8317a6c | 8,966 | py | Python | manipulation/manipulation.py | StanfordASL/CoCo | a085dd53b6ffd1a16bb3e91869ac6bce3695a366 | [
"MIT"
] | 13 | 2020-09-06T17:42:09.000Z | 2021-09-03T18:29:51.000Z | manipulation/manipulation.py | StanfordASL/mlopt-micp | 2f1f0a32a91c3417871308bab6918d1876d66392 | [
"MIT"
] | null | null | null | manipulation/manipulation.py | StanfordASL/mlopt-micp | 2f1f0a32a91c3417871308bab6918d1876d66392 | [
"MIT"
] | 10 | 2020-12-16T07:55:54.000Z | 2021-12-02T11:38:19.000Z | import os
import cvxpy as cp
import yaml
import pickle
import numpy as np
import sys
sys.path.insert(1, os.environ['CoCo'])
sys.path.insert(1, os.path.join(os.environ['CoCo'], 'manipulation'))
from utils import sample_points
from core import Problem
class Manipulation(Problem):
"""Class to setup + solve manipula... | 36.008032 | 135 | 0.59313 |
0d8d7c179acce07b5daf1952cd823fb0dceddc07 | 116 | py | Python | core_get/main.py | core-get/core-get | 8fb960e4e51d0d46b5e3b2f4832eb4a39e0e60f7 | [
"MIT"
] | null | null | null | core_get/main.py | core-get/core-get | 8fb960e4e51d0d46b5e3b2f4832eb4a39e0e60f7 | [
"MIT"
] | null | null | null | core_get/main.py | core-get/core-get | 8fb960e4e51d0d46b5e3b2f4832eb4a39e0e60f7 | [
"MIT"
] | null | null | null | import sys
from core_get.cli.cli_main import cli_main
if __name__ == '__main__':
sys.exit(cli_main(sys.argv))
| 16.571429 | 42 | 0.741379 |
78a37d982529b7fa98c950d1c187c6711bbc8ccd | 22,056 | py | Python | neutron/plugins/ml2/driver_api.py | yagosys/neutron | 005fec677c3bf8b2aa0df68c4aedc2b708ec7caf | [
"Apache-2.0"
] | 1 | 2021-07-26T16:15:11.000Z | 2021-07-26T16:15:11.000Z | neutron/plugins/ml2/driver_api.py | yagosys/neutron | 005fec677c3bf8b2aa0df68c4aedc2b708ec7caf | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/driver_api.py | yagosys/neutron | 005fec677c3bf8b2aa0df68c4aedc2b708ec7caf | [
"Apache-2.0"
] | 3 | 2015-04-03T08:47:02.000Z | 2020-02-05T10:40:45.000Z | # Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 35.574194 | 78 | 0.687613 |
d3206932e6f55bb5c95976d4ff15b9185bba78ad | 6,875 | py | Python | test/utils/threatconnect_mock_server.py | tony163163/cb-threatconnect-connector | b1d3753d11a4532d9ebb41a693fa5640d5d329c5 | [
"MIT"
] | null | null | null | test/utils/threatconnect_mock_server.py | tony163163/cb-threatconnect-connector | b1d3753d11a4532d9ebb41a693fa5640d5d329c5 | [
"MIT"
] | null | null | null | test/utils/threatconnect_mock_server.py | tony163163/cb-threatconnect-connector | b1d3753d11a4532d9ebb41a693fa5640d5d329c5 | [
"MIT"
] | null | null | null | __author__ = "Zachary Estep"
import logging
import os
try:
import simplejson as json
except ImportError:
import json
from flask import Flask, request, make_response, Response
from test.utils.generate_test_data import get_random_hex, get_random_fqdn, get_random_ip
def get_mocked_server(path):
mocked... | 40.204678 | 170 | 0.4016 |
9f6129ad915562eb0842548fb560518cbea31e03 | 30,368 | py | Python | cinder/tests/unit/volume/test_snapshot.py | guillermomolina/cinder | c93131faf659d002a9a3f4af945c76d1b94396f9 | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/test_snapshot.py | guillermomolina/cinder | c93131faf659d002a9a3f4af945c76d1b94396f9 | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/test_snapshot.py | guillermomolina/cinder | c93131faf659d002a9a3f4af945c76d1b94396f9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | 44.79056 | 79 | 0.593026 |
657268b7af7ccc91efd6aa607d8802af669d5361 | 2,493 | py | Python | openstack_dashboard/dashboards/project/instances/tabs.py | vasart/horizon | d9bb2169688483b795fe8b048e184528885afd33 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/instances/tabs.py | vasart/horizon | d9bb2169688483b795fe8b048e184528885afd33 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/instances/tabs.py | vasart/horizon | d9bb2169688483b795fe8b048e184528885afd33 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 32.802632 | 78 | 0.655034 |
50fe5fcb265094fef056642b64124b5d2108de05 | 24,621 | py | Python | mindspore/train/callback.py | unseenme/mindspore | 4ba052f0cd9146ac0ccc4880a778706f1b2d0af8 | [
"Apache-2.0"
] | 1 | 2020-05-02T10:38:52.000Z | 2020-05-02T10:38:52.000Z | mindspore/train/callback.py | unseenme/mindspore | 4ba052f0cd9146ac0ccc4880a778706f1b2d0af8 | [
"Apache-2.0"
] | null | null | null | mindspore/train/callback.py | unseenme/mindspore | 4ba052f0cd9146ac0ccc4880a778706f1b2d0af8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 35.273639 | 120 | 0.645628 |
9dbe0043482d2b6208219853d0778ee3f4c06b02 | 4,047 | py | Python | tests/test_plot_BKP.py | mjlarson/CosmoloPy | eb20661d0aa20ab10b5d494593baeed0ac2c1ba0 | [
"MIT"
] | 27 | 2015-01-13T16:22:08.000Z | 2022-03-04T19:27:18.000Z | tests/test_plot_BKP.py | mjlarson/CosmoloPy | eb20661d0aa20ab10b5d494593baeed0ac2c1ba0 | [
"MIT"
] | 7 | 2015-11-26T01:17:19.000Z | 2021-07-07T21:36:24.000Z | tests/test_plot_BKP.py | mjlarson/CosmoloPy | eb20661d0aa20ab10b5d494593baeed0ac2c1ba0 | [
"MIT"
] | 20 | 2015-03-14T06:07:10.000Z | 2021-09-08T17:37:21.000Z | """Reionization consistency check with BK&P 2009MNRAS.397..971B"""
from __future__ import absolute_import, division, print_function
import numpy
import numpy.testing.utils as ntest
import matplotlib.pyplot as pylab
import cosmolopy.perturbation as cp
import cosmolopy.distance as cd
import cosmolopy.density as cden
i... | 36.790909 | 80 | 0.545342 |
555c3f3b931ef61066c62d540ddc618fb0b8a2f3 | 840 | py | Python | dnsimple/service/identity.py | mherrmann/dnsimple-python | a89127f0bafb2a001c902206fba87cbc4f3bc2d1 | [
"MIT"
] | 12 | 2020-06-18T17:16:03.000Z | 2022-03-23T08:35:49.000Z | dnsimple/service/identity.py | mherrmann/dnsimple-python | a89127f0bafb2a001c902206fba87cbc4f3bc2d1 | [
"MIT"
] | 129 | 2020-06-25T12:15:51.000Z | 2022-03-23T09:42:16.000Z | dnsimple/service/identity.py | mherrmann/dnsimple-python | a89127f0bafb2a001c902206fba87cbc4f3bc2d1 | [
"MIT"
] | 6 | 2020-07-03T09:34:01.000Z | 2021-12-20T04:29:59.000Z | from dnsimple.response import Response
from dnsimple.struct import Whoami
class Identity(object):
"""
The Identity Service handles the identity (whoami) endpoint of the
DNSimple API.
See https://developer.dnsimple.com/v2/identity/
"""
def __init__(self, client):
"""
Initializ... | 26.25 | 76 | 0.640476 |
c7b456eb44999035fe8fede0229365d69af53398 | 5,599 | py | Python | fusion-infoblox-and-domaindb-in-json-datastore/TBD/filter_infoblox.py | bockor/mwhois | a2408493dc5b32ae36c7c7f2dd18a5c7281cc88d | [
"MIT"
] | null | null | null | fusion-infoblox-and-domaindb-in-json-datastore/TBD/filter_infoblox.py | bockor/mwhois | a2408493dc5b32ae36c7c7f2dd18a5c7281cc88d | [
"MIT"
] | null | null | null | fusion-infoblox-and-domaindb-in-json-datastore/TBD/filter_infoblox.py | bockor/mwhois | a2408493dc5b32ae36c7c7f2dd18a5c7281cc88d | [
"MIT"
] | null | null | null | #!/usr/bin/python
from pprint import pprint
infoblox = {
"result": [
{
"comment": "comment@3",
"_ref": "_ref@3",
"network": "10.176.180.160/27",
"network_view": "NOTSOdefault",
"extattrs": {
"country": {
"... | 27.581281 | 79 | 0.280229 |
8170e13946b376feb193b886b19103f52bbb762e | 1,407 | py | Python | tethys_apps/context_processors.py | romer8/tethys | d18f1a203da41245b3b283e13068b8c1b5b2f2a7 | [
"BSD-2-Clause"
] | null | null | null | tethys_apps/context_processors.py | romer8/tethys | d18f1a203da41245b3b283e13068b8c1b5b2f2a7 | [
"BSD-2-Clause"
] | null | null | null | tethys_apps/context_processors.py | romer8/tethys | d18f1a203da41245b3b283e13068b8c1b5b2f2a7 | [
"BSD-2-Clause"
] | null | null | null | """
********************************************************************************
* Name: context_processors.py
* Author: Nathan Swain
* Created On: 2014
* Copyright: (c) Brigham Young University 2014
* License: BSD 2-Clause
********************************************************************************
"""
from te... | 28.714286 | 80 | 0.545842 |
0a87658fdc0ad592b272cf1beefe25ec5de9fcfa | 571 | py | Python | examples/tuning_file.py | meawoppl/picamera2 | 47c2482fe2a38b286f35114a2620e330ddb58519 | [
"BSD-2-Clause"
] | null | null | null | examples/tuning_file.py | meawoppl/picamera2 | 47c2482fe2a38b286f35114a2620e330ddb58519 | [
"BSD-2-Clause"
] | null | null | null | examples/tuning_file.py | meawoppl/picamera2 | 47c2482fe2a38b286f35114a2620e330ddb58519 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python3
from picamera2.picamera2 import *
# Here we load up the tuning for the HQ cam and alter the default exposure profile.
# For more information on what can be changed, see chapter 5 in
# https://datasheets.raspberrypi.com/camera/raspberry-pi-camera-guide.pdf
tuning = Picamera2.load_tuning_file("imx47... | 33.588235 | 93 | 0.754816 |
bda7b15b53e54a1bf7a2fd5941b9ce73f06d1cc4 | 1,612 | py | Python | main.py | MaXXXXfeng/flask-scaffolding | 5edf6bb0b28dafc22a492ab085d5720a489c92e1 | [
"MIT"
] | null | null | null | main.py | MaXXXXfeng/flask-scaffolding | 5edf6bb0b28dafc22a492ab085d5720a489c92e1 | [
"MIT"
] | null | null | null | main.py | MaXXXXfeng/flask-scaffolding | 5edf6bb0b28dafc22a492ab085d5720a489c92e1 | [
"MIT"
] | null | null | null | import click
import os
import os.path
import sh
HERE = os.path.abspath(os.path.dirname(__file__))
@click.group()
def cli():
pass
def get_scaffoldings():
dirs = os.scandir(os.path.join(HERE, 'flask_scaffolding/scaffoldings'))
names = []
for entry in dirs:
if entry.is_dir():
names... | 29.309091 | 99 | 0.621588 |
537085623a0d2fefbfee267c530b79da3b9e8ef1 | 21,423 | py | Python | jacket/tests/compute/unit/api/openstack/compute/test_attach_interfaces.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/tests/compute/unit/api/openstack/compute/test_attach_interfaces.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/tests/compute/unit/api/openstack/compute/test_attach_interfaces.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | 2 | 2016-08-10T02:21:49.000Z | 2020-07-24T01:57:21.000Z | # Copyright 2012 SINA Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 41.119002 | 86 | 0.622835 |
d573ebffe4bce34ce47678073f925ed6e4c4c41d | 5,052 | py | Python | test/test_tensorflow_graph_dump_tensor.py | huggingface/neural-compressor | aaad4c357a86914ffa583753c9a26d949838a2a5 | [
"Apache-2.0"
] | 172 | 2021-09-14T18:34:17.000Z | 2022-03-30T06:49:53.000Z | test/test_tensorflow_graph_dump_tensor.py | intel/lp-opt-tool | 130eefa3586b38df6c0ff78cc8807ae273f6a63f | [
"Apache-2.0"
] | 40 | 2021-09-14T02:26:12.000Z | 2022-03-29T08:34:04.000Z | test/test_tensorflow_graph_dump_tensor.py | intel/neural-compressor | 16a4a12045fcb468da4d33769aff2c1a5e2ba6ba | [
"Apache-2.0"
] | 33 | 2021-09-15T07:27:25.000Z | 2022-03-25T08:30:57.000Z | #
# -*- coding: utf-8 -*-
#
import os
import unittest
import yaml
import tensorflow as tf
import numpy as np
np.random.seed(0)
def build_fake_yaml():
fake_yaml = '''
model:
name: fake_yaml
framework: tensorflow
inputs: input
outputs: op_to_store
device: cp... | 30.993865 | 126 | 0.561758 |
92f298e6173c15db60795b01b990eb556641e1eb | 1,577 | py | Python | adversary/sample_with_network_test/payloads.py | CyberMonitor/adb | 6f0b336aa7dae9578cac340cfc1dd67374a5a4af | [
"MIT"
] | 1 | 2021-12-10T18:31:41.000Z | 2021-12-10T18:31:41.000Z | adversary/sample_with_network_test/payloads.py | CyberMonitor/adb | 6f0b336aa7dae9578cac340cfc1dd67374a5a4af | [
"MIT"
] | null | null | null | adversary/sample_with_network_test/payloads.py | CyberMonitor/adb | 6f0b336aa7dae9578cac340cfc1dd67374a5a4af | [
"MIT"
] | null | null | null | import base64
def get_payloads():
template = '''powershell.exe -WindowStyle Hidden -noprofile [Ref].Assembly.GetType('System.Management.Automation.AmsiUtils').GetField('amsiInitFailed','NonPublic,Static').SetValue($null,$true);If (test-path $env:APPDATA + '\localfilename') {Remove-Item $env:APPDATA + '\localfile... | 56.321429 | 567 | 0.721623 |
eeae7abc2212ce4eae87989c0f89bf3fa3f639ae | 201 | py | Python | Param_Ex.py | tariah/python-misc | a8fcd774ae6d563fa8bb8c08bb6e4c770c018cbc | [
"Apache-2.0"
] | null | null | null | Param_Ex.py | tariah/python-misc | a8fcd774ae6d563fa8bb8c08bb6e4c770c018cbc | [
"Apache-2.0"
] | null | null | null | Param_Ex.py | tariah/python-misc | a8fcd774ae6d563fa8bb8c08bb6e4c770c018cbc | [
"Apache-2.0"
] | null | null | null | def shout_out(the_name):
return("Congratulations " + the_name + "!")
print(shout_out('Wanda'))
msg = shout_out("Graham, John, Micheal, Eric, and Terry by 2")
print(shout_out('Monty'))
print(msg)
| 22.333333 | 62 | 0.691542 |
28196eb02e2f2604deb70a99dbb90d4bf075acb2 | 1,685 | py | Python | tests/validators/test_not_in.py | kdeltared/tcex | 818c0d09256764f871e42d9ca5916f92d941d882 | [
"Apache-2.0"
] | 18 | 2017-01-09T22:17:49.000Z | 2022-01-24T20:46:42.000Z | tests/validators/test_not_in.py | kdeltared/tcex | 818c0d09256764f871e42d9ca5916f92d941d882 | [
"Apache-2.0"
] | 84 | 2017-04-11T13:47:49.000Z | 2022-03-21T20:12:57.000Z | tests/validators/test_not_in.py | kdeltared/tcex | 818c0d09256764f871e42d9ca5916f92d941d882 | [
"Apache-2.0"
] | 43 | 2017-01-05T20:40:26.000Z | 2022-03-31T19:18:02.000Z | """Test the not_in validator."""
# first-party
from tcex.validators import ValidationError, not_in
class TestNotIn:
"""Test the not_in validator."""
@staticmethod
def tests_multi_values():
"""Test handling of multiple invalid values."""
validator = not_in(['foo', None])
try:
... | 31.203704 | 79 | 0.575668 |
38e952fc7ab982ef8a5ae5974c5fb817f2fa1fb7 | 4,111 | py | Python | demisto_sdk/commands/common/hook_validations/reputation.py | SergeBakharev/demisto-sdk | 17d00942a1bd33039a8aba9ddffecfd81008d275 | [
"MIT"
] | null | null | null | demisto_sdk/commands/common/hook_validations/reputation.py | SergeBakharev/demisto-sdk | 17d00942a1bd33039a8aba9ddffecfd81008d275 | [
"MIT"
] | null | null | null | demisto_sdk/commands/common/hook_validations/reputation.py | SergeBakharev/demisto-sdk | 17d00942a1bd33039a8aba9ddffecfd81008d275 | [
"MIT"
] | null | null | null | import re
from distutils.version import LooseVersion
from demisto_sdk.commands.common.constants import \
DEFAULT_CONTENT_ITEM_FROM_VERSION
from demisto_sdk.commands.common.errors import Errors
from demisto_sdk.commands.common.hook_validations.content_entity_validator import \
ContentEntityValidator
# Valid in... | 39.528846 | 114 | 0.650693 |
828881fde9703d9673ead5020b75557c9e764a38 | 27,268 | py | Python | platform/gfmedia/stbservice.py | DentonGentry/gfiber-catawampus | b01e4444f3c7f12b1af7837203b37060fd443bb7 | [
"Apache-2.0"
] | 2 | 2017-10-03T16:06:29.000Z | 2020-09-08T13:03:13.000Z | platform/gfmedia/stbservice.py | DentonGentry/gfiber-catawampus | b01e4444f3c7f12b1af7837203b37060fd443bb7 | [
"Apache-2.0"
] | null | null | null | platform/gfmedia/stbservice.py | DentonGentry/gfiber-catawampus | b01e4444f3c7f12b1af7837203b37060fd443bb7 | [
"Apache-2.0"
] | 1 | 2017-05-07T17:39:02.000Z | 2017-05-07T17:39:02.000Z | #!/usr/bin/python
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 30.130387 | 80 | 0.684282 |
8e34040ca183d68986572b37474510211c42dd8b | 72 | py | Python | lib/corsheaders/__init__.py | mmzepedab/tomathonWebDjango | c766a86ecfea0aa407d290aa35937bae787667b5 | [
"BSD-3-Clause"
] | null | null | null | lib/corsheaders/__init__.py | mmzepedab/tomathonWebDjango | c766a86ecfea0aa407d290aa35937bae787667b5 | [
"BSD-3-Clause"
] | null | null | null | lib/corsheaders/__init__.py | mmzepedab/tomathonWebDjango | c766a86ecfea0aa407d290aa35937bae787667b5 | [
"BSD-3-Clause"
] | null | null | null | from .checks import check_settings # noqa: F401
__version__ = '1.3.1'
| 18 | 48 | 0.722222 |
698ea47044028e163b67f8b3a8aed531b6f29fd0 | 2,965 | py | Python | packages/gtmapi/lmsrvlabbook/api/objects/ref.py | gigabackup/gigantum-client | 70fe6b39b87b1c56351f2b4c551b6f1693813e4f | [
"MIT"
] | 60 | 2018-09-26T15:46:00.000Z | 2021-10-10T02:37:14.000Z | packages/gtmapi/lmsrvlabbook/api/objects/ref.py | gigabackup/gigantum-client | 70fe6b39b87b1c56351f2b4c551b6f1693813e4f | [
"MIT"
] | 1,706 | 2018-09-26T16:11:22.000Z | 2021-08-20T13:37:59.000Z | packages/gtmapi/lmsrvlabbook/api/objects/ref.py | griffinmilsap/gigantum-client | 70fe6b39b87b1c56351f2b4c551b6f1693813e4f | [
"MIT"
] | 11 | 2019-03-14T13:23:51.000Z | 2022-01-25T01:29:16.000Z |
# Copyright (c) 2018 FlashX, LLC
#
# 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, modify, merge, publish, distri... | 44.924242 | 109 | 0.710624 |
816cccf128c309ac94052cc2f70e699cfc61f5eb | 3,338 | py | Python | configs/cornernet/cornernet_hourglass104_mstest_8x6_210e_coco.py | zactodd/mmdetection | 9596b9a4c916ae601f9a8a641c3a0ea47265abec | [
"Apache-2.0"
] | 158 | 2021-03-05T11:58:11.000Z | 2022-03-30T03:29:20.000Z | configs/cornernet/cornernet_hourglass104_mstest_8x6_210e_coco.py | epsilon11101/mmdetection | f8d5f6cafeafeac8beb22d855798327682f65f0a | [
"Apache-2.0"
] | 27 | 2021-04-25T10:28:44.000Z | 2022-03-19T13:37:35.000Z | configs/cornernet/cornernet_hourglass104_mstest_8x6_210e_coco.py | epsilon11101/mmdetection | f8d5f6cafeafeac8beb22d855798327682f65f0a | [
"Apache-2.0"
] | 21 | 2021-04-20T15:22:35.000Z | 2022-02-16T09:38:43.000Z | _base_ = [
'../_base_/default_runtime.py', '../_base_/datasets/coco_detection.py'
]
# model settings
model = dict(
type='CornerNet',
backbone=dict(
type='HourglassNet',
downsample_times=5,
num_stacks=2,
stage_channels=[256, 256, 384, 384, 384, 512],
stage_blocks=[2, ... | 31.490566 | 78 | 0.589575 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.