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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
291831aa00a6766c53f2f4478976393b6e8a733d | 1,681 | py | Python | dfapp/views.py | dorican/django-dfapp | c70a1cc036cfe87a8075f76c39fdb437893351fe | [
"MIT"
] | 2 | 2020-05-25T07:51:47.000Z | 2020-06-18T15:57:20.000Z | dfapp/views.py | dorican/django-dfapp | c70a1cc036cfe87a8075f76c39fdb437893351fe | [
"MIT"
] | null | null | null | dfapp/views.py | dorican/django-dfapp | c70a1cc036cfe87a8075f76c39fdb437893351fe | [
"MIT"
] | null | null | null | from django.views.generic.edit import FormView
from django.views.generic import DetailView
from django.contrib.contenttypes.models import ContentType
from django.http import JsonResponse
from django.contrib.admin.sites import site
from django.contrib import admin
class CheckCTView(DetailView):
"""
The view th... | 35.020833 | 168 | 0.69304 |
011f4fbc50b2b91713a1892d38d1dd747b6cdbec | 586 | py | Python | src/opera/parser/tosca/v_1_3/policy_definition.py | Legion2/xopera-opera | 808f23cbac326b6d067e6ec531a0109ae02d0f5e | [
"Apache-2.0"
] | null | null | null | src/opera/parser/tosca/v_1_3/policy_definition.py | Legion2/xopera-opera | 808f23cbac326b6d067e6ec531a0109ae02d0f5e | [
"Apache-2.0"
] | null | null | null | src/opera/parser/tosca/v_1_3/policy_definition.py | Legion2/xopera-opera | 808f23cbac326b6d067e6ec531a0109ae02d0f5e | [
"Apache-2.0"
] | null | null | null | from ..entity import Entity
from ..list import List
from ..map import Map
from ..reference import Reference, ReferenceXOR
from ..string import String
from ..void import Void
from .trigger_definition import TriggerDefinition
class PolicyDefinition(Entity):
ATTRS = dict(
type=Reference("policy_types"),
... | 27.904762 | 109 | 0.699659 |
854e53a1a703310f0da8cca56b6fb958c993dd37 | 156,522 | py | Python | tensorflow/python/data/ops/dataset_ops.py | 18867664853/tensorflow | f4a49de0041f7e3f3e8c5cf04fb1862cd0944fdc | [
"Apache-2.0"
] | null | null | null | tensorflow/python/data/ops/dataset_ops.py | 18867664853/tensorflow | f4a49de0041f7e3f3e8c5cf04fb1862cd0944fdc | [
"Apache-2.0"
] | null | null | null | tensorflow/python/data/ops/dataset_ops.py | 18867664853/tensorflow | f4a49de0041f7e3f3e8c5cf04fb1862cd0944fdc | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.525758 | 116 | 0.691845 |
7cdfae988ee44edc9d0ad77ebf895365e8efc116 | 184 | py | Python | Semana_6/errores.py | eovallea3786/ProgramacionEAN20191 | 0f48a842195de29a3141d5012085e49d4b13a7d4 | [
"MIT"
] | null | null | null | Semana_6/errores.py | eovallea3786/ProgramacionEAN20191 | 0f48a842195de29a3141d5012085e49d4b13a7d4 | [
"MIT"
] | null | null | null | Semana_6/errores.py | eovallea3786/ProgramacionEAN20191 | 0f48a842195de29a3141d5012085e49d4b13a7d4 | [
"MIT"
] | null | null | null | numero = input('ingresa tu numero ')
try:
print('tu numero {0} al cuadrado es {1}'.format(numero, float(numero) ** 2))
except:
print("'{0}' no es un numero".format(numero)) | 20.444444 | 80 | 0.630435 |
b7be2e550e48ad551e8767466fd293832a83c9d3 | 8,569 | py | Python | config/settings/common.py | AlexPylaev/mrpulse | 4a4cdff3ed3d32f81f6c60264663b24b02738743 | [
"MIT"
] | null | null | null | config/settings/common.py | AlexPylaev/mrpulse | 4a4cdff3ed3d32f81f6c60264663b24b02738743 | [
"MIT"
] | null | null | null | config/settings/common.py | AlexPylaev/mrpulse | 4a4cdff3ed3d32f81f6c60264663b24b02738743 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Django settings for mrpulse project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, unicode_lit... | 35.556017 | 98 | 0.612907 |
58fa010d7047602090531482ad2e85e9b8d397e4 | 9,469 | py | Python | optuna_core/pruners/_successive_halving.py | hvy/optuna-core | be9df49424aa4022cfcec7d9423768cc39c73ae6 | [
"MIT"
] | 1 | 2020-10-09T02:35:25.000Z | 2020-10-09T02:35:25.000Z | optuna_core/pruners/_successive_halving.py | hvy/optuna-core | be9df49424aa4022cfcec7d9423768cc39c73ae6 | [
"MIT"
] | null | null | null | optuna_core/pruners/_successive_halving.py | hvy/optuna-core | be9df49424aa4022cfcec7d9423768cc39c73ae6 | [
"MIT"
] | null | null | null | import math
from typing import List
from typing import Optional
from typing import Union
import optuna_core
from optuna_core.pruners._base import BasePruner
from optuna_core.trial._state import TrialState
class SuccessiveHalvingPruner(BasePruner):
"""Pruner using Asynchronous Successive Halving Algorithm.
`... | 38.028112 | 100 | 0.626782 |
7c6d81544d5af45d2ff38fd37128a30200bb6c17 | 9,336 | py | Python | ch18/genetic.py | skypather/GeneticAlgorithmsWithPython | d6d99f59e6e2b77380cadf0a1158d2442298fe89 | [
"Apache-2.0"
] | 2 | 2018-04-08T15:05:42.000Z | 2018-04-08T15:06:30.000Z | ch18/genetic.py | skypather/GeneticAlgorithmsWithPython | d6d99f59e6e2b77380cadf0a1158d2442298fe89 | [
"Apache-2.0"
] | null | null | null | ch18/genetic.py | skypather/GeneticAlgorithmsWithPython | d6d99f59e6e2b77380cadf0a1158d2442298fe89 | [
"Apache-2.0"
] | 1 | 2019-10-09T01:28:38.000Z | 2019-10-09T01:28:38.000Z | # File: genetic.py
# from chapter 18 of _Genetic Algorithms with Python_
#
# Author: Clinton Sheppard <fluentcoder@gmail.com>
# Copyright (c) 2016 Clinton Sheppard
#
# 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... | 35.363636 | 78 | 0.617395 |
f242445b4b38e37d7443b6e6ed987fb3f97cff46 | 294 | py | Python | Flask-System/create.py | mkousathanas/myrepo | 63868918a83e1d0fc4979860d1cb7d8d3f3d9725 | [
"MIT"
] | null | null | null | Flask-System/create.py | mkousathanas/myrepo | 63868918a83e1d0fc4979860d1cb7d8d3f3d9725 | [
"MIT"
] | null | null | null | Flask-System/create.py | mkousathanas/myrepo | 63868918a83e1d0fc4979860d1cb7d8d3f3d9725 | [
"MIT"
] | null | null | null | import sqlite3
"""Για την έναρξη της σύνδεσης με τη βάση δεδομένων"""
conn = sqlite3.connect('database.db')
print "Πετυχημένη σύνδεση με τη βάση δεδομένων";
conn.execute('CREATE TABLE users (name TEXT, addr TEXT, city TEXT, pin TEXT)')
print "Ο πίνακας δημιουργήθηκε με επιτυχία";
conn.close() | 36.75 | 78 | 0.758503 |
ff3d8650e1952d8dd8920497e0c16ef34a47af41 | 5,117 | py | Python | tests/algorithms/test_distributions.py | festusdrakon/PyDP | ae02ef587b8716f038b2a3c0c454682f6cc772b2 | [
"Apache-2.0"
] | null | null | null | tests/algorithms/test_distributions.py | festusdrakon/PyDP | ae02ef587b8716f038b2a3c0c454682f6cc772b2 | [
"Apache-2.0"
] | null | null | null | tests/algorithms/test_distributions.py | festusdrakon/PyDP | ae02ef587b8716f038b2a3c0c454682f6cc772b2 | [
"Apache-2.0"
] | 1 | 2020-05-29T20:46:25.000Z | 2020-05-29T20:46:25.000Z | import pytest
from pydp.distributions import (
LaplaceDistribution,
GaussianDistribution,
# GeometricDistribution,
)
import pydp as dp
import math
from typing import List
from itertools import accumulate
import math
k_num_samples = 10000000
k_num_geometric_samples = 1000000
k_gaussian_samples = 1000000
k_... | 36.55 | 159 | 0.689662 |
b6d7e191e9f64aa3710bfe5c849abd1ca7ae0333 | 53,310 | py | Python | tests/gclient_smoketest.py | miaosf/depot_tools | cb329f4a09b779497ab56ea2fe47c4aff31c35b6 | [
"BSD-3-Clause"
] | null | null | null | tests/gclient_smoketest.py | miaosf/depot_tools | cb329f4a09b779497ab56ea2fe47c4aff31c35b6 | [
"BSD-3-Clause"
] | null | null | null | tests/gclient_smoketest.py | miaosf/depot_tools | cb329f4a09b779497ab56ea2fe47c4aff31c35b6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Smoke tests for gclient.py.
Shell out 'gclient' and run basic conformance tests.
This test assumes GClientSmokeBase.URL_BASE i... | 40.052592 | 80 | 0.559595 |
a1fa3906866949782c0334a8bad6aea15b3b5685 | 1,841 | py | Python | main.py | umchemurziev/avito | c6125693aa00c2d933b37e32c7d94b7bd12a8288 | [
"MIT"
] | null | null | null | main.py | umchemurziev/avito | c6125693aa00c2d933b37e32c7d94b7bd12a8288 | [
"MIT"
] | null | null | null | main.py | umchemurziev/avito | c6125693aa00c2d933b37e32c7d94b7bd12a8288 | [
"MIT"
] | null | null | null | import asyncio
async def get_matrix(url):
import requests
async def url_to_matrix(url):
loop = asyncio.get_event_loop()
res = await loop.run_in_executor(None, requests.get, url)
if res.status_code in range(400, 601):
print("Error: ", res.status_code)
return []
... | 26.3 | 103 | 0.507876 |
2d7357064dda4c2ce56b74614059d38806d37c1b | 2,704 | py | Python | src/ipyradiant/query/namespace_manager.py | lnijhawan/ipyradiant | d804e9031ef39c1ea75fedd52d110302c065ad84 | [
"BSD-3-Clause"
] | null | null | null | src/ipyradiant/query/namespace_manager.py | lnijhawan/ipyradiant | d804e9031ef39c1ea75fedd52d110302c065ad84 | [
"BSD-3-Clause"
] | null | null | null | src/ipyradiant/query/namespace_manager.py | lnijhawan/ipyradiant | d804e9031ef39c1ea75fedd52d110302c065ad84 | [
"BSD-3-Clause"
] | null | null | null | """ a namespace manager
"""
# Copyright (c) 2021 ipyradiant contributors.
# Distributed under the terms of the Modified BSD License.
import re
import ipywidgets as W
import traitlets as T
from rdflib.namespace import RDF, RDFS, XSD
default_ns = {
"rdfs": RDFS,
"rdf": RDF,
"xsd": XSD,
}
def collapse_nam... | 33.382716 | 88 | 0.626849 |
0f9eb7bdac3d9a52777dda6ba114a6c05c60f1f8 | 706 | py | Python | src/core/path_settings.py | wu-clan/automated_api | 6c41ddc3b900608403855afb9e740ce31e24186f | [
"MulanPSL-1.0"
] | null | null | null | src/core/path_settings.py | wu-clan/automated_api | 6c41ddc3b900608403855afb9e740ce31e24186f | [
"MulanPSL-1.0"
] | null | null | null | src/core/path_settings.py | wu-clan/automated_api | 6c41ddc3b900608403855afb9e740ce31e24186f | [
"MulanPSL-1.0"
] | null | null | null | #!/usr/bin/env python
# _*_ coding:utf-8 _*_
import os
from src.core.conf import settings
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# 测试用例参数 yaml 文件
YAML_FILE = os.path.join(BASE_DIR, 'data')
# 测试用例参数 xlsx 文件
XLSX_FILE = os.path.join(BASE_DIR, 'data')
# 测试用例参数文件
TEMPLATE_XLSX_FILE = os.path.join(BASE_D... | 22.0625 | 75 | 0.730878 |
767b6b09189226c8156ad211d41e6290df060db1 | 2,063 | py | Python | body/stretch_body/hello_utils.py | PickNikRobotics/stretch_body | 6d8fd9cea3292c19c4c2256f9c6cceea56ff3e5f | [
"RSA-MD"
] | null | null | null | body/stretch_body/hello_utils.py | PickNikRobotics/stretch_body | 6d8fd9cea3292c19c4c2256f9c6cceea56ff3e5f | [
"RSA-MD"
] | null | null | null | body/stretch_body/hello_utils.py | PickNikRobotics/stretch_body | 6d8fd9cea3292c19c4c2256f9c6cceea56ff3e5f | [
"RSA-MD"
] | 1 | 2021-05-04T16:29:26.000Z | 2021-05-04T16:29:26.000Z | import yaml
import math
import os
import time
def print_stretch_re_use():
print("For use with S T R E T C H (TM) RESEARCH EDITION from Hello Robot Inc.\n")
def create_time_string():
t = time.localtime()
time_string = str(t.tm_year) + str(t.tm_mon).zfill(2) + str(t.tm_mday).zfill(2) + str(t.tm_hour).zfill... | 24.270588 | 159 | 0.62094 |
ba1ba48a5157edc7680048ddccb7d0756cb4d0ad | 2,100 | py | Python | lib/galaxy/workflow/steps.py | ramezrawas/galaxy-1 | c03748dd49c060a68d07bce56eae33e0ba154414 | [
"CC-BY-3.0"
] | 6 | 2018-11-03T22:43:35.000Z | 2022-02-15T17:51:33.000Z | lib/galaxy/workflow/steps.py | igorhollaender/OBSOLETE_sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | 7 | 2016-12-07T22:19:37.000Z | 2019-01-30T15:04:26.000Z | lib/galaxy/workflow/steps.py | igorhollaender/OBSOLETE_sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | 10 | 2017-04-10T21:40:22.000Z | 2022-02-21T16:50:10.000Z | """ This module contains utility methods for reasoning about and ordering
workflow steps.
"""
import math
from galaxy.util.topsort import (
CycleError,
topsort,
topsort_levels
)
def attach_ordered_steps( workflow, steps ):
""" Attempt to topologically order steps and attach to workflow. If this
fa... | 32.8125 | 169 | 0.664286 |
da1cad60f5ff393c8474cc1715db3e73e5351b04 | 37,365 | py | Python | vistrails/packages/matplotlib/parse.py | celiafish/VisTrails | d8cb575b8b121941de190fe608003ad1427ef9f6 | [
"BSD-3-Clause"
] | 1 | 2020-03-13T20:56:21.000Z | 2020-03-13T20:56:21.000Z | vistrails/packages/matplotlib/parse.py | celiafish/VisTrails | d8cb575b8b121941de190fe608003ad1427ef9f6 | [
"BSD-3-Clause"
] | null | null | null | vistrails/packages/matplotlib/parse.py | celiafish/VisTrails | d8cb575b8b121941de190fe608003ad1427ef9f6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import ast
import re
import sys
from xml.etree import ElementTree as ET
import docutils.core
import docutils.nodes
from itertools import izip
import inspect
import matplotlib
matplotlib.use('Qt4Agg')
import matplotlib.docstring
def new_call(self, func):
return func
matplotlib.docstring.Subst... | 39.75 | 304 | 0.526375 |
3610827665e06acb76502cb0aa5189d29dd66ed5 | 21,619 | py | Python | axelrod/strategies/memoryone.py | Jessegoodspeed/Axelrod | bdb1c909e9a37a1527fd1094f45586bc5f853414 | [
"MIT"
] | null | null | null | axelrod/strategies/memoryone.py | Jessegoodspeed/Axelrod | bdb1c909e9a37a1527fd1094f45586bc5f853414 | [
"MIT"
] | null | null | null | axelrod/strategies/memoryone.py | Jessegoodspeed/Axelrod | bdb1c909e9a37a1527fd1094f45586bc5f853414 | [
"MIT"
] | null | null | null | """Memory One strategies. Note that there are Memory One strategies in other
files, including titfortat.py and zero_determinant.py"""
import warnings
from typing import Tuple
from axelrod.action import Action
from axelrod.player import Player
C, D = Action.C, Action.D
class WinStayLoseShift(Player):
"""
Wi... | 27.193711 | 91 | 0.601369 |
b5234ee349e289b304fef3186e31859dd9165d62 | 4,890 | py | Python | frappe/hooks.py | indictranstech/harware-frappe | 92a67b7b780e242de3722163c32811781cf3492c | [
"MIT"
] | null | null | null | frappe/hooks.py | indictranstech/harware-frappe | 92a67b7b780e242de3722163c32811781cf3492c | [
"MIT"
] | null | null | null | frappe/hooks.py | indictranstech/harware-frappe | 92a67b7b780e242de3722163c32811781cf3492c | [
"MIT"
] | 2 | 2016-07-28T06:00:16.000Z | 2018-03-21T19:59:50.000Z | from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "frappe"
app_title = "Frappe Framework"
app_publisher = "Frappe Technologies"
app_description = "Full stack web framework with Python, Javascript, MariaDB, Redis, Node"
app_icon = "octicon octicon-circuit-board"
app_color = "or... | 32.6 | 90 | 0.743763 |
233f778bab334ed7079c3699c38c8cfa8d5ae182 | 608 | py | Python | senza/manaus/utils.py | mschwitalla/senza | 301a43fde41db194cbb80c68271692d1fe2212db | [
"Apache-2.0"
] | 106 | 2015-03-30T14:15:15.000Z | 2021-07-26T07:30:11.000Z | senza/manaus/utils.py | mschwitalla/senza | 301a43fde41db194cbb80c68271692d1fe2212db | [
"Apache-2.0"
] | 547 | 2015-04-13T09:58:50.000Z | 2021-01-26T11:20:35.000Z | senza/manaus/utils.py | mschwitalla/senza | 301a43fde41db194cbb80c68271692d1fe2212db | [
"Apache-2.0"
] | 102 | 2015-04-01T08:09:53.000Z | 2020-11-05T09:05:28.000Z | """
Generic functions related to AWS/Boto/Manaus but don't belong to any specific
component
"""
from typing import Dict, Optional # noqa: F401 pylint: disable=locally-disabled, unused-import
from botocore.exceptions import ClientError
__all__ = ["extract_client_error_code"]
def extract_client_error_code(exception... | 28.952381 | 95 | 0.730263 |
c1e978d629fad1246666a9feefb6eb348fc5f2b9 | 353 | py | Python | photoStore/Store/migrations/0002_rename_cvr_url_photo_photo_url.py | j-ahn94/JPhotoStore | 308c018b6e1163e7d00d1e5df9fc84d7157f85c1 | [
"MIT"
] | null | null | null | photoStore/Store/migrations/0002_rename_cvr_url_photo_photo_url.py | j-ahn94/JPhotoStore | 308c018b6e1163e7d00d1e5df9fc84d7157f85c1 | [
"MIT"
] | null | null | null | photoStore/Store/migrations/0002_rename_cvr_url_photo_photo_url.py | j-ahn94/JPhotoStore | 308c018b6e1163e7d00d1e5df9fc84d7157f85c1 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-09 03:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Store', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='photo',
old_name='cvr_url',
new_na... | 18.578947 | 47 | 0.572238 |
9c49de4c8411b96b5ba67fb50f94f815a1088ee2 | 5,500 | py | Python | main.py | rAcHekLoS/plugin.video.owncast | 419b40db0cffd3f659b1fa2e70f80ef19867f267 | [
"MIT"
] | 2 | 2021-12-13T02:33:42.000Z | 2021-12-13T03:18:43.000Z | main.py | rAcHekLoS/plugin.video.owncast | 419b40db0cffd3f659b1fa2e70f80ef19867f267 | [
"MIT"
] | null | null | null | main.py | rAcHekLoS/plugin.video.owncast | 419b40db0cffd3f659b1fa2e70f80ef19867f267 | [
"MIT"
] | null | null | null | # Module: main
# Author: rache_klos
# Created on: 16.01.2021
import sys
from urllib.parse import urlencode, parse_qsl
import resources.lib.owncast as owncast
import xbmcgui
import xbmcplugin
import xbmcaddon
import xbmc
import inputstreamhelper
# Get the plugin url in plugin:// notation.
_url = sys.argv[0]
# Get the... | 40.145985 | 95 | 0.651091 |
0b86505c7945c6983de12e0c13859acfae164158 | 2,093 | py | Python | 1010.pairs-of-songs-with-total-durations-divisible-by-60.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | 1010.pairs-of-songs-with-total-durations-divisible-by-60.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | 1010.pairs-of-songs-with-total-durations-divisible-by-60.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | # coding=utf-8
#
# @lc app=leetcode id=1010 lang=python
#
# [1010] Pairs of Songs With Total Durations Divisible by 60
#
# https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60/description/
#
# algorithms
# Easy (45.72%)
# Likes: 198
# Dislikes: 16
# Total Accepted: 15.3K
# Total Submi... | 22.505376 | 96 | 0.543239 |
de88017dae0e946f8affb05c31fb94d0b8c991b5 | 868 | py | Python | azure/mgmt/resource/__init__.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | azure/mgmt/resource/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/resource/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # 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.
# --------------------------------------------------------------------... | 31 | 76 | 0.650922 |
3a8ef011486cdac22808f79c8724afbad31c1939 | 3,969 | py | Python | mopy/MusicInfo.py | motools/mopy | c5f76b02300f2c086cfbf48acb00774deeb858fb | [
"DOC"
] | 10 | 2015-04-15T16:00:26.000Z | 2022-01-15T21:50:29.000Z | mopy/MusicInfo.py | motools/mopy | c5f76b02300f2c086cfbf48acb00774deeb858fb | [
"DOC"
] | null | null | null | mopy/MusicInfo.py | motools/mopy | c5f76b02300f2c086cfbf48acb00774deeb858fb | [
"DOC"
] | 2 | 2015-10-16T08:37:13.000Z | 2017-10-04T15:14:55.000Z | """
MusicInfo.py
Holds a collection of Music Ontology objects
Created by Chris Sutton on 2007-08-13.
Copyright (c) 2007 Chris Sutton. All rights reserved.
"""
from logging import log, error, warning, info, debug
from mopy import model
import random
class MusicInfoException(Exception):
def __init__(self, message) :... | 32.532787 | 114 | 0.647518 |
259e650eb8c9f7af0a93be390dd09be6758cf20c | 1,418 | py | Python | moonlight/settings/dev.py | ad-free/moonlight | b60bf8668f2559c67425c683d2c9103f7685fdc1 | [
"MIT"
] | null | null | null | moonlight/settings/dev.py | ad-free/moonlight | b60bf8668f2559c67425c683d2c9103f7685fdc1 | [
"MIT"
] | null | null | null | moonlight/settings/dev.py | ad-free/moonlight | b60bf8668f2559c67425c683d2c9103f7685fdc1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import logging
from moonlight.settings.base import *
from django.utils.translation import gettext_lazy as _
from django.conf import settings
logger = logging.getLogger("")
logger.info("Starting on development environment")
DEBUG = True
ALLOWED... | 25.321429 | 86 | 0.543724 |
45c75cf1958080efd70fa04d600ed0ac0da2756d | 26,521 | py | Python | tensorflow/python/ops/stateful_random_ops_test.py | huonw/tensorflow | 85f47254af7cc230a4a031998dffe770b7edbb9d | [
"Apache-2.0"
] | 1 | 2018-02-25T02:08:34.000Z | 2018-02-25T02:08:34.000Z | tensorflow/python/ops/stateful_random_ops_test.py | huonw/tensorflow | 85f47254af7cc230a4a031998dffe770b7edbb9d | [
"Apache-2.0"
] | 58 | 2021-11-22T05:41:28.000Z | 2022-01-19T01:33:40.000Z | tensorflow/python/ops/stateful_random_ops_test.py | eniktab/tensorflow_build | af6b342154e5ba16543d3fc351fad26c230fe567 | [
"Apache-2.0"
] | 1 | 2022-03-18T04:26:38.000Z | 2022-03-18T04:26:38.000Z | # Copyright 2019 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... | 36.58069 | 83 | 0.693752 |
29acd6cc0f1d88b3fb812cfc88899a839d394061 | 5,230 | py | Python | sdk/python/pulumi_aws/elasticloadbalancing/load_balancer_cookie_stickiness_policy.py | johnktims/pulumi-aws | c838bc79043f5376c66fc66275a1e012edd3ab7d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/elasticloadbalancing/load_balancer_cookie_stickiness_policy.py | johnktims/pulumi-aws | c838bc79043f5376c66fc66275a1e012edd3ab7d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/elasticloadbalancing/load_balancer_cookie_stickiness_policy.py | johnktims/pulumi-aws | c838bc79043f5376c66fc66275a1e012edd3ab7d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class LoadBa... | 45.877193 | 175 | 0.68088 |
19e9989e269fa632e9d77a25b898989d08c1f54a | 610 | py | Python | raven/response/_command/_commands/commands.py | jawahar273/Tx | d595ebd347194402984505a051f842854ce0fc9f | [
"MIT"
] | null | null | null | raven/response/_command/_commands/commands.py | jawahar273/Tx | d595ebd347194402984505a051f842854ce0fc9f | [
"MIT"
] | null | null | null | raven/response/_command/_commands/commands.py | jawahar273/Tx | d595ebd347194402984505a051f842854ce0fc9f | [
"MIT"
] | null | null | null | from raven.response.abstract_response import BaseResponse
from raven.config import FOR_OUTPUT
class Commands(BaseResponse):
def __init__(self, scope=None):
super(Commands, self).__init__(self, scope=scope)
def get_class_name(self):
return self.__class__.__name__
def render(self, txObj... | 25.416667 | 85 | 0.706557 |
171aa91ca52df0ba1bf66946f533381acc836279 | 837 | py | Python | login/login/session.py | maosplx/L2py | 5d81b2ea150c0096cfce184706fa226950f7f583 | [
"MIT"
] | 7 | 2020-09-01T21:52:37.000Z | 2022-02-25T16:00:08.000Z | login/login/session.py | maosplx/L2py | 5d81b2ea150c0096cfce184706fa226950f7f583 | [
"MIT"
] | 4 | 2021-09-10T22:15:09.000Z | 2022-03-25T22:17:43.000Z | login/login/session.py | maosplx/L2py | 5d81b2ea150c0096cfce184706fa226950f7f583 | [
"MIT"
] | 9 | 2020-09-01T21:53:39.000Z | 2022-03-30T12:03:04.000Z | from common.session import Session
from login.keys.blowfish import BlowfishKey
from login.keys.rsa import L2RsaKey
from login.keys.session import SessionKey
from login.keys.xor import LoginXorKey
class LoginSession(Session):
def __init__(self, protocol):
super().__init__()
self.id = Int32.random()... | 32.192308 | 55 | 0.670251 |
a58ea8e90668d78c8ef6c6289c3f9b4de1eaf326 | 32,693 | py | Python | src/graph_models.py | satyakisikdar/infinity-mirror | d8b44aa75f1052318dc1c40a770a7ad07e38abb7 | [
"MIT"
] | 5 | 2020-03-13T02:54:03.000Z | 2022-03-18T02:33:12.000Z | src/graph_models.py | satyakisikdar/infinity-mirror | d8b44aa75f1052318dc1c40a770a7ad07e38abb7 | [
"MIT"
] | 2 | 2021-11-10T19:47:00.000Z | 2022-02-10T01:24:59.000Z | src/graph_models.py | satyakisikdar/infinity-mirror | d8b44aa75f1052318dc1c40a770a7ad07e38abb7 | [
"MIT"
] | 1 | 2021-05-24T21:54:44.000Z | 2021-05-24T21:54:44.000Z | """
Container for different graph models
"""
import abc
import math
import os
import platform
import random
import subprocess as sub
from itertools import combinations
from time import time
from typing import List, Dict, Any, Union, Set, Tuple
from tqdm import tqdm
import networkx as nx
import numpy as np
from scipy i... | 37.535017 | 154 | 0.609427 |
25e1affaab88b5563c102a8de04d789f2b288a54 | 1,262 | py | Python | seg3/map.py | iViolinSolo/2018MathYouKnow | b7027ef874c69c751ddfeac2a0b861de8d49e5b0 | [
"Apache-2.0"
] | null | null | null | seg3/map.py | iViolinSolo/2018MathYouKnow | b7027ef874c69c751ddfeac2a0b861de8d49e5b0 | [
"Apache-2.0"
] | null | null | null | seg3/map.py | iViolinSolo/2018MathYouKnow | b7027ef874c69c751ddfeac2a0b861de8d49e5b0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: violinsolo
# Created on 19/09/2018
import json
import pygal.maps.world
from country_codes import get_country_code
from pygal.style import RotateStyle
from pygal.style import LightColorizedStyle as LCS, RotateStyle as RS
# 将数据加载到一个列表中
filename = 'population_data.js... | 25.755102 | 69 | 0.690174 |
1791a9b2b4749a94e1650ffea58a07ac0c71a649 | 1,361 | py | Python | examples/copy_data_scripts/main.py | masoncusack/azmlops | abf9e6d394ed2930c7a40eb8863b3a45eb018db3 | [
"MIT"
] | 1 | 2021-04-21T08:07:31.000Z | 2021-04-21T08:07:31.000Z | examples/copy_data_scripts/main.py | masoncusack/azmlops | abf9e6d394ed2930c7a40eb8863b3a45eb018db3 | [
"MIT"
] | 3 | 2021-04-29T15:04:23.000Z | 2021-05-12T16:01:19.000Z | examples/copy_data_scripts/main.py | masoncusack/azmlops | abf9e6d394ed2930c7a40eb8863b3a45eb018db3 | [
"MIT"
] | 1 | 2021-04-21T14:14:25.000Z | 2021-04-21T14:14:25.000Z | from azureml.core import Run
import argparse
from os import makedirs, path
from shutil import copyfile
def copy_data(input_file_path, output_file_path, run):
"""
Copy input file to output file
"""
run.log("copy_data Job", 1)
with open(input_file_path, 'r') as reader:
print(f"Input file... | 30.931818 | 90 | 0.688464 |
0ef82b4db2380fea047a7080ebc2d014e52b885a | 1,804 | py | Python | fast_ft/server.py | practice9420/fast-ft | e0e5f2553bdd74a6770ccd3e2b8cf31abc56f6c9 | [
"MIT"
] | 4 | 2021-02-08T07:20:27.000Z | 2021-07-04T10:25:51.000Z | fast_ft/server.py | practice9420/fast-ft | e0e5f2553bdd74a6770ccd3e2b8cf31abc56f6c9 | [
"MIT"
] | null | null | null | fast_ft/server.py | practice9420/fast-ft | e0e5f2553bdd74a6770ccd3e2b8cf31abc56f6c9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
import os
import sys
from pathlib import Path
# 打包后添加当前目录到环境变量以便导入项目中的包
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from settings import Config
from fast_ft import create_app, socket_server
from utils.make_qrcode import get_inner_ip, open_browser, make_qrcode_
from ... | 32.214286 | 95 | 0.620288 |
fa05e2f355f3aba63ebe75f263e757aaba2f7d0f | 9,561 | py | Python | trace-viewer/third_party/web_dev_style/web_dev_style/css_checker.py | yinquan529/platform-external-chromium-trace | 8252ae6b83ea65cf871e7981e981da07379f5a0f | [
"BSD-3-Clause"
] | 1 | 2019-01-22T02:36:35.000Z | 2019-01-22T02:36:35.000Z | trace-viewer/third_party/web_dev_style/web_dev_style/css_checker.py | yinquan529/platform-external-chromium-trace | 8252ae6b83ea65cf871e7981e981da07379f5a0f | [
"BSD-3-Clause"
] | null | null | null | trace-viewer/third_party/web_dev_style/web_dev_style/css_checker.py | yinquan529/platform-external-chromium-trace | 8252ae6b83ea65cf871e7981e981da07379f5a0f | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for Chromium WebUI resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the... | 39.672199 | 81 | 0.559042 |
809624890ea90a40d1ea56404d6663aab15f6bde | 4,574 | py | Python | core/rawlint.py | armoha/python-lnp | aaee5582e4024f839b8155360292a427fc5639e2 | [
"0BSD"
] | null | null | null | core/rawlint.py | armoha/python-lnp | aaee5582e4024f839b8155360292a427fc5639e2 | [
"0BSD"
] | null | null | null | core/rawlint.py | armoha/python-lnp | aaee5582e4024f839b8155360292a427fc5639e2 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Linter for raw files. Ported from Lethosor's Lua script:
https://github.com/lethosor/dfhack-scripts/blob/master/raw-lint.lua"""
from __future__ import print_function, unicode_literals, absolute_import
import os
from .dfraw import DFRaw
from . import log
# TODO: Handle... | 33.144928 | 80 | 0.636861 |
c1df5fda640d09ca221ab1f93f0546c68274ac3b | 11,223 | py | Python | tools/Polygraphy/polygraphy/backend/trt/runner.py | spradius/TensorRT | eb5de99b523c76c2f3ae997855ad86d3a1e86a31 | [
"Apache-2.0"
] | 1 | 2021-08-23T01:15:16.000Z | 2021-08-23T01:15:16.000Z | tools/Polygraphy/polygraphy/backend/trt/runner.py | spradius/TensorRT | eb5de99b523c76c2f3ae997855ad86d3a1e86a31 | [
"Apache-2.0"
] | null | null | null | tools/Polygraphy/polygraphy/backend/trt/runner.py | spradius/TensorRT | eb5de99b523c76c2f3ae997855ad86d3a1e86a31 | [
"Apache-2.0"
] | 1 | 2022-03-29T12:39:29.000Z | 2022-03-29T12:39:29.000Z | #
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appl... | 42.673004 | 120 | 0.632451 |
18855288c565f93dab59ce8b6a217d27394588dc | 1,833 | py | Python | neutron_plugin_contrail/tests/test_plugins_opencontrail_quota_driver.py | alexelshamouty/tf-neutron-plugin | 3effc5e80f3fa0d8d0252d5f994a36386b987f7f | [
"Apache-2.0"
] | 3 | 2021-09-07T05:02:24.000Z | 2022-02-11T04:25:43.000Z | neutron_plugin_contrail/tests/test_plugins_opencontrail_quota_driver.py | alexelshamouty/tf-neutron-plugin | 3effc5e80f3fa0d8d0252d5f994a36386b987f7f | [
"Apache-2.0"
] | 1 | 2021-09-27T08:05:08.000Z | 2021-09-27T08:05:08.000Z | neutron_plugin_contrail/tests/test_plugins_opencontrail_quota_driver.py | alexelshamouty/tf-neutron-plugin | 3effc5e80f3fa0d8d0252d5f994a36386b987f7f | [
"Apache-2.0"
] | 5 | 2020-07-14T07:52:05.000Z | 2022-03-24T15:08:02.000Z | import mock
import unittest
from neutron_plugin_contrail.plugins.opencontrail.quota.driver import QuotaDriver
class ContrailPluginQuotaDriverTest(unittest.TestCase):
def setUp(self):
print("setup quota")
def test_testenv(self):
print("testenv quota ok")
def test_get_tenant_quotas_arg(se... | 33.944444 | 120 | 0.554283 |
2db6ca8d1a677d7b043d93c3607206d047339b96 | 606 | py | Python | var/spack/repos/builtin/packages/perl-term-readline-gnu/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/perl-term-readline-gnu/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/perl-term-readline-gnu/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PerlTermReadlineGnu(PerlPackage):
"""Perl extension for the GNU Readline/History Library.""... | 35.647059 | 96 | 0.747525 |
ca5355b7bd7804ad997c7576d81d6a659e3cb9ca | 3,178 | py | Python | tasks/transform_classification_groups.py | reidmv/reidmv-pe_architecture | 33317df518d8d80ef8f7d7a47096c522eb196809 | [
"Apache-2.0"
] | null | null | null | tasks/transform_classification_groups.py | reidmv/reidmv-pe_architecture | 33317df518d8d80ef8f7d7a47096c522eb196809 | [
"Apache-2.0"
] | null | null | null | tasks/transform_classification_groups.py | reidmv/reidmv-pe_architecture | 33317df518d8d80ef8f7d7a47096c522eb196809 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""This module takes two classification outputs from source and targer puppet infrastructure and
takes the user defintions from the source and adds them to the infrastructure defintions of the
target. Allowing the ability to restore a backup of user node definitions"""
import json
import sys
para... | 40.227848 | 103 | 0.741976 |
a64c2a1c46f3b4c8efb174e0dc082f3b368a4228 | 1,094 | py | Python | meiduo/meiduo/apps/users/utils.py | q934744153/meiduo_mall | 6f5b0ae38cc80c21ddca161c428fea09584d4b95 | [
"MIT"
] | null | null | null | meiduo/meiduo/apps/users/utils.py | q934744153/meiduo_mall | 6f5b0ae38cc80c21ddca161c428fea09584d4b95 | [
"MIT"
] | null | null | null | meiduo/meiduo/apps/users/utils.py | q934744153/meiduo_mall | 6f5b0ae38cc80c21ddca161c428fea09584d4b95 | [
"MIT"
] | null | null | null | from django.contrib.auth.backends import ModelBackend
from django.db.models import Q
from users.models import User
from django.contrib.auth.mixins import LoginRequiredMixin
from django import http
from django.conf import settings
from meiduo.utils.secret import SecretOauth
class UsernameMobileAuthBackend(ModelBackend):... | 28.051282 | 76 | 0.712066 |
e556786e37fc3aebbb80cf3e219ee7817e3bceac | 1,115 | py | Python | cfg/base/GlobalConfig.py | vancebs/EasyCoding3 | e78db51096ba07ef1b274becca4817a00ca0ef31 | [
"Apache-2.0"
] | null | null | null | cfg/base/GlobalConfig.py | vancebs/EasyCoding3 | e78db51096ba07ef1b274becca4817a00ca0ef31 | [
"Apache-2.0"
] | null | null | null | cfg/base/GlobalConfig.py | vancebs/EasyCoding3 | e78db51096ba07ef1b274becca4817a00ca0ef31 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# coding=utf-8
##########################################
# Easy Coding 3 global config File #
##########################################
class GlobalConfig(object):
# The dir where you keep all your projects
cfgGlobalBaseDir = '/home/hufan/platforms'
# URL where you download you... | 30.972222 | 68 | 0.569507 |
b7485d8b2ab338e6d4d9eae5b3f5ebf85b6de6c8 | 20,096 | py | Python | thing/views/character.py | skyride/evething-2 | e0778a539b7f8a56667b2508293ca7e9f515283f | [
"BSD-2-Clause"
] | 21 | 2017-05-24T00:06:07.000Z | 2019-08-06T04:31:18.000Z | thing/views/character.py | skyride/evething-2 | e0778a539b7f8a56667b2508293ca7e9f515283f | [
"BSD-2-Clause"
] | 11 | 2017-05-23T23:58:57.000Z | 2018-05-27T03:21:30.000Z | thing/views/character.py | skyride/evething-2 | e0778a539b7f8a56667b2508293ca7e9f515283f | [
"BSD-2-Clause"
] | 10 | 2017-06-08T18:23:51.000Z | 2021-09-05T06:03:59.000Z | # ------------------------------------------------------------------------------
# Copyright (c) 2010-2013, EVEthing team
# 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... | 37.703565 | 184 | 0.63749 |
4337d329f3378b8ca9e7e8a6a1ce2063d48c24ce | 687 | py | Python | mytests/dodo_5.py | OliverTED/doit | a6f75f312390aba352c3f00680cd32609323dbc2 | [
"MIT"
] | null | null | null | mytests/dodo_5.py | OliverTED/doit | a6f75f312390aba352c3f00680cd32609323dbc2 | [
"MIT"
] | null | null | null | mytests/dodo_5.py | OliverTED/doit | a6f75f312390aba352c3f00680cd32609323dbc2 | [
"MIT"
] | null | null | null | def task_file2():
yield {'basename' : 'file2',
'file_dep' : ["missing.txt"],
'targets' : ["tmp2"],
'actions' : ["date > tmp2"],
}
def task_file3():
yield {'basename' : 'file3',
'file_dep' : ["tmp2"],
'targets' : ["tmp3"],
'actions' ... | 27.48 | 41 | 0.41048 |
a9759307772efec4fa0bec5aa3fac4bde191c093 | 1,635 | py | Python | src/BTrees/tests/testPersistency.py | pfw/BTrees | e9d3bfc301c24ebe2ef8c6818926de41da342f47 | [
"ZPL-2.1"
] | 66 | 2015-02-22T23:33:22.000Z | 2021-12-13T07:14:58.000Z | src/BTrees/tests/testPersistency.py | pfw/BTrees | e9d3bfc301c24ebe2ef8c6818926de41da342f47 | [
"ZPL-2.1"
] | 160 | 2015-01-05T21:47:16.000Z | 2022-03-09T07:12:30.000Z | src/BTrees/tests/testPersistency.py | pfw/BTrees | e9d3bfc301c24ebe2ef8c6818926de41da342f47 | [
"ZPL-2.1"
] | 21 | 2015-04-03T04:28:27.000Z | 2021-12-02T06:21:06.000Z | ##############################################################################
#
# Copyright (c) 2020 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 35.543478 | 78 | 0.584098 |
890bdd03f6706e33d09ea256ff5e59e7b1c27adb | 1,431 | py | Python | lib/bes/python/python_installer_base.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/python/python_installer_base.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/python/python_installer_base.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | #-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
from abc import abstractmethod, ABCMeta
from collections import namedtuple
from bes.common.check import check
from bes.system.compat import with_metaclass
from bes.script.blurber import blurber
class python_installer_base(with... | 31.8 | 90 | 0.740042 |
6b7ea195c68d39e50481dfb64e6364e3693b13a3 | 2,238 | py | Python | addons/l10n_de_purchase/models/purchase.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/l10n_de_purchase/models/purchase.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/l10n_de_purchase/models/purchase.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | from odoo import models, fields, api, _
from odoo.tools import format_date
class PurchaseOrder(models.Model):
_inherit = 'purchase.order'
l10n_de_template_data = fields.Binary(compute='_compute_l10n_de_template_data')
l10n_de_document_title = fields.Char(compute='_compute_l10n_de_document_title')
l10... | 45.673469 | 101 | 0.632261 |
90f7ac64caffb645020448c467e272bca78102fd | 641 | py | Python | python/path-sum-iii.py | alirezaghey/leetcode-solutions | 676b71b4790c64d21af91dce02e97ee47e78d523 | [
"MIT"
] | 3 | 2020-10-10T00:14:23.000Z | 2022-03-02T21:16:29.000Z | python/path-sum-iii.py | alirezaghey/leetcode-solutions | 676b71b4790c64d21af91dce02e97ee47e78d523 | [
"MIT"
] | null | null | null | python/path-sum-iii.py | alirezaghey/leetcode-solutions | 676b71b4790c64d21af91dce02e97ee47e78d523 | [
"MIT"
] | 1 | 2021-09-14T05:16:54.000Z | 2021-09-14T05:16:54.000Z | import collections
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def pathSum(self, root: TreeNode, s: int) -> int:
def dfs(node, prev_sum, dic):
if not node: return 0
curr_sum = prev_s... | 27.869565 | 65 | 0.50702 |
e2557f2f69bd39ef5f7b7d067d3e7b3d095ffabe | 323 | py | Python | litebot/__main__.py | rybot666/LiteBot | 9598c021a59ee7983a1515c54a6cbc43bfcb5eb9 | [
"MIT"
] | 22 | 2020-10-18T22:36:51.000Z | 2022-03-27T07:49:25.000Z | litebot/__main__.py | rybot666/LiteBot | 9598c021a59ee7983a1515c54a6cbc43bfcb5eb9 | [
"MIT"
] | 8 | 2021-07-14T06:46:47.000Z | 2021-08-17T06:09:52.000Z | litebot/__main__.py | rybot666/LiteBot | 9598c021a59ee7983a1515c54a6cbc43bfcb5eb9 | [
"MIT"
] | 7 | 2021-05-04T16:56:19.000Z | 2021-10-12T05:44:31.000Z | from .litebot import LiteBot
from .core.components import DiscordComponents
def main():
bot_instance = LiteBot()
DiscordComponents(bot_instance)
bot_instance.start_server()
bot_instance.plugin_manager.load_plugins()
bot_instance.run(bot_instance.config["token"])
if __name__ == "__main__":
mai... | 24.846154 | 50 | 0.749226 |
a8696bb25458bea07ef6e957409d65c32bf81cac | 4,424 | py | Python | setup.py | initit/lexicon | 91107879c6a6f966557c3ce1ee354aa22d8a654c | [
"MIT"
] | null | null | null | setup.py | initit/lexicon | 91107879c6a6f966557c3ce1ee354aa22d8a654c | [
"MIT"
] | null | null | null | setup.py | initit/lexicon | 91107879c6a6f966557c3ce1ee354aa22d8a654c | [
"MIT"
] | null | null | null | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path, listdir
version... | 33.770992 | 115 | 0.663879 |
7066fb9c40052bf54812111bbc55652c2d194baf | 3,604 | py | Python | classification/models/CausalNormClassifier.py | kratos236/ICU-loss | ca05e54c33c03da6ac7df2c0913ba08d05713531 | [
"Apache-2.0"
] | null | null | null | classification/models/CausalNormClassifier.py | kratos236/ICU-loss | ca05e54c33c03da6ac7df2c0913ba08d05713531 | [
"Apache-2.0"
] | null | null | null | classification/models/CausalNormClassifier.py | kratos236/ICU-loss | ca05e54c33c03da6ac7df2c0913ba08d05713531 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
from utils import *
from os import path
import math
class Causal_Norm_Classifier(nn.Module):
def __init__(self, num_classes=1000, feat_dim=2048, use_effect=True, num_head=2, tau=16.0, alpha=3.0, gamma=0.03125, *args):
super(Causal_Norm_Classifier, self).__init__()
... | 43.421687 | 180 | 0.617092 |
8156ff9f2623077a7d1af7b1ee96bf6621076123 | 6,157 | py | Python | dataset cleaning.py | MbProg/BughouseAlphaZero | 25d2f25417713a85b24eac3ce9a3a7f5c55ff5e5 | [
"MIT"
] | null | null | null | dataset cleaning.py | MbProg/BughouseAlphaZero | 25d2f25417713a85b24eac3ce9a3a7f5c55ff5e5 | [
"MIT"
] | null | null | null | dataset cleaning.py | MbProg/BughouseAlphaZero | 25d2f25417713a85b24eac3ce9a3a7f5c55ff5e5 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import csv
import re
import os
import pickle
from collections import Counter
import numpy as np
def filter_bpgn_file(bpgn_file, output_file):
#check if outputfile already exists. If so, delete it.
if os.path.exists(output_file):
os.remove(output_file)
else:
... | 43.978571 | 274 | 0.544583 |
53f7606db45d2a1f047e0ee0e34791a2086bf964 | 2,396 | py | Python | supg/datasource/datasource.py | stanford-futuredata/supg | cff4e7eb9b657e79a8f1d8e245e23bcad543126c | [
"Apache-2.0"
] | 3 | 2020-08-31T21:03:31.000Z | 2021-01-17T08:08:51.000Z | supg/datasource/datasource.py | stanford-futuredata/supg | cff4e7eb9b657e79a8f1d8e245e23bcad543126c | [
"Apache-2.0"
] | 1 | 2021-07-29T06:07:25.000Z | 2021-07-29T07:04:57.000Z | supg/datasource/datasource.py | stanford-futuredata/supg | cff4e7eb9b657e79a8f1d8e245e23bcad543126c | [
"Apache-2.0"
] | 4 | 2020-09-03T03:13:37.000Z | 2021-12-20T12:13:51.000Z | from typing import List, Sequence
import pandas as pd
import numpy as np
class DataSource:
def lookup(self, idxs: Sequence) -> np.ndarray:
raise NotImplemented()
def filter(self, ids) -> np.ndarray:
labels = self.lookup(ids)
return np.array([ids[i] for i in range(len(ids)) if labels[... | 28.188235 | 91 | 0.604758 |
2b29ce1c95b5c09098c8204f246e9d218722e97b | 3,247 | py | Python | django_libphon/settings.py | Aladom/django-libphon | 47814242d02fe7915293c49fcec25766553bbd01 | [
"MIT"
] | null | null | null | django_libphon/settings.py | Aladom/django-libphon | 47814242d02fe7915293c49fcec25766553bbd01 | [
"MIT"
] | null | null | null | django_libphon/settings.py | Aladom/django-libphon | 47814242d02fe7915293c49fcec25766553bbd01 | [
"MIT"
] | null | null | null | """
Django settings for django_libphon project.
Generated by 'django-admin startproject' using Django 1.9.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
impor... | 25.769841 | 91 | 0.701571 |
1ec4475a2f79e19a0d151e2617ca12cae5ba445d | 246 | py | Python | models/effdet/config/__init__.py | Rakeshiva/vehicle-counting | b178780b4829c4e6f8e1089e57bc56cd57a93d0a | [
"MIT"
] | null | null | null | models/effdet/config/__init__.py | Rakeshiva/vehicle-counting | b178780b4829c4e6f8e1089e57bc56cd57a93d0a | [
"MIT"
] | null | null | null | models/effdet/config/__init__.py | Rakeshiva/vehicle-counting | b178780b4829c4e6f8e1089e57bc56cd57a93d0a | [
"MIT"
] | null | null | null | from .config_utils import set_config_readonly, set_config_writeable
from .fpn_config import get_fpn_config
from .model_config import get_efficientdet_config, default_detection_model_configs
from .train_config import default_detection_train_config | 61.5 | 82 | 0.906504 |
9d233b81cee11e16c102820c007ef1d9c8cb0d0a | 749 | py | Python | Python/101symmetric_tree.py | Apocrypse/LeetCode | 3ada2605ce8c8f6dadebf37a30c9c00a0d1ede39 | [
"MIT"
] | 4 | 2020-03-17T03:08:51.000Z | 2022-03-14T17:33:28.000Z | Python/101symmetric_tree.py | Apocrypse/LeetCode | 3ada2605ce8c8f6dadebf37a30c9c00a0d1ede39 | [
"MIT"
] | null | null | null | Python/101symmetric_tree.py | Apocrypse/LeetCode | 3ada2605ce8c8f6dadebf37a30c9c00a0d1ede39 | [
"MIT"
] | 3 | 2021-04-29T16:51:02.000Z | 2022-03-19T17:37:56.000Z | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def isSymmetric(self, root):
"""
:type root: TreeNode
:rtype: bool
"""
if root:
retur... | 25.827586 | 92 | 0.53271 |
3b6dd6da04b6f1be201d1ff50dfa1f080c52c71b | 439 | py | Python | Estruturas de dados/WHILE/DF064_Tratando_valores(gambiarra).py | Camilla-Carvalho/List-of-algorithms | b7b3a68332b370879351f08566edcd9ce81bfe53 | [
"MIT"
] | 5 | 2020-11-12T02:53:15.000Z | 2021-09-15T19:52:26.000Z | Estruturas de dados/WHILE/DF064_Tratando_valores(gambiarra).py | Camilla-Carvalho/List-of-algorithms | b7b3a68332b370879351f08566edcd9ce81bfe53 | [
"MIT"
] | null | null | null | Estruturas de dados/WHILE/DF064_Tratando_valores(gambiarra).py | Camilla-Carvalho/List-of-algorithms | b7b3a68332b370879351f08566edcd9ce81bfe53 | [
"MIT"
] | null | null | null |
#Soma de vários valores com condição de parada
value = soma = cont = 0
while value != 999:
value = int(input('Digite um número [999 para parar]: '))
if value != 999:
soma += value
cont += 1
else:
soma += value
cont += 1
print(f'Você digitou {cont - 1} números e a som... | 29.266667 | 87 | 0.6082 |
a46d670d7016573f4d985e2aa167a11cbc971365 | 20,443 | py | Python | ansible/library/lambda.py | gshakir/aws-price-api | bcf03bd03eb7b408ba0b5a50620a42c6b36c3b23 | [
"MIT"
] | null | null | null | ansible/library/lambda.py | gshakir/aws-price-api | bcf03bd03eb7b408ba0b5a50620a42c6b36c3b23 | [
"MIT"
] | null | null | null | ansible/library/lambda.py | gshakir/aws-price-api | bcf03bd03eb7b408ba0b5a50620a42c6b36c3b23 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# (c) 2016, Pierre Jodouin <pjodouin@virtualcomputing.solutions>
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | 36.310835 | 135 | 0.652595 |
26685c1ed916123eae87f08fe1a134445d69a752 | 587 | py | Python | examples/ping_client_requests.py | recht/thriftrw-python | aad5ee4e9ca21fe59c9bea479465615ef3825dec | [
"MIT"
] | 40 | 2016-02-18T18:01:23.000Z | 2022-03-31T10:34:33.000Z | examples/ping_client_requests.py | recht/thriftrw-python | aad5ee4e9ca21fe59c9bea479465615ef3825dec | [
"MIT"
] | 56 | 2016-02-10T16:51:07.000Z | 2020-02-07T05:28:49.000Z | examples/ping_client_requests.py | recht/thriftrw-python | aad5ee4e9ca21fe59c9bea479465615ef3825dec | [
"MIT"
] | 12 | 2016-03-29T17:29:28.000Z | 2021-10-30T14:36:39.000Z | from __future__ import absolute_import, unicode_literals, print_function
import os.path
import requests
import thriftrw
ping = thriftrw.load(
os.path.join(os.path.dirname(__file__), 'ping.thrift'),
)
def main():
req = ping.Ping.ping.request('world')
response = requests.post(
'http://127.0.0.1:... | 20.241379 | 72 | 0.666099 |
2842b6288c5162e51f047842f4ea0ee38694a97e | 1,660 | py | Python | chas/client/chaslib/server.py | Owen-Cochell/chas | 303bf090e6db19a326888f3e31268f8035576255 | [
"Apache-2.0"
] | null | null | null | chas/client/chaslib/server.py | Owen-Cochell/chas | 303bf090e6db19a326888f3e31268f8035576255 | [
"Apache-2.0"
] | 1 | 2018-08-09T18:51:43.000Z | 2020-08-31T20:54:00.000Z | chas/client/chaslib/server.py | Owen-Cochell/C.H.A.S | 303bf090e6db19a326888f3e31268f8035576255 | [
"Apache-2.0"
] | null | null | null | # A class representing the CHAS server
# TODO: Add ping, test for socketserver discrepancies, ...
import uuid
class Server:
def __init__(self, chas, ip, port, sck, uu_id):
self.chas = chas # CHAS Masterclass
self.ip = ip # IP Address of the CHAS server
self.port = port # Websocket p... | 24.776119 | 68 | 0.526506 |
99fd402a701bd31d613dabfb6b413198642cdadd | 5,039 | py | Python | films101.py | tgadf/movies | 28ae1a0798029d3d3f1034aba456390d06e7e0dc | [
"MIT"
] | null | null | null | films101.py | tgadf/movies | 28ae1a0798029d3d3f1034aba456390d06e7e0dc | [
"MIT"
] | null | null | null | films101.py | tgadf/movies | 28ae1a0798029d3d3f1034aba456390d06e7e0dc | [
"MIT"
] | null | null | null | import re
from time import sleep
from timeUtils import clock, elapsed
from ioUtils import saveFile, getFile
from fsUtils import setDir, isDir, mkDir, setFile, isFile, setSubFile
from fileUtils import getBaseFilename
from searchUtils import findSubPatternExt, findPatternExt, findExt, findNearest
from strUtils import con... | 39.367188 | 127 | 0.471721 |
3c0c7cb44a0cb191dd8a2386338c09d8e7e5e996 | 22,601 | py | Python | open/Edgecortix/code/mobilenetv2/SingleStream/python/main.py | wom-ai/inference_results_v1.0 | af4bfffd5b6c4815f305a272cb42ae6de09f44e1 | [
"Apache-2.0"
] | null | null | null | open/Edgecortix/code/mobilenetv2/SingleStream/python/main.py | wom-ai/inference_results_v1.0 | af4bfffd5b6c4815f305a272cb42ae6de09f44e1 | [
"Apache-2.0"
] | 24 | 2021-07-19T01:09:35.000Z | 2022-03-17T11:44:02.000Z | open/Edgecortix/code/mobilenetv2/SingleStream/python/main.py | wom-ai/inference_results_v1.0 | af4bfffd5b6c4815f305a272cb42ae6de09f44e1 | [
"Apache-2.0"
] | null | null | null | """
mlperf inference benchmarking tool
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import array
import collections
import json
import logging
import os
import sys
import threading
import time
from queue import Queue
import mlperf_l... | 36.336013 | 124 | 0.633777 |
ed0c05140639b92c31e97ba72cb399dd88caaa87 | 999 | py | Python | examples/opencensus/python-app/app/views.py | gaybro8777/ApplicationInsights-LocalForwarder | fca29ddde58622dcd8ac51f5e16ee0a8c455654c | [
"MIT"
] | 24 | 2018-09-17T15:40:37.000Z | 2019-04-28T11:37:20.000Z | examples/opencensus/python-app/app/views.py | gaybro8777/ApplicationInsights-LocalForwarder | fca29ddde58622dcd8ac51f5e16ee0a8c455654c | [
"MIT"
] | 10 | 2018-08-31T19:15:13.000Z | 2019-03-27T16:25:32.000Z | examples/opencensus/python-app/app/views.py | gaybro8777/ApplicationInsights-LocalForwarder | fca29ddde58622dcd8ac51f5e16ee0a8c455654c | [
"MIT"
] | 9 | 2019-07-02T11:30:02.000Z | 2021-09-18T09:05:48.000Z | from django.http import HttpResponse
from django.shortcuts import render
from opencensus.trace import config_integration
from opencensus.trace.exporters.ocagent import trace_exporter
from opencensus.trace import tracer as tracer_module
from opencensus.trace.propagation.trace_context_http_header_format import TraceCont... | 32.225806 | 96 | 0.811812 |
f54b8c8203744c41fdd5c840c406c09764c530d1 | 10,140 | py | Python | tests/unit/plugins/service/test_gdns_publisher.py | bcleenders/gordon-gcp | 0cd7d154891e94f9b0174bb4d8daa20cff594996 | [
"Apache-2.0"
] | 14 | 2018-02-14T19:29:23.000Z | 2021-09-15T12:15:57.000Z | tests/unit/plugins/service/test_gdns_publisher.py | bcleenders/gordon-gcp | 0cd7d154891e94f9b0174bb4d8daa20cff594996 | [
"Apache-2.0"
] | 101 | 2018-01-02T14:30:48.000Z | 2021-04-08T20:08:24.000Z | tests/unit/plugins/service/test_gdns_publisher.py | bcleenders/gordon-gcp | 0cd7d154891e94f9b0174bb4d8daa20cff594996 | [
"Apache-2.0"
] | 4 | 2018-10-10T19:29:52.000Z | 2022-03-19T09:56:37.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2017 Spotify AB
#
# 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 a... | 30.820669 | 79 | 0.663609 |
bb8ed1633ed071882209b2133f463aaef826d5b6 | 322 | py | Python | smb_report/config/docs.py | bhavesh95863/SMB-Report | 672b6b6ec05382e15d7255c8073e560dffe7e917 | [
"MIT"
] | null | null | null | smb_report/config/docs.py | bhavesh95863/SMB-Report | 672b6b6ec05382e15d7255c8073e560dffe7e917 | [
"MIT"
] | null | null | null | smb_report/config/docs.py | bhavesh95863/SMB-Report | 672b6b6ec05382e15d7255c8073e560dffe7e917 | [
"MIT"
] | null | null | null | """
Configuration for docs
"""
# source_link = "https://github.com/[org_name]/smb_report"
# docs_base_url = "https://[org_name].github.io/smb_report"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"
def get_context(context):
context.brand_html = "Smb Report... | 26.833333 | 68 | 0.726708 |
1b5a41e694514377d8ae94403c7b372695634444 | 1,804 | py | Python | scripts/py_scripts/get_hpo_names.py | Elenadisa/PhenoClusters | 8736c257bf9b498469388afe8df7a41ab7248622 | [
"MIT"
] | null | null | null | scripts/py_scripts/get_hpo_names.py | Elenadisa/PhenoClusters | 8736c257bf9b498469388afe8df7a41ab7248622 | [
"MIT"
] | null | null | null | scripts/py_scripts/get_hpo_names.py | Elenadisa/PhenoClusters | 8736c257bf9b498469388afe8df7a41ab7248622 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import functions as fn
##############################################################################################################################################
# OPTPARSE
########################################################################################################... | 47.473684 | 143 | 0.441796 |
b4ac18f651950bbc63d31233fcaf1be67757871d | 13,964 | py | Python | test/functional/feature_dbcrash.py | raininfotech/Guapcoin | 3df58f6d5ffab0d6c4c97fb79ad9722891fad528 | [
"MIT"
] | null | null | null | test/functional/feature_dbcrash.py | raininfotech/Guapcoin | 3df58f6d5ffab0d6c4c97fb79ad9722891fad528 | [
"MIT"
] | null | null | null | test/functional/feature_dbcrash.py | raininfotech/Guapcoin | 3df58f6d5ffab0d6c4c97fb79ad9722891fad528 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php.
"""Test recovery from a crash during chainstate writing.
- 4 nodes
* node0, node1, and node2 will have... | 47.986254 | 120 | 0.639215 |
570106dad9961824d3a7d1324f945be54cf4e6d5 | 36,457 | py | Python | sympy/geometry/tests/test_line.py | rvbcldud/sympy | 7f6044484997a67c5af7a6319ed46745195d6b0b | [
"BSD-3-Clause"
] | 1 | 2022-02-03T04:35:56.000Z | 2022-02-03T04:35:56.000Z | sympy/geometry/tests/test_line.py | rvbcldud/sympy | 7f6044484997a67c5af7a6319ed46745195d6b0b | [
"BSD-3-Clause"
] | 3 | 2022-02-04T14:45:16.000Z | 2022-02-04T14:45:45.000Z | sympy/geometry/tests/test_line.py | rvbcldud/sympy | 7f6044484997a67c5af7a6319ed46745195d6b0b | [
"BSD-3-Clause"
] | null | null | null | from sympy.core.numbers import (Float, Rational, oo, pi)
from sympy.core.relational import Eq
from sympy.core.singleton import S
from sympy.core.symbol import (Symbol, symbols)
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.functions.elementary.trigonometric import (acos, cos, sin)
from sympy.sets... | 44.030193 | 264 | 0.572538 |
87797d986df11052d6f5abdbf955094f31446415 | 253 | py | Python | apps/api/apps.py | luisito666/Mt2Web.py | e37ca79a5a21373c8b773cf30c622beba6d28ec4 | [
"MIT"
] | 5 | 2018-02-04T05:41:39.000Z | 2021-11-09T10:51:58.000Z | apps/api/apps.py | vps-hosting/Mt2Web.py | e37ca79a5a21373c8b773cf30c622beba6d28ec4 | [
"MIT"
] | 4 | 2020-11-22T16:07:47.000Z | 2022-01-13T03:27:05.000Z | apps/api/apps.py | vps-hosting/Mt2Web.py | e37ca79a5a21373c8b773cf30c622beba6d28ec4 | [
"MIT"
] | 4 | 2018-12-22T23:56:47.000Z | 2021-07-31T11:00:54.000Z | # Copyright (c) 2017-2018 luispenagos91@gmail.com
# Distribuido bajo la licencia MIT Software Licence
# Mas informacion http://www.opensource.org/licenses/mit-license.php
from django.apps import AppConfig
class ApiConfig(AppConfig):
name = 'api'
| 25.3 | 68 | 0.774704 |
43b1d076df4d9abc5091b53124f1c4d3760d0238 | 894 | py | Python | sips/lines/bov/utils/divy.py | AnandIJain/sip | 7eadee83a1bf5d447efd42ebab69197a4e73d52a | [
"MIT"
] | 5 | 2019-09-11T15:44:56.000Z | 2021-06-13T13:53:59.000Z | sips/lines/bov/utils/divy.py | AnandIJain/sip | 7eadee83a1bf5d447efd42ebab69197a4e73d52a | [
"MIT"
] | 19 | 2019-09-26T21:17:24.000Z | 2020-05-03T06:35:33.000Z | sips/lines/bov/utils/divy.py | anandijain/sips | 7eadee83a1bf5d447efd42ebab69197a4e73d52a | [
"MIT"
] | 2 | 2019-09-05T16:55:59.000Z | 2019-09-05T17:22:50.000Z | def divy_games(events):
"""
we want to divy up the games by locations closest to our server.
prereq: dataframe for arena latitude and longitudes,
as well as the events
1. determine location of each game based on home away (in terms of arena)
2. lookup arena to find latitude and lon... | 35.76 | 78 | 0.671141 |
c75552d15441d7d484c6287e36425145c72d0f76 | 3,651 | py | Python | pandas/core/computation/engines.py | developing-coder/pandas | 9feb3ad92cc0397a04b665803a49299ee7aa1037 | [
"BSD-3-Clause"
] | 1 | 2019-05-04T03:42:25.000Z | 2019-05-04T03:42:25.000Z | pandas/core/computation/engines.py | developing-coder/pandas | 9feb3ad92cc0397a04b665803a49299ee7aa1037 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/computation/engines.py | developing-coder/pandas | 9feb3ad92cc0397a04b665803a49299ee7aa1037 | [
"BSD-3-Clause"
] | 1 | 2020-08-21T08:00:10.000Z | 2020-08-21T08:00:10.000Z | """
Engine classes for :func:`~pandas.eval`
"""
import abc
from pandas.core.computation.align import _align, _reconstruct_object
from pandas.core.computation.ops import (
UndefinedVariableError, _mathops, _reductions)
import pandas.io.formats.printing as printing
_ne_builtins = frozenset(_mathops + _reductions)... | 25.006849 | 79 | 0.603944 |
99e1fa07c2d88d2d963a9e7b623ac33db9635c12 | 2,692 | py | Python | pathfinder/backend/size_change.py | Tenebrar/codebase | 59c9a35289fb29afedad0e3edd0519b67372ef9f | [
"Unlicense"
] | 1 | 2020-04-21T11:39:25.000Z | 2020-04-21T11:39:25.000Z | pathfinder/backend/size_change.py | Tenebrar/codebase | 59c9a35289fb29afedad0e3edd0519b67372ef9f | [
"Unlicense"
] | 7 | 2020-02-12T01:08:01.000Z | 2022-02-10T11:56:56.000Z | pathfinder/backend/size_change.py | Tenebrar/codebase | 59c9a35289fb29afedad0e3edd0519b67372ef9f | [
"Unlicense"
] | null | null | null | from typing import Dict
from pathfinder.backend.dice import Dice, DieType
from pathfinder.charsheet.constants import Size
DICE_PROGRESSION_CHART: Dict[Dice, int] = {
Dice(1, DieType.D1): 1,
Dice(1, DieType.D2): 2,
Dice(1, DieType.D3): 3,
Dice(1, DieType.D4): 4,
Dice(1, DieType.D6): 5,
Dice(1,... | 34.512821 | 111 | 0.640416 |
5bce8a96fc34357aefc2eead17a45ec24add2ebb | 838 | py | Python | boa/tests/src/blockchain/SignatureTest.py | chisleu/neo-boa | 799bb37f7e7862215f94f479cfe74a4dd4b8cba2 | [
"MIT"
] | 2 | 2017-11-27T08:45:34.000Z | 2021-03-08T03:08:56.000Z | boa/tests/src/blockchain/SignatureTest.py | chisleu/neo-boa | 799bb37f7e7862215f94f479cfe74a4dd4b8cba2 | [
"MIT"
] | 2 | 2018-02-13T07:30:09.000Z | 2021-06-01T22:02:52.000Z | boa/tests/src/blockchain/SignatureTest.py | localhuman/neo-boa | 799bb37f7e7862215f94f479cfe74a4dd4b8cba2 | [
"MIT"
] | null | null | null | from boa.code.builtins import verify_signature
from boa.blockchain.vm.Neo.Runtime import CheckWitness, Notify
OWNER_PUBKEY = b'\x02\xf7\xbchi\xdf-\xbew\xa6bE\x11\x16\xcc\x99\x9cx\xc3^\xedA\xa11c\x17\xa3\xef\xe3c@t2'
# this is the ScriptHash of the address that created the contract
# the hex string is b'f223483e4287... | 23.277778 | 105 | 0.700477 |
cb140d5f956694986dc62192aff61de78e7bb108 | 3,315 | py | Python | oscn/request/cases.py | kendallcorner/oscn | 6ba2d939b27d0d54af236e14f8a6b3f5f2aa995c | [
"MIT"
] | null | null | null | oscn/request/cases.py | kendallcorner/oscn | 6ba2d939b27d0d54af236e14f8a6b3f5f2aa995c | [
"MIT"
] | null | null | null | oscn/request/cases.py | kendallcorner/oscn | 6ba2d939b27d0d54af236e14f8a6b3f5f2aa995c | [
"MIT"
] | null | null | null | import requests
import warnings
from . import settings
from oscn.parse import append_parsers
oscn_url = settings.OSCN_URL
warnings.filterwarnings("ignore")
class OSCNrequest(object):
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome... | 28.826087 | 145 | 0.572851 |
5d186ebd92623d3ffd32246734ea40230e3cf64c | 855 | py | Python | arrays_strings/permutation/test_permutation_solution.py | rubenparedes0796/interactive-coding-challenges | 4a942ff7a8b4a78052eae7e2b33d129683796570 | [
"Apache-2.0"
] | 27,173 | 2015-07-06T12:36:05.000Z | 2022-03-31T23:56:41.000Z | arrays_strings/permutation/test_permutation_solution.py | govind527/interactive-coding-challenges | 358f2cc60426d5c4c3d7d580910eec9a7b393fa9 | [
"Apache-2.0"
] | 143 | 2015-07-07T05:13:11.000Z | 2021-12-07T17:05:54.000Z | arrays_strings/permutation/test_permutation_solution.py | govind527/interactive-coding-challenges | 358f2cc60426d5c4c3d7d580910eec9a7b393fa9 | [
"Apache-2.0"
] | 4,657 | 2015-07-06T13:28:02.000Z | 2022-03-31T10:11:28.000Z | import unittest
class TestPermutation(unittest.TestCase):
def test_permutation(self, func):
self.assertEqual(func(None, 'foo'), False)
self.assertEqual(func('', 'foo'), False)
self.assertEqual(func('Nib', 'bin'), False)
self.assertEqual(func('act', 'cat'), True)
self.asser... | 27.580645 | 62 | 0.647953 |
c282f14ff98583ee6a78ba1b309581830c65f705 | 5,998 | py | Python | docspring/models/combined_submission_data.py | DocSpring/docspring-python | 5afc7c88bdb52a96346364ff7dd2c7474a73c3de | [
"MIT"
] | null | null | null | docspring/models/combined_submission_data.py | DocSpring/docspring-python | 5afc7c88bdb52a96346364ff7dd2c7474a73c3de | [
"MIT"
] | null | null | null | docspring/models/combined_submission_data.py | DocSpring/docspring-python | 5afc7c88bdb52a96346364ff7dd2c7474a73c3de | [
"MIT"
] | 1 | 2020-12-20T05:14:04.000Z | 2020-12-20T05:14:04.000Z | # coding: utf-8
"""
API v1
DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501
OpenAPI spec version: v1
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class CombinedSubmissionData(object):
"""NOTE: This class... | 27.513761 | 116 | 0.588696 |
582d598c3f2e9089bb78a3f2fdac5ecac00c9b17 | 8,010 | py | Python | src/modules/hunting/cves.py | maorkuriel/kube-hunter | e0bacd6e7bd5e728ad3c6010904574adb1687dc5 | [
"Apache-2.0"
] | 1 | 2019-09-25T12:31:33.000Z | 2019-09-25T12:31:33.000Z | src/modules/hunting/cves.py | maorkuriel/kube-hunter | e0bacd6e7bd5e728ad3c6010904574adb1687dc5 | [
"Apache-2.0"
] | null | null | null | src/modules/hunting/cves.py | maorkuriel/kube-hunter | e0bacd6e7bd5e728ad3c6010904574adb1687dc5 | [
"Apache-2.0"
] | null | null | null | import logging
import json
import requests
from ...core.events import handler
from ...core.events.types import Vulnerability, Event, K8sVersionDisclosure
from ...core.types import Hunter, ActiveHunter, KubernetesCluster, RemoteCodeExec, AccessRisk, InformationDisclosure, \
PrivilegeEscalation, DenialOfService, Kub... | 47.117647 | 140 | 0.691511 |
2abf8b2d50aceaaed72bc9069a0c99290023b534 | 495 | py | Python | src/logChunk/chunkingConstants.py | Yagniksuchak/CodeParser | 8bf1a7432aba44e982f94d4525607d738bac658a | [
"BSD-3-Clause"
] | 1 | 2016-03-14T01:45:35.000Z | 2016-03-14T01:45:35.000Z | src/logChunk/chunkingConstants.py | Yagniksuchak/CodeParser | 8bf1a7432aba44e982f94d4525607d738bac658a | [
"BSD-3-Clause"
] | null | null | null | src/logChunk/chunkingConstants.py | Yagniksuchak/CodeParser | 8bf1a7432aba44e982f94d4525607d738bac658a | [
"BSD-3-Clause"
] | null | null | null | #Constants for the keywords
SINGLE = "single"
BLOCK = "block"
INCLUDED = "included"
EXCLUDED = "excluded"
KEYLISTSIZE = 3
#Constants for which phase we are in
LOOKFORNAME = 1
LOOKFOREND = 2
LOOKFOREXCP = 3
LOOKFOREXCPEND = 4
#LineTypes
ADD = 1
REMOVE = 2
OTHER = 3
#Scope Change directions
INCREASE = 1
DECREASE = 2
... | 15 | 49 | 0.735354 |
bcd25bf5cbd01829b08ef433dbbcaa0161f4616d | 3,982 | py | Python | ceilometer/sample.py | andymcc/ceilometer | fa3b047eb17152b30829eadd9220f12ca9949b4f | [
"Apache-2.0"
] | null | null | null | ceilometer/sample.py | andymcc/ceilometer | fa3b047eb17152b30829eadd9220f12ca9949b4f | [
"Apache-2.0"
] | null | null | null | ceilometer/sample.py | andymcc/ceilometer | fa3b047eb17152b30829eadd9220f12ca9949b4f | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
# Copyright 2013 eNovance
#
# 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 ... | 34.327586 | 79 | 0.65344 |
9b787e9efb86b034c5d70e5b8019a9097ae5fe13 | 8,388 | py | Python | scripts/build/builders/android.py | rachel-li-jci/connectedhomeip | 7200076e7c690d9fbad4c1d3d13db1d11d87d259 | [
"Apache-2.0"
] | null | null | null | scripts/build/builders/android.py | rachel-li-jci/connectedhomeip | 7200076e7c690d9fbad4c1d3d13db1d11d87d259 | [
"Apache-2.0"
] | 1 | 2021-06-16T08:38:45.000Z | 2021-06-16T08:38:45.000Z | scripts/build/builders/android.py | rachel-li-jci/connectedhomeip | 7200076e7c690d9fbad4c1d3d13db1d11d87d259 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 Project CHIP 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 or agreed to in ... | 41.731343 | 108 | 0.584645 |
2e194b8d8eba05ea79c0966ccc9cee208fc63a6c | 3,065 | py | Python | extract_notes.py | margrietpalm/reveal_tools | 4e1b9d421fcbab0d2be7a66c0d3690c3c7229804 | [
"MIT"
] | null | null | null | extract_notes.py | margrietpalm/reveal_tools | 4e1b9d421fcbab0d2be7a66c0d3690c3c7229804 | [
"MIT"
] | null | null | null | extract_notes.py | margrietpalm/reveal_tools | 4e1b9d421fcbab0d2be7a66c0d3690c3c7229804 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Clean up images folder for reveal presentation"""
# rom optparse import OptionParser
import argparse
import sys
import os
import glob
import shutil
import future
from itertools import groupby
from operator import itemgetter
__author__ = "Margriet Palm"
__copyright__ = "Copyright 2018"
__credi... | 31.927083 | 120 | 0.585971 |
637488264a3624069b06a94000425c17f46c7f69 | 713 | py | Python | test/conanfile.py | kannkyo/boilerplate-conan | 3621fd0a4dad2bcf746fb6ad3b78f99554708e50 | [
"MIT"
] | null | null | null | test/conanfile.py | kannkyo/boilerplate-conan | 3621fd0a4dad2bcf746fb6ad3b78f99554708e50 | [
"MIT"
] | 1 | 2021-11-05T22:33:34.000Z | 2021-11-05T22:33:34.000Z | test/conanfile.py | kannkyo/boilerplate-conan | 3621fd0a4dad2bcf746fb6ad3b78f99554708e50 | [
"MIT"
] | null | null | null | import os
from conans import ConanFile, CMake, tools
class SampleTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
requires = "cunit/2.1.3"
def build(self):
cmake = CMake(self)
# Current dir is "test_package/build/<build_id>" and CMakeLists.... | 26.407407 | 78 | 0.570827 |
791b25d466d7f1dc79e978d2eb34a6779a7fc0df | 4,793 | py | Python | lib/gps.py | ifurusato/ros | 77b1361e78f68f00ba2d3e3db908bb5ce0f973f5 | [
"MIT"
] | 9 | 2020-10-12T08:49:55.000Z | 2021-07-23T14:20:05.000Z | lib/gps.py | fanmuzhi/ros | 04534a35901341c4aaa9084bff3d46851795357d | [
"MIT"
] | 12 | 2020-07-22T19:08:58.000Z | 2022-02-03T03:17:03.000Z | lib/gps.py | fanmuzhi/ros | 04534a35901341c4aaa9084bff3d46851795357d | [
"MIT"
] | 3 | 2020-07-19T20:43:19.000Z | 2022-03-02T09:15:51.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2021 by Murray Altheim. All rights reserved. This file is part
# of the Robot Operating System project, released under the MIT License. Please
# see the LICENSE file included as part of this package.
#
# author: Murray Altheim
# created: 2021-03-06
# ... | 35.768657 | 170 | 0.440851 |
3ae332081debc19c5bfb920e480a08600d912fbb | 10,064 | py | Python | src/storage-blob-preview/azext_storage_blob_preview/tests/latest/test_storage_blob_live_scenarios.py | ConnectionMaster/azure-cli-extensions | 08d184f4efeac397c1ffcd21a83d651f4fad2782 | [
"MIT"
] | 2 | 2021-06-05T17:51:26.000Z | 2021-11-17T11:17:56.000Z | src/storage-blob-preview/azext_storage_blob_preview/tests/latest/test_storage_blob_live_scenarios.py | ConnectionMaster/azure-cli-extensions | 08d184f4efeac397c1ffcd21a83d651f4fad2782 | [
"MIT"
] | 1 | 2020-06-12T01:39:40.000Z | 2020-06-12T01:39:40.000Z | src/storage-blob-preview/azext_storage_blob_preview/tests/latest/test_storage_blob_live_scenarios.py | ConnectionMaster/azure-cli-extensions | 08d184f4efeac397c1ffcd21a83d651f4fad2782 | [
"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.
# --------------------------------------------------------------------... | 54.107527 | 118 | 0.641494 |
e7a19b279b17bf722890f1c9d4e35480da127ad5 | 1,149 | py | Python | setup.py | pannkotsky/graphene-field-permission | 75306a09e89949915cc82ca32aa2eca88d3f7016 | [
"MIT"
] | 9 | 2019-02-23T05:09:14.000Z | 2022-03-11T00:22:36.000Z | setup.py | pannkotsky/graphene-field-permission | 75306a09e89949915cc82ca32aa2eca88d3f7016 | [
"MIT"
] | null | null | null | setup.py | pannkotsky/graphene-field-permission | 75306a09e89949915cc82ca32aa2eca88d3f7016 | [
"MIT"
] | 2 | 2020-12-07T22:32:10.000Z | 2022-01-25T15:36:03.000Z | import setuptools
from os import sys
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
with open('README.md') as readme:
long_description = readme.read()
setuptools.setup(
name="graphene-field-permission",
version="1.0.0",
author... | 31.916667 | 73 | 0.651871 |
d4818cf6e04e375a9dbddea8d4363e96e8a47060 | 927 | py | Python | example/conftest.py | Euraxluo/dynamic_config | 7c6e0881159e5334f44b70eb704eb179d03f9287 | [
"MIT"
] | null | null | null | example/conftest.py | Euraxluo/dynamic_config | 7c6e0881159e5334f44b70eb704eb179d03f9287 | [
"MIT"
] | null | null | null | example/conftest.py | Euraxluo/dynamic_config | 7c6e0881159e5334f44b70eb704eb179d03f9287 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Time: 2022-02-11 11:59
# Copyright (c) 2022
# author: Euraxluo
import redis # type:ignore
import json
from typing import Union, Callable
class RedisHelper(object):
def __init__(self, host='127.0.0.1', port='6379', db=1, password='redis', decode_responses=False):
redis.Connec... | 25.75 | 123 | 0.644013 |
78ac0640d93b59b3b4d5477cdf9990558d888a26 | 11,255 | py | Python | src/de5000.py | 4x1md/de5000_lcr_python | abfbe5d605f0e9d6928119f4be904a382d0c14a0 | [
"MIT"
] | 8 | 2018-08-08T22:52:21.000Z | 2021-06-10T07:29:40.000Z | src/de5000.py | 4x1md/de5000_lcr_python | abfbe5d605f0e9d6928119f4be904a382d0c14a0 | [
"MIT"
] | 1 | 2019-03-29T19:23:28.000Z | 2019-03-29T19:23:28.000Z | src/de5000.py | 4x1md/de5000_lcr_python | abfbe5d605f0e9d6928119f4be904a382d0c14a0 | [
"MIT"
] | 2 | 2018-08-08T22:52:24.000Z | 2019-03-31T00:26:16.000Z | '''
Created on Sep 15, 2017
@author: 4x1md
Serial port settings: 9600 8N1 DTR=1 RTS=0
'''
import serial
# Settings constants
BAUD_RATE = 9600
BITS = serial.EIGHTBITS
PARITY = serial.PARITY_NONE
STOP_BITS = serial.STOPBITS_ONE
TIMEOUT = 1
# Data packet ends with CR LF (\r \n) characters
EOL = b'\x0D\x0A'
RAW_DATA_L... | 26.358314 | 99 | 0.525722 |
d693426256bdf2e623fcb3060e05c85caa7828d1 | 6,196 | py | Python | parlai/core/testing_utils.py | cherie11/ParlAI | 1c1e4b00b398278b652c24ed5cac072cff6a9c9a | [
"MIT"
] | 3 | 2020-12-04T07:29:18.000Z | 2021-04-08T06:23:20.000Z | parlai/core/testing_utils.py | cherie11/ParlAI | 1c1e4b00b398278b652c24ed5cac072cff6a9c9a | [
"MIT"
] | null | null | null | parlai/core/testing_utils.py | cherie11/ParlAI | 1c1e4b00b398278b652c24ed5cac072cff6a9c9a | [
"MIT"
] | 1 | 2020-12-04T07:29:04.000Z | 2020-12-04T07:29:04.000Z | #!/usr/bin/env python
# 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.
"""
General utilities for helping writing ParlAI unit and integration tests.
"""
import os
import unittest
import contex... | 26.706897 | 83 | 0.641059 |
cabd876d0a79abfc7f8a1a79c68e05c0438d9b8a | 2,230 | py | Python | Data collection/scriptSf.py | PAMepi/PAMepi_scripts_datalake | 3b268a09c69c5120fa71611983e23f224df0a5e3 | [
"MIT"
] | 2 | 2021-12-07T09:00:47.000Z | 2022-03-30T20:39:33.000Z | Data collection/scriptSf.py | PAMepi/PAMepi_scripts_datalake | 3b268a09c69c5120fa71611983e23f224df0a5e3 | [
"MIT"
] | null | null | null | Data collection/scriptSf.py | PAMepi/PAMepi_scripts_datalake | 3b268a09c69c5120fa71611983e23f224df0a5e3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import pathlib
from datetime import datetime
import requests
from bs4 import BeautifulSoup
from tqdm import tqdm
from config import DATALAKE
raw = 'raw_data_covid19_version-' + datetime.now().strftime('%Y-%m-%d')
output_sg = os.path.join(DATALAKE, raw, 'data-notificacao_sindrome_gri... | 31.857143 | 83 | 0.575785 |
021a0a73a077b0a4efe50c98eaca50da84c2e78f | 2,067 | py | Python | elixir_rems_proxy/config/jwks.py | CSCfi/elixir-rems-proxy | 8f3f3e02880fedd22902a53c1ff650e753fb9c03 | [
"MIT"
] | 1 | 2018-08-29T08:33:06.000Z | 2018-08-29T08:33:06.000Z | elixir_rems_proxy/config/jwks.py | CSCfi/elixir-rems-proxy | 8f3f3e02880fedd22902a53c1ff650e753fb9c03 | [
"MIT"
] | 19 | 2018-09-21T08:11:24.000Z | 2020-09-07T12:30:29.000Z | elixir_rems_proxy/config/jwks.py | CSCfi/elixir-rems-proxy | 8f3f3e02880fedd22902a53c1ff650e753fb9c03 | [
"MIT"
] | null | null | null | """JWK Generator."""
import json
import os
import secrets
from pathlib import Path
from typing import Tuple
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends import default_backend
from authlib.jose import jwk
def prin... | 40.529412 | 147 | 0.726173 |
c3d8e30064cd8c63cede7f3244c6cee23272555b | 325 | py | Python | April 2021/Count Binary Substrings.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | April 2021/Count Binary Substrings.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | April 2021/Count Binary Substrings.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | class Solution:
def countBinarySubstrings(self, s):
ans, prev, cur = 0, 0, 1
for i in range(1, len(s)):
if s[i] != s[i-1]:
ans += min(prev, cur)
prev, cur = cur, 1
else:
cur += 1
return ans + min(prev, ... | 25 | 39 | 0.396923 |
0616ccdae5aa312b65ea4688dc5efc06435f24b9 | 7,862 | py | Python | userbot/plugins/filemanager.py | indianSammy07/Wolf | aba9ecce1860f86f81a52722062531590521ad7f | [
"MIT"
] | 1 | 2020-08-30T07:57:50.000Z | 2020-08-30T07:57:50.000Z | userbot/plugins/filemanager.py | indianSammy07/Wolf | aba9ecce1860f86f81a52722062531590521ad7f | [
"MIT"
] | null | null | null | userbot/plugins/filemanager.py | indianSammy07/Wolf | aba9ecce1860f86f81a52722062531590521ad7f | [
"MIT"
] | 3 | 2020-12-06T23:40:55.000Z | 2020-12-18T17:38:36.000Z | """Execute GNU/Linux commands inside Telegram
Syntax: .lsroot , .lslocal"""
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from telethon import events
import subprocess... | 33.887931 | 91 | 0.616764 |
a724f41118084f0fc1f47dae0dd809a445be3dca | 276 | py | Python | tests/basics/fun_name.py | learnforpractice/micropython-cpp | 004bc8382f74899e7b876cc29bfa6a9cc976ba10 | [
"MIT"
] | 53 | 2018-12-12T15:36:54.000Z | 2021-12-06T18:31:12.000Z | tests/basics/fun_name.py | learnforpractice/micropython-cpp | 004bc8382f74899e7b876cc29bfa6a9cc976ba10 | [
"MIT"
] | 175 | 2018-05-30T03:06:15.000Z | 2019-02-06T23:54:24.000Z | tests/basics/fun_name.py | learnforpractice/micropython-cpp | 004bc8382f74899e7b876cc29bfa6a9cc976ba10 | [
"MIT"
] | 16 | 2016-09-13T17:56:59.000Z | 2022-01-02T09:19:59.000Z | def Fun():
pass
class A:
def __init__(self):
pass
def Fun(self):
pass
try:
print(Fun.__name__)
print(A.__init__.__name__)
print(A.Fun.__name__)
print(A().Fun.__name__)
except AttributeError:
print('SKIP')
raise SystemExit
| 15.333333 | 30 | 0.608696 |
3572a2cb07d95ffaec261bdc63492ade734ea8b9 | 596 | py | Python | python/paddle/trainer_config_helpers/tests/configs/test_detection_output_layer.py | shenchaohua/Paddle | 9c5942db13308d53cc115708058c1e885f4b57a3 | [
"Apache-2.0"
] | 3 | 2018-04-16T23:35:32.000Z | 2019-08-12T01:01:07.000Z | python/paddle/trainer_config_helpers/tests/configs/test_detection_output_layer.py | shenchaohua/Paddle | 9c5942db13308d53cc115708058c1e885f4b57a3 | [
"Apache-2.0"
] | 9 | 2017-09-13T07:39:31.000Z | 2017-10-18T05:58:23.000Z | python/paddle/trainer_config_helpers/tests/configs/test_detection_output_layer.py | shenchaohua/Paddle | 9c5942db13308d53cc115708058c1e885f4b57a3 | [
"Apache-2.0"
] | 2 | 2020-11-04T08:07:46.000Z | 2020-11-06T08:33:24.000Z | from paddle.trainer_config_helpers import *
settings(batch_size=1000, learning_rate=1e-5)
input_loc = data_layer(name='input_loc', size=16, height=16, width=1)
input_conf = data_layer(name='input_conf', size=8, height=1, width=8)
priorbox = data_layer(name='priorbox', size=32, height=4, width=8)
detout = detection... | 24.833333 | 69 | 0.738255 |
40fe350bfcb0fece3168bfced6c0b135fab3f5c9 | 771 | py | Python | Kaggle-Expedia/test_read_csv.py | ppik/playdata | 62612dbaf26ed139d0ced800d199b897a0f2ba01 | [
"MIT"
] | null | null | null | Kaggle-Expedia/test_read_csv.py | ppik/playdata | 62612dbaf26ed139d0ced800d199b897a0f2ba01 | [
"MIT"
] | null | null | null | Kaggle-Expedia/test_read_csv.py | ppik/playdata | 62612dbaf26ed139d0ced800d199b897a0f2ba01 | [
"MIT"
] | 1 | 2021-06-19T19:27:28.000Z | 2021-06-19T19:27:28.000Z | import os
import timeit
import sys
def time_read_csv(filename, numlines=10, numtries=10):
s = 'pd.read_csv("{}", nrows={:d})'.format(filename, numlines)
setup = 'import pandas as pd'
return timeit.timeit(stmt=s, setup=setup, number=numtries)
if __name__=='__main__':
filename = 'data/train.csv'
num... | 28.555556 | 77 | 0.61738 |
e5839ba8d36da2f4068ddc00efdf2a33ad90dded | 9,931 | py | Python | detect.py | Dishant-P/S-Extension-patch-Official-research-module | 6f1c887874b9afd4a9765d04821cbcdfc1113271 | [
"MIT"
] | 1 | 2021-09-07T16:25:04.000Z | 2021-09-07T16:25:04.000Z | detect.py | Dishant-P/S-Extension-patch-Official-research-module | 6f1c887874b9afd4a9765d04821cbcdfc1113271 | [
"MIT"
] | null | null | null | detect.py | Dishant-P/S-Extension-patch-Official-research-module | 6f1c887874b9afd4a9765d04821cbcdfc1113271 | [
"MIT"
] | null | null | null | import argparse
import time
from pathlib import Path
import cv2
import torch
import torch.backends.cudnn as cudnn
from numpy import random
from models.experimental import attempt_load
from utils.datasets import LoadStreams, LoadImages
from utils.general import check_img_size, check_requirements, check_imshow, non_max... | 48.208738 | 156 | 0.593596 |
e46e5b24da35dbf48dc9bf61f34bd8a29a2c0b37 | 12,695 | py | Python | PostDiffMixture/simulations_folder/Old/checkpickle_simbased_bsprop_armprob_EFFECT_backup.py | SIGKDDanon/SIGKDD2021DeAnonV2 | 76f0373ec42ab55feefed3f4ce4bf4d532b51dd2 | [
"Apache-2.0"
] | null | null | null | PostDiffMixture/simulations_folder/Old/checkpickle_simbased_bsprop_armprob_EFFECT_backup.py | SIGKDDanon/SIGKDD2021DeAnonV2 | 76f0373ec42ab55feefed3f4ce4bf4d532b51dd2 | [
"Apache-2.0"
] | null | null | null | PostDiffMixture/simulations_folder/Old/checkpickle_simbased_bsprop_armprob_EFFECT_backup.py | SIGKDDanon/SIGKDD2021DeAnonV2 | 76f0373ec42ab55feefed3f4ce4bf4d532b51dd2 | [
"Apache-2.0"
] | null | null | null | import matplotlib
matplotlib.use('Agg')
import pickle
import os
import pandas as pd
import matplotlib.pyplot as plt
# print(data)
import numpy as np
import os
from scipy import stats
from matplotlib.pyplot import figure
import glob
import numpy as np
#import explorE_delete as ed
#figure(num=None, figsize=(15, 15), dp... | 39.303406 | 172 | 0.578968 |
9b718c18612170b944fbad3d099770130031b6c3 | 6,734 | py | Python | redisrpc/base.py | munisisazade/redis-pub-sub | 782d556e2ebdd8839edaeef8678f94db0c4e6a54 | [
"MIT"
] | 2 | 2020-03-16T07:14:32.000Z | 2021-02-14T11:19:37.000Z | redisrpc/base.py | munisisazade/redis-pub-sub | 782d556e2ebdd8839edaeef8678f94db0c4e6a54 | [
"MIT"
] | null | null | null | redisrpc/base.py | munisisazade/redis-pub-sub | 782d556e2ebdd8839edaeef8678f94db0c4e6a54 | [
"MIT"
] | 2 | 2020-01-26T15:07:56.000Z | 2021-04-03T17:48:13.000Z | import os
import time
import base64
import json
import uuid
import platform
import itertools
import datetime
import traceback
from urllib.parse import urlparse
from redisrpc.version import VERSION
try:
import redis
except:
pass
class BasePubSub(object):
"""
Base publish–subscribe is a
mes... | 37.831461 | 120 | 0.472973 |
54686bcaea51ab1ca85cc3e6940a25c2dfa5b505 | 2,631 | py | Python | benchmarks/report.py | nammingi/haste | 459608cfdb4de4d28d2213df8e71f005be8d0f35 | [
"Apache-2.0"
] | 291 | 2020-01-29T19:46:28.000Z | 2022-03-31T22:41:27.000Z | benchmarks/report.py | nammingi/haste | 459608cfdb4de4d28d2213df8e71f005be8d0f35 | [
"Apache-2.0"
] | 43 | 2020-02-24T22:25:13.000Z | 2022-03-07T20:08:43.000Z | benchmarks/report.py | nammingi/haste | 459608cfdb4de4d28d2213df8e71f005be8d0f35 | [
"Apache-2.0"
] | 28 | 2020-02-07T02:51:19.000Z | 2022-01-12T08:44:15.000Z | # Copyright 2020 LMNT, 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 applicable law or agr... | 36.041096 | 98 | 0.630179 |
2a0fef16f5bbc828fcb24e658d0454f825452eab | 9,064 | py | Python | edparser/transform/txt.py | attardi/iwpt-shared-task-2020 | 3a70c42d53716678776afcccf02d896655777353 | [
"Apache-2.0"
] | 3 | 2020-06-16T12:58:57.000Z | 2021-06-07T21:07:37.000Z | edparser/transform/txt.py | attardi/iwpt-shared-task-2020 | 3a70c42d53716678776afcccf02d896655777353 | [
"Apache-2.0"
] | 6 | 2020-06-22T07:46:49.000Z | 2022-02-10T02:22:14.000Z | edparser/transform/txt.py | attardi/iwpt-shared-task-2020 | 3a70c42d53716678776afcccf02d896655777353 | [
"Apache-2.0"
] | 2 | 2020-06-27T07:32:43.000Z | 2020-11-10T07:21:03.000Z | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-10-24 15:07
import functools
from abc import ABC
from typing import Tuple, Union, List, Iterable
import tensorflow as tf
from edparser.common.transform_tf import Transform
from edparser.common.vocab_tf import VocabTF
from edparser.utils.io_util import get_resource
... | 38.570213 | 122 | 0.575905 |
74e3bce185f65bb181c055a03eae589a3e663533 | 6,322 | py | Python | PythonClient/multirotor/wav_reader.py | altay13/AirSim | a42fb69e6a692ec154f25abd80c0b49ef45caac4 | [
"MIT"
] | 6,115 | 2019-05-07T05:29:14.000Z | 2022-03-31T12:46:36.000Z | PythonClient/multirotor/wav_reader.py | altay13/AirSim | a42fb69e6a692ec154f25abd80c0b49ef45caac4 | [
"MIT"
] | 2,306 | 2019-05-07T00:17:31.000Z | 2022-03-31T23:31:46.000Z | PythonClient/multirotor/wav_reader.py | altay13/AirSim | a42fb69e6a692ec154f25abd80c0b49ef45caac4 | [
"MIT"
] | 2,059 | 2019-05-07T03:07:43.000Z | 2022-03-31T06:31:19.000Z | ###################################################################################################
#
# Project: Embedded Learning Library (ELL)
# File: wav_reader.py
# Authors: Chris Lovett
#
# Requires: Python 3.x
#
############################################################################################... | 39.761006 | 112 | 0.600601 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.