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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3f9bb64c3b13688df63ef2c1c6621c6981f22e05 | 16,251 | py | Python | tqsdk/objs.py | shinny-hongyan/tqsdk-python | cd130944148fba15ae10a49e77e62a9a6c551cfc | [
"Apache-2.0"
] | null | null | null | tqsdk/objs.py | shinny-hongyan/tqsdk-python | cd130944148fba15ae10a49e77e62a9a6c551cfc | [
"Apache-2.0"
] | null | null | null | tqsdk/objs.py | shinny-hongyan/tqsdk-python | cd130944148fba15ae10a49e77e62a9a6c551cfc | [
"Apache-2.0"
] | null | null | null | #:!/usr/bin/env python
#: -*- coding: utf-8 -*-
__author__ = 'chengzhi'
import copy
import weakref
from collections.abc import MutableMapping
class Entity(MutableMapping):
def _instance_entity(self, path):
self._path = path
self._listener = weakref.WeakSet()
def __setitem__(self, key, value... | 28.967914 | 134 | 0.542797 |
ab67738c1734d3a2f4ccc7448f52dd8bbf439bc4 | 12,722 | py | Python | pyrad/tests/testDictionary.py | lemquoc/pyrad | d3db68cb00d47dd0b4e8b59024beb4a2d5e115ca | [
"BSD-3-Clause"
] | null | null | null | pyrad/tests/testDictionary.py | lemquoc/pyrad | d3db68cb00d47dd0b4e8b59024beb4a2d5e115ca | [
"BSD-3-Clause"
] | null | null | null | pyrad/tests/testDictionary.py | lemquoc/pyrad | d3db68cb00d47dd0b4e8b59024beb4a2d5e115ca | [
"BSD-3-Clause"
] | 1 | 2019-07-16T23:41:48.000Z | 2019-07-16T23:41:48.000Z | import unittest
import operator
import os
from six import StringIO
from pyrad.tests import home
from pyrad.dictionary import Attribute
from pyrad.dictionary import Dictionary
from pyrad.dictionary import ParseError
from pyrad.tools import DecodeAttr
from pyrad.dictfile import DictFile
class AttributeTests(unittest.Te... | 37.307918 | 101 | 0.59574 |
b549b5e8e981d0cb09df28f3d4d5136feaf105e6 | 1,681 | py | Python | dynamic_yaml/__init__.py | childsish/dynamic-yaml | a7186d7f9b18f3dc0859c18fcb2b9ed5655e9fba | [
"MIT"
] | 27 | 2017-04-04T18:46:02.000Z | 2022-01-14T16:09:52.000Z | dynamic_yaml/__init__.py | childsish/dynamic-pyyaml | ea50d792120e87d1f2ad496364512d9591daacc0 | [
"MIT"
] | 10 | 2019-05-03T14:52:11.000Z | 2021-11-11T10:49:37.000Z | dynamic_yaml/__init__.py | childsish/dynamic-pyyaml | ea50d792120e87d1f2ad496364512d9591daacc0 | [
"MIT"
] | 8 | 2018-08-01T09:27:08.000Z | 2022-01-06T06:10:50.000Z | import yaml
from typing import Type
class DynamicYamlLoader(yaml.FullLoader):
def __init__(self, stream):
super().__init__(stream)
self.root = None
def add_wrappers(loader: Type[DynamicYamlLoader]):
from .yaml_wrappers import DynamicYamlObject, YamlDict, YamlList
def _add_dict_wrapper(... | 38.204545 | 142 | 0.774539 |
09fb7095773d5df5c3c3448d1042e7bf803d6286 | 1,646 | py | Python | osism/commands/bifrost.py | osism/python-osism | cb4f74501f92fceab1b803d4990ef20335bb7ca1 | [
"Apache-2.0"
] | null | null | null | osism/commands/bifrost.py | osism/python-osism | cb4f74501f92fceab1b803d4990ef20335bb7ca1 | [
"Apache-2.0"
] | 28 | 2022-02-03T16:45:11.000Z | 2022-03-29T13:47:33.000Z | osism/commands/bifrost.py | osism/python-osism | cb4f74501f92fceab1b803d4990ef20335bb7ca1 | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
from cliff.command import Command
from redis import Redis
from osism.tasks import ansible
redis = Redis(host="redis", port="6379")
class Run(Command):
log = logging.getLogger(__name__)
def get_parser(self, prog_name):
parser = super(Run, self).get_parser(prog_name)... | 27.898305 | 128 | 0.58627 |
04cfd54cb4463d6e7b298dd9bdc67ccccfa7ec28 | 6,271 | py | Python | dockerfiles/tasks.py | rtfd/autolint | baa26aa89229b0a59a9507eb5992e559d37775b1 | [
"MIT"
] | null | null | null | dockerfiles/tasks.py | rtfd/autolint | baa26aa89229b0a59a9507eb5992e559d37775b1 | [
"MIT"
] | 1 | 2018-03-15T23:05:13.000Z | 2018-03-22T19:07:37.000Z | dockerfiles/tasks.py | rtfd/readthedocs-common | baa26aa89229b0a59a9507eb5992e559d37775b1 | [
"MIT"
] | null | null | null | from invoke import task
DOCKER_COMPOSE = 'common/dockerfiles/docker-compose.yml'
DOCKER_COMPOSE_SEARCH = 'common/dockerfiles/docker-compose-search.yml'
DOCKER_COMPOSE_WEBPACK = 'common/dockerfiles/docker-compose-webpack.yml'
DOCKER_COMPOSE_ASSETS = 'dockerfiles/docker-compose-assets.yml'
DOCKER_COMPOSE_OVERRIDE = 'doc... | 39.19375 | 167 | 0.668952 |
881684398027de3fabce1c5edebaedaf0c541159 | 2,950 | py | Python | kingdom_sdk/adapters/unit_of_work.py | t10d/kingdom-python-core | 87aa614084e5692db23e58e0c82150e858985509 | [
"MIT"
] | 1 | 2021-11-16T14:59:08.000Z | 2021-11-16T14:59:08.000Z | kingdom_sdk/adapters/unit_of_work.py | t10d/kingdom-python-core | 87aa614084e5692db23e58e0c82150e858985509 | [
"MIT"
] | 2 | 2021-11-05T17:38:05.000Z | 2021-11-18T23:06:14.000Z | kingdom_sdk/adapters/unit_of_work.py | t10d/kingdom-python-core | 87aa614084e5692db23e58e0c82150e858985509 | [
"MIT"
] | null | null | null | from abc import ABC
from typing import Any, Generator, Iterator, List, Set, Tuple
from sqlalchemy import create_engine
from sqlalchemy.orm import Session, sessionmaker
from kingdom_sdk import config
from kingdom_sdk.domain.aggregate import Aggregate
from kingdom_sdk.domain.exception import KingdomError
from kingdom_s... | 31.052632 | 79 | 0.668136 |
249540d924e577f9c56dae5949821c31c4315da1 | 254 | py | Python | testpy/testqtgui.py | quchunguang/test | dd1dde14a69d9e8b2c9ed3efbf536df7840f0487 | [
"MIT"
] | 1 | 2021-05-06T02:02:59.000Z | 2021-05-06T02:02:59.000Z | testpy/testqtgui.py | SrikanthParsha14/test | 8cee69e09c8557d53d8d30382cec8ea5c1f82f6e | [
"MIT"
] | null | null | null | testpy/testqtgui.py | SrikanthParsha14/test | 8cee69e09c8557d53d8d30382cec8ea5c1f82f6e | [
"MIT"
] | 1 | 2019-06-17T13:20:39.000Z | 2019-06-17T13:20:39.000Z | #!/usr/bin/env python
import sys
from PyQt4 import QtGui
class Form(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
app = QtGui.QApplication(sys.argv)
form = Form()
form.show()
sys.exit(app.exec_())
| 15.875 | 44 | 0.700787 |
15df941238eb710a49e7ec41d96f95909ac883ea | 1,508 | py | Python | thenewboston_node/business_logic/blockchain/base/__init__.py | andbortnik/thenewboston-node | bd63c7def5f224286dba70f9560252a7da8ea712 | [
"MIT"
] | null | null | null | thenewboston_node/business_logic/blockchain/base/__init__.py | andbortnik/thenewboston-node | bd63c7def5f224286dba70f9560252a7da8ea712 | [
"MIT"
] | null | null | null | thenewboston_node/business_logic/blockchain/base/__init__.py | andbortnik/thenewboston-node | bd63c7def5f224286dba70f9560252a7da8ea712 | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Type, TypeVar
from django.conf import settings
from thenewboston_node.core.utils.importing import import_from_string
from .account_state import AccountStateMixin
from .blockchain_state import BlockchainStateMixin
from .blocks import BlocksMixin
from .network import Ne... | 31.416667 | 110 | 0.736074 |
c960436e8cadd5221cc3ed1ab18c015117a43ec1 | 9,005 | py | Python | scripts_ddpg/evaluate2-clde.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | 1 | 2020-06-14T13:50:28.000Z | 2020-06-14T13:50:28.000Z | scripts_ddpg/evaluate2-clde.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | null | null | null | scripts_ddpg/evaluate2-clde.py | lbaiao/sys-simulator-2 | 94f00d43309fe7b56dac5099bd4024695ba317b6 | [
"MIT"
] | null | null | null | from shutil import copyfile
import matplotlib.pyplot as plt
import os
from math import pi
import numpy as np
from copy import deepcopy
from time import time
from sys_simulator.plots import plot_positions, plot_trajectories
from sys_simulator.ddpg.agent import SurrogateAgent, SysSimAgent
from sys_simulator.parameters.pa... | 37.210744 | 113 | 0.687174 |
505ad7e815e372fe541155bb18eb93a5c4f722f7 | 9,780 | py | Python | airflow/contrib/operators/postgres_to_gcs_operator.py | rlkelly/incubator-airflow | 7105e40a2a2f0801c85402c49fadfb3fd264267f | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/contrib/operators/postgres_to_gcs_operator.py | rlkelly/incubator-airflow | 7105e40a2a2f0801c85402c49fadfb3fd264267f | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/contrib/operators/postgres_to_gcs_operator.py | rlkelly/incubator-airflow | 7105e40a2a2f0801c85402c49fadfb3fd264267f | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 39.277108 | 84 | 0.628425 |
a948a523a83aae6e5da3f9b54c785f6b6f5ce40e | 1,276 | py | Python | main.py | jeanmira/Trabalho-sobre-metodos-numericos | f43042ffcc11e4c750e247af8e9b2793d5cacdf9 | [
"MIT"
] | null | null | null | main.py | jeanmira/Trabalho-sobre-metodos-numericos | f43042ffcc11e4c750e247af8e9b2793d5cacdf9 | [
"MIT"
] | null | null | null | main.py | jeanmira/Trabalho-sobre-metodos-numericos | f43042ffcc11e4c750e247af8e9b2793d5cacdf9 | [
"MIT"
] | null | null | null | # ------------------------------- /usr/bin/g++-7 ------------------------------#
# ------------------------------- coding: utf-8 -------------------------------#
# Criado por: Jean Marcelo Mira Junior
# Lucas Daniel dos Santos
# Versão: 1.0
# Criado em: 13/04/2021
# Sistema operacional: Linux - Ubuntu 2... | 31.121951 | 80 | 0.467868 |
4915cd58e1672d903087e1f46f0c36273e58ddbf | 2,174 | py | Python | venv/lib/python3.6/site-packages/django_otp/plugins/otp_totp/migrations/0001_initial.py | ostar0816/mc-crypto | 80ad9896aed1dc952f819a404a458ccfad207d8e | [
"MIT"
] | 4 | 2018-10-19T04:36:20.000Z | 2020-02-13T16:14:09.000Z | venv/lib/python3.6/site-packages/django_otp/plugins/otp_totp/migrations/0001_initial.py | ostar0816/mc-crypto | 80ad9896aed1dc952f819a404a458ccfad207d8e | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/django_otp/plugins/otp_totp/migrations/0001_initial.py | ostar0816/mc-crypto | 80ad9896aed1dc952f819a404a458ccfad207d8e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_otp.plugins.otp_totp.models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
... | 57.210526 | 233 | 0.650874 |
9bc694208a5ef8553057a2796a045bd1941b1d20 | 875 | py | Python | Sum Consecutives.py | Darkhunter9/python | 8caa3d0aa4b06e5e48871ff085fc740b0ea2d7aa | [
"MIT"
] | null | null | null | Sum Consecutives.py | Darkhunter9/python | 8caa3d0aa4b06e5e48871ff085fc740b0ea2d7aa | [
"MIT"
] | null | null | null | Sum Consecutives.py | Darkhunter9/python | 8caa3d0aa4b06e5e48871ff085fc740b0ea2d7aa | [
"MIT"
] | 1 | 2022-01-08T00:20:15.000Z | 2022-01-08T00:20:15.000Z | def sum_consecutives(a):
if not a:
return []
result = []
cur = a[0]
temp = 0
for i in a:
if i == cur:
temp += i
else:
result.append(temp)
temp = i
cur = i
result.append(temp)
return result
if __name__ == '__main__':... | 27.34375 | 76 | 0.540571 |
08b778d81a185c7a2c50354fc0ba0a23ca563aa8 | 1,664 | py | Python | national_id/validators.py | AhmedElmougy/national-id-validator | 27d81cd6e3ef556074c0fd5097db0537fd2114c2 | [
"BSD-3-Clause"
] | 1 | 2021-06-24T08:31:44.000Z | 2021-06-24T08:31:44.000Z | national_id/validators.py | AhmedElmougy/national-id-validator | 27d81cd6e3ef556074c0fd5097db0537fd2114c2 | [
"BSD-3-Clause"
] | null | null | null | national_id/validators.py | AhmedElmougy/national-id-validator | 27d81cd6e3ef556074c0fd5097db0537fd2114c2 | [
"BSD-3-Clause"
] | null | null | null | import re
from datetime import date, datetime
from rest_framework import serializers
from national_id.governorate_list import GOVERNORATES
class NationalIdValidator:
"""
validates national id number
"""
def __call__(self, value):
# validate general id format
regex = r"^(?P<century... | 29.714286 | 72 | 0.551683 |
2234614c3958f4537d24b2801eff0fb449340c36 | 6,792 | py | Python | openflix/providers/ygg/ygg.py | ChevalFugace/OpenFlix | cf2cadca1a919091c327afffed26c3280449def5 | [
"MIT"
] | null | null | null | openflix/providers/ygg/ygg.py | ChevalFugace/OpenFlix | cf2cadca1a919091c327afffed26c3280449def5 | [
"MIT"
] | null | null | null | openflix/providers/ygg/ygg.py | ChevalFugace/OpenFlix | cf2cadca1a919091c327afffed26c3280449def5 | [
"MIT"
] | null | null | null | from openflix.interface import Interface, expose
from openflix import app
from mastodon import Mastodon
from yggtorrentscraper import (YggTorrentScraper, set_yggtorrent_tld,
get_yggtorrent_tld, categories)
import time
import datetime
from http import HTTPStatus as status
from flask import... | 30.321429 | 93 | 0.605713 |
b99df80a241df4c693bb37bb0d8b5e25d9211097 | 20,212 | py | Python | test/augmentation/test_functional.py | ceroytres/kornia | b9ffe7efcba7399daeeb8028f10c22941b55d32d | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2021-04-15T01:20:01.000Z | 2022-01-12T14:12:54.000Z | test/augmentation/test_functional.py | wyli/kornia | 53e417eae7c296a0d0b57ad2b1ba8cd11f24c40d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/augmentation/test_functional.py | wyli/kornia | 53e417eae7c296a0d0b57ad2b1ba8cd11f24c40d | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-10-20T06:57:07.000Z | 2020-10-20T06:57:07.000Z | import pytest
import torch
import torch.nn as nn
from torch.testing import assert_allclose
from torch.autograd import gradcheck
import kornia
import kornia.testing as utils # test utils
import kornia.augmentation.functional as F
from kornia.constants import pi
from kornia.augmentation import ColorJitter
class Test... | 44.815965 | 98 | 0.403721 |
6f46890a5f08975016f37f1b18f3bc8b3c453b01 | 1,197 | py | Python | stats/tactic_asts.py | reichel3/TacTok | c344e76263de04311af8a0030c07aec95d87f71c | [
"MIT"
] | 7 | 2020-11-23T02:45:36.000Z | 2022-03-18T03:03:33.000Z | stats/tactic_asts.py | reichel3/TacTok | c344e76263de04311af8a0030c07aec95d87f71c | [
"MIT"
] | 4 | 2021-02-23T03:03:51.000Z | 2021-11-13T00:07:38.000Z | stats/tactic_asts.py | reichel3/TacTok | c344e76263de04311af8a0030c07aec95d87f71c | [
"MIT"
] | 2 | 2021-01-19T17:56:28.000Z | 2022-03-28T04:39:41.000Z | import common
import numpy as np
from utils import iter_proofs
from lark.exceptions import UnexpectedCharacters, ParseError
from tac_grammar import CFG, TreeBuilder, NonterminalNode, TerminalNode
import pdb
grammar = CFG(common.tac_grammar, 'tactic_expr')
tree_builder = TreeBuilder(grammar)
ast_height = []
num_token... | 29.195122 | 90 | 0.688388 |
e1d08b1c8d96281c1a45c1638cec602dd4b39a18 | 9,174 | py | Python | nilearn/plotting/html_connectome.py | SIMEXP/nilearn | 4f51aea58f38689ca32c2edd748528d521e6cfb0 | [
"BSD-2-Clause"
] | 2 | 2015-04-30T23:29:24.000Z | 2018-04-13T08:38:05.000Z | nilearn/plotting/html_connectome.py | SIMEXP/nilearn | 4f51aea58f38689ca32c2edd748528d521e6cfb0 | [
"BSD-2-Clause"
] | 1 | 2015-02-23T08:53:09.000Z | 2015-02-23T08:53:09.000Z | nilearn/plotting/html_connectome.py | SIMEXP/nilearn | 4f51aea58f38689ca32c2edd748528d521e6cfb0 | [
"BSD-2-Clause"
] | 1 | 2017-08-23T22:04:21.000Z | 2017-08-23T22:04:21.000Z | import json
import numpy as np
from scipy import sparse
from nilearn._utils import replace_parameters
from .. import datasets
from . import cm
from .js_plotting_utils import (add_js_lib, HTMLDocument, mesh_to_plotly,
encode, colorscale, get_html_template,
... | 35.149425 | 79 | 0.659799 |
38f14f3ce9b905a152ff4f7b6ef85c46113bdc7d | 11,977 | py | Python | main.py | aryanshivamarya/LOCO-BOT | 3ea8229e282d6b28930af96881693294ae6805c1 | [
"BSD-3-Clause"
] | null | null | null | main.py | aryanshivamarya/LOCO-BOT | 3ea8229e282d6b28930af96881693294ae6805c1 | [
"BSD-3-Clause"
] | null | null | null | main.py | aryanshivamarya/LOCO-BOT | 3ea8229e282d6b28930af96881693294ae6805c1 | [
"BSD-3-Clause"
] | null | null | null |
'''
using discord.py version 1.0.0a
'''
import discord
import asyncio
import re
import multiprocessing
import threading
import concurrent
BOT_OWNER_ROLE = 'fetch' # change to what you need
#BOT_OWNER_ROLE_ID = "597332392637890571"
oot_channel_id_list = [
"593990608914219008", #loco galaxy
"607613349491... | 34.22 | 295 | 0.616515 |
a9556ec8ba62e5c55d22713ac49d2d13c4c3f7a4 | 16,768 | py | Python | production/production/node_modules/mavlink/src/mavlink/pymavlink/generator/mavgen_python.py | baconpancakes1482/narc-drone | d1b6563f68db6488cd46684e6ca32e655e000a57 | [
"MIT"
] | null | null | null | production/production/node_modules/mavlink/src/mavlink/pymavlink/generator/mavgen_python.py | baconpancakes1482/narc-drone | d1b6563f68db6488cd46684e6ca32e655e000a57 | [
"MIT"
] | 7 | 2021-09-01T00:00:56.000Z | 2021-11-17T04:08:28.000Z | production/production/node_modules/mavlink/src/mavlink/pymavlink/generator/mavgen_python.py | baconpancakes1482/narc-drone | d1b6563f68db6488cd46684e6ca32e655e000a57 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
parse a MAVLink protocol XML file and generate a python implementation
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
import sys, textwrap, os
import mavparse, mavtemplate
t = mavtemplate.MAVTemplate()
def generate_preamble(outf, msgs, args, xml):
print("G... | 34.716356 | 130 | 0.527552 |
035cf522f7b8da623c530613d628d0d617b1a56e | 4,938 | py | Python | fcblog/app/routes.py | francoiscolombo/sample | 87a1943b815da8d8c3772758b8181df27242d216 | [
"MIT"
] | 1 | 2020-03-09T08:26:28.000Z | 2020-03-09T08:26:28.000Z | fcblog/app/routes.py | francoiscolombo/sample | 87a1943b815da8d8c3772758b8181df27242d216 | [
"MIT"
] | null | null | null | fcblog/app/routes.py | francoiscolombo/sample | 87a1943b815da8d8c3772758b8181df27242d216 | [
"MIT"
] | null | null | null | from datetime import datetime
from flask import render_template, flash, redirect, url_for, request
from flask_login import current_user, login_user, logout_user, login_required
from werkzeug.urls import url_parse
from app import app, db
from app.forms import LoginForm, RegistrationForm, EditProfileForm, PostForm
from a... | 36.308824 | 120 | 0.728028 |
bb867308fdc2d15e96a93db7f41f67d1b77dd47d | 6,484 | py | Python | ppb/engine.py | nbraud/pursuedpybear | d6647063568133118f66cbe63401a289c8cecfce | [
"Artistic-2.0"
] | null | null | null | ppb/engine.py | nbraud/pursuedpybear | d6647063568133118f66cbe63401a289c8cecfce | [
"Artistic-2.0"
] | 1 | 2019-03-30T14:10:13.000Z | 2019-04-02T21:29:10.000Z | ppb/engine.py | nbraud/pursuedpybear | d6647063568133118f66cbe63401a289c8cecfce | [
"Artistic-2.0"
] | null | null | null | from collections import defaultdict
from collections import deque
from contextlib import ExitStack
from itertools import chain
import time
from typing import Any
from typing import Callable
from typing import DefaultDict
from typing import List
from typing import Type
from typing import Union
import ppb.events as even... | 31.784314 | 115 | 0.61752 |
db56aad5ff327239ce2e35d7a81914fd3886771a | 110,019 | py | Python | emscripten.py | revmischa/emscripten | ad0838a2f354f86b1bbf1fb799faeadb29b9a7b5 | [
"MIT"
] | null | null | null | emscripten.py | revmischa/emscripten | ad0838a2f354f86b1bbf1fb799faeadb29b9a7b5 | [
"MIT"
] | null | null | null | emscripten.py | revmischa/emscripten | ad0838a2f354f86b1bbf1fb799faeadb29b9a7b5 | [
"MIT"
] | null | null | null | # Copyright 2010 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""A small wrapper script around the core JS compiler. This calls tha... | 39.447472 | 256 | 0.6838 |
3ef040c937a3665d5d0fe4fb0aa5c9d5717f92b7 | 3,928 | py | Python | GameBoard.py | DebugScientist78/domino_game_ics4ur | 008bca1efc528290cfa1f54e3dc8506888ebda53 | [
"MIT"
] | null | null | null | GameBoard.py | DebugScientist78/domino_game_ics4ur | 008bca1efc528290cfa1f54e3dc8506888ebda53 | [
"MIT"
] | null | null | null | GameBoard.py | DebugScientist78/domino_game_ics4ur | 008bca1efc528290cfa1f54e3dc8506888ebda53 | [
"MIT"
] | null | null | null | import DominosPile
import random
import GameEngine
class Deque:
def __init__(self, ls=[]):
self.deq = ls[:]
def appendR(self, data):
self.deq.append(data)
def appendL(self, data):
ls = [data]
self.deq = ls + self.deq
def popL(self):
self.deq.pop(0)
def popR(s... | 28.882353 | 92 | 0.520876 |
4730601d4a38652a9820f1fecb64401fd75644fa | 1,538 | py | Python | exportplan/migrations/0004_exportplanactions.py | uktrade/directory-api | 45a9024a7ecc2842895201cbb51420ba9e57a168 | [
"MIT"
] | 2 | 2017-06-02T09:09:08.000Z | 2021-01-18T10:26:53.000Z | exportplan/migrations/0004_exportplanactions.py | uktrade/directory-api | 45a9024a7ecc2842895201cbb51420ba9e57a168 | [
"MIT"
] | 629 | 2016-10-10T09:35:52.000Z | 2022-03-25T15:04:04.000Z | exportplan/migrations/0004_exportplanactions.py | uktrade/directory-api | 45a9024a7ecc2842895201cbb51420ba9e57a168 | [
"MIT"
] | 5 | 2017-06-22T10:02:22.000Z | 2022-03-14T17:55:21.000Z | # Generated by Django 2.2.10 on 2020-03-13 15:30
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
('exportplan', '0003_auto_20200219_1332'),
]
operations = [
migrations.Cr... | 45.235294 | 161 | 0.630689 |
bc369cdfbdb3e5d38f82021702458d4894c1ea42 | 17,729 | py | Python | gui/text.py | cmatomic/electrum-cesc | 8e32dee4ff13cbc07646de632d49272636f936c0 | [
"MIT"
] | null | null | null | gui/text.py | cmatomic/electrum-cesc | 8e32dee4ff13cbc07646de632d49272636f936c0 | [
"MIT"
] | 2 | 2015-09-13T19:53:35.000Z | 2020-01-26T23:48:04.000Z | gui/text.py | cmatomic/electrum-cesc | 8e32dee4ff13cbc07646de632d49272636f936c0 | [
"MIT"
] | 4 | 2016-10-07T17:21:11.000Z | 2021-12-20T05:21:24.000Z | import tty, sys
import curses, datetime, locale
from decimal import Decimal
from electrum_cesc.util import format_satoshis, set_verbosity
from electrum_cesc.util import StoreDict
from electrum_cesc.bitcoin import is_valid, COIN, TYPE_ADDRESS
from electrum_cesc import Wallet, WalletStorage
_ = lambda x:x
class Elec... | 36.107943 | 151 | 0.529754 |
08f08986951a902a331011b272ada03c89845c7d | 13,375 | py | Python | salt/states/boto_cloudtrail.py | ronnix/salt | 00ffa294ad5842786e9da9cb4fc70955f53299fa | [
"Apache-2.0"
] | null | null | null | salt/states/boto_cloudtrail.py | ronnix/salt | 00ffa294ad5842786e9da9cb4fc70955f53299fa | [
"Apache-2.0"
] | null | null | null | salt/states/boto_cloudtrail.py | ronnix/salt | 00ffa294ad5842786e9da9cb4fc70955f53299fa | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Manage CloudTrail Objects
=================
.. versionadded:: 2016.3.0
Create and destroy CloudTrail objects. Be aware that this interacts with Amazon's services,
and so may incur charges.
This module uses ``boto3``, which can be installed via package, or pip.
This module accepts explici... | 36.345109 | 97 | 0.584822 |
3632b2b7af57e14d43cefebd02bbbfb120cdfdee | 1,328 | py | Python | Dino.py | ashishcssom/small-projects | 389be06c5ba0e37fd4164a34e2278210f77903fb | [
"MIT"
] | null | null | null | Dino.py | ashishcssom/small-projects | 389be06c5ba0e37fd4164a34e2278210f77903fb | [
"MIT"
] | null | null | null | Dino.py | ashishcssom/small-projects | 389be06c5ba0e37fd4164a34e2278210f77903fb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun May 24 21:19:15 2020
@author: imash
"""
import pyautogui # pip install pyautogui
from PIL import Image, ImageGrab # pip install pillow
#from numpy import asarray
import time
def hit(key):
pyautogui.keyDown(key)
return
def isCollide(data):
# Dra... | 22.896552 | 57 | 0.487199 |
d13ff84a8aca63d0c819f985845febf2082d2d39 | 605 | py | Python | physionet-django/user/migrations/0014_credentialapplication_project_of_interest.py | Lucas-Mc/physionet-build | 77da5da6273cf3f5f2afce95dc5d0ce3302741ca | [
"BSD-3-Clause"
] | 36 | 2019-02-14T18:10:39.000Z | 2022-01-21T12:48:52.000Z | physionet-django/user/migrations/0014_credentialapplication_project_of_interest.py | Lucas-Mc/physionet-build | 77da5da6273cf3f5f2afce95dc5d0ce3302741ca | [
"BSD-3-Clause"
] | 1,051 | 2019-01-31T18:03:14.000Z | 2022-03-31T20:53:04.000Z | physionet-django/user/migrations/0014_credentialapplication_project_of_interest.py | Lucas-Mc/physionet-build | 77da5da6273cf3f5f2afce95dc5d0ce3302741ca | [
"BSD-3-Clause"
] | 13 | 2019-03-26T11:02:32.000Z | 2022-03-17T11:39:49.000Z | # Generated by Django 2.1.9 on 2019-06-19 20:06
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project', '0022_author_creation_date'),
('user', '0013_auto_20190618_0832'),
]
operations = [
migra... | 28.809524 | 163 | 0.669421 |
e1be98ac9c029dd140a0a5a2f47bb00e189bb09a | 6,744 | py | Python | script/cached-benchmark/postprocess.py | TITAN-PyCompat/ck-tensorflow | 6e42c2dc7a98ced05c2e74990b215407f06b542b | [
"BSD-3-Clause"
] | null | null | null | script/cached-benchmark/postprocess.py | TITAN-PyCompat/ck-tensorflow | 6e42c2dc7a98ced05c2e74990b215407f06b542b | [
"BSD-3-Clause"
] | null | null | null | script/cached-benchmark/postprocess.py | TITAN-PyCompat/ck-tensorflow | 6e42c2dc7a98ced05c2e74990b215407f06b542b | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright (c) 2018 cTuning foundation.
# See CK COPYRIGHT.txt for copyright details.
#
# SPDX-License-Identifier: BSD-3-Clause.
# See CK LICENSE.txt for licensing details.
#
import os
import json
TOP1 = 0
TOP5 = 0
IMAGES_COUNT = 0 # to be assigned
def ck_postprocess(i):
print('\n-------------------------------... | 32.267943 | 114 | 0.64917 |
c3cfb3de27eb7fcf9251fdabf2fdfc0cf07c2628 | 505 | py | Python | models/city.py | joseluis-max/AirBnB_clone_v2 | da5755ab708beb8f31ce6387e01a2eb646b41b46 | [
"MIT"
] | null | null | null | models/city.py | joseluis-max/AirBnB_clone_v2 | da5755ab708beb8f31ce6387e01a2eb646b41b46 | [
"MIT"
] | null | null | null | models/city.py | joseluis-max/AirBnB_clone_v2 | da5755ab708beb8f31ce6387e01a2eb646b41b46 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
""" City Module for HBNB project """
from sqlalchemy import Column, String, ForeignKey
from sqlalchemy.orm import relationship
from models.base_model import BaseModel, Base
class City(BaseModel, Base):
""" The city class, contains state ID and name """
__tablename__ = 'cities'
state_id ... | 36.071429 | 75 | 0.722772 |
fb1bb8c969cef14d231d8528cb30e473cec40444 | 8,339 | py | Python | toontown/coghq/LevelSuitPlannerAI.py | CrankySupertoon01/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2021-02-13T22:40:50.000Z | 2021-02-13T22:40:50.000Z | toontown/coghq/LevelSuitPlannerAI.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | toontown/coghq/LevelSuitPlannerAI.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | from panda3d.core import *
from direct.showbase import DirectObject
from toontown.suit import SuitDNA
from direct.directnotify import DirectNotifyGlobal
import LevelBattleManagerAI
import types
import random
class LevelSuitPlannerAI(DirectObject.DirectObject):
notify = DirectNotifyGlobal.directNotify.newCategory('... | 38.252294 | 194 | 0.605588 |
22aa1e7bfe730572b77678fa4111664dea276bbe | 3,674 | py | Python | dufi/gui/boxes/custombox/exceptionboxui.py | Shura1oplot/dufi | c9c25524020e57d3670c298acca305900b6490e7 | [
"MIT"
] | null | null | null | dufi/gui/boxes/custombox/exceptionboxui.py | Shura1oplot/dufi | c9c25524020e57d3670c298acca305900b6490e7 | [
"MIT"
] | null | null | null | dufi/gui/boxes/custombox/exceptionboxui.py | Shura1oplot/dufi | c9c25524020e57d3670c298acca305900b6490e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
exceptionboxui = '''\
<?xml version='1.0' encoding='utf-8'?>
<interface>
<object class="tk.Toplevel" id="ToplevelMainWindow">
<property name="height">200</property>
<property name="resizable">both</property>
<property name="title" translatable="yes">Application Error</property>
... | 39.505376 | 148 | 0.538922 |
306e9558ef6090c1c7db72367273e5ef15c40f84 | 3,825 | py | Python | ecs_connect/config.py | saurabhjambhule/ecs-connect | 49fdffb03b1cb811513a5bc0720009540b29833f | [
"MIT"
] | null | null | null | ecs_connect/config.py | saurabhjambhule/ecs-connect | 49fdffb03b1cb811513a5bc0720009540b29833f | [
"MIT"
] | null | null | null | ecs_connect/config.py | saurabhjambhule/ecs-connect | 49fdffb03b1cb811513a5bc0720009540b29833f | [
"MIT"
] | null | null | null | """ Config helper """
import os
from configparser import RawConfigParser
class ECSConfig():
""" Config handler class """
def __init__(self, logger):
self.logger = logger
self.config_path = os.path.expanduser('~') + '/.ecs_connect'
self._value = RawConfigParser()
self._value.re... | 34.459459 | 73 | 0.570196 |
754d5e1138b1a491f88b9c5c4f3b8568933f0b54 | 7,648 | py | Python | appengine/monorail/project/project_helpers.py | xinghun61/infra | b5d4783f99461438ca9e6a477535617fadab6ba3 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/monorail/project/project_helpers.py | asdfghjjklllllaaa/infra | 8f63af54e46194cd29291813f2790ff6e986804d | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/monorail/project/project_helpers.py | xinghun61/infra | b5d4783f99461438ca9e6a477535617fadab6ba3 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 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 or at
# https://developers.google.com/open-source/licenses/bsd
"""Helper functions and classes used by the project pages."""
from __future__ import print_func... | 36.075472 | 77 | 0.735094 |
c110104e22f3d365fe97834e08d4ead7539f798c | 2,430 | py | Python | data/cirq_new/cirq_program/startCirq_noisy743.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_noisy743.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_noisy743.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=20
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
def make_circuit(n: int, input_qubit):
c = cirq.Ci... | 34.225352 | 77 | 0.6893 |
5a053ddba58ddce51a2126769a7292f702f4eecc | 1,137 | py | Python | puzzle/models/sql/phenotypeterm.py | robinandeer/puzzle | 9476f05b416d3a5135d25492cb31411fdf831c58 | [
"MIT"
] | 24 | 2015-10-15T16:29:58.000Z | 2020-12-08T22:14:13.000Z | puzzle/models/sql/phenotypeterm.py | J35P312/PuzzleWin | 20f2521306492722fc035b5db18927578f1eae4a | [
"MIT"
] | 212 | 2015-10-08T14:28:36.000Z | 2020-04-29T22:44:10.000Z | puzzle/models/sql/phenotypeterm.py | J35P312/PuzzleWin | 20f2521306492722fc035b5db18927578f1eae4a | [
"MIT"
] | 11 | 2015-10-08T09:26:46.000Z | 2018-02-02T16:45:07.000Z | # -*- coding: utf-8 -*-
from sqlalchemy import Column, ForeignKey, Integer, String, UniqueConstraint
from sqlalchemy.orm import relationship
from .models import BASE
class PhenotypeTerm(BASE):
"""Represent a HPO phenotype term."""
__tablename__ = "phenotype_term"
__table_args__ = (UniqueConstraint('ind... | 30.72973 | 76 | 0.64292 |
fb15777bd601277880d369bac1b4e55f1ff08d19 | 422 | py | Python | src/simfoni/apps/company/migrations/0004_auto_20180510_1628.py | django-stars/simfoni-test | eaca4adc8177505e7c53e708456fd0dbb6be0b71 | [
"MIT"
] | null | null | null | src/simfoni/apps/company/migrations/0004_auto_20180510_1628.py | django-stars/simfoni-test | eaca4adc8177505e7c53e708456fd0dbb6be0b71 | [
"MIT"
] | null | null | null | src/simfoni/apps/company/migrations/0004_auto_20180510_1628.py | django-stars/simfoni-test | eaca4adc8177505e7c53e708456fd0dbb6be0b71 | [
"MIT"
] | 4 | 2018-04-26T17:43:24.000Z | 2018-05-10T14:11:09.000Z | # Generated by Django 2.0.4 on 2018-05-10 16:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('company', '0003_auto_20180510_1235'),
]
operations = [
migrations.AlterField(
model_name='rawcompany',
name='name',
... | 22.210526 | 84 | 0.616114 |
c346e9e2a1338db4cd19d613db72dc1b0e8ad6cc | 1,705 | py | Python | example/reinforcement-learning/ddpg/strategies.py | axbaretto/mxnet | 5f593885356ff6d14f5519fa18e79b944beb51cd | [
"Apache-2.0"
] | 36 | 2018-02-10T07:14:27.000Z | 2021-09-03T09:11:59.000Z | example/reinforcement-learning/ddpg/strategies.py | yanghaojin/BMXNet | 102f8d0ed59529bbd162c37bf07ae58ad6c4caa1 | [
"Apache-2.0"
] | 3 | 2017-07-10T21:49:18.000Z | 2017-07-12T22:40:06.000Z | example/reinforcement-learning/ddpg/strategies.py | yanghaojin/BMXNet | 102f8d0ed59529bbd162c37bf07ae58ad6c4caa1 | [
"Apache-2.0"
] | 15 | 2017-09-20T15:24:53.000Z | 2018-01-11T11:14:03.000Z | import numpy as np
class BaseStrategy(object):
"""
Base class of exploration strategy.
"""
def get_action(self, obs, policy):
raise NotImplementedError
def reset(self):
pass
class OUStrategy(BaseStrategy):
"""
Ornstein-Uhlenbeck process: dxt = theta * (mu - xt) * dt +... | 20.792683 | 78 | 0.578886 |
a9511dbd1a39c7ce1721c9eddb533497d8f40983 | 930 | py | Python | mmdet/core/bbox/samplers/pseudo_sampler.py | deepakksingh/mmdetection | b0d845f1fecf8064db30ef6b456b6ef5f36fa40f | [
"Apache-2.0"
] | 232 | 2021-05-25T12:55:24.000Z | 2022-03-25T07:58:49.000Z | mmdet/core/bbox/samplers/pseudo_sampler.py | deepakksingh/mmdetection | b0d845f1fecf8064db30ef6b456b6ef5f36fa40f | [
"Apache-2.0"
] | 51 | 2021-05-29T06:36:54.000Z | 2022-03-27T09:24:39.000Z | mmdet/core/bbox/samplers/pseudo_sampler.py | deepakksingh/mmdetection | b0d845f1fecf8064db30ef6b456b6ef5f36fa40f | [
"Apache-2.0"
] | 66 | 2021-06-01T03:40:08.000Z | 2022-03-30T16:51:21.000Z | import torch
from ..builder import BBOX_SAMPLERS
from .base_sampler import BaseSampler
from .sampling_result import SamplingResult
@BBOX_SAMPLERS.register_module()
class PseudoSampler(BaseSampler):
def __init__(self, **kwargs):
pass
def _sample_pos(self, **kwargs):
raise NotImplementedError... | 32.068966 | 79 | 0.673118 |
d6cc858dbbacacbac522059c83e407b8b4490b1a | 3,866 | py | Python | gensei/intersectors.py | rc/gensei | 8a8be511b545e1618a3140295a564b09001e095e | [
"BSD-3-Clause"
] | 1 | 2015-03-05T10:57:30.000Z | 2015-03-05T10:57:30.000Z | gensei/intersectors.py | rc/gensei | 8a8be511b545e1618a3140295a564b09001e095e | [
"BSD-3-Clause"
] | null | null | null | gensei/intersectors.py | rc/gensei | 8a8be511b545e1618a3140295a564b09001e095e | [
"BSD-3-Clause"
] | null | null | null | from scipy.linalg import eig, inv
from gensei.base import np, Object, pause
class Intersector(Object):
"""
Base class defining the intersector interface.
An intersector is a generalization of the concept of bounding box. Its
purpose is to quickly decide that two objects do not intersect. False
po... | 27.81295 | 75 | 0.503104 |
a26874b3456b16be15e1256393011f9c31f79d5c | 4,750 | py | Python | demo/image_classification/train.py | qizheng09/cloud | 2a6aa526f2eec0d3e3aedca78d15bdc72b85bef9 | [
"Apache-2.0"
] | null | null | null | demo/image_classification/train.py | qizheng09/cloud | 2a6aa526f2eec0d3e3aedca78d15bdc72b85bef9 | [
"Apache-2.0"
] | 1 | 2018-02-13T11:39:03.000Z | 2018-02-13T11:39:03.000Z | demo/image_classification/train.py | qizheng09/cloud | 2a6aa526f2eec0d3e3aedca78d15bdc72b85bef9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 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 applic... | 34.172662 | 79 | 0.617263 |
dc77a04eb728cad43ab7764d234f9a9be51d840b | 1,070 | py | Python | src/data/transforms.py | LucasFidon/TRABIT_BraTS2021 | 5e950f57a8580356b0b4037477c5069113f3cf31 | [
"BSD-3-Clause"
] | 5 | 2022-01-04T01:27:18.000Z | 2022-02-10T13:43:01.000Z | src/data/transforms.py | LucasFidon/TRABIT_BraTS2021 | 5e950f57a8580356b0b4037477c5069113f3cf31 | [
"BSD-3-Clause"
] | null | null | null | src/data/transforms.py | LucasFidon/TRABIT_BraTS2021 | 5e950f57a8580356b0b4037477c5069113f3cf31 | [
"BSD-3-Clause"
] | 2 | 2022-01-03T10:20:08.000Z | 2022-01-19T05:54:19.000Z | # Copyright 2021 Lucas Fidon and Suprosanna Shit
from monai.transforms import MapTransform
from dataset_config.loader import load_brats_data_config
class ConvertToMultiChannelBasedOnBratsClassesd(MapTransform):
"""
Convert labels to multi channels based on brats classes:
label 1 is the peritumoral edema
... | 35.666667 | 83 | 0.688785 |
40939ab589c1df91f7f1ef487b5dc964260d91bf | 29 | py | Python | dagster/repository/dags/dags/__init__.py | nullhack/docker-airflow | c0e31ef6bcfcf5e213d6e8776aa12d544fe00921 | [
"MIT"
] | 5 | 2020-01-05T07:25:45.000Z | 2022-03-17T05:38:52.000Z | dagster/repository/dags/dags/__init__.py | nullhack/docker-airflow | c0e31ef6bcfcf5e213d6e8776aa12d544fe00921 | [
"MIT"
] | null | null | null | dagster/repository/dags/dags/__init__.py | nullhack/docker-airflow | c0e31ef6bcfcf5e213d6e8776aa12d544fe00921 | [
"MIT"
] | 1 | 2019-10-23T09:48:33.000Z | 2019-10-23T09:48:33.000Z | from .repository import dags
| 14.5 | 28 | 0.827586 |
39b998c6a6e41625e65bf8c9ee3c05dcd91fc625 | 78 | py | Python | models.py | zhangruochi/Mol-HGT | 81c1662cdfcf9796651c761c4c64715cf7be64ce | [
"MIT"
] | 3 | 2022-01-25T08:36:20.000Z | 2022-02-23T09:16:49.000Z | models.py | zhangruochi/Mol-HGT | 81c1662cdfcf9796651c761c4c64715cf7be64ce | [
"MIT"
] | 1 | 2022-02-15T10:19:26.000Z | 2022-02-24T14:25:37.000Z | models.py | zhangruochi/Mol-HGT | 81c1662cdfcf9796651c761c4c64715cf7be64ce | [
"MIT"
] | null | null | null | from core.molPred_tfg.model import molHgt
models = {
'molHgt': molHgt,
}
| 13 | 41 | 0.692308 |
e6b0ccff6d4193568fa73b984c4dccbcf2bad902 | 1,183 | py | Python | executing_updates.py | o-netzer/operations1 | 729fda93ac1c754fd4a5db0857f539637849e8bb | [
"MIT"
] | null | null | null | executing_updates.py | o-netzer/operations1 | 729fda93ac1c754fd4a5db0857f539637849e8bb | [
"MIT"
] | null | null | null | executing_updates.py | o-netzer/operations1 | 729fda93ac1c754fd4a5db0857f539637849e8bb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 28 09:25:12 2017
@author: netzer
This is a start script for a series of update scripts each of which fetches the
latest data from either some Oracle or a MySQL data base and saves it in some
output file (for details see the given paths below in the input section)... | 39.433333 | 81 | 0.565511 |
a29e3e521f44919c211730a2de0f34d9bf11f4b3 | 2,461 | py | Python | HARK/ConsumptionSaving/ConsIndShockModelDemos/TryAlternativeParameterValues.py | jvasile/HARK | 6543432fe4105b28881d0fcf9e8c48c88caaac1d | [
"Apache-2.0"
] | null | null | null | HARK/ConsumptionSaving/ConsIndShockModelDemos/TryAlternativeParameterValues.py | jvasile/HARK | 6543432fe4105b28881d0fcf9e8c48c88caaac1d | [
"Apache-2.0"
] | 1 | 2019-03-22T10:14:44.000Z | 2019-03-22T10:14:44.000Z | HARK/ConsumptionSaving/ConsIndShockModelDemos/TryAlternativeParameterValues.py | jvasile/HARK | 6543432fe4105b28881d0fcf9e8c48c88caaac1d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 9 09:40:49 2017
@author: ccarroll@llorracc.org
"""
from __future__ import division, print_function
from builtins import str
from builtins import range
import pylab # the plotting tools
xPoints=100 # number of points at which to sample a function when plotting it using ... | 57.232558 | 152 | 0.761073 |
7c8ecf70752a4888dd1d31163cc67511df95bde6 | 5,639 | py | Python | test/unit/proxy/controllers/test_container.py | ucsc-hp-group/swift | d6f1cb851d256ceffdff6d61513f42005e7ddcec | [
"Apache-2.0"
] | 2 | 2016-01-26T14:31:04.000Z | 2016-01-26T14:31:08.000Z | test/unit/proxy/controllers/test_container.py | ucsc-hp-group/swift | d6f1cb851d256ceffdff6d61513f42005e7ddcec | [
"Apache-2.0"
] | null | null | null | test/unit/proxy/controllers/test_container.py | ucsc-hp-group/swift | d6f1cb851d256ceffdff6d61513f42005e7ddcec | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 45.475806 | 76 | 0.63646 |
ac40aa0fe5e517605f875a851d9f21017604b1be | 3,505 | py | Python | robokassa/views.py | movermeyer/django-robokassa | e6b2c42415db145540abf541e7b17c60fc4e1f09 | [
"MIT"
] | 12 | 2015-11-25T06:56:16.000Z | 2021-07-01T14:37:12.000Z | robokassa/views.py | movermeyer/django-robokassa | e6b2c42415db145540abf541e7b17c60fc4e1f09 | [
"MIT"
] | 1 | 2015-12-01T05:03:00.000Z | 2015-12-03T10:30:06.000Z | robokassa/views.py | movermeyer/django-robokassa | e6b2c42415db145540abf541e7b17c60fc4e1f09 | [
"MIT"
] | 9 | 2015-11-30T23:43:37.000Z | 2021-05-31T11:44:56.000Z | # coding: utf-8
from django.http import HttpResponse
from django.template.response import TemplateResponse
from django.views.decorators.csrf import csrf_exempt
from robokassa.conf import USE_POST
from robokassa.forms import (
ResultURLForm, SuccessRedirectForm, FailRedirectForm)
from robokassa.models import Succe... | 35.765306 | 79 | 0.69301 |
dd88a4481fdbf69934595ba8eabdca69ec623012 | 9,626 | py | Python | boml/upper_iter/forward.py | vis-opt-group/BDA | 0350187b12cb1f36d87ac4f6bc2f15a282e8fac4 | [
"MIT"
] | 2 | 2021-12-20T03:24:27.000Z | 2022-01-10T14:16:21.000Z | boml/upper_iter/forward.py | vis-opt-group/BDA | 0350187b12cb1f36d87ac4f6bc2f15a282e8fac4 | [
"MIT"
] | null | null | null | boml/upper_iter/forward.py | vis-opt-group/BDA | 0350187b12cb1f36d87ac4f6bc2f15a282e8fac4 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, print_function, division
from collections import OrderedDict
import tensorflow as tf
from tensorflow.python.training import slot_creator
import sys
import boml.extension
from boml import utils
from boml.upper_iter.outer_grad import BOMLOuterGrad
from boml.utils import maybe_add... | 45.838095 | 135 | 0.636921 |
5233c4daf1896d6ab5285a32614b975a9ba05762 | 12,524 | py | Python | slowfast/visualization/demo_loader.py | Morgan-Gan/Slowfast-fb | f7387d5f30d609f6d0e022a81c51729b647dae97 | [
"Apache-2.0"
] | null | null | null | slowfast/visualization/demo_loader.py | Morgan-Gan/Slowfast-fb | f7387d5f30d609f6d0e022a81c51729b647dae97 | [
"Apache-2.0"
] | null | null | null | slowfast/visualization/demo_loader.py | Morgan-Gan/Slowfast-fb | f7387d5f30d609f6d0e022a81c51729b647dae97 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import atexit
import copy
import queue
import threading
import time
import cv2
import slowfast.utils.loggings as logging
from slowfast.visualization.utils import TaskInfo
logger = logging.get_logger(__name__)
class Video... | 34.125341 | 103 | 0.560604 |
e6b4baf3a4468e37654d2e2e73be30608f51f42a | 13,099 | py | Python | tests/test_color_objects.py | ssaw/python-colormath | 618fadb5c56225d6c171a26be909cb3a12824fa6 | [
"BSD-3-Clause"
] | 1 | 2019-06-10T20:06:31.000Z | 2019-06-10T20:06:31.000Z | tests/test_color_objects.py | ssaw/python-colormath | 618fadb5c56225d6c171a26be909cb3a12824fa6 | [
"BSD-3-Clause"
] | null | null | null | tests/test_color_objects.py | ssaw/python-colormath | 618fadb5c56225d6c171a26be909cb3a12824fa6 | [
"BSD-3-Clause"
] | null | null | null | """
Various tests for color objects.
"""
import unittest
from colormath.color_conversions import convert_color
from colormath.color_objects import SpectralColor, XYZColor, xyYColor, \
LabColor, LuvColor, LCHabColor, LCHuvColor, RGBColor, HSLColor, HSVColor, \
CMYColor, CMYKColor
class BaseColorC... | 37.74928 | 80 | 0.65379 |
b654cfd85a6f6972298b42083c2a477475c2bd5a | 1,334 | py | Python | events.py | shurain/archbold | 887524c05737da9975bed712f5267af3cc4c3581 | [
"MIT"
] | 2 | 2015-10-24T09:24:51.000Z | 2015-10-26T18:38:29.000Z | events.py | shurain/archbold | 887524c05737da9975bed712f5267af3cc4c3581 | [
"MIT"
] | null | null | null | events.py | shurain/archbold | 887524c05737da9975bed712f5267af3cc4c3581 | [
"MIT"
] | null | null | null | import logging
import subprocess
from functools import wraps
from settings import ALLOWED_USERS, DEFAULT_RESPONSE, NOT_ALLOWED_RESPONSE
logger = logging.getLogger('archbold_basic')
def auth_required(func):
@wraps(func)
def wrapper(update, match):
user_id = update.message.from_user.id
if use... | 24.254545 | 90 | 0.64018 |
526ff2cd2859091155bf386fee14a300d5e4e265 | 2,088 | py | Python | microrganist/__init__.py | tgbugs/microrangist | 451e992ee4366ece1c03281ffb43486f688293f8 | [
"MIT"
] | null | null | null | microrganist/__init__.py | tgbugs/microrangist | 451e992ee4366ece1c03281ffb43486f688293f8 | [
"MIT"
] | null | null | null | microrganist/__init__.py | tgbugs/microrangist | 451e992ee4366ece1c03281ffb43486f688293f8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
""" Kernel needs CONFIG_INPUT_UINPUT set and/or load the uinput
module. Install pyusb and python-evdev. Run as root. """
import usb.core
import usb.util
import evdev
from evdev import ecodes
dev = usb.core.find(idVendor=0x05f3, idProduct=0x00ff)
if dev is None:
raise ValueError('dev not fo... | 24 | 81 | 0.588123 |
0e2b1e0932a1e36d8ff5f038e7d31ff803df6266 | 1,794 | py | Python | pythonAlgorithm/datastrcture/Kth Smallest Number in Sorted Matrix.py | Sky-zzt/lintcodePractice | d6436b296c5865d85e55c8ad4fcdbb0165d4ebb1 | [
"MIT"
] | 1 | 2020-09-15T07:58:55.000Z | 2020-09-15T07:58:55.000Z | pythonAlgorithm/datastrcture/Kth Smallest Number in Sorted Matrix.py | Sky-zzt/lintcodePractice | d6436b296c5865d85e55c8ad4fcdbb0165d4ebb1 | [
"MIT"
] | null | null | null | pythonAlgorithm/datastrcture/Kth Smallest Number in Sorted Matrix.py | Sky-zzt/lintcodePractice | d6436b296c5865d85e55c8ad4fcdbb0165d4ebb1 | [
"MIT"
] | null | null | null | import heapq
class Solution:
"""
@param matrix: a matrix of integers
@param k: An integer
@return: the kth smallest number in the matrix
在一个排序矩阵中找从小到大的第 k 个整数。
排序矩阵的定义为:每一行递增,每一列也递增。
Example
样例 1:
输入:
[
[1 ,5 ,7],
[3 ,7 ,8],
[4 ,8 ,9],
]
k = 4
输出: 5
... | 23.92 | 70 | 0.544593 |
8ea3e02076c3d81b767404365a3769e117429275 | 13,881 | py | Python | memberportal/profile/xerohelpers.py | snoopen/MemberMatters | 218d215aec3a32a34d7ff3c32df5b5525c461bd9 | [
"MIT"
] | null | null | null | memberportal/profile/xerohelpers.py | snoopen/MemberMatters | 218d215aec3a32a34d7ff3c32df5b5525c461bd9 | [
"MIT"
] | null | null | null | memberportal/profile/xerohelpers.py | snoopen/MemberMatters | 218d215aec3a32a34d7ff3c32df5b5525c461bd9 | [
"MIT"
] | null | null | null | from xero import Xero
from xero.auth import PrivateCredentials
from xero.exceptions import XeroBadRequest
from constance import config
import datetime
import os
xero_rsa = os.environ.get("PORTAL_XERO_RSA_FILE", "/usr/src/data/xerkey.pem")
def get_xero_contact(user):
"""
Returns an object with the... | 32.661176 | 110 | 0.507744 |
93a5db8edcd7fb5dca1e45a79dcf65d90fe57e22 | 250 | py | Python | src/py/devops_tools/contribute.py | StatisKit/license | e93fc2fd81d82eff3f6c336d5f29e5938062cc32 | [
"Apache-2.0"
] | null | null | null | src/py/devops_tools/contribute.py | StatisKit/license | e93fc2fd81d82eff3f6c336d5f29e5938062cc32 | [
"Apache-2.0"
] | 1 | 2018-02-28T14:15:09.000Z | 2018-02-28T14:15:09.000Z | src/py/devops_tools/contribute.py | StatisKit/license | e93fc2fd81d82eff3f6c336d5f29e5938062cc32 | [
"Apache-2.0"
] | 51 | 2018-02-28T15:21:01.000Z | 2021-03-15T18:26:26.000Z |
def fork_repository(organization, repository, username):
pass
def clone_repository(username, repository, directory):
pass
def add_upstream(organization, repository, username, directory):
pass
def install_recipes(directory):
pass
| 17.857143 | 64 | 0.764 |
130b813bc44b6abfaf1e754c821bb39018d39f51 | 1,656 | py | Python | config/urls.py | juftin/golfr | d94b79eca6a50bc645cf9f0814ad2bc1517c1344 | [
"MIT"
] | null | null | null | config/urls.py | juftin/golfr | d94b79eca6a50bc645cf9f0814ad2bc1517c1344 | [
"MIT"
] | 17 | 2021-11-22T18:27:32.000Z | 2022-03-29T18:30:49.000Z | config/urls.py | juftin/golfr | d94b79eca6a50bc645cf9f0814ad2bc1517c1344 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.views import defaults as default_views
from django.views.generic import TemplateView
urlpatterns = [
path("", TemplateView.as_view(template_name="pages/home... | 35.234043 | 86 | 0.646739 |
bb7bd28999f0abfc89295450bdf779c41f5f575a | 22,905 | py | Python | purity_fb/purity_fb_1dot9/apis/object_store_remote_credentials_api.py | bsamz-ps/purity_fb_python_client | 11f27ef0c72d8aac1fc4e1ed036cca038b85dfa4 | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot9/apis/object_store_remote_credentials_api.py | bsamz-ps/purity_fb_python_client | 11f27ef0c72d8aac1fc4e1ed036cca038b85dfa4 | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot9/apis/object_store_remote_credentials_api.py | bsamz-ps/purity_fb_python_client | 11f27ef0c72d8aac1fc4e1ed036cca038b85dfa4 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.9 Python SDK
Pure Storage FlashBlade REST 1.9 Python SDK. Compatible with REST API versions 1.0 - 1.9. Developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
... | 46.272727 | 249 | 0.60668 |
02e637442518bd86e8ab8ea0378a64b35b6ecf02 | 3,036 | py | Python | BeaconCharityServer/app-server/app.py | hanks/Second_Hackson_Demo | a0c76da6bfbff847be056d21481ad7e37826f617 | [
"MIT"
] | null | null | null | BeaconCharityServer/app-server/app.py | hanks/Second_Hackson_Demo | a0c76da6bfbff847be056d21481ad7e37826f617 | [
"MIT"
] | null | null | null | BeaconCharityServer/app-server/app.py | hanks/Second_Hackson_Demo | a0c76da6bfbff847be056d21481ad7e37826f617 | [
"MIT"
] | null | null | null | # coding: utf-8
from flask import Flask, jsonify, url_for, render_template, send_from_directory, request
from redis import Redis
import json
import os
from models import CharityItem
from managers import RedisManager
app = Flask(__name__)
redis_manager = RedisManager()
@app.route("/charityitem/<major>/<minor>", meth... | 38.923077 | 234 | 0.724308 |
3fecfa14b8d886fbe9962ec8c683860d6f9822bd | 4,916 | py | Python | src/vc_visual_verifier/settings.py | MonolithicMonk/vc-visual-verifier | 2199a4b0f93993bccf00b5d8504b0d7c126ae3fd | [
"Apache-2.0"
] | null | null | null | src/vc_visual_verifier/settings.py | MonolithicMonk/vc-visual-verifier | 2199a4b0f93993bccf00b5d8504b0d7c126ae3fd | [
"Apache-2.0"
] | null | null | null | src/vc_visual_verifier/settings.py | MonolithicMonk/vc-visual-verifier | 2199a4b0f93993bccf00b5d8504b0d7c126ae3fd | [
"Apache-2.0"
] | null | null | null | """
Django settings for vc_visual_verifier project.
Generated by 'django-admin startproject' using Django 3.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
i... | 29.614458 | 91 | 0.737388 |
9368abe4eb7900cc5bc94f13b1152855c1c4a136 | 9,899 | py | Python | test/models/test_approximate_gp.py | saitcakmak/botorch | fca1fa6ec27814e320564c2041f6c7dba8847ecc | [
"MIT"
] | 2,344 | 2019-05-01T04:57:26.000Z | 2022-03-29T17:00:41.000Z | test/models/test_approximate_gp.py | saitcakmak/botorch | fca1fa6ec27814e320564c2041f6c7dba8847ecc | [
"MIT"
] | 942 | 2019-05-01T05:11:30.000Z | 2022-03-31T21:58:24.000Z | test/models/test_approximate_gp.py | saitcakmak/botorch | fca1fa6ec27814e320564c2041f6c7dba8847ecc | [
"MIT"
] | 280 | 2019-05-01T05:14:53.000Z | 2022-03-29T16:00:33.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import torch
from botorch.models.approximate_gp import (
_SingleTaskVariationalGP,
Approximat... | 41.074689 | 88 | 0.649763 |
fb666934b32d4196e2f3214ecce3f9ed8c18fb4c | 5,451 | py | Python | colour/temperature/hernandez1999.py | BPearlstine/colour | 40f0281295496774d2a19eee017d50fd0c265bd8 | [
"Cube",
"BSD-3-Clause"
] | 2 | 2020-05-03T20:15:42.000Z | 2021-04-09T18:19:06.000Z | colour/temperature/hernandez1999.py | BPearlstine/colour | 40f0281295496774d2a19eee017d50fd0c265bd8 | [
"Cube",
"BSD-3-Clause"
] | null | null | null | colour/temperature/hernandez1999.py | BPearlstine/colour | 40f0281295496774d2a19eee017d50fd0c265bd8 | [
"Cube",
"BSD-3-Clause"
] | 1 | 2019-12-11T19:48:27.000Z | 2019-12-11T19:48:27.000Z | # -*- coding: utf-8 -*-
"""
Hernandez-Andres, Lee and Romero (1999) Correlated Colour Temperature
=====================================================================
Defines *Hernandez-Andres et al. (1999)* correlated colour temperature
:math:`T_{cp}` computations objects:
- :func:`colour.temperature.xy_to_CCT_He... | 32.254438 | 79 | 0.650156 |
d377322de85a41ebf041f43c79803db2f6a6ecc6 | 766 | py | Python | generated-libraries/python/netapp/qos/qos_workload_get_iter_key_td.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | 2 | 2017-03-28T15:31:26.000Z | 2018-08-16T22:15:18.000Z | generated-libraries/python/netapp/qos/qos_workload_get_iter_key_td.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | generated-libraries/python/netapp/qos/qos_workload_get_iter_key_td.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | from netapp.netapp_object import NetAppObject
class QosWorkloadGetIterKeyTd(NetAppObject):
"""
Key typedef for table qos_workload_ui
"""
_key_0 = None
@property
def key_0(self):
"""
Field workload
"""
return self._key_0
@key_0.setter
def key_0(self, ... | 21.885714 | 87 | 0.546997 |
752b0d65509d780276afdf545bcc049f019de90b | 2,631 | py | Python | src/primaires/scripting/variable.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/primaires/scripting/variable.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/primaires/scripting/variable.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | # -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... | 36.541667 | 79 | 0.720258 |
694b55cedd3e7f9248138175e42e802fc0b83c0c | 39,855 | py | Python | src/transformers/tokenization_utils.py | dctelus/transformers | 6786cbc4b14ebff0ac59c768cadd109391db9a08 | [
"Apache-2.0"
] | 8,028 | 2018-11-05T15:19:44.000Z | 2019-07-16T09:14:59.000Z | src/transformers/tokenization_utils.py | arron1227/transformers | b18dfd95e1f60ae65a959a7b255fc06522170d1b | [
"Apache-2.0"
] | 731 | 2018-11-05T21:35:52.000Z | 2019-07-16T09:51:26.000Z | src/transformers/tokenization_utils.py | arron1227/transformers | b18dfd95e1f60ae65a959a7b255fc06522170d1b | [
"Apache-2.0"
] | 2,106 | 2018-11-05T15:29:15.000Z | 2019-07-16T08:51:57.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# 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... | 41.602296 | 132 | 0.601129 |
59026e9d131f02ea73acdce89e779f228781b46f | 22,444 | py | Python | tensorboardX/proto/summary_pb2.py | cnzeki/tensorboardX | eddd644a0876fa24cdc036cf94495e7cd59c125c | [
"MIT"
] | 6 | 2019-04-30T17:32:28.000Z | 2019-11-14T03:19:16.000Z | tensorboardX/proto/summary_pb2.py | cnzeki/tensorboardX | eddd644a0876fa24cdc036cf94495e7cd59c125c | [
"MIT"
] | null | null | null | tensorboardX/proto/summary_pb2.py | cnzeki/tensorboardX | eddd644a0876fa24cdc036cf94495e7cd59c125c | [
"MIT"
] | 3 | 2019-04-29T16:21:38.000Z | 2019-11-14T03:19:31.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorboardX/proto/summary.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import r... | 42.34717 | 1,931 | 0.752762 |
6352f1fcf4ec3521127410b0df131336453f51f7 | 2,845 | py | Python | upstream/wav2vec2/expert.py | simpleoier/s3prl | 05d6fdebd8fc4e20ded01de9261028885f7f9181 | [
"MIT"
] | null | null | null | upstream/wav2vec2/expert.py | simpleoier/s3prl | 05d6fdebd8fc4e20ded01de9261028885f7f9181 | [
"MIT"
] | null | null | null | upstream/wav2vec2/expert.py | simpleoier/s3prl | 05d6fdebd8fc4e20ded01de9261028885f7f9181 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ upstream/wav2vec2/expert.py ]
# Synopsis [ the wav2vec2 wrapper ]
# Author [ S3PRL ]
# Copyright [ Copyleft(c), Speech Lab, NTU, Taiwan ]
"""***************... | 30.923913 | 99 | 0.560633 |
02732fc756d0307b1dcd1b1c09b05388bd5ab9db | 221 | py | Python | malls/utils/pagination.py | wangjianxun1995/mall | 552b635348cd5778a56c0c1fe630c6f954e99505 | [
"MIT"
] | null | null | null | malls/utils/pagination.py | wangjianxun1995/mall | 552b635348cd5778a56c0c1fe630c6f954e99505 | [
"MIT"
] | null | null | null | malls/utils/pagination.py | wangjianxun1995/mall | 552b635348cd5778a56c0c1fe630c6f954e99505 | [
"MIT"
] | null | null | null | from rest_framework.pagination import LimitOffsetPagination,PageNumberPagination
class StandardResultsSetPagination(PageNumberPagination):
page_size = 2
page_size_query_param = 'page_size'
max_page_size = 20 | 31.571429 | 80 | 0.828054 |
35dac4746735f0a24465bccfaed905f538e1837e | 2,958 | py | Python | code/Iris_pytorch/register_model.py | matheesan-CGI/AzureML_MLflow_demo | d4791a28b5f131caf94fa2a84998639c25c3afc9 | [
"MIT"
] | 5 | 2021-05-11T10:31:33.000Z | 2022-01-16T22:35:44.000Z | code/Iris_pytorch/register_model.py | matheesan-CGI/AzureML_MLflow_demo | d4791a28b5f131caf94fa2a84998639c25c3afc9 | [
"MIT"
] | null | null | null | code/Iris_pytorch/register_model.py | matheesan-CGI/AzureML_MLflow_demo | d4791a28b5f131caf94fa2a84998639c25c3afc9 | [
"MIT"
] | 3 | 2021-03-19T15:02:36.000Z | 2021-06-01T13:32:50.000Z | """
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft Corporation (“Microsoft”) grants you a nonexclusive, perpetual,
royalty-free right to use, copy, and modify the software code provided by us
("Software Code"). You may not sublicense the Software Code or any use of it
(except to your affiliates... | 45.507692 | 87 | 0.751183 |
ea8380861fea4fe461ed94acdd85ceb29c33a3b3 | 40,828 | py | Python | packages/QtInventor/QInspectorWidget.py | TheHubbit/PyInventor | 351aa15d6394a43fec5f42e757136e00d007fb5e | [
"BSD-3-Clause"
] | 15 | 2015-07-24T06:42:52.000Z | 2021-09-27T10:09:46.000Z | packages/QtInventor/QInspectorWidget.py | TheHubbit/PyInventor | 351aa15d6394a43fec5f42e757136e00d007fb5e | [
"BSD-3-Clause"
] | 8 | 2015-04-07T22:49:22.000Z | 2019-04-11T19:11:47.000Z | packages/QtInventor/QInspectorWidget.py | TheHubbit/PyInventor | 351aa15d6394a43fec5f42e757136e00d007fb5e | [
"BSD-3-Clause"
] | 9 | 2015-02-25T08:13:17.000Z | 2022-01-13T18:01:38.000Z | # QInspectorWidget class and helper classes implementation
# Author: Thomas Moeller
#
# Copyright (C) the PyInventor contributors. All rights reserved.
# This file is part of PyInventor, distributed under the BSD 3-Clause
# License. For full terms see the included COPYING file.
#
# Acknowledgements:
# For the creatio... | 37.803704 | 162 | 0.602185 |
e0ec5e657a417405b0267127ababf766e9659b29 | 316 | py | Python | src/basics/scripts/service_client.py | kaiodt/kaio_ros_ws | d9ee0edb97d16cf2a0a6074fecd049db7367a032 | [
"BSD-2-Clause"
] | null | null | null | src/basics/scripts/service_client.py | kaiodt/kaio_ros_ws | d9ee0edb97d16cf2a0a6074fecd049db7367a032 | [
"BSD-2-Clause"
] | null | null | null | src/basics/scripts/service_client.py | kaiodt/kaio_ros_ws | d9ee0edb97d16cf2a0a6074fecd049db7367a032 | [
"BSD-2-Clause"
] | null | null | null | #! /usr/bin/env python
import rospy
from basics.srv import WordCount
import sys
rospy.init_node('service_client')
rospy.wait_for_service('word_count')
word_counter = rospy.ServiceProxy('word_count', WordCount)
words = ' '.join(sys.argv[1:])
word_count = word_counter(words)
print words, '->', word_count.count
| 18.588235 | 58 | 0.756329 |
3a40f9149db442a5c573b5b7b9778fb1f31149bc | 12,399 | py | Python | scipy/io/wavfile.py | zerothi/scipy | 396a3592767c7477d14083053ac7b772951f125e | [
"BSD-3-Clause"
] | null | null | null | scipy/io/wavfile.py | zerothi/scipy | 396a3592767c7477d14083053ac7b772951f125e | [
"BSD-3-Clause"
] | null | null | null | scipy/io/wavfile.py | zerothi/scipy | 396a3592767c7477d14083053ac7b772951f125e | [
"BSD-3-Clause"
] | 1 | 2020-08-06T07:23:10.000Z | 2020-08-06T07:23:10.000Z | """
Module to read / write wav files using numpy arrays
Functions
---------
`read`: Return the sample rate (in samples/sec) and data from a WAV file.
`write`: Write a numpy array as a WAV file.
"""
from __future__ import division, print_function, absolute_import
import sys
import numpy
import struct
import warnings... | 30.9975 | 81 | 0.548593 |
fcfad5e7126b31ccc3798116be6394d06468e2bf | 2,605 | py | Python | src/python/pants/backend/project_info/tasks/dependencies.py | silverguo/pants | 141510d03fbf2b7e1a0b54f66b54088697f6fa51 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/project_info/tasks/dependencies.py | silverguo/pants | 141510d03fbf2b7e1a0b54f66b54088697f6fa51 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/project_info/tasks/dependencies.py | silverguo/pants | 141510d03fbf2b7e1a0b54f66b54088697f6fa51 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.jvm.targets.jar_library import JarLibrary
from pants.backend.jvm.targets.jvm_app import JvmApp
from pants.backend.jvm.targets.jvm_target import JvmTarget
from pants.back... | 43.416667 | 102 | 0.65643 |
43e0f5b39b8b7188e06291f5a44da32e2cf47254 | 2,316 | py | Python | cm_models/ascad_r_value/hyper_parameters.py | AISyLab/RL-based-countermeasure-design-for-SCA | f03895b4b13b0397f0cc7014d9e7d2738ff2a6a2 | [
"MIT"
] | null | null | null | cm_models/ascad_r_value/hyper_parameters.py | AISyLab/RL-based-countermeasure-design-for-SCA | f03895b4b13b0397f0cc7014d9e7d2738ff2a6a2 | [
"MIT"
] | null | null | null | cm_models/ascad_r_value/hyper_parameters.py | AISyLab/RL-based-countermeasure-design-for-SCA | f03895b4b13b0397f0cc7014d9e7d2738ff2a6a2 | [
"MIT"
] | null | null | null | from sklearn import preprocessing
from . import state_space_parameters as ssp
import countermeasures.data_loader as data_loader
import numpy as np
import tensorflow as tf
MODEL_NAME = 'ASCAD_R_Value'
# Number of output neurons
NUM_CLASSES = 256 # Number of output neurons
# Input Size
INPUT_SIZE = 1400
# Batch Que... | 34.567164 | 108 | 0.772453 |
2e2945c791cf18a925ced5c2561e41bbf994d09d | 424 | py | Python | hpc-historias-clinicas/contacto/forms.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | hpc-historias-clinicas/contacto/forms.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | hpc-historias-clinicas/contacto/forms.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django import forms
class ContactoForm(forms.Form):
"""
Formulario para el contacto con
soporte técnico
"""
nombre = forms.CharField(widget=forms.TextInput, required=True)
email = forms.EmailField(required=True)
telefono = forms.CharField(widget=forms.TextInput... | 30.285714 | 88 | 0.712264 |
384c2da51c31fb7c63ba117d74729beae01ee6ba | 15,042 | py | Python | baselines/baselines/ppo2/ppo2.py | amiranas/flow_rl | 9e6e69991c22bb85a9aeb2d5399bbade1e3bb682 | [
"Apache-2.0"
] | 26 | 2019-01-11T05:20:53.000Z | 2022-03-28T11:25:33.000Z | baselines/baselines/ppo2/ppo2.py | amiranas/flow_rl | 9e6e69991c22bb85a9aeb2d5399bbade1e3bb682 | [
"Apache-2.0"
] | 1 | 2019-04-19T17:35:31.000Z | 2019-04-30T09:03:23.000Z | baselines/baselines/ppo2/ppo2.py | amiranas/flow_rl | 9e6e69991c22bb85a9aeb2d5399bbade1e3bb682 | [
"Apache-2.0"
] | 10 | 2019-03-19T08:21:37.000Z | 2022-03-11T09:05:35.000Z | import os
import os.path as osp
import time
from collections import deque
from os.path import join as p_join
import numpy as np
import tensorflow as tf
from tensorflow.python import pywrap_tensorflow
from baselines import logger
from baselines.common import explained_variance
from baselines.flow_rl_utils import netwo... | 41.324176 | 99 | 0.587156 |
896f470180acf77e502e0a1dd23ea2e8cf3894de | 2,587 | py | Python | tests/st/ops/ascend/vector/test_fused_mean_mul_001.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/st/ops/ascend/vector/test_fused_mean_mul_001.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/st/ops/ascend/vector/test_fused_mean_mul_001.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.493333 | 144 | 0.614612 |
1017c5028d954766cea293328aca166608720cbc | 5,068 | py | Python | acme/utils/reverb_utils.py | GACWR/acme | 764a92c09673cb826cdaf7ad157c1aab451507df | [
"Apache-2.0"
] | 1 | 2022-03-31T17:24:10.000Z | 2022-03-31T17:24:10.000Z | acme/utils/reverb_utils.py | GACWR/acme | 764a92c09673cb826cdaf7ad157c1aab451507df | [
"Apache-2.0"
] | null | null | null | acme/utils/reverb_utils.py | GACWR/acme | 764a92c09673cb826cdaf7ad157c1aab451507df | [
"Apache-2.0"
] | null | null | null | # python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 35.690141 | 79 | 0.740923 |
6cc715f23f8970e477a9a77321fc57f51927838e | 21,276 | py | Python | sktime/classification/interval_based/_drcif.py | AreloTanoh/sktime | 34f3a62a1ec86ff19da313aa421b4594f02ed993 | [
"BSD-3-Clause"
] | 2 | 2020-12-25T08:08:38.000Z | 2021-04-07T08:00:56.000Z | sktime/classification/interval_based/_drcif.py | afzal442/sktime | 294429e7f2ac5824171bb61ad075e0af0055cb02 | [
"BSD-3-Clause"
] | null | null | null | sktime/classification/interval_based/_drcif.py | afzal442/sktime | 294429e7f2ac5824171bb61ad075e0af0055cb02 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""DrCIF classifier.
interval based DrCIF classifier extracting catch22 features from random intervals on
periodogram and differences representations as well as the base series.
"""
__author__ = ["MatthewMiddlehurst"]
__all__ = ["DrCIF"]
import math
import time
import numpy as np
from joblib... | 36.873484 | 88 | 0.577082 |
f71ab74bbb37c06ec87292445a3616dd3669f146 | 7,850 | py | Python | openprompt/prompts/one2one_verbalizer.py | hlzhang109/OpenPrompt | 8a1ec1ceac3805a11b09dda9b96ad7406d222f26 | [
"Apache-2.0"
] | null | null | null | openprompt/prompts/one2one_verbalizer.py | hlzhang109/OpenPrompt | 8a1ec1ceac3805a11b09dda9b96ad7406d222f26 | [
"Apache-2.0"
] | null | null | null | openprompt/prompts/one2one_verbalizer.py | hlzhang109/OpenPrompt | 8a1ec1ceac3805a11b09dda9b96ad7406d222f26 | [
"Apache-2.0"
] | null | null | null | import json
from transformers.tokenization_utils import PreTrainedTokenizer
from yacs.config import CfgNode
from openprompt.data_utils.data_utils import InputFeatures
import re
from openprompt import Verbalizer
from typing import *
import torch
import torch.nn as nn
import torch.nn.functional as F
from openprompt.utils... | 44.101124 | 183 | 0.643057 |
98edc28d70e8a28e0bf6954e7a7da30111d30bad | 31,117 | py | Python | numba/cuda/compiler.py | svrakitin/numba | 830a2c7ccc410f270677b0b241f9b8acc2598101 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | numba/cuda/compiler.py | svrakitin/numba | 830a2c7ccc410f270677b0b241f9b8acc2598101 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2019-08-29T21:03:09.000Z | 2019-08-29T21:04:26.000Z | numba/cuda/compiler.py | svrakitin/numba | 830a2c7ccc410f270677b0b241f9b8acc2598101 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | import ctypes
import os
from functools import reduce, wraps
import operator
import sys
import threading
import warnings
import numpy as np
from numba.core.typing.templates import AbstractTemplate, ConcreteTemplate
from numba.core import types, typing, utils, funcdesc, serialize, config, compiler, sigutils
from numba.... | 34.923681 | 97 | 0.594273 |
ebdee138d6fd2468927c1b410cf2565e694792d8 | 1,052 | py | Python | freezing/web/serialize.py | freezingsaddles/freezingsaddles | a65281c0183972aa647d9ffb45ff6bd7f8da47d5 | [
"Apache-2.0"
] | 4 | 2019-01-02T15:14:46.000Z | 2020-01-02T01:22:34.000Z | freezing/web/serialize.py | freezingsaddles/freezingsaddles | a65281c0183972aa647d9ffb45ff6bd7f8da47d5 | [
"Apache-2.0"
] | 119 | 2018-01-19T13:34:39.000Z | 2022-03-16T11:48:00.000Z | freezing/web/serialize.py | freezingsaddles/freezingsaddles | a65281c0183972aa647d9ffb45ff6bd7f8da47d5 | [
"Apache-2.0"
] | 3 | 2016-07-29T02:26:24.000Z | 2017-11-20T20:38:49.000Z | from marshmallow import Schema, fields
# shortcut
optional = dict(allow_none=True, required=False)
class AthleteSchema(Schema):
id = fields.Integer()
name = fields.String()
display_name = fields.String()
team_id = fields.Integer(**optional)
access_token = fields.String(**optional)
refresh_tok... | 26.974359 | 111 | 0.692966 |
c54383ef1bb87effea3174212f317e646c831739 | 18,278 | py | Python | src/commands/cmdset.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | src/commands/cmdset.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | src/commands/cmdset.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | """
A cmdset holds a set of commands available to the object or to other
objects near it. All the commands a player can give (look, @create etc)
are stored as the default cmdset on the player object and managed using the
CmdHandler object (see cmdhandler.py).
The power of having command sets in CmdSets like this is th... | 41.635535 | 121 | 0.598917 |
a9b9a871d28a4764dfb7693ea647326d7012450b | 277 | py | Python | cyder/cydhcp/workgroup/forms.py | drkitty/cyder | 1babc443cc03aa51fa3c1015bcd22f0ea2e5f0f8 | [
"BSD-3-Clause"
] | 6 | 2015-04-16T23:18:22.000Z | 2020-08-25T22:50:13.000Z | cyder/cydhcp/workgroup/forms.py | drkitty/cyder | 1babc443cc03aa51fa3c1015bcd22f0ea2e5f0f8 | [
"BSD-3-Clause"
] | 267 | 2015-01-01T00:18:57.000Z | 2015-10-14T00:01:13.000Z | cyder/cydhcp/workgroup/forms.py | drkitty/cyder | 1babc443cc03aa51fa3c1015bcd22f0ea2e5f0f8 | [
"BSD-3-Clause"
] | 5 | 2015-03-23T00:57:09.000Z | 2019-09-09T22:42:37.000Z | from django import forms
from cyder.base.eav.forms import get_eav_form
from cyder.cydhcp.workgroup.models import Workgroup, WorkgroupAV
class WorkgroupForm(forms.ModelForm):
class Meta:
model = Workgroup
WorkgroupAVForm = get_eav_form(WorkgroupAV, Workgroup)
| 19.785714 | 64 | 0.787004 |
ef4daf5108e3ab137d61fdff23b3061d541c285c | 4,730 | py | Python | package/scripts/prmon_compress_output.py | nikoladze/prmon | 5f69f056e47119d2ed8a9379d4f4ad4290f27457 | [
"Apache-2.0"
] | 35 | 2018-03-28T11:32:16.000Z | 2022-03-11T19:05:11.000Z | package/scripts/prmon_compress_output.py | nikoladze/prmon | 5f69f056e47119d2ed8a9379d4f4ad4290f27457 | [
"Apache-2.0"
] | 166 | 2018-03-13T20:19:09.000Z | 2022-01-31T08:54:22.000Z | package/scripts/prmon_compress_output.py | HEP-SF/prmon | 33ce283183cbb31dc779f43fe899d26a699b1cc6 | [
"Apache-2.0"
] | 13 | 2018-03-16T09:37:26.000Z | 2022-01-26T07:38:39.000Z | #! /usr/bin/env python3
"""prmon output smart compression script"""
import argparse
import os
import sys
try:
import pandas as pd
except ImportError:
print("ERROR:: This script needs pandas.")
sys.exit(-1)
MEMORY_IO_NETWORK_GPU_CPU = [
"vmem",
"pss",
"rss",
"swap",
"rchar",
"wcha... | 29.197531 | 87 | 0.62093 |
0c121c218979c0f4722383e78010490072f227c0 | 393 | py | Python | backend/chat_user_profile/api/v1/urls.py | crowdbotics-apps/hey-neighbor-30236 | be2e66cbfe274f6e01584bf1e54e661b75eaa0de | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/chat_user_profile/api/v1/urls.py | crowdbotics-apps/hey-neighbor-30236 | be2e66cbfe274f6e01584bf1e54e661b75eaa0de | [
"FTL",
"AML",
"RSA-MD"
] | 20 | 2021-09-06T14:23:04.000Z | 2022-03-13T17:37:36.000Z | backend/chat_user_profile/api/v1/urls.py | crowdbotics-apps/textme-30334 | 120bb87693a98e352c36fd116b4426e209b773ba | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .viewsets import VerificationCodeViewSet, ProfileViewSet, ContactViewSet
router = DefaultRouter()
router.register("verificationcode", VerificationCodeViewSet)
router.register("contact", ContactViewSet)
router.register("profile"... | 30.230769 | 77 | 0.80916 |
cb06ba14954d7ce3bf33f4de78f403ffff03cf98 | 15,930 | py | Python | raiden_contracts/tests/test_token_network.py | karlb/raiden-contracts | 944eb6aa4cc0189caab5b735b46bb6fb72ad5658 | [
"MIT"
] | null | null | null | raiden_contracts/tests/test_token_network.py | karlb/raiden-contracts | 944eb6aa4cc0189caab5b735b46bb6fb72ad5658 | [
"MIT"
] | null | null | null | raiden_contracts/tests/test_token_network.py | karlb/raiden-contracts | 944eb6aa4cc0189caab5b735b46bb6fb72ad5658 | [
"MIT"
] | null | null | null | from typing import Callable
import pytest
from eth_tester.exceptions import TransactionFailed
from web3 import Web3
from web3.contract import Contract
from raiden_contracts.constants import (
EMPTY_ADDRESS,
TEST_SETTLE_TIMEOUT_MAX,
TEST_SETTLE_TIMEOUT_MIN,
)
from raiden_contracts.tests.utils.constants imp... | 36.287016 | 95 | 0.644382 |
f5cae8f14fd8f8e9f5d805da7ed2132de928b789 | 4,771 | py | Python | tests/test_indexes.py | zikphil/umongo | ab96ae76c56cfa1c636ff965096a2f3a19a3efd0 | [
"MIT"
] | 1 | 2021-04-28T12:15:42.000Z | 2021-04-28T12:15:42.000Z | tests/test_indexes.py | AndsoiIo/umongo | bded0bade1d8d3ec1414171f3f1c337fec6ebe81 | [
"MIT"
] | null | null | null | tests/test_indexes.py | AndsoiIo/umongo | bded0bade1d8d3ec1414171f3f1c337fec6ebe81 | [
"MIT"
] | null | null | null | from itertools import zip_longest
import pytest
from umongo import Document, EmbeddedDocument, fields
from umongo.indexes import (
explicit_key, parse_index,
IndexModel, ASCENDING, DESCENDING, TEXT, HASHED)
from .common import BaseTest
def assert_indexes(indexes1, indexes2):
if hasattr(indexes1, '__ite... | 34.824818 | 97 | 0.535946 |
c5dce030a47e73168228d4df20e8b8f6914b0ddd | 537 | py | Python | Leetcode/829-consecutive_numbers_sum.py | EdwaRen/Competitve-Programming | e8bffeb457936d28c75ecfefb5a1f316c15a9b6c | [
"MIT"
] | 1 | 2021-05-03T21:48:25.000Z | 2021-05-03T21:48:25.000Z | Leetcode/829-consecutive_numbers_sum.py | EdwaRen/Competitve_Programming | e8bffeb457936d28c75ecfefb5a1f316c15a9b6c | [
"MIT"
] | null | null | null | Leetcode/829-consecutive_numbers_sum.py | EdwaRen/Competitve_Programming | e8bffeb457936d28c75ecfefb5a1f316c15a9b6c | [
"MIT"
] | null | null | null | class Solution(object):
def consecutiveNumbersSum(self, N):
"""
:type N: int
:rtype: int
"""
# start off with N = N as a possibility
res = 1
# i is the number of elements in a consecutive chunk
i = 2
while i*(i+1)//2 <= N:
# n0 is t... | 26.85 | 64 | 0.480447 |
c9b001ac3c61c69e740f07abf11395693b484515 | 269 | py | Python | cloudtools/stop.py | rbonazzola/cloudtools | 75cb0d86423b814382591206af7a543df7ff55b7 | [
"MIT"
] | null | null | null | cloudtools/stop.py | rbonazzola/cloudtools | 75cb0d86423b814382591206af7a543df7ff55b7 | [
"MIT"
] | null | null | null | cloudtools/stop.py | rbonazzola/cloudtools | 75cb0d86423b814382591206af7a543df7ff55b7 | [
"MIT"
] | null | null | null | from subprocess import call
def init_parser(parser):
parser.add_argument('name', type=str, help='Cluster name.')
def main(args):
print("Stopping cluster '{}'...".format(args.name))
call(['gcloud', 'dataproc', 'clusters', 'delete', '--quiet', args.name])
| 26.9 | 76 | 0.66171 |
39a649ed407f4a54cdbfa8c14aacb047cdb117e3 | 868 | py | Python | printscreen.py | SilasPDJ/maeportifolios_desktop_etc | a341648c8161251d42055155f6fd99fd388d9f2d | [
"MIT"
] | null | null | null | printscreen.py | SilasPDJ/maeportifolios_desktop_etc | a341648c8161251d42055155f6fd99fd388d9f2d | [
"MIT"
] | null | null | null | printscreen.py | SilasPDJ/maeportifolios_desktop_etc | a341648c8161251d42055155f6fd99fd388d9f2d | [
"MIT"
] | null | null | null | def executa():
from time import sleep
import pyautogui as pygui
path = r'C:\Users\Silas\OneDrive\Mae_Area de Trabalho\_PRINTSCREEN_3ANO-2020\11-11'
prossegue = True
try:
with open('counter', 'r') as file:
valor = file.read()
except FileNotFoundError:
with open('coun... | 23.459459 | 87 | 0.576037 |
b4966031a0787a0ef834238b532f4faa7549910a | 2,413 | py | Python | src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_upgrade_profile.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 2 | 2021-06-05T17:51:26.000Z | 2021-11-17T11:17:56.000Z | src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_upgrade_profile.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 3 | 2020-05-27T20:16:26.000Z | 2020-07-23T19:46:49.000Z | src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_upgrade_profile.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 5 | 2020-05-09T17:47:09.000Z | 2020-10-01T19:52:06.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 38.919355 | 119 | 0.641525 |
457f71995ba4ca80041dcc038a629911e723e013 | 1,042 | py | Python | src/slippinj/cli/interactive/properties_file.py | scm-spain/slippin-jimmy | d0e52277daff523eda63f5d3137b5a990413923d | [
"Apache-2.0"
] | 7 | 2016-03-31T06:17:23.000Z | 2018-01-25T15:25:05.000Z | src/slippinj/cli/interactive/properties_file.py | scm-spain/slippin-jimmy | d0e52277daff523eda63f5d3137b5a990413923d | [
"Apache-2.0"
] | 8 | 2016-03-30T18:45:09.000Z | 2017-06-19T09:21:35.000Z | src/slippinj/cli/interactive/properties_file.py | scm-spain/slippin-jimmy | d0e52277daff523eda63f5d3137b5a990413923d | [
"Apache-2.0"
] | 13 | 2017-04-21T08:17:14.000Z | 2019-07-12T04:59:24.000Z | import os
from injector import inject
class PropertiesFile(object):
"""Get the properties file to run on the cluster"""
@inject(filesystem='filesystem')
def __init__(self, filesystem):
"""
Initialize the class
:param filesystem: Filesystem
"""
super(PropertiesFile... | 28.162162 | 100 | 0.626679 |
86bbf1f13f452312e9538f84fb98e059928f2d3c | 95 | py | Python | Tutorials/01. 10 Days of Statistics/013. Day 5 - Normal Distribution II.py | stonehengee/HackerrankPractice | ec052e7447391e40d1919cf0b641ff5023da3da3 | [
"MIT"
] | null | null | null | Tutorials/01. 10 Days of Statistics/013. Day 5 - Normal Distribution II.py | stonehengee/HackerrankPractice | ec052e7447391e40d1919cf0b641ff5023da3da3 | [
"MIT"
] | null | null | null | Tutorials/01. 10 Days of Statistics/013. Day 5 - Normal Distribution II.py | stonehengee/HackerrankPractice | ec052e7447391e40d1919cf0b641ff5023da3da3 | [
"MIT"
] | null | null | null | # Problem: https://www.hackerrank.com/challenges/s10-normal-distribution-2/problem
# Score: 30
| 31.666667 | 82 | 0.778947 |
841518f1e4e615b38404905fa1e62f45ce7342dc | 1,632 | py | Python | example/myshop/models/polymorphic_/smartcard.py | haitwang-cloud/django-shop | 8ac767a42022d66d226c0bb342f16ac3df3ca30b | [
"BSD-3-Clause"
] | 39 | 2015-02-21T00:45:02.000Z | 2020-05-18T14:46:09.000Z | example/myshop/models/polymorphic_/smartcard.py | haitwang-cloud/django-shop | 8ac767a42022d66d226c0bb342f16ac3df3ca30b | [
"BSD-3-Clause"
] | 46 | 2015-02-03T19:51:37.000Z | 2017-03-24T23:40:14.000Z | example/myshop/models/polymorphic_/smartcard.py | haitwang-cloud/django-shop | 8ac767a42022d66d226c0bb342f16ac3df3ca30b | [
"BSD-3-Clause"
] | 23 | 2015-04-12T09:03:41.000Z | 2020-04-14T16:38:35.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from djangocms_text_ckeditor.fields import HTMLField
from shop.money.fields import MoneyField
from .product import Product, BaseProductManager
class SmartCard(Product... | 26.322581 | 90 | 0.621324 |
9b413a367175d1baef75de163c0718d33dc388f4 | 260 | py | Python | dev_generate_model.py | Jimmy-Xu/fastapi_demo | f19c629cc7fa0e0e47e73e8688cd019bc74aa982 | [
"MIT"
] | 12 | 2020-09-01T09:19:41.000Z | 2022-03-17T05:48:50.000Z | dev_generate_model.py | Jimmy-Xu/fastapi_demo | f19c629cc7fa0e0e47e73e8688cd019bc74aa982 | [
"MIT"
] | null | null | null | dev_generate_model.py | Jimmy-Xu/fastapi_demo | f19c629cc7fa0e0e47e73e8688cd019bc74aa982 | [
"MIT"
] | 3 | 2021-04-26T02:53:04.000Z | 2021-11-01T14:32:38.000Z | # 基于Demo代码生成新的模块,省去复制粘贴
import os
from fastapi_plus.utils.generate_model import GenerateModel
if __name__ == "__main__":
app_dir = os.path.dirname(os.path.abspath(__file__)) + os.sep + 'app'
model_name = 'test'
GenerateModel(app_dir, model_name)
| 26 | 73 | 0.742308 |
0fc61fa1317a585b9c0e8c8498a3002463cb631a | 469 | py | Python | packages/python/plotly/plotly/validators/volume/colorbar/_borderwidth.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/volume/colorbar/_borderwidth.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/volume/colorbar/_borderwidth.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class BorderwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="borderwidth", parent_name="volume.colorbar", **kwargs
):
super(BorderwidthValidator, self).__init__(
plotly_name=plotly_name,
p... | 31.266667 | 80 | 0.643923 |
8ba96c8c411ef9dfbee57d89b58fc17b8f8f7e78 | 3,820 | py | Python | drapps/util.py | schwa-lab/dr-apps-python | e1b7b68de54cb86f60e5c570f4ebce6c47820c39 | [
"MIT"
] | 3 | 2015-03-23T17:19:10.000Z | 2016-01-11T16:40:57.000Z | drapps/util.py | schwa-lab/dr-apps-python | e1b7b68de54cb86f60e5c570f4ebce6c47820c39 | [
"MIT"
] | null | null | null | drapps/util.py | schwa-lab/dr-apps-python | e1b7b68de54cb86f60e5c570f4ebce6c47820c39 | [
"MIT"
] | null | null | null | # vim: set et nosi ai ts=2 sts=2 sw=2:
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import collections
import msgpack
import six
from six.moves import xrange
RawDoc = collections.namedtuple('RawDoc', ('version', 'klasses', 'stores', 'doc', 'instances'))
class Raw... | 28.507463 | 104 | 0.682199 |
ab1889ec2380dc545e61c96a1fc22dae995ab888 | 3,036 | py | Python | mt/config/get_config.py | Summer-2077/nlp-machine_translation | 1c69657badb21ef4672c18c712264dac79766703 | [
"Apache-2.0"
] | 2 | 2021-04-05T05:57:24.000Z | 2021-12-13T14:28:45.000Z | mt/config/get_config.py | Summer-2077/nlp-machine_translation | 1c69657badb21ef4672c18c712264dac79766703 | [
"Apache-2.0"
] | null | null | null | mt/config/get_config.py | Summer-2077/nlp-machine_translation | 1c69657badb21ef4672c18c712264dac79766703 | [
"Apache-2.0"
] | null | null | null | import os
import json
json_path = os.path.join(os.path.dirname(__file__), 'config.json') # 配置文件路径
def get_config_json(config_file='main.json'):
with open(config_file, 'r') as file:
return json.load(file)
conf = get_config_json(json_path)
# 对各变量赋值
num_validate_sentences = conf["num_validate_sentences"... | 46.707692 | 114 | 0.772727 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.