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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ef61351bdd2b7617d556d6d5e459aac9191e5266 | 812 | py | Python | exercises/11-python-beyond-basics-exercise-files/exceptions/median.py | deskach/pybasics | 75372aa8b795fb4608e7cf2f5ccb276da980e8d0 | [
"MIT"
] | null | null | null | exercises/11-python-beyond-basics-exercise-files/exceptions/median.py | deskach/pybasics | 75372aa8b795fb4608e7cf2f5ccb276da980e8d0 | [
"MIT"
] | null | null | null | exercises/11-python-beyond-basics-exercise-files/exceptions/median.py | deskach/pybasics | 75372aa8b795fb4608e7cf2f5ccb276da980e8d0 | [
"MIT"
] | null | null | null | def median(iterable):
"""Obtain the central value of a series.
Sorts the iterable and returns the middle value if there is an even
number of elements, or the arithmetic mean of the middle two elements
if there is an even number of elements.
Args:
iterable: A series of orderable items.
... | 26.193548 | 73 | 0.615764 |
50bc085ba41865e859dffd4d157dfa80e7e1169d | 248 | py | Python | today/manage.py | AbhiAgarwal/prototyping-django | af3bdd242cf29340ffa61752def497260464af2c | [
"MIT"
] | 6 | 2016-01-21T14:59:22.000Z | 2016-04-26T08:47:02.000Z | today/manage.py | AbhiAgarwal/prototyping-django | af3bdd242cf29340ffa61752def497260464af2c | [
"MIT"
] | null | null | null | today/manage.py | AbhiAgarwal/prototyping-django | af3bdd242cf29340ffa61752def497260464af2c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "today.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 22.545455 | 69 | 0.770161 |
d79d3d6333e0c8be5aef7d0e6a9d0f124c83a7b6 | 1,496 | py | Python | kubespawner/clients.py | kafonek/kubespawner | 386a24c8085d90de21c498c50484db4a236479c9 | [
"BSD-3-Clause"
] | null | null | null | kubespawner/clients.py | kafonek/kubespawner | 386a24c8085d90de21c498c50484db4a236479c9 | [
"BSD-3-Clause"
] | null | null | null | kubespawner/clients.py | kafonek/kubespawner | 386a24c8085d90de21c498c50484db4a236479c9 | [
"BSD-3-Clause"
] | null | null | null | """Shared clients for kubernetes
avoids creating multiple kubernetes client objects,
each of which spawns an unused max-size thread pool
"""
import weakref
from unittest.mock import Mock
import kubernetes.client
from kubernetes.client import api_client
# FIXME: remove when instantiating a kubernetes client
# doesn't... | 32.521739 | 67 | 0.733957 |
7e77b586162d317a1a617e92e60d42106e37f394 | 248 | py | Python | venv/Classes/aula08c.py | jonassignoreti/Python-CursoemVideo | 24f5932bed2fe98308321be7dd9326e65a942d4b | [
"MIT"
] | null | null | null | venv/Classes/aula08c.py | jonassignoreti/Python-CursoemVideo | 24f5932bed2fe98308321be7dd9326e65a942d4b | [
"MIT"
] | null | null | null | venv/Classes/aula08c.py | jonassignoreti/Python-CursoemVideo | 24f5932bed2fe98308321be7dd9326e65a942d4b | [
"MIT"
] | null | null | null | import emoji #adicione uma biblioteca externa clicando sobre ela após escrita, e instalando.
# https://pypi.org/project/emoji/ neste site há todas as funcionalidades desta biblioteca
print(emoji.emojize('Olá Mundo :sunglasses:', use_aliases=True))
| 62 | 92 | 0.802419 |
df7ccf3a4ad7f745795d6cdbb92cbe426881bc73 | 1,761 | py | Python | Homework/Class 16/scrape_nfl.py | pratheekrebala/SMPA-SystemsForReporting | 131d56b6a2c83312d35ac24726eb007ccf77b7e9 | [
"MIT"
] | null | null | null | Homework/Class 16/scrape_nfl.py | pratheekrebala/SMPA-SystemsForReporting | 131d56b6a2c83312d35ac24726eb007ccf77b7e9 | [
"MIT"
] | null | null | null | Homework/Class 16/scrape_nfl.py | pratheekrebala/SMPA-SystemsForReporting | 131d56b6a2c83312d35ac24726eb007ccf77b7e9 | [
"MIT"
] | null | null | null | import csv
import requests
from bs4 import BeautifulSoup
from urllib.parse import urljoin
import time
import itertools
URL = 'http://m.nationals.mlb.com/js/roster/transactions/%d/%d?v=1000'
YEARS = [2015, 2016, 2017]
all_pages_rows = []
all_pages_headers = []
def parseTable(table, id):
list_of_rows = []
hea... | 33.865385 | 75 | 0.621806 |
a87f56f126921edc5016cee143f47ebd082a3a40 | 312 | py | Python | mundo-3/ex095.py | RaoniSilvestre/Exercicios-Python | d840a9471dc0ddf805ead0c63f9be5de0fb375af | [
"MIT"
] | 2 | 2021-05-06T20:36:36.000Z | 2022-02-17T13:50:07.000Z | mundo-3/ex095.py | RaoniSilvestre/Exercicios-Python | d840a9471dc0ddf805ead0c63f9be5de0fb375af | [
"MIT"
] | null | null | null | mundo-3/ex095.py | RaoniSilvestre/Exercicios-Python | d840a9471dc0ddf805ead0c63f9be5de0fb375af | [
"MIT"
] | 1 | 2021-05-26T02:24:04.000Z | 2021-05-26T02:24:04.000Z | jogadores = []
jogador = {}
gols = []
while True:
jogador['nome'] = str(input('Nome do jogador: '))
jogador['partidas'] = int(input(f'Quantas partidas {jogador["nome"]} jogou?'))
for c in range(0, len(jogador)):
gols.append(int(input(f'Gol na partida {c}: ')))
jogador['gol'] = gols
| 28.363636 | 82 | 0.589744 |
807132fed933484066c57fb17c180fe9c5f02e69 | 1,007 | py | Python | setup.py | iamdanialkamali/hazm | 7e0928aac9b4f1806cf522cade3cdf9f172629d6 | [
"MIT"
] | null | null | null | setup.py | iamdanialkamali/hazm | 7e0928aac9b4f1806cf522cade3cdf9f172629d6 | [
"MIT"
] | null | null | null | setup.py | iamdanialkamali/hazm | 7e0928aac9b4f1806cf522cade3cdf9f172629d6 | [
"MIT"
] | null | null | null |
import codecs
from os import path
from setuptools import setup
setup(
name='hazm',
version='0.7.1',
description='Python library for digesting Persian text.',
author='Alireza Nourian',
author_email='az.nourian@gmail.com',
url='http://www.sobhe.ir/hazm/',
long_description=codecs.open(path.join(path.abspath(path... | 31.46875 | 117 | 0.683217 |
588470977baec5cd773022cbbc6bdd61d44363d9 | 697 | py | Python | POMDP/0-DQN/memory.py | g6ling/Pytorch-Cartpole | ecb7b622cfefe825ac95388cceb6752413d90a2a | [
"MIT"
] | 116 | 2019-01-08T02:35:42.000Z | 2022-03-16T07:24:06.000Z | POMDP/0-DQN/memory.py | g6ling/Pytorch-Cartpole-Example | ecb7b622cfefe825ac95388cceb6752413d90a2a | [
"MIT"
] | 3 | 2019-10-24T17:34:38.000Z | 2021-07-09T06:22:20.000Z | POMDP/0-DQN/memory.py | g6ling/Pytorch-Cartpole-Example | ecb7b622cfefe825ac95388cceb6752413d90a2a | [
"MIT"
] | 21 | 2019-01-29T11:14:45.000Z | 2021-09-13T15:38:18.000Z | import random
from collections import namedtuple, deque
import torch
Transition = namedtuple('Transition', ('state', 'next_state', 'action', 'reward', 'mask'))
class Memory(object):
def __init__(self, capacity):
self.memory = deque(maxlen=capacity)
self.capacity = capacity
def push(self, sta... | 30.304348 | 117 | 0.681492 |
ccd0d8f5eab46f424ba820cebf7b9e734a3b4af4 | 2,268 | py | Python | vendor/packages/sqlalchemy/test/sql/test_rowcount.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | 2 | 2019-08-19T17:08:47.000Z | 2019-10-05T11:37:02.000Z | vendor/packages/sqlalchemy/test/sql/test_rowcount.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | vendor/packages/sqlalchemy/test/sql/test_rowcount.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | from sqlalchemy import *
from sqlalchemy.test import *
class FoundRowsTest(TestBase, AssertsExecutionResults):
"""tests rowcount functionality"""
__requires__ = ('sane_rowcount', )
@classmethod
def setup_class(cls):
global employees_table, metadata
metadata = MetaData(testing... | 31.5 | 75 | 0.561728 |
60bf6108b7ee6e6c03f9cd6be02c706fa389c15b | 10,067 | py | Python | deeppavlov/models/seq2seq_go_bot/bot.py | alexeyyakimovich/DeepPavlov | a95149294bc7fa30baaa15c629adad4c1cba264e | [
"Apache-2.0"
] | 3 | 2020-04-16T04:25:10.000Z | 2021-05-07T23:04:43.000Z | deeppavlov/models/seq2seq_go_bot/bot.py | alexeyyakimovich/DeepPavlov | a95149294bc7fa30baaa15c629adad4c1cba264e | [
"Apache-2.0"
] | 12 | 2020-01-28T22:14:04.000Z | 2022-02-10T00:10:17.000Z | deeppavlov/models/seq2seq_go_bot/bot.py | alexeyyakimovich/DeepPavlov | a95149294bc7fa30baaa15c629adad4c1cba264e | [
"Apache-2.0"
] | 1 | 2022-02-08T14:41:28.000Z | 2022-02-08T14:41:28.000Z | # Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# 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 applicab... | 43.960699 | 99 | 0.6269 |
5d8378819144fc0de9ef72365e5211720b410f68 | 4,584 | py | Python | sib_api_v3_sdk/models/get_folders.py | tarraschk/APIv3-python-library | 440883d3a7ca503a655f16bf69cef6c122a95e01 | [
"MIT"
] | 46 | 2018-12-18T21:37:18.000Z | 2022-03-30T20:38:29.000Z | sib_api_v3_sdk/models/get_folders.py | tarraschk/APIv3-python-library | 440883d3a7ca503a655f16bf69cef6c122a95e01 | [
"MIT"
] | 41 | 2018-03-02T13:22:48.000Z | 2021-11-25T04:32:03.000Z | sib_api_v3_sdk/models/get_folders.py | tarraschk/APIv3-python-library | 440883d3a7ca503a655f16bf69cef6c122a95e01 | [
"MIT"
] | 45 | 2018-01-22T14:42:32.000Z | 2021-12-16T19:58:45.000Z | # coding: utf-8
"""
SendinBlue API
SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at h... | 31.833333 | 856 | 0.565663 |
fa8829f23d7011219714656926fe0b947022e5e0 | 5,230 | py | Python | generate_notebooks_from_toc.py | programatt/ccd-reduction-and-photometry-guide | 780df2c49d8f36b51f091f53c81aee04827cec5d | [
"BSD-3-Clause"
] | 40 | 2018-05-29T15:31:59.000Z | 2021-05-27T19:57:05.000Z | generate_notebooks_from_toc.py | programatt/ccd-reduction-and-photometry-guide | 780df2c49d8f36b51f091f53c81aee04827cec5d | [
"BSD-3-Clause"
] | 230 | 2018-05-29T15:15:51.000Z | 2020-07-15T14:25:27.000Z | generate_notebooks_from_toc.py | programatt/ccd-reduction-and-photometry-guide | 780df2c49d8f36b51f091f53c81aee04827cec5d | [
"BSD-3-Clause"
] | 14 | 2020-08-11T17:56:36.000Z | 2022-03-18T08:27:10.000Z | import argparse
from collections import OrderedDict, defaultdict
import re
from pathlib import Path
import nbformat as nbf
def parse_toc(toc_markdown):
"""
Generate set of essentially empty Jupyter notebooks from a table of
contents in markdown.
Parameters
----------
toc_markdown : str
... | 34.866667 | 79 | 0.564627 |
28657eb27257f69f93589f65bcfdcfdd95ee52e8 | 8,978 | py | Python | paddlespeech/t2s/exps/synthesize_e2e.py | SmileGoat/PaddleSpeech | 67994cb8a3f0d3c65446ef9560c69025d6d9a0ef | [
"Apache-2.0"
] | null | null | null | paddlespeech/t2s/exps/synthesize_e2e.py | SmileGoat/PaddleSpeech | 67994cb8a3f0d3c65446ef9560c69025d6d9a0ef | [
"Apache-2.0"
] | null | null | null | paddlespeech/t2s/exps/synthesize_e2e.py | SmileGoat/PaddleSpeech | 67994cb8a3f0d3c65446ef9560c69025d6d9a0ef | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle 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 appli... | 33.5 | 105 | 0.579751 |
3fc696b66a1d5fa21bed10877b6aee13115997b0 | 2,940 | py | Python | warehouse/legacy/api/simple.py | shlomiLan/warehouse | 75fcb01a11591405f87ae9f3b35a2608e65ff7d0 | [
"Apache-2.0"
] | 2 | 2015-04-08T20:48:40.000Z | 2016-04-23T00:14:49.000Z | warehouse/legacy/api/simple.py | shlomiLan/warehouse | 75fcb01a11591405f87ae9f3b35a2608e65ff7d0 | [
"Apache-2.0"
] | 1 | 2018-10-28T00:05:43.000Z | 2018-10-28T00:05:43.000Z | warehouse/legacy/api/simple.py | shlomiLan/warehouse | 75fcb01a11591405f87ae9f3b35a2608e65ff7d0 | [
"Apache-2.0"
] | 1 | 2015-04-08T20:48:41.000Z | 2015-04-08T20:48:41.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | 32.666667 | 77 | 0.67483 |
defd83c0f948fb9233c7102c30791b8a704e2a68 | 2,840 | py | Python | tests/test_action_tag_category_delete.py | lingfish/stackstorm-vsphere | 49199f5ebdc05b70b7504962e104642b0c30ba30 | [
"Apache-2.0"
] | null | null | null | tests/test_action_tag_category_delete.py | lingfish/stackstorm-vsphere | 49199f5ebdc05b70b7504962e104642b0c30ba30 | [
"Apache-2.0"
] | 2 | 2019-03-25T18:03:02.000Z | 2019-03-26T13:13:59.000Z | tests/test_action_tag_category_delete.py | lingfish/stackstorm-vsphere | 49199f5ebdc05b70b7504962e104642b0c30ba30 | [
"Apache-2.0"
] | 1 | 2021-03-05T10:12:21.000Z | 2021-03-05T10:12:21.000Z | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | 35.061728 | 84 | 0.708803 |
5d94a822532918a6626acbf9a74455551e26d442 | 51,143 | py | Python | src/twisted/internet/base.py | ndg63276/twisted | f672a20395e8beece6350631a70514f06c391bae | [
"Unlicense",
"MIT"
] | 1 | 2020-12-18T06:32:58.000Z | 2020-12-18T06:32:58.000Z | src/twisted/internet/base.py | ndg63276/twisted | f672a20395e8beece6350631a70514f06c391bae | [
"Unlicense",
"MIT"
] | null | null | null | src/twisted/internet/base.py | ndg63276/twisted | f672a20395e8beece6350631a70514f06c391bae | [
"Unlicense",
"MIT"
] | null | null | null | # -*- test-case-name: twisted.test.test_internet,twisted.internet.test.test_core -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Very basic functionality for a Reactor implementation.
"""
from abc import ABC, abstractmethod
import builtins
from heapq import heappush, heappop, heapify
... | 35.739343 | 97 | 0.604423 |
c2f98b8700156a0da5cc22cf2d488d9a9bd0a1c1 | 71 | py | Python | formatml/__init__.py | src-d/formatml | f052313391a5a2ca47af7859520f968c423024f1 | [
"Apache-2.0"
] | 2 | 2019-06-07T16:30:51.000Z | 2019-10-09T10:10:17.000Z | mloncode/__init__.py | m09/mloncode | 0c28e6007d5e3cf0e4e0963428f15ec488cb49eb | [
"Apache-2.0"
] | 2 | 2019-11-07T14:52:30.000Z | 2019-11-08T14:40:06.000Z | mloncode/__init__.py | m09/mloncode | 0c28e6007d5e3cf0e4e0963428f15ec488cb49eb | [
"Apache-2.0"
] | 3 | 2019-05-29T13:09:18.000Z | 2021-01-28T11:35:01.000Z | """Formatting with meta-learning experiments."""
__version__ = "0.3.0"
| 23.666667 | 48 | 0.71831 |
43502a9ae70f1f72ed12ec3d242e51c6c0a0e7b3 | 2,100 | py | Python | utilbox/spreadsheet_utils/excel_utils.py | jensonjose/utilbox | f47ac1c97fdd3f7caf8ea1c6b693ea115076f0e8 | [
"MIT"
] | 1 | 2017-07-08T17:59:09.000Z | 2017-07-08T17:59:09.000Z | utilbox/spreadsheet_utils/excel_utils.py | jensonjose/utilbox | f47ac1c97fdd3f7caf8ea1c6b693ea115076f0e8 | [
"MIT"
] | 1 | 2017-08-12T13:51:37.000Z | 2017-08-12T13:51:37.000Z | utilbox/spreadsheet_utils/excel_utils.py | jensonjose/utilbox | f47ac1c97fdd3f7caf8ea1c6b693ea115076f0e8 | [
"MIT"
] | 1 | 2018-10-27T06:13:22.000Z | 2018-10-27T06:13:22.000Z | """
Utility module to manipulate excel spreadsheets.
"""
__author__ = "Jenson Jose"
__email__ = "jensonjose@live.in"
__status__ = "Alpha"
class ExcelUtils:
"""
Utility class containing methods for manipulating excel spreadsheets.
"""
def __init__(self):
self.excel_type_validation_map = {
... | 35.59322 | 97 | 0.575238 |
5f62107259cd39104f5eb42432132e649a29e163 | 880 | py | Python | recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref_timeout.py | yefengfang/depot_tools | e0de6a88e5385ee9cd38d5e87f97456bbad8e7d2 | [
"BSD-3-Clause"
] | 3 | 2020-11-30T15:35:37.000Z | 2022-01-06T14:17:18.000Z | recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref_timeout.py | yefengfang/depot_tools | e0de6a88e5385ee9cd38d5e87f97456bbad8e7d2 | [
"BSD-3-Clause"
] | 54 | 2020-06-23T17:34:04.000Z | 2022-03-31T02:04:06.000Z | recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref_timeout.py | yefengfang/depot_tools | e0de6a88e5385ee9cd38d5e87f97456bbad8e7d2 | [
"BSD-3-Clause"
] | 12 | 2020-07-14T23:59:57.000Z | 2022-03-22T09:59:18.000Z | # Copyright 2019 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.
from recipe_engine import post_process
DEPS = [
'gerrit',
'recipe_engine/buildbucket',
'recipe_engine/properties',
'tryserver',
]
def RunS... | 29.333333 | 80 | 0.702273 |
30c2fb96c94dea87f28bc95bfb1252a21b893a06 | 22,937 | py | Python | tensorflow/python/keras/distribute/keras_correctness_test_base.py | junhwanjang/tensorflow-advanced-gpu | a9a1d641d47bbe2d2c2b6fd91016046a5ad3b9ef | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/distribute/keras_correctness_test_base.py | junhwanjang/tensorflow-advanced-gpu | a9a1d641d47bbe2d2c2b6fd91016046a5ad3b9ef | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/distribute/keras_correctness_test_base.py | junhwanjang/tensorflow-advanced-gpu | a9a1d641d47bbe2d2c2b6fd91016046a5ad3b9ef | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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.56124 | 93 | 0.678467 |
7767d71291941ad601d78cbc4b2d27c4f2dc8b87 | 16,219 | py | Python | cvpysdk/content_analyzer.py | CommvaultEngg/cvpysdk | fbcbb183d2c66c4156a2b9aa1e5a17b245866a3f | [
"Apache-2.0"
] | 35 | 2016-11-30T03:51:02.000Z | 2020-05-14T09:48:34.000Z | cvpysdk/content_analyzer.py | CommvaultEngg/cvpysdk | fbcbb183d2c66c4156a2b9aa1e5a17b245866a3f | [
"Apache-2.0"
] | 88 | 2016-11-30T03:56:00.000Z | 2020-05-14T06:58:36.000Z | cvpysdk/content_analyzer.py | CommvaultEngg/cvpysdk | fbcbb183d2c66c4156a2b9aa1e5a17b245866a3f | [
"Apache-2.0"
] | 40 | 2016-11-29T04:11:07.000Z | 2020-06-06T15:02:59.000Z | # -*- coding: utf-8 -*-
# --------------------------------------------------------------------------
# Copyright Commvault Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 38.433649 | 118 | 0.555336 |
231391d4608966dcdcb80434570a44057c767896 | 5,055 | py | Python | public/cantusdata/views/search_notation.py | jacobsanz97/cantus | 37d139ae20972c36d4abb96a2a5ac5106b0c1b47 | [
"MIT"
] | null | null | null | public/cantusdata/views/search_notation.py | jacobsanz97/cantus | 37d139ae20972c36d4abb96a2a5ac5106b0c1b47 | [
"MIT"
] | null | null | null | public/cantusdata/views/search_notation.py | jacobsanz97/cantus | 37d139ae20972c36d4abb96a2a5ac5106b0c1b47 | [
"MIT"
] | null | null | null | from django.conf import settings
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.exceptions import APIException
from cantusdata.helpers import search_utils
import solr
import json
import types
from operator import itemgetter
class NotationException(APIExcept... | 37.444444 | 110 | 0.556083 |
d89a25392fa733210d125679c2562f14c9608aa2 | 546 | py | Python | manage.py | robot-lab/judyst-backend | 198a265084122b5846041c59f7a30ccee0be427e | [
"Apache-2.0"
] | 3 | 2019-06-16T10:03:44.000Z | 2019-09-23T13:36:17.000Z | manage.py | robot-lab/judyst-backend | 198a265084122b5846041c59f7a30ccee0be427e | [
"Apache-2.0"
] | 25 | 2019-03-25T17:30:10.000Z | 2021-06-10T21:18:59.000Z | manage.py | robot-lab/judyst-backend | 198a265084122b5846041c59f7a30ccee0be427e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'judyst_backend.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Djang... | 34.125 | 78 | 0.690476 |
84e225e43dd149ce5f4205dae8ff9b7cd585ca7b | 13,402 | py | Python | sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_anomaly_alert_configuration.py | kahinton/azure-sdk-for-python | 7f67fd752ec77ef0de9507e9293a377c17c3162f | [
"MIT"
] | 1 | 2021-09-07T18:35:07.000Z | 2021-09-07T18:35:07.000Z | sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_anomaly_alert_configuration.py | kahinton/azure-sdk-for-python | 7f67fd752ec77ef0de9507e9293a377c17c3162f | [
"MIT"
] | null | null | null | sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_anomaly_alert_configuration.py | kahinton/azure-sdk-for-python | 7f67fd752ec77ef0de9507e9293a377c17c3162f | [
"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.
# --------------------------------------------------------------------... | 42.817891 | 109 | 0.706089 |
dd5e692eb4138269739077060f8b1d88bce5f90e | 16,399 | py | Python | monitoring/tests/unit/gapic/v3/test_metric_service_client_v3.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 2 | 2021-11-26T07:08:43.000Z | 2022-03-07T20:20:04.000Z | monitoring/tests/unit/gapic/v3/test_metric_service_client_v3.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 6 | 2019-05-27T22:05:58.000Z | 2019-08-05T16:46:16.000Z | monitoring/tests/unit/gapic/v3/test_metric_service_client_v3.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 1 | 2020-04-14T10:47:41.000Z | 2020-04-14T10:47:41.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 37.10181 | 88 | 0.673883 |
e0b6f6d55e5188f4ae2319003a1e23b300ab6a6a | 963 | py | Python | examples/avro/py/gen_data.py | muhammadyaseen/pydoop | f97abbee663d1e90ae7bb2be7a9431e13b1c3113 | [
"Apache-2.0"
] | 1 | 2021-03-22T02:22:30.000Z | 2021-03-22T02:22:30.000Z | examples/avro/py/gen_data.py | muhammadyaseen/pydoop | f97abbee663d1e90ae7bb2be7a9431e13b1c3113 | [
"Apache-2.0"
] | null | null | null | examples/avro/py/gen_data.py | muhammadyaseen/pydoop | f97abbee663d1e90ae7bb2be7a9431e13b1c3113 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# BEGIN_COPYRIGHT
#
# Copyright 2009-2018 CRS4.
#
# 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 ap... | 26.027027 | 77 | 0.719626 |
ac8c51effef60ea9f758143da2521695f972dfae | 14,111 | py | Python | amplify/agent/objects/nginx/object.py | dafvid/nginx-amplify-agent | c5470f711e72f3424208842a8d4b3954514092a4 | [
"BSD-2-Clause"
] | 1 | 2019-08-21T04:10:51.000Z | 2019-08-21T04:10:51.000Z | amplify/agent/objects/nginx/object.py | VonRosenchild/nginx-amplify-agent | de296b81c36398b6aa21a0ed3c3e667fed5112b2 | [
"BSD-2-Clause"
] | null | null | null | amplify/agent/objects/nginx/object.py | VonRosenchild/nginx-amplify-agent | de296b81c36398b6aa21a0ed3c3e667fed5112b2 | [
"BSD-2-Clause"
] | 1 | 2019-08-21T04:10:54.000Z | 2019-08-21T04:10:54.000Z | # -*- coding: utf-8 -*-
import time
from amplify.agent.collectors.nginx.accesslog import NginxAccessLogsCollector
from amplify.agent.collectors.nginx.config import NginxConfigCollector
from amplify.agent.collectors.nginx.errorlog import NginxErrorLogsCollector
from amplify.agent.common.context import context
from amp... | 39.974504 | 120 | 0.62221 |
44b0319d59a57d143cf4183aed747407a09df14d | 3,431 | py | Python | tests/integration/files/file/base/_modules/runtests_helpers.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | null | null | null | tests/integration/files/file/base/_modules/runtests_helpers.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | null | null | null | tests/integration/files/file/base/_modules/runtests_helpers.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
runtests_helpers.py
~~~~~~~~~~~~~~~~~~~
'''
# Import python libs
from __future__ import absolute_import
import fnmatch
import os
import re
import fnmatch
import tempfile
# Import salt libs
import salt.utils
# Import 3r... | 27.230159 | 103 | 0.608569 |
03379f929ecfae4d9a286fecc18b47997853ecf3 | 210 | py | Python | fixtures/mypy/to_ordered_dict_decorator.py | shinnng/platon-utils | 50f2b95279ab12bf295b430b83827d9db440da74 | [
"MIT"
] | null | null | null | fixtures/mypy/to_ordered_dict_decorator.py | shinnng/platon-utils | 50f2b95279ab12bf295b430b83827d9db440da74 | [
"MIT"
] | null | null | null | fixtures/mypy/to_ordered_dict_decorator.py | shinnng/platon-utils | 50f2b95279ab12bf295b430b83827d9db440da74 | [
"MIT"
] | null | null | null | from typing import (
List,
Tuple
)
from platon_utils import (
to_ordered_dict
)
@to_ordered_dict
def return_value() -> List[Tuple[int, int]]:
return [(1, 2)]
x = return_value()
reveal_type(x)
| 14 | 44 | 0.666667 |
9da7cf1154544413da10f2253fcb858350497f8b | 1,173 | py | Python | quiz_master/accounts/forms.py | DiyanKalaydzhiev23/quiz_master | d8624a59d5bfc52c13ede72b024d1178c17c1780 | [
"MIT"
] | null | null | null | quiz_master/accounts/forms.py | DiyanKalaydzhiev23/quiz_master | d8624a59d5bfc52c13ede72b024d1178c17c1780 | [
"MIT"
] | null | null | null | quiz_master/accounts/forms.py | DiyanKalaydzhiev23/quiz_master | d8624a59d5bfc52c13ede72b024d1178c17c1780 | [
"MIT"
] | null | null | null | from django.contrib.auth import forms as auth_forms, get_user_model
from django import forms
from quiz_master.accounts.models import Profile
class CustomUserCreationForm(auth_forms.UserCreationForm):
class Meta:
model = get_user_model()
fields = ('username', 'email', 'password')
class CustomUser... | 26.066667 | 106 | 0.658142 |
902259235615eb7c519c6dc934899e5e01ef9139 | 6,026 | py | Python | tests/test_logistic.py | pbenner/pyleapfrog | 9673dba01c4a18f1bd4230a062db78b5ec5cec14 | [
"MIT"
] | null | null | null | tests/test_logistic.py | pbenner/pyleapfrog | 9673dba01c4a18f1bd4230a062db78b5ec5cec14 | [
"MIT"
] | null | null | null | tests/test_logistic.py | pbenner/pyleapfrog | 9673dba01c4a18f1bd4230a062db78b5ec5cec14 | [
"MIT"
] | null | null | null | ## Copyright (c) 2022 Philipp Benner
##
## 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, publis... | 40.993197 | 106 | 0.625456 |
6e8876f3fe7a6011bf518018e4bff6fa3c5918fd | 5,285 | py | Python | integration_tests/test_suites/backcompat-test-suite/test_backcompat.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | integration_tests/test_suites/backcompat-test-suite/test_backcompat.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | integration_tests/test_suites/backcompat-test-suite/test_backcompat.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | import os
import subprocess
import time
from contextlib import contextmanager
import packaging
import pytest
import requests
from dagster_graphql import DagsterGraphQLClient
from dagster import file_relative_path
from dagster.core.storage.pipeline_run import PipelineRunStatus
DAGSTER_CURRENT_BRANCH = "current_branch... | 34.096774 | 100 | 0.735856 |
def791fe980b72173c43290b259f57b224b28dc1 | 7,931 | py | Python | ch10/imitation_learning/train.py | Bitdribble/pdl-se | 95f59244e8e27713c28f8aaed407e326de5fddfc | [
"MIT"
] | 92 | 2019-01-25T20:36:24.000Z | 2022-03-26T08:55:00.000Z | ch10/imitation_learning/train.py | Bitdribble/pdl-se | 95f59244e8e27713c28f8aaed407e326de5fddfc | [
"MIT"
] | 2 | 2019-02-09T08:19:10.000Z | 2019-02-09T21:27:15.000Z | ch10/imitation_learning/train.py | Bitdribble/pdl-se | 95f59244e8e27713c28f8aaed407e326de5fddfc | [
"MIT"
] | 65 | 2019-01-29T13:06:13.000Z | 2022-02-20T02:00:42.000Z | import gzip
import os
import pickle
import random
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from util import \
available_actions, \
data_transform, \
DATA_DIR, \
DATA_FILE, \
MODEL_FILE
restore = False # restore from file if exists
BATCH_SIZE = 32 # mb si... | 28.735507 | 79 | 0.597655 |
a2ea1aeee0ca5796fa33e7e1f1085e1e0c6f90e1 | 3,001 | py | Python | hoshi/ePIE_sergio_mE_v5.py | SergioLordano/hoshi | b14d9d26ebb92c283cc7026ba85bb70135046cf7 | [
"MIT"
] | 1 | 2022-03-08T13:55:45.000Z | 2022-03-08T13:55:45.000Z | hoshi/ePIE_sergio_mE_v5.py | SergioLordano/hoshi | b14d9d26ebb92c283cc7026ba85bb70135046cf7 | [
"MIT"
] | null | null | null | hoshi/ePIE_sergio_mE_v5.py | SergioLordano/hoshi | b14d9d26ebb92c283cc7026ba85bb70135046cf7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 11 19:47:02 2018
@author: Sergio
"""
import numpy as np
from matplotlib import pyplot as plt
import time
import h5py
import copy
import hoshi.ptycho as hpty
startTime = time.time()
##################################################################... | 35.72619 | 110 | 0.570143 |
a89a9ecf0e8ce822e284c8a04ac652d2c18ae9ed | 1,621 | py | Python | scripts/benchmark_model.py | TobiRoby/data-science-gist | 51dcdadc6832ca7134e678f674cb4c0cef905e39 | [
"MIT"
] | null | null | null | scripts/benchmark_model.py | TobiRoby/data-science-gist | 51dcdadc6832ca7134e678f674cb4c0cef905e39 | [
"MIT"
] | null | null | null | scripts/benchmark_model.py | TobiRoby/data-science-gist | 51dcdadc6832ca7134e678f674cb4c0cef905e39 | [
"MIT"
] | null | null | null | """Application main."""
from datetime import datetime
import xgboost
from sklearn.metrics import log_loss, roc_auc_score
from patient_no_show.data_adapter import load_patients_appointment_data
from patient_no_show.prepare import engineer_features
from patient_no_show.train import train_no_show_model
# DATA... | 39.536585 | 93 | 0.806909 |
871449ff5c0711afe0d56de2ebdb3a6d798f8272 | 2,381 | py | Python | code_week5_525_531/lru_cache.py | dylanlee101/leetcode | b059afdadb83d504e62afd1227107de0b59557af | [
"Apache-2.0"
] | null | null | null | code_week5_525_531/lru_cache.py | dylanlee101/leetcode | b059afdadb83d504e62afd1227107de0b59557af | [
"Apache-2.0"
] | null | null | null | code_week5_525_531/lru_cache.py | dylanlee101/leetcode | b059afdadb83d504e62afd1227107de0b59557af | [
"Apache-2.0"
] | null | null | null | '''
运用你所掌握的数据结构,设计和实现一个 LRU (最近最少使用) 缓存机制。它应该支持以下操作: 获取数据 get 和 写入数据 put 。
获取数据 get(key) - 如果密钥 (key) 存在于缓存中,则获取密钥的值(总是正数),否则返回 -1。
写入数据 put(key, value) - 如果密钥已经存在,则变更其数据值;如果密钥不存在,则插入该组「密钥/数据值」。当缓存容量达到上限时,它应该在写入新数据之前删除最久未使用的数据值,从而为新的数据值留出空间。
进阶:
你是否可以在 O(1) 时间复杂度内完成这两种操作?
示例:
LRUCache cache = new LRUCache( ... | 24.546392 | 109 | 0.573289 |
0b45b8ee62706f6f24ab9f26d133f4316cdb66b0 | 2,173 | py | Python | ui_extensions/aws_network_flow/forms.py | p6knewman/cloudbolt-forge | 7c9319495beea7a9fc892287ee2255f783f593d6 | [
"Apache-2.0"
] | 34 | 2015-08-30T09:26:41.000Z | 2022-03-03T13:18:14.000Z | ui_extensions/aws_network_flow/forms.py | p6knewman/cloudbolt-forge | 7c9319495beea7a9fc892287ee2255f783f593d6 | [
"Apache-2.0"
] | 22 | 2015-11-23T21:24:17.000Z | 2022-01-31T04:24:24.000Z | ui_extensions/aws_network_flow/forms.py | p6knewman/cloudbolt-forge | 7c9319495beea7a9fc892287ee2255f783f593d6 | [
"Apache-2.0"
] | 43 | 2015-11-18T16:26:22.000Z | 2021-10-18T13:19:39.000Z | from django import forms
from common.forms import C2Form, ProfileModelMultipleChoiceField, C2HorizontalFormHelper
from common.widgets import SelectizeMultiple
from django.utils.translation import ugettext as _
class AWSNetFlowFilterForm(C2Form):
"""
The form for creating fields for filters on the AWS Net Flow... | 41.788462 | 93 | 0.529682 |
5400fedbbce4f3a8b606360da76fdb3741cf841b | 2,064 | py | Python | tests/integration/cattletest/core/test_resource_change.py | mbrukman/rancher-cattle | ac7caffb97346f601043458411391d2d00fd6129 | [
"Apache-2.0"
] | null | null | null | tests/integration/cattletest/core/test_resource_change.py | mbrukman/rancher-cattle | ac7caffb97346f601043458411391d2d00fd6129 | [
"Apache-2.0"
] | null | null | null | tests/integration/cattletest/core/test_resource_change.py | mbrukman/rancher-cattle | ac7caffb97346f601043458411391d2d00fd6129 | [
"Apache-2.0"
] | 1 | 2021-08-10T05:56:19.000Z | 2021-08-10T05:56:19.000Z | import base64
from threading import Thread
from websocket import create_connection
from common_fixtures import * # NOQA
SUB_OPTIONS = '?include=hosts&include=instances&include=instanceLinks' \
'&include=ipAddresses&eventNames=resource.change'
def stop_collection(collector):
collector()
def aut... | 27.157895 | 77 | 0.625969 |
6fe036e439ac9803b01d11ad38c51ba7793ad837 | 18,423 | py | Python | src/snowflake/connector/ocsp_asn1crypto.py | fermezz/snowflake-connector-python | bc9616ad568b23cb8a931d2d590041f6bac1cff9 | [
"Apache-2.0"
] | 1 | 2021-08-06T07:21:09.000Z | 2021-08-06T07:21:09.000Z | src/snowflake/connector/ocsp_asn1crypto.py | fermezz/snowflake-connector-python | bc9616ad568b23cb8a931d2d590041f6bac1cff9 | [
"Apache-2.0"
] | 37 | 2021-08-11T23:22:14.000Z | 2021-08-12T22:27:15.000Z | src/snowflake/connector/ocsp_asn1crypto.py | fermezz/snowflake-connector-python | bc9616ad568b23cb8a931d2d590041f6bac1cff9 | [
"Apache-2.0"
] | 2 | 2021-05-21T10:52:52.000Z | 2021-05-21T13:34:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved.
#
import os
import platform
import sys
import warnings
from base64 import b64decode, b64encode
from collections import OrderedDict
from datetime import datetime, timezone
from logging import getLogger... | 38.703782 | 88 | 0.601585 |
caf423bdc2fc11f2502c62ff94e88331eb59213b | 2,925 | py | Python | edgelm/fairseq/model_parallel/modules/transformer_layer.py | guotao0628/DeepNet | 1ae74d8b44d715bf67c7d64a8efafff4b7c7937a | [
"MIT"
] | 1 | 2021-11-07T00:30:05.000Z | 2021-11-07T00:30:05.000Z | edgelm/fairseq/model_parallel/modules/transformer_layer.py | guotao0628/DeepNet | 1ae74d8b44d715bf67c7d64a8efafff4b7c7937a | [
"MIT"
] | null | null | null | edgelm/fairseq/model_parallel/modules/transformer_layer.py | guotao0628/DeepNet | 1ae74d8b44d715bf67c7d64a8efafff4b7c7937a | [
"MIT"
] | null | null | null | # 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.
from fairseq.model_parallel.modules import ModelParallelMultiheadAttention
from fairseq.modules import TransformerDecoderLayer, Transfor... | 37.025316 | 80 | 0.688205 |
aaec27bbb086a8e72680d8ad3870493e7249165e | 19,739 | py | Python | post_optimization_studies/mad_analyses/ma100MeV_L2TeV_deta2_1/Output/Histos/MadAnalysis5job_0/selection_12.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | post_optimization_studies/mad_analyses/ma100MeV_L2TeV_deta2_1/Output/Histos/MadAnalysis5job_0/selection_12.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | post_optimization_studies/mad_analyses/ma100MeV_L2TeV_deta2_1/Output/Histos/MadAnalysis5job_0/selection_12.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | def selection_12():
# Library import
import numpy
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
# Library version
matplotlib_version = matplotlib.__version__
numpy_version = numpy.__version__
# Histo binning
xBinning = numpy.li... | 101.747423 | 1,041 | 0.696337 |
851d8994d0f001184eb2b12879cdec5f264eb15f | 13,509 | py | Python | src/backend/expungeservice/expunger.py | KentShikama/recordexpungPDX | 4d3d14339e9f408ae466b867615101bdee42e98b | [
"MIT"
] | null | null | null | src/backend/expungeservice/expunger.py | KentShikama/recordexpungPDX | 4d3d14339e9f408ae466b867615101bdee42e98b | [
"MIT"
] | null | null | null | src/backend/expungeservice/expunger.py | KentShikama/recordexpungPDX | 4d3d14339e9f408ae466b867615101bdee42e98b | [
"MIT"
] | null | null | null | from dataclasses import replace
from datetime import date
from functools import lru_cache
from typing import Set, List, Iterator, Tuple, Dict
from dateutil.relativedelta import relativedelta
from more_itertools import flatten, padnone, take
from expungeservice.models.case import Case
from expungeservice.models.charge... | 50.406716 | 255 | 0.633948 |
7ecff8c4cd1e2d54d17735abb095d4b7cea5106a | 87,974 | py | Python | git-p4t.py | brycelelbach/git_p4t | c45e149d390d593481e3dd0ee4b9b28e25627eac | [
"MIT"
] | 8 | 2019-12-26T22:47:58.000Z | 2021-03-25T20:21:09.000Z | git-p4t.py | brycelelbach/git_p4t | c45e149d390d593481e3dd0ee4b9b28e25627eac | [
"MIT"
] | null | null | null | git-p4t.py | brycelelbach/git_p4t | c45e149d390d593481e3dd0ee4b9b28e25627eac | [
"MIT"
] | 3 | 2020-11-11T09:14:13.000Z | 2021-03-20T07:02:43.000Z | #!/usr/bin/env python
#
# git-p4t.py -- A tool for transparent pushing from a Git repo to a Perforce depot.
#
# Author: Bryce Adelstein Lelbach <brycelelbach@gmail.com>
# Simon Hausmann <simon@lst.de>
# Copyright: 2018 NVIDIA Corporation
# 2007 Simon Hausmann <simon@lst.de>
# 2007 Trolltec... | 36.367921 | 127 | 0.561814 |
70f2015fa46dbfce579baba08ad930ca601af868 | 8,976 | py | Python | fastapi_cloudauth/base.py | vovawed/fastapi-cloudauth | 5677d6cac4a14253d714d67c85c9f30f98b12fd6 | [
"MIT"
] | null | null | null | fastapi_cloudauth/base.py | vovawed/fastapi-cloudauth | 5677d6cac4a14253d714d67c85c9f30f98b12fd6 | [
"MIT"
] | null | null | null | fastapi_cloudauth/base.py | vovawed/fastapi-cloudauth | 5677d6cac4a14253d714d67c85c9f30f98b12fd6 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from copy import deepcopy
from typing import Any, Dict, Optional, Type, Union
from fastapi import Depends, HTTPException
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
from jose import jwt # type: ignore
from pydantic import BaseModel
from pydantic.error_wrap... | 30.634812 | 106 | 0.607175 |
f084e8ca5e641729ce3052a395b42bc2341a5bbd | 685 | py | Python | cfp/migrations/0006_auto_20170811_1457.py | JulienPalard/PonyConf | e462fb4bc42a2e7ade4dd230d928b0cecc05fecb | [
"Apache-2.0"
] | 11 | 2016-06-15T12:05:18.000Z | 2017-08-02T14:12:41.000Z | cfp/migrations/0006_auto_20170811_1457.py | JulienPalard/PonyConf | e462fb4bc42a2e7ade4dd230d928b0cecc05fecb | [
"Apache-2.0"
] | 110 | 2016-07-06T20:04:57.000Z | 2017-12-01T20:51:52.000Z | cfp/migrations/0006_auto_20170811_1457.py | JulienPalard/PonyConf | e462fb4bc42a2e7ade4dd230d928b0cecc05fecb | [
"Apache-2.0"
] | 10 | 2016-08-28T14:13:35.000Z | 2017-06-08T07:27:29.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-11 14:57
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('cfp', '0005_conference_reply_email'),
]
operations = [
migratio... | 25.37037 | 84 | 0.614599 |
2e57683d2483ce7231e764b303a718324d434192 | 2,505 | py | Python | 393 UTF-8 Validation.py | ChiFire/legend_LeetCode | 93fe97fef7e929fdbdc25fbb53955d44e14ecff8 | [
"MIT"
] | 872 | 2015-06-15T12:02:41.000Z | 2022-03-30T08:44:35.000Z | 393 UTF-8 Validation.py | ChiFire/legend_LeetCode | 93fe97fef7e929fdbdc25fbb53955d44e14ecff8 | [
"MIT"
] | 8 | 2015-06-21T15:11:59.000Z | 2022-02-01T11:22:34.000Z | 393 UTF-8 Validation.py | ChiFire/legend_LeetCode | 93fe97fef7e929fdbdc25fbb53955d44e14ecff8 | [
"MIT"
] | 328 | 2015-06-28T03:10:35.000Z | 2022-03-29T11:05:28.000Z | """
A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules:
For 1-byte character, the first bit is a 0, followed by its unicode code.
For n-bytes character, the first n-bits are all one's, the n+1 bit is 0, followed by n-1 bytes with most significant 2
bits being 10.
This is how the UTF-8 ... | 33.4 | 118 | 0.59002 |
e34bf37b5db8593d2bfaf37f65b1fc14fc893b88 | 1,121 | py | Python | Codes/pgportfolio/utils/indicator.py | Reself-C/COMAP-MCM-ICM-2022 | 30fe1de5b58de99878bc1358662f3ae7d7689b20 | [
"MIT"
] | 1 | 2022-03-13T20:15:41.000Z | 2022-03-13T20:15:41.000Z | Codes/pgportfolio/utils/indicator.py | Reself-C/COMAP-MCM-ICM-2022 | 30fe1de5b58de99878bc1358662f3ae7d7689b20 | [
"MIT"
] | null | null | null | Codes/pgportfolio/utils/indicator.py | Reself-C/COMAP-MCM-ICM-2022 | 30fe1de5b58de99878bc1358662f3ae7d7689b20 | [
"MIT"
] | 1 | 2022-03-04T16:07:51.000Z | 2022-03-04T16:07:51.000Z | import numpy as np
def max_drawdown(pc_array):
"""
Calculate the max drawdown with the portfolio changes.
Returns:
Max drawdown.
"""
portfolio_values = []
drawdown_list = []
max_benefit = 0
for i in range(pc_array.shape[0]):
if i > 0:
portfolio_values.appen... | 22.42 | 74 | 0.625335 |
4cc6db7d4ab734be2fc0abab482ea6897d723bf7 | 2,046 | py | Python | setup.py | Chazzz/sc2reader | 3d1c3bac9984b69f6a3fa3d7db75ab934928081b | [
"MIT"
] | 1 | 2020-12-09T03:17:14.000Z | 2020-12-09T03:17:14.000Z | setup.py | fpli-mbr/sc2reader | abe2b2b5fa455350899f4eb1518195cf2276039d | [
"MIT"
] | null | null | null | setup.py | fpli-mbr/sc2reader | abe2b2b5fa455350899f4eb1518195cf2276039d | [
"MIT"
] | null | null | null | import sys
import setuptools
setuptools.setup(
license="MIT",
name="sc2reader",
version="1.6.0",
keywords=["starcraft 2", "sc2", "replay", "parser"],
description="Utility for parsing Starcraft II replay files",
long_description=open("README.rst").read() + "\n\n" + open("CHANGELOG.rst").read(),
... | 38.603774 | 87 | 0.609971 |
ee64beb4ee1bb4c097a807021c376f7e9bf1c861 | 1,005 | py | Python | jorldy/config/noisy/atari.py | Kyushik/JORLDY | 6a24a2195e5e87ade157ee53f631af2221f0a188 | [
"Apache-2.0"
] | null | null | null | jorldy/config/noisy/atari.py | Kyushik/JORLDY | 6a24a2195e5e87ade157ee53f631af2221f0a188 | [
"Apache-2.0"
] | null | null | null | jorldy/config/noisy/atari.py | Kyushik/JORLDY | 6a24a2195e5e87ade157ee53f631af2221f0a188 | [
"Apache-2.0"
] | null | null | null | ### Noisy DQN Atari Config ###
env = {
# "name": it should be defined in the command. ex) python main.py --config config.AGENT.atari --env.name breakout
"render": False,
"gray_img": True,
"img_width": 84,
"img_height": 84,
"stack_frame": 4,
"no_op": True,
"skip_frame": 4,
"reward_cl... | 20.9375 | 117 | 0.579104 |
4506d391f677a2cf1ef3f16814984eff1ae26db1 | 9,211 | py | Python | scripts/legacy/InceptionV4.py | rhong3/COVID | c61b516250d0d7d0f11b6403ffd5c7e98beb157b | [
"MIT"
] | null | null | null | scripts/legacy/InceptionV4.py | rhong3/COVID | c61b516250d0d7d0f11b6403ffd5c7e98beb157b | [
"MIT"
] | null | null | null | scripts/legacy/InceptionV4.py | rhong3/COVID | c61b516250d0d7d0f11b6403ffd5c7e98beb157b | [
"MIT"
] | null | null | null | """
InceptionV4 for TF2.0
Created on 03/19/2019
@author: RH
"""
import tensorflow as tf
from keras.layers.convolutional import Conv2D
from keras.layers.pooling import MaxPooling2D, AveragePooling2D, GlobalAveragePooling2D
from keras.layers.core import Dense, Dropout, Flatten, Activation
from keras.layers.normalizatio... | 42.252294 | 120 | 0.655195 |
eeaee7e9f0f627ae5d7a779366ee2f3fae69e9d4 | 607 | py | Python | tests/apps.py | dwasyl/django-elevate | 7846e5f7f88700fd4c80e001b40551e6a1b3727b | [
"BSD-3-Clause"
] | 33 | 2017-12-16T00:08:29.000Z | 2022-01-07T15:11:42.000Z | tests/apps.py | dwasyl/django-elevate | 7846e5f7f88700fd4c80e001b40551e6a1b3727b | [
"BSD-3-Clause"
] | 23 | 2018-01-17T17:27:31.000Z | 2022-01-19T00:41:41.000Z | tests/apps.py | dwasyl/django-elevate | 7846e5f7f88700fd4c80e001b40551e6a1b3727b | [
"BSD-3-Clause"
] | 8 | 2018-01-17T01:01:14.000Z | 2022-02-11T13:24:02.000Z | import sys
from elevate import apps
from .base import BaseTestCase
class AppConfigTestCase(BaseTestCase):
def test_ready(self):
try:
del sys.modules["elevate.signals"]
except KeyError:
pass
apps.ElevateConfig("elevate", apps).ready()
self.assertIn("elevat... | 26.391304 | 63 | 0.665568 |
0e4c0cbd1f9bd1c63369b0ec8461ebaeacca23af | 3,498 | py | Python | testcases/cloud_admin/3-3/Euca4229.py | tbeckham/eutester | 1440187150ce284bd87147e71ac7f0fda194b4d9 | [
"BSD-2-Clause"
] | null | null | null | testcases/cloud_admin/3-3/Euca4229.py | tbeckham/eutester | 1440187150ce284bd87147e71ac7f0fda194b4d9 | [
"BSD-2-Clause"
] | null | null | null | testcases/cloud_admin/3-3/Euca4229.py | tbeckham/eutester | 1440187150ce284bd87147e71ac7f0fda194b4d9 | [
"BSD-2-Clause"
] | null | null | null | '''
Created on Mar 18, 2013
@author: mmunn
Unit test : EUCA-4229 After hitting maximum snapshot limit the cloud still sees snapshots
setUp : Install Credentials,
test : Set the storagemaxtotalsnapshotsizeingb to 1GB, try and create a 2G snapshot (this throws an EntityTooLargeExcepti... | 46.64 | 138 | 0.664666 |
6ced379e0575cf6c4edd7b51e41b2ec3ac102d6f | 2,003 | py | Python | active_directory/setup.py | Siecje/integrations-core | b2f3ea4145b25394be0b274093d1f0723e8f968d | [
"BSD-3-Clause"
] | null | null | null | active_directory/setup.py | Siecje/integrations-core | b2f3ea4145b25394be0b274093d1f0723e8f968d | [
"BSD-3-Clause"
] | null | null | null | active_directory/setup.py | Siecje/integrations-core | b2f3ea4145b25394be0b274093d1f0723e8f968d | [
"BSD-3-Clause"
] | null | null | null | # Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
HERE = path.dirname(path.abspath(__file__))
# Get version info
ABOUT = {}
with open(path.join(HERE, 'datadog_checks', 'active_d... | 28.614286 | 86 | 0.687968 |
78141405e53fec704f9960c48e05fbb9314a8f73 | 16,770 | py | Python | experiments/scenario_d2/plot_results.py | kit-tm/gcmi2 | 607ffd191e2d35186683447ea14fc8d3ce453ff4 | [
"BSD-2-Clause"
] | null | null | null | experiments/scenario_d2/plot_results.py | kit-tm/gcmi2 | 607ffd191e2d35186683447ea14fc8d3ce453ff4 | [
"BSD-2-Clause"
] | null | null | null | experiments/scenario_d2/plot_results.py | kit-tm/gcmi2 | 607ffd191e2d35186683447ea14fc8d3ce453ff4 | [
"BSD-2-Clause"
] | 1 | 2019-12-19T13:25:17.000Z | 2019-12-19T13:25:17.000Z | import statistics
import sys
import numpy as np
import matplotlib.pyplot as plt
import re
import pandas as pd
import os
from matplotlib.patches import Patch
def fileToObject(filename):
currentObject = {}
for line in open(filename, "r"):
splittedLine = line.split(' ')
if not splittedLine[0] in ... | 35.529661 | 171 | 0.634109 |
cebd5e7ee9415e3abbd39fbb307fad2706a75dd5 | 152 | py | Python | lakey_finicity/models/institution/__init__.py | jeremydeanlakey/lakey-finicity-python | f0b5ae6febb9337f0e28731f631b726fca940d2c | [
"MIT"
] | 1 | 2021-02-09T14:44:55.000Z | 2021-02-09T14:44:55.000Z | lakey_finicity/models/institution/__init__.py | jeremydeanlakey/lakey-finicity-python | f0b5ae6febb9337f0e28731f631b726fca940d2c | [
"MIT"
] | null | null | null | lakey_finicity/models/institution/__init__.py | jeremydeanlakey/lakey-finicity-python | f0b5ae6febb9337f0e28731f631b726fca940d2c | [
"MIT"
] | 1 | 2022-01-26T18:09:33.000Z | 2022-01-26T18:09:33.000Z | from .institution import Institution
# from .institution_account_type import InstitutionAccountType
from .institution_address import InstitutionAddress
| 38 | 62 | 0.888158 |
fe04b7c4c64b4efd82dcf417162ee1aeee5c1282 | 1,029 | py | Python | python/cuml/test/dask/test_dask_utils.py | efajardo-nv/cuml | bc86714836284ed4752c267513e5d447e884e1c5 | [
"Apache-2.0"
] | 1 | 2020-07-13T04:16:50.000Z | 2020-07-13T04:16:50.000Z | python/cuml/test/dask/test_dask_utils.py | efajardo-nv/cuml | bc86714836284ed4752c267513e5d447e884e1c5 | [
"Apache-2.0"
] | 1 | 2020-02-03T22:43:57.000Z | 2020-02-29T02:32:40.000Z | python/cuml/test/dask/test_dask_utils.py | efajardo-nv/cuml | bc86714836284ed4752c267513e5d447e884e1c5 | [
"Apache-2.0"
] | null | null | null |
# Copyright (c) 2019, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 28.583333 | 74 | 0.730807 |
c1fb314d56dc9e93fa8d24c3ec9cc5741cee3adf | 967 | py | Python | python_avatars/hair_types.py | ibonn/python_avatars | 2c49dc330b7022a79999394c2894d1ececbefd59 | [
"MIT"
] | 13 | 2021-03-20T12:42:25.000Z | 2022-03-26T21:39:34.000Z | python_avatars/hair_types.py | ibonn/python_avatars | 2c49dc330b7022a79999394c2894d1ececbefd59 | [
"MIT"
] | null | null | null | python_avatars/hair_types.py | ibonn/python_avatars | 2c49dc330b7022a79999394c2894d1ececbefd59 | [
"MIT"
] | 1 | 2021-12-28T09:09:12.000Z | 2021-12-28T09:09:12.000Z | from .base_enums import AvatarPart
class HairType(AvatarPart):
"""Hair types"""
__install__ = True
__enum_path__ = 'hair_types.py'
__path__ = 'avatar_parts/top/hair'
NONE = 'no_hair'
BIG_HAIR = 'big_hair'
BOB = 'bob'
BUN = 'bun'
CAESAR_SIDE_PART = 'caesar_side_part'
CAESAR = ... | 24.794872 | 43 | 0.651499 |
d664e3ac19fcc764fa808e82fdf46d42e0496a55 | 3,032 | py | Python | examples/check_box_group_example.py | ZSD-tim/dayu_widgets | 31c2530bdc4161d9311574d9850c2e9471e53072 | [
"MIT"
] | 157 | 2019-03-10T05:55:21.000Z | 2022-03-31T09:07:00.000Z | examples/check_box_group_example.py | ZSD-tim/dayu_widgets | 31c2530bdc4161d9311574d9850c2e9471e53072 | [
"MIT"
] | 16 | 2019-07-15T11:30:53.000Z | 2021-12-16T14:17:59.000Z | examples/check_box_group_example.py | ZSD-tim/dayu_widgets | 31c2530bdc4161d9311574d9850c2e9471e53072 | [
"MIT"
] | 56 | 2019-06-19T03:35:27.000Z | 2022-03-22T08:07:32.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###################################################################
# Author: Mu yanru
# Date : 2019.3
# Email : muyanru345@163.com
###################################################################
from dayu_widgets.push_button import MPushButton
from dayu_widgets.butt... | 35.255814 | 95 | 0.64215 |
414ebbaec47014ddcb386b08485aa700c48aa1dd | 12,762 | py | Python | common/dsl_yacc.py | shirish100/OpenVinoInference | e9efbd61e28a68953a3e5a687985eff4ab00716d | [
"BSD-3-Clause"
] | null | null | null | common/dsl_yacc.py | shirish100/OpenVinoInference | e9efbd61e28a68953a3e5a687985eff4ab00716d | [
"BSD-3-Clause"
] | null | null | null | common/dsl_yacc.py | shirish100/OpenVinoInference | e9efbd61e28a68953a3e5a687985eff4ab00716d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
import ply.yacc as yacc
from dsl_lex import tokens, lexer
from language_dsl import text
import datetime
import time
import re
def get_spec(p, var):
return p.parser.specs
def check_nested_label(spec, var):
# expand keyword if matches
if "search" in spec:
for s in spec["search"]:... | 32.976744 | 127 | 0.5315 |
7de03a97bf273030754753115916cdb9f56b3977 | 9,578 | py | Python | readthedocs/rtd_tests/tests/test_celery.py | Abdelrahman-Hamdy722/readthedocs.org | 4acfaa58952945bb3166f82bdd7fd894be005bac | [
"MIT"
] | null | null | null | readthedocs/rtd_tests/tests/test_celery.py | Abdelrahman-Hamdy722/readthedocs.org | 4acfaa58952945bb3166f82bdd7fd894be005bac | [
"MIT"
] | null | null | null | readthedocs/rtd_tests/tests/test_celery.py | Abdelrahman-Hamdy722/readthedocs.org | 4acfaa58952945bb3166f82bdd7fd894be005bac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
import os
import shutil
from os.path import exists
from tempfile import mkdtemp
from django.contrib.auth.models import User
from django_dynamic_fixture import get
from mock import patch, MagicMock
from readthedocs.builds.consta... | 40.757447 | 100 | 0.685112 |
cfaa63df773f77e1da213da80eb4c7c7742c9043 | 4,417 | py | Python | src/tests/test_temp_correction.py | mzy2240/GridCal | 0352f0e9ce09a9c037722bf2f2afc0a31ccd2880 | [
"BSD-3-Clause"
] | 284 | 2016-01-31T03:20:44.000Z | 2022-03-17T21:16:52.000Z | src/tests/test_temp_correction.py | mzy2240/GridCal | 0352f0e9ce09a9c037722bf2f2afc0a31ccd2880 | [
"BSD-3-Clause"
] | 94 | 2016-01-14T13:37:40.000Z | 2022-03-28T03:13:56.000Z | src/tests/test_temp_correction.py | mzy2240/GridCal | 0352f0e9ce09a9c037722bf2f2afc0a31ccd2880 | [
"BSD-3-Clause"
] | 84 | 2016-03-29T10:43:04.000Z | 2022-02-22T16:26:55.000Z | # This file is part of GridCal.
#
# GridCal is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GridCal is distributed in the hope that... | 29.644295 | 90 | 0.559429 |
a7e2fb26bb3426902b05e600ddd6114be7c4e6de | 1,001 | py | Python | cfgov/sheerlike/apps.py | Mario-Kart-Felix/cfgov-refresh | 7978fedeb7aaf4d96a87720e6545567085e056a9 | [
"CC0-1.0"
] | 1 | 2019-12-29T17:50:07.000Z | 2019-12-29T17:50:07.000Z | cfgov/sheerlike/apps.py | ascott1/cfgov-refresh | 9c916aaed3a48110a199eb4675474290a51f815d | [
"CC0-1.0"
] | 1 | 2021-04-22T01:09:52.000Z | 2021-04-22T01:09:52.000Z | cfgov/sheerlike/apps.py | ascott1/cfgov-refresh | 9c916aaed3a48110a199eb4675474290a51f815d | [
"CC0-1.0"
] | 1 | 2021-02-02T08:59:38.000Z | 2021-02-02T08:59:38.000Z | from django.apps import AppConfig
from django.conf import settings
class SheerlikeConfig(AppConfig):
name = 'sheerlike'
verbose_name = 'Sheerlike'
def ready(self):
for app, directory in settings.SHEER_SITES.items():
if directory.exists():
engine_config = {
... | 41.708333 | 95 | 0.51049 |
f6b34bf7a5eb5ec6cd18946117e4b1501838d748 | 1,264 | py | Python | fibo/server/start_introducer.py | Fibo-Network/fibo-blockchain | 34471efc081a52443e874749bb8ea3dc50b59891 | [
"Apache-2.0"
] | null | null | null | fibo/server/start_introducer.py | Fibo-Network/fibo-blockchain | 34471efc081a52443e874749bb8ea3dc50b59891 | [
"Apache-2.0"
] | null | null | null | fibo/server/start_introducer.py | Fibo-Network/fibo-blockchain | 34471efc081a52443e874749bb8ea3dc50b59891 | [
"Apache-2.0"
] | null | null | null | import pathlib
from typing import Dict
from fibo.introducer.introducer import Introducer
from fibo.introducer.introducer_api import IntroducerAPI
from fibo.server.outbound_message import NodeType
from fibo.server.start_service import run_service
from fibo.util.config import load_config_cli
from fibo.util.default_root ... | 28.088889 | 89 | 0.739715 |
bf5f45ff7c94947991ddc39f5e35e038a55b3326 | 472 | py | Python | dictionaries/postcodes/postcode5.py | ewartj/MedCAT | 90ae7f199edf9c5aa3937b927d01c3cdc1b6b721 | [
"MIT"
] | 1 | 2021-02-02T09:13:37.000Z | 2021-02-02T09:13:37.000Z | dictionaries/postcodes/postcode5.py | ewartj/MedCAT_Deidentification | 90ae7f199edf9c5aa3937b927d01c3cdc1b6b721 | [
"MIT"
] | null | null | null | dictionaries/postcodes/postcode5.py | ewartj/MedCAT_Deidentification | 90ae7f199edf9c5aa3937b927d01c3cdc1b6b721 | [
"MIT"
] | null | null | null | import postcodes_io_api
api = postcodes_io_api.Api(debug_http=False)
#data = api.get_postcode('SW112EF')
postcodes = []
with open('postcodes5.txt', 'w') as f:
for i in range(0,200000):
# print("Gettings postcode {}".format(i))
data = api.get_random_postcode()
postcodes.append(data["result"... | 27.764706 | 52 | 0.667373 |
f423dde3fa3e3f803daf6922344c6802cf7e9bbb | 1,790 | py | Python | ker/api/monitor.py | csvwolf/ker.py | ac86e1f01cdef0f3ae8b45022df20e8f4fcc9a76 | [
"MIT"
] | 5 | 2019-09-30T08:40:53.000Z | 2019-10-14T10:22:06.000Z | ker/api/monitor.py | csvwolf/ker.py | ac86e1f01cdef0f3ae8b45022df20e8f4fcc9a76 | [
"MIT"
] | null | null | null | ker/api/monitor.py | csvwolf/ker.py | ac86e1f01cdef0f3ae8b45022df20e8f4fcc9a76 | [
"MIT"
] | null | null | null | """
monitor module
"""
from datetime import datetime
from ker.utils import request
from .list import API_LIST
class Monitor:
"""
monitor api
"""
def __init__(self, email, token):
self.email = email
self.token = token
def get_cpu(self, uuid, start_time, unit, end_time=datetime.utcn... | 26.323529 | 74 | 0.513966 |
01bf9c3f618bd30c67280ec5f5761a255dd3045e | 198 | py | Python | 1/reverse_bits.py | IronCore864/leetcode | a62a4cdde9814ae48997176debcaad537f7ad01f | [
"Apache-2.0"
] | 4 | 2018-03-07T02:56:03.000Z | 2021-06-15T05:43:31.000Z | 1/reverse_bits.py | IronCore864/leetcode | a62a4cdde9814ae48997176debcaad537f7ad01f | [
"Apache-2.0"
] | null | null | null | 1/reverse_bits.py | IronCore864/leetcode | a62a4cdde9814ae48997176debcaad537f7ad01f | [
"Apache-2.0"
] | 1 | 2021-09-02T12:05:15.000Z | 2021-09-02T12:05:15.000Z | class Solution:
# @param n, an integer
# @return an integer
def reverseBits(self, n):
binary = '{0:032b}'.format(n)
reverse = binary[::-1]
return int(reverse, 2)
| 24.75 | 37 | 0.560606 |
f2b5d0fba930079a1901636c48bf18d3a5fde4b6 | 227 | py | Python | vpcnn/convert_to_tsv.py | QiS9596/vp-cnn | e1ab2ce856a704013a8eddd80b492cd9336d12eb | [
"Apache-2.0"
] | null | null | null | vpcnn/convert_to_tsv.py | QiS9596/vp-cnn | e1ab2ce856a704013a8eddd80b492cd9336d12eb | [
"Apache-2.0"
] | 1 | 2021-09-11T23:44:00.000Z | 2021-09-12T12:21:41.000Z | vpcnn/convert_to_tsv.py | QiS9596/vp-cnn | e1ab2ce856a704013a8eddd80b492cd9336d12eb | [
"Apache-2.0"
] | 3 | 2019-05-15T01:50:23.000Z | 2019-09-23T20:44:02.000Z | from __future__ import print_function
import sys
with open(sys.argv[1], "r") as iff:
for line in iff:
fields = line.strip().split(" ")
result = fields[0] + "\t" + " ".join(fields[1:])
print(result)
| 25.222222 | 56 | 0.585903 |
177ddc93bf1062f8346f9cb5bdd779100dd90b3b | 5,457 | py | Python | fetcher/cron.py | ulsdevteam/pisces | c3c6a513e8c29bf95673971b158828e1cc85c744 | [
"MIT"
] | 1 | 2019-05-13T21:05:20.000Z | 2019-05-13T21:05:20.000Z | fetcher/cron.py | ulsdevteam/pisces | c3c6a513e8c29bf95673971b158828e1cc85c744 | [
"MIT"
] | 307 | 2019-04-03T13:11:57.000Z | 2022-03-16T21:57:35.000Z | fetcher/cron.py | RockefellerArchiveCenter/pisces | 0fcdfd7a6055e6df58cc27058e31249cfe3ecca7 | [
"MIT"
] | null | null | null | from datetime import datetime
from subprocess import CalledProcessError, check_output
from django_cron import CronJobBase, Schedule
from .fetchers import ArchivesSpaceDataFetcher, CartographerDataFetcher
from .models import FetchRun
class BaseCron(CronJobBase):
RUN_EVERY_MINS = 0
schedule = Schedule(run_eve... | 34.537975 | 112 | 0.696353 |
4f487af0a9dbb4065ef08a42d440800e8a547e3c | 1,698 | py | Python | sdk/python/setup.py | thehyve/arvados | 7b72f9d1b628698277617e9f1b8a9eac1f8dd562 | [
"Apache-2.0"
] | null | null | null | sdk/python/setup.py | thehyve/arvados | 7b72f9d1b628698277617e9f1b8a9eac1f8dd562 | [
"Apache-2.0"
] | null | null | null | sdk/python/setup.py | thehyve/arvados | 7b72f9d1b628698277617e9f1b8a9eac1f8dd562 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
import os
import sys
import re
from setuptools import setup, find_packages
SETUP_DIR = os.path.dirname(__file__) or '.'
README = os.path.join(SETUP_DIR, 'READ... | 27.387097 | 81 | 0.588928 |
eaafa9d28f18afac77f2e69b85bcdc2a1d12ad41 | 23,963 | py | Python | web2py/applications/rip/modules/VDSprac.py | 2spmohanty/vcenter-automation | 1d10b765ef335087902b0194ed12a61e53807987 | [
"Apache-2.0"
] | 1 | 2019-10-02T13:25:03.000Z | 2019-10-02T13:25:03.000Z | web2py/applications/rip/modules/VDSprac.py | 2spmohanty/vcenter-automation | 1d10b765ef335087902b0194ed12a61e53807987 | [
"Apache-2.0"
] | null | null | null | web2py/applications/rip/modules/VDSprac.py | 2spmohanty/vcenter-automation | 1d10b765ef335087902b0194ed12a61e53807987 | [
"Apache-2.0"
] | 1 | 2021-11-05T09:51:02.000Z | 2021-11-05T09:51:02.000Z | __author__ = 'smrutim'
import time
from pyVmomi import vim
from pyVim.connect import SmartConnect, Disconnect
import atexit
import getpass
import logging
import re
import ssl
import DatacenterPrac
def wait_for_task(task):
""" wait for a vCenter task to finish """
task_done = False
while not t... | 31.201823 | 149 | 0.586112 |
2d402e6e3ff26aa25c969141e1350537649fe93f | 24,107 | py | Python | google/ads/google_ads/v6/proto/services/extension_feed_item_service_pb2.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v6/proto/services/extension_feed_item_service_pb2.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v6/proto/services/extension_feed_item_service_pb2.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v6/proto/services/extension_feed_item_service.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflecti... | 54.295045 | 2,877 | 0.796947 |
4385fef18950498ea42486deb89d787649a38cb0 | 2,322 | py | Python | setup.py | soachishti/autoScanner | ac7f28f6978b9cad79b1ac1819d71d2f9f4a436b | [
"BSD-2-Clause-FreeBSD"
] | 7 | 2016-02-01T07:28:02.000Z | 2020-12-28T09:59:43.000Z | setup.py | soachishti/autoScanner | ac7f28f6978b9cad79b1ac1819d71d2f9f4a436b | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | setup.py | soachishti/autoScanner | ac7f28f6978b9cad79b1ac1819d71d2f9f4a436b | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2016-06-05T07:03:52.000Z | 2021-11-04T10:27:34.000Z | import os
import site
import sys
import glob
from cx_Freeze import setup, Executable
siteDir = site.getsitepackages()[1]
includeDllPath = os.path.join(siteDir, "gnome")
# missingDll = glob.glob(includeDllPath + "\\" + '*.dll')
missingDLL = ['libffi-6.dll',
'libgirepository-1.0-1.dll',
'li... | 27.317647 | 65 | 0.508613 |
d6a0c913a55c227585b7c78472788e6096402e3f | 1,953 | py | Python | pypuffin/contextlib.py | tpgillam/pypuffin | 3ab6aae14287a61ae763b6002ebde83e84ebc452 | [
"MIT"
] | null | null | null | pypuffin/contextlib.py | tpgillam/pypuffin | 3ab6aae14287a61ae763b6002ebde83e84ebc452 | [
"MIT"
] | null | null | null | pypuffin/contextlib.py | tpgillam/pypuffin | 3ab6aae14287a61ae763b6002ebde83e84ebc452 | [
"MIT"
] | null | null | null | ''' Extensions of the contextlib library '''
from contextlib import contextmanager
from functools import wraps
def safecontextmanager(func):
''' Behaves similarly to context manager, but if an exception occurs during the context execution, we ensure
that the cleanup code is called prior to re-raising the... | 27.507042 | 112 | 0.504352 |
ff11240a5c292ac98783720849df301eb30a1971 | 2,948 | py | Python | vmware_nsx/tests/unit/nsx_v3/housekeeper/test_orphaned_logical_switch.py | salv-orlando/vmware-nsx | 6ad0d595aa8099004eb6dd5ff62c7a91b0e11dfd | [
"Apache-2.0"
] | null | null | null | vmware_nsx/tests/unit/nsx_v3/housekeeper/test_orphaned_logical_switch.py | salv-orlando/vmware-nsx | 6ad0d595aa8099004eb6dd5ff62c7a91b0e11dfd | [
"Apache-2.0"
] | null | null | null | vmware_nsx/tests/unit/nsx_v3/housekeeper/test_orphaned_logical_switch.py | salv-orlando/vmware-nsx | 6ad0d595aa8099004eb6dd5ff62c7a91b0e11dfd | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 VMware, 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 a... | 34.27907 | 78 | 0.65502 |
e5790673cc02d52d8b871fc63c392290ee5a7108 | 8,924 | py | Python | gluon/model_stats.py | yick2232/imgclsmob | fb220bff18b27d1fc6db1bac6cf69b70c2d07490 | [
"MIT"
] | 1 | 2019-11-13T16:00:51.000Z | 2019-11-13T16:00:51.000Z | gluon/model_stats.py | fireoil/imgclsmob | fb220bff18b27d1fc6db1bac6cf69b70c2d07490 | [
"MIT"
] | null | null | null | gluon/model_stats.py | fireoil/imgclsmob | fb220bff18b27d1fc6db1bac6cf69b70c2d07490 | [
"MIT"
] | null | null | null | """
Routines for model statistics calculation.
"""
import logging
import numpy as np
import mxnet as mx
from mxnet.gluon import nn
from mxnet.gluon.contrib.nn import Identity
from .gluoncv2.models.common import ReLU6, ChannelShuffle, ChannelShuffle2, PReLU2, HSigmoid, HSwish
from .gluoncv2.models.fishnet import In... | 35.133858 | 111 | 0.584043 |
e1d195c404e08cc9bfe5703595eb71e3d5660b3b | 998 | py | Python | Chapter 7/PC7-2.py | Nolazco1/pythonProjects | 33938487cb2e4771ea4ff6716703868844d04e52 | [
"MIT"
] | null | null | null | Chapter 7/PC7-2.py | Nolazco1/pythonProjects | 33938487cb2e4771ea4ff6716703868844d04e52 | [
"MIT"
] | null | null | null | Chapter 7/PC7-2.py | Nolazco1/pythonProjects | 33938487cb2e4771ea4ff6716703868844d04e52 | [
"MIT"
] | null | null | null | # This program asks the user to enter 20 different
# numbers and stores them in a list. It then displays
# the lowest num, highest num, total, and average of the numbers.
def main():
# Defines constants
numbers1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
numbers2 = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
... | 28.514286 | 66 | 0.608216 |
9ee403767e9d2c102560f6c8f74bd968eee95ad7 | 557 | py | Python | auth/forms/singin_form.py | katrze89/app_authentication_authorization | f60057d44a5a4ff1f6641fba2b2b0948b9e1bd90 | [
"MIT"
] | null | null | null | auth/forms/singin_form.py | katrze89/app_authentication_authorization | f60057d44a5a4ff1f6641fba2b2b0948b9e1bd90 | [
"MIT"
] | null | null | null | auth/forms/singin_form.py | katrze89/app_authentication_authorization | f60057d44a5a4ff1f6641fba2b2b0948b9e1bd90 | [
"MIT"
] | 1 | 2021-04-08T20:33:57.000Z | 2021-04-08T20:33:57.000Z | """Form to sign in user
"""
from flask_wtf import FlaskForm # pylint: disable=import-error
from wtforms import StringField, PasswordField, SubmitField # pylint: disable=import-error
from wtforms.validators import DataRequired, Email # pylint: disable=import-error
class SigninForm(FlaskForm): # pylint: disable=to... | 39.785714 | 91 | 0.741472 |
02ec23b8278e528fa0817001251ff3d1b2050686 | 10,412 | py | Python | c7n/resources/quotas.py | lessmian/cloud-custodian | 60e52a230a3fcd0064d4a7d66668c8f42086c175 | [
"Apache-2.0"
] | null | null | null | c7n/resources/quotas.py | lessmian/cloud-custodian | 60e52a230a3fcd0064d4a7d66668c8f42086c175 | [
"Apache-2.0"
] | null | null | null | c7n/resources/quotas.py | lessmian/cloud-custodian | 60e52a230a3fcd0064d4a7d66668c8f42086c175 | [
"Apache-2.0"
] | null | null | null | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import absolute_import, division, print_function, unicode_literals
import re
import math
from concurrent.futures import as_completed
from datetime import timedelta, datetime
from statistics import mean
from c7n.actions... | 34.363036 | 100 | 0.572801 |
f08dda80fefdbaa60e06f50d21fdcac5097208eb | 2,335 | py | Python | lib/ninjecto/utils/iso8601.py | eduar-m/ninjecto | 701cc7e122b747090f52e72ffa6f55f8defa8a5e | [
"Apache-2.0"
] | 1 | 2018-08-21T13:14:47.000Z | 2018-08-21T13:14:47.000Z | lib/ninjecto/utils/iso8601.py | eduar-m/ninjecto | 701cc7e122b747090f52e72ffa6f55f8defa8a5e | [
"Apache-2.0"
] | 13 | 2017-09-15T01:14:18.000Z | 2020-06-09T21:20:09.000Z | lib/ninjecto/utils/iso8601.py | eduar-m/ninjecto | 701cc7e122b747090f52e72ffa6f55f8defa8a5e | [
"Apache-2.0"
] | 6 | 2017-10-04T16:49:24.000Z | 2019-07-03T20:38:23.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 KuraLabs S.R.L
#
# 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 applicabl... | 25.944444 | 77 | 0.707495 |
959ef4f862ab187d9f68f85eae8a2fe817c0adaa | 6,330 | py | Python | flare_removal/python/synthesis.py | ParikhKadam/google-research | 00a282388e389e09ce29109eb050491c96cfab85 | [
"Apache-2.0"
] | 2 | 2022-01-21T18:15:34.000Z | 2022-01-25T15:21:34.000Z | flare_removal/python/synthesis.py | ParikhKadam/google-research | 00a282388e389e09ce29109eb050491c96cfab85 | [
"Apache-2.0"
] | 110 | 2021-10-01T18:22:38.000Z | 2021-12-27T22:08:31.000Z | flare_removal/python/synthesis.py | admariner/google-research | 7cee4b22b925581d912e8d993625c180da2a5a4f | [
"Apache-2.0"
] | 1 | 2022-02-10T10:43:10.000Z | 2022-02-10T10:43:10.000Z | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | 38.13253 | 80 | 0.699684 |
6bcafca619c825feb1b6b2d35138b97d674b92b0 | 11,615 | py | Python | TaichiGAME/scene.py | maksyuki/TaichiGAME | 647d08d3d31b209314ec0dfec5270c565b2f6a61 | [
"MIT"
] | 37 | 2021-12-30T02:03:11.000Z | 2022-03-21T11:37:52.000Z | TaichiGAME/scene.py | maksyuki/TaichiGame | 647d08d3d31b209314ec0dfec5270c565b2f6a61 | [
"MIT"
] | 2 | 2022-01-09T13:04:04.000Z | 2022-01-11T06:47:43.000Z | TaichiGAME/scene.py | maksyuki/TaichiGame | 647d08d3d31b209314ec0dfec5270c565b2f6a61 | [
"MIT"
] | 2 | 2022-01-03T06:52:23.000Z | 2022-01-11T06:31:30.000Z | from __future__ import annotations
from typing import Dict, Tuple, Union, List, cast, Optional
import taichi as ti
from .common.camera import Camera
from .common.config import Config
from .common.export_manager import ExportManager
from .frame import Frame
from .collision.broad_phase.dbvt import DBVT
from .collision.... | 38.333333 | 79 | 0.569264 |
a61b96fc0797e95b3659a3f693a3a3c3e23e3cd0 | 4,956 | py | Python | tfx/orchestration/portable/python_executor_operator.py | epona-science/tfx | 2081eee1e94d97de399514e02079a233309d648d | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/portable/python_executor_operator.py | epona-science/tfx | 2081eee1e94d97de399514e02079a233309d648d | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/portable/python_executor_operator.py | epona-science/tfx | 2081eee1e94d97de399514e02079a233309d648d | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.967742 | 88 | 0.749395 |
551bf7449e1afdbd53e2c513bbf5493ff685cb82 | 234 | py | Python | 2016/WEEK_3/ex3-6-how_may.py | codxse/mitx-600.1 | c1cfa51d5ffe426cb1e84b9c1f2d133213b83962 | [
"MIT"
] | null | null | null | 2016/WEEK_3/ex3-6-how_may.py | codxse/mitx-600.1 | c1cfa51d5ffe426cb1e84b9c1f2d133213b83962 | [
"MIT"
] | null | null | null | 2016/WEEK_3/ex3-6-how_may.py | codxse/mitx-600.1 | c1cfa51d5ffe426cb1e84b9c1f2d133213b83962 | [
"MIT"
] | null | null | null | def how_many(aDict):
'''
aDict: A dictionary, where all the values are lists.
returns: int, how many values are in the dictionary.
'''
t = 0
for vals in aDict.values():
t += len(vals)
return t | 21.272727 | 56 | 0.576923 |
fcc22c863f33a7b066b5a38d5c13ef2d55d64054 | 8,552 | py | Python | heat/tests/test_instance.py | CiscoSystems/heat | 1b609f3c0621c44e4988a166a38f36c2b57eb4c6 | [
"Apache-2.0"
] | 1 | 2020-08-15T14:29:15.000Z | 2020-08-15T14:29:15.000Z | heat/tests/test_instance.py | CiscoSystems/heat | 1b609f3c0621c44e4988a166a38f36c2b57eb4c6 | [
"Apache-2.0"
] | null | null | null | heat/tests/test_instance.py | CiscoSystems/heat | 1b609f3c0621c44e4988a166a38f36c2b57eb4c6 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.150235 | 78 | 0.613424 |
3f514070e6214a383645e534f3ad7675a8dd1012 | 5,354 | py | Python | url_shortener/views.py | w2srobinho/urlshortener | e21c00d02e221b5c3314a1bbe35da51fbf4db793 | [
"MIT"
] | null | null | null | url_shortener/views.py | w2srobinho/urlshortener | e21c00d02e221b5c3314a1bbe35da51fbf4db793 | [
"MIT"
] | null | null | null | url_shortener/views.py | w2srobinho/urlshortener | e21c00d02e221b5c3314a1bbe35da51fbf4db793 | [
"MIT"
] | null | null | null | from flask import abort, jsonify, make_response, redirect, request
from . import app, db_manager
@app.route('/urls/<id>', methods=['GET'])
def get_url(id):
"""
Endpoint to add url
:param id: the url code
:return: 301, redirect to url found or
401, if url not found
"""
url_found = ... | 33.4625 | 88 | 0.461524 |
a959471ba3616a256b0f797bc97862d9934f9add | 2,009 | py | Python | examples/push/env.py | adaptivelab/datasift-python | 3cd530866f6929f3f20f0dca3459518df86b6ff9 | [
"MIT"
] | null | null | null | examples/push/env.py | adaptivelab/datasift-python | 3cd530866f6929f3f20f0dca3459518df86b6ff9 | [
"MIT"
] | null | null | null | examples/push/env.py | adaptivelab/datasift-python | 3cd530866f6929f3f20f0dca3459518df86b6ff9 | [
"MIT"
] | null | null | null | # encoding: utf-8
import sys, os
sys.path[0:0] = [os.path.join(os.path.dirname(__file__), "..", ".."),]
import datasift
class Env(object):
"""
Sets up and provides access to the environment for the Push examples.
"""
_user = None
_args = []
def __init__(self, args):
"""
Initia... | 32.403226 | 124 | 0.584868 |
ad2ebffa5aeadacc6e4def83208ffa8fd6daf029 | 3,896 | py | Python | lib/bx/align/score_tests.py | mvdbeek/bx-python | 325f495f3d6273f225acd3097216bbbfe462facf | [
"MIT"
] | 2 | 2021-01-19T00:36:14.000Z | 2021-04-28T12:09:15.000Z | lib/bx/align/score_tests.py | mvdbeek/bx-python | 325f495f3d6273f225acd3097216bbbfe462facf | [
"MIT"
] | null | null | null | lib/bx/align/score_tests.py | mvdbeek/bx-python | 325f495f3d6273f225acd3097216bbbfe462facf | [
"MIT"
] | null | null | null | """
Tests for `bx.align.score`.
"""
import sys
import unittest
from numpy import array, cumsum, allclose
from six import StringIO
import bx.align.maf
import bx.align.score
aligns = [ ( "CCACTAGTTTTTAAATAATCTACTATCAAATAAAAGATTTGTTAATAATAAATTTTAAATCATTAACACTT",
"CCATTTGGGTTCAAAAATTGATCTATCA----------TGGTG... | 42.347826 | 117 | 0.530031 |
c6789e07082f261e6477ab6673980235aae6fbb0 | 235 | py | Python | layout.py | rgiglio/python-engeco | 3b01c1f24f682017a1f006b6cc9804a5c35b4674 | [
"MIT"
] | null | null | null | layout.py | rgiglio/python-engeco | 3b01c1f24f682017a1f006b6cc9804a5c35b4674 | [
"MIT"
] | null | null | null | layout.py | rgiglio/python-engeco | 3b01c1f24f682017a1f006b6cc9804a5c35b4674 | [
"MIT"
] | null | null | null | import dash_html_components as html
import dash_core_components as dcc
from pages.pv2fv import pv2fv
from pages.pv2us import pv2us
layout_div = html.Div([
dcc.Location(id='url', refresh=False),
html.Div(id='page-content')
]) | 21.363636 | 42 | 0.757447 |
8c78131ad1fdaff580af03a1dec4f25a3a2caa30 | 2,114 | py | Python | Settings.py | mkgvb/whet | 1b9516131f6bfe9e3b2c3faea00a651af9f267a3 | [
"MIT"
] | null | null | null | Settings.py | mkgvb/whet | 1b9516131f6bfe9e3b2c3faea00a651af9f267a3 | [
"MIT"
] | null | null | null | Settings.py | mkgvb/whet | 1b9516131f6bfe9e3b2c3faea00a651af9f267a3 | [
"MIT"
] | null | null | null | '''Holds Settings'''
import logging
import json
from WeatherType import WeatherType
import os
FILELOC = 'json/whet_settings.json'
class Settings(object):
"""Class to hold settings"""
# pylint: disable=too-many-instance-attributes
logger = logging.getLogger('__main__')
last_modified_time = 0
d... | 33.555556 | 90 | 0.5965 |
160a25a23f705ed7801bc0b9423e0ee85532fac8 | 752 | py | Python | python/lxf/03advancedFeature/list_comprehensions.py | andyzhenghn/LinuxStuding | ca872a4ba822781c95721dea0e0af2ef25f5a717 | [
"MIT"
] | null | null | null | python/lxf/03advancedFeature/list_comprehensions.py | andyzhenghn/LinuxStuding | ca872a4ba822781c95721dea0e0af2ef25f5a717 | [
"MIT"
] | null | null | null | python/lxf/03advancedFeature/list_comprehensions.py | andyzhenghn/LinuxStuding | ca872a4ba822781c95721dea0e0af2ef25f5a717 | [
"MIT"
] | null | null | null | # 列表生成式
# 列表生成式,快速生成 list,可以通过一个 list推导另一个 list
L = list(range(1, 11))
L = []
for x in range(1, 11):
L.append(x * x)
# 列表生成式用一行语句代替循环生成上面的list
L = [x * x for x in range(1, 11)]
# 使用条件判断,筛选出仅有偶数的平方
L = [x * x for x in range(1, 11) if x % 2 == 0]
# 使用两层循环,可以全排列
L = [m + n for m in 'ABC' for n in 'XYZ']
# 列出当前目录下... | 16.347826 | 61 | 0.55984 |
ac0c18c579361a4dd2c15a6daf3690f0f569e90e | 6,411 | py | Python | library/python/testing/yatest_common/yatest/common/network.py | r1nadeg/04_catboost | 6755bbbd1496540b92ded57eea1974f64bef87c5 | [
"Apache-2.0"
] | null | null | null | library/python/testing/yatest_common/yatest/common/network.py | r1nadeg/04_catboost | 6755bbbd1496540b92ded57eea1974f64bef87c5 | [
"Apache-2.0"
] | null | null | null | library/python/testing/yatest_common/yatest/common/network.py | r1nadeg/04_catboost | 6755bbbd1496540b92ded57eea1974f64bef87c5 | [
"Apache-2.0"
] | 1 | 2018-08-06T14:13:12.000Z | 2018-08-06T14:13:12.000Z | # coding=utf-8
import os
import errno
import socket
import random
import platform
import threading
UI16MAXVAL = (1 << 16) - 1
class PortManagerException(Exception):
pass
class PortManager(object):
"""
See documentation here
https://wiki.yandex-team.ru/yatool/test/#poluchenieportovdljatestirovanij... | 29.273973 | 127 | 0.581189 |
d8602e589b10369d710e43270ca600d227a86c56 | 120 | py | Python | dvc/remote/https.py | kaiogu/dvc | ffa8fe5888dbbb3d37b3874562f99fd77d4bbcb7 | [
"Apache-2.0"
] | 3 | 2020-01-31T05:33:14.000Z | 2021-05-20T08:19:25.000Z | dvc/remote/https.py | kaiogu/dvc | ffa8fe5888dbbb3d37b3874562f99fd77d4bbcb7 | [
"Apache-2.0"
] | null | null | null | dvc/remote/https.py | kaiogu/dvc | ffa8fe5888dbbb3d37b3874562f99fd77d4bbcb7 | [
"Apache-2.0"
] | null | null | null | from .http import RemoteHTTP
from dvc.scheme import Schemes
class RemoteHTTPS(RemoteHTTP):
scheme = Schemes.HTTPS
| 17.142857 | 30 | 0.783333 |
60f7a9c1aa94033d58dd6bbbabdae07bc8bb2419 | 1,484 | py | Python | events/migrations/0002_auto_20200602_1833.py | MaxGvozd/Krinitsa_crm | 3d9954c0143ae601f09904c2597d0e089db52426 | [
"MIT"
] | null | null | null | events/migrations/0002_auto_20200602_1833.py | MaxGvozd/Krinitsa_crm | 3d9954c0143ae601f09904c2597d0e089db52426 | [
"MIT"
] | null | null | null | events/migrations/0002_auto_20200602_1833.py | MaxGvozd/Krinitsa_crm | 3d9954c0143ae601f09904c2597d0e089db52426 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-06-02 18:33
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('events', '0001_initial'),
migrations.swappable_dependency(setti... | 32.26087 | 113 | 0.614555 |
aa389027e012b5ea4c661b01051610a018d96baf | 13,379 | py | Python | girder/api/v1/assetstore.py | JKitok/girder | 317962d155fc9811d25e5f33bd3e849c4ac96645 | [
"Apache-2.0"
] | 395 | 2015-01-12T19:20:13.000Z | 2022-03-30T05:40:40.000Z | girder/api/v1/assetstore.py | JKitok/girder | 317962d155fc9811d25e5f33bd3e849c4ac96645 | [
"Apache-2.0"
] | 2,388 | 2015-01-01T20:09:19.000Z | 2022-03-29T16:49:14.000Z | girder/api/v1/assetstore.py | JKitok/girder | 317962d155fc9811d25e5f33bd3e849c4ac96645 | [
"Apache-2.0"
] | 177 | 2015-01-04T14:47:00.000Z | 2022-03-25T09:01:51.000Z | # -*- coding: utf-8 -*-
from ..describe import Description, autoDescribeRoute
from ..rest import Resource
from girder import events
from girder.constants import AccessType, AssetstoreType, TokenScope
from girder.exceptions import RestException
from girder.api import access
from girder.models.assetstore import Assetstor... | 52.673228 | 100 | 0.628298 |
bb77caa0142a247a9aa83819e8482eb5706c4386 | 2,812 | py | Python | ptsemseg/metrics.py | ozendelait/pytorch-semseg | 200491febd653bd26befcd5b3d52c614aa832b7e | [
"MIT"
] | 1 | 2021-04-30T07:46:32.000Z | 2021-04-30T07:46:32.000Z | ptsemseg/metrics.py | ozendelait/pytorch-semseg | 200491febd653bd26befcd5b3d52c614aa832b7e | [
"MIT"
] | null | null | null | ptsemseg/metrics.py | ozendelait/pytorch-semseg | 200491febd653bd26befcd5b3d52c614aa832b7e | [
"MIT"
] | 1 | 2022-01-21T17:31:46.000Z | 2022-01-21T17:31:46.000Z | # Adapted from score written by wkentaro
# https://github.com/wkentaro/pytorch-fcn/blob/master/torchfcn/utils.py
import numpy as np
class runningScore(object):
def __init__(self, n_classes):
self.n_classes = n_classes
self.confusion_matrices = {}
self.confusion_matrix = np.zeros((n_classe... | 32.697674 | 93 | 0.540896 |
2fcb5d2ded0de6ff1a778701a12981201eb3e79c | 237 | py | Python | src/gui/handlers/batteryhandler.py | spaceconcordia/csdc3 | 86d70a3eb677f23f6b38346f335b8d88d027f612 | [
"MIT"
] | null | null | null | src/gui/handlers/batteryhandler.py | spaceconcordia/csdc3 | 86d70a3eb677f23f6b38346f335b8d88d027f612 | [
"MIT"
] | null | null | null | src/gui/handlers/batteryhandler.py | spaceconcordia/csdc3 | 86d70a3eb677f23f6b38346f335b8d88d027f612 | [
"MIT"
] | null | null | null | import tornado.web
import os
class BatteryHandler(tornado.web.RequestHandler):
def get(self):
os.system('rm /root/csdc3/src/gui/handlers/systemhandlers/battery_data.txt')
self.render('index.html', section='battery')
| 29.625 | 84 | 0.725738 |
700f9c9f1d9a71d6fd3049a82a0ee0b427f648a8 | 632 | py | Python | exercicios/ex032.py | MaikolSantos/curso-em-video-python3 | 3a1ab2761b8a0f98e128083a7b0e50b19a75b7bf | [
"MIT"
] | null | null | null | exercicios/ex032.py | MaikolSantos/curso-em-video-python3 | 3a1ab2761b8a0f98e128083a7b0e50b19a75b7bf | [
"MIT"
] | null | null | null | exercicios/ex032.py | MaikolSantos/curso-em-video-python3 | 3a1ab2761b8a0f98e128083a7b0e50b19a75b7bf | [
"MIT"
] | null | null | null | from datetime import date
ano = int(input('Digite um ano para saber se ele é BISSEXTO: (para analisar o ano atual, digite 0) '))
if ano == 0:
ano = date.today().year
m4 = (ano % 4) == 0
m100 = (ano % 100) != 0
m400 = (ano % 400) == 0
if m4 == True and m100 == True:
print(f'\n O ano {ano} é BISSEXTO')
elif m... | 24.307692 | 102 | 0.59019 |
f83b291d21e6c8cc9483720314d1ef94a37de628 | 8,090 | py | Python | bindings/python/example/decoder_example.py | pukaifei/flashlight | a489aaf3be9d161c02540fdcbf41bda5709908d9 | [
"BSD-3-Clause"
] | 1 | 2021-05-26T11:56:41.000Z | 2021-05-26T11:56:41.000Z | bindings/python/example/decoder_example.py | pukaifei/flashlight | a489aaf3be9d161c02540fdcbf41bda5709908d9 | [
"BSD-3-Clause"
] | null | null | null | bindings/python/example/decoder_example.py | pukaifei/flashlight | a489aaf3be9d161c02540fdcbf41bda5709908d9 | [
"BSD-3-Clause"
] | 1 | 2022-01-12T06:48:28.000Z | 2022-01-12T06:48:28.000Z | #!/usr/bin/env python3
"""
Copyright (c) Facebook, Inc. and its affiliates.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
"""
# Perform beam-search decoding with word-level LM
# this is test with dumped acoustic model ... | 35.79646 | 123 | 0.663164 |
b3146db70a5eba467ddf53e0db4228b3476bd6a2 | 387 | py | Python | Houch/asgi.py | bharathsepuri/Home-Search-Web-App-Python-Django | 3e48f5f6e8f5dd2a1a59c9a6e9c69cb07f59a33c | [
"MIT"
] | null | null | null | Houch/asgi.py | bharathsepuri/Home-Search-Web-App-Python-Django | 3e48f5f6e8f5dd2a1a59c9a6e9c69cb07f59a33c | [
"MIT"
] | 1 | 2021-10-03T21:25:18.000Z | 2021-10-03T21:25:18.000Z | Houch/asgi.py | bharathsepuri/Home-Search-Web-App-Python-Django | 3e48f5f6e8f5dd2a1a59c9a6e9c69cb07f59a33c | [
"MIT"
] | null | null | null | """
ASGI config for Houch project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTING... | 22.764706 | 78 | 0.782946 |
1163008e8f0849c9de433b9f96a17b8a48108cac | 2,873 | py | Python | setup.py | aluhrs13/HPI | e750666e30e8987f3a4c46755857dc85dd64446c | [
"MIT"
] | null | null | null | setup.py | aluhrs13/HPI | e750666e30e8987f3a4c46755857dc85dd64446c | [
"MIT"
] | null | null | null | setup.py | aluhrs13/HPI | e750666e30e8987f3a4c46755857dc85dd64446c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# see https://github.com/karlicoss/pymplate for up-to-date reference
from setuptools import setup, find_namespace_packages # type: ignore
INSTALL_REQUIRES = [
'pytz', # even though it's not needed by the core, it's so common anyway...
'appdirs', # very common, and makes... | 33.022989 | 124 | 0.556213 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.