hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2a9f13a70d3783da3197770a209618a00e0a33a0 | 585 | py | Python | src/deviceinterface.py | nlitz88/metrics | a53cb0aa9bfbeea0dc9788f5461ff10905bc0352 | [
"MIT"
] | null | null | null | src/deviceinterface.py | nlitz88/metrics | a53cb0aa9bfbeea0dc9788f5461ff10905bc0352 | [
"MIT"
] | null | null | null | src/deviceinterface.py | nlitz88/metrics | a53cb0aa9bfbeea0dc9788f5461ff10905bc0352 | [
"MIT"
] | null | null | null | class DeviceInterface:
# This operation is used to initialize the device instance. Accepts a dictionary that is read in from the device's yaml definition.
# This device_config_yaml may contain any number of parameters/fields necessary to initialize/setup the instance for data collection.
def initialize(self... | 65 | 137 | 0.760684 |
924fb0c2c41bd7434c3e4512df262f91ab045978 | 837 | py | Python | models/deterministic/simple_cnn.py | tooba-jd/Test | c8ef37bfe9303542a57fad37e54b49938728089a | [
"BSD-3-Clause"
] | 33 | 2020-11-11T21:06:50.000Z | 2022-03-11T10:45:36.000Z | models/deterministic/simple_cnn.py | tooba-jd/Test | c8ef37bfe9303542a57fad37e54b49938728089a | [
"BSD-3-Clause"
] | 2 | 2021-01-09T00:40:39.000Z | 2021-01-11T21:23:39.000Z | models/deterministic/simple_cnn.py | tooba-jd/Test | c8ef37bfe9303542a57fad37e54b49938728089a | [
"BSD-3-Clause"
] | 8 | 2021-01-09T15:38:47.000Z | 2022-03-03T10:15:59.000Z | from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
class SCNN(nn.Module):
def __init__(self):
super(SCNN, self).__init__()
self.conv1 = nn.Conv2d(1, 32, 3, 1)
self.conv2 = nn.Conv2d(32, 64, 3, 1)
self.dropout1 = ... | 26.15625 | 44 | 0.551971 |
bc3fa63586213ae05eb4ab8cd6ecd43818d019b4 | 1,522 | py | Python | app/routes/assets.py | gecko0307/wallet | e1769615d409563408be27610b26d87d1f4894f9 | [
"BSL-1.0"
] | null | null | null | app/routes/assets.py | gecko0307/wallet | e1769615d409563408be27610b26d87d1f4894f9 | [
"BSL-1.0"
] | null | null | null | app/routes/assets.py | gecko0307/wallet | e1769615d409563408be27610b26d87d1f4894f9 | [
"BSL-1.0"
] | null | null | null | import json
import datetime
from datetime import datetime
import bottle
from bottle import request
from ..namespace import *
from ..data import *
@bottle.route('/assets')
def assets(db):
year = datetime.now().year
if 'year' in request.query:
year = int(request.query['year'])
d = NestedNamespace({
... | 28.185185 | 72 | 0.578187 |
e8586a79483f52a584df02361f6e390974c3c14f | 15,342 | py | Python | ansible/modules/network/netvisor/pn_vrouterif.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | ansible/modules/network/netvisor/pn_vrouterif.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | ansible/modules/network/netvisor/pn_vrouterif.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
""" PN-CLI vrouter-interface-add/remove/modify """
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | 31.698347 | 80 | 0.628275 |
5fc91f08923a4fa783e0d0e74443c04056b109b1 | 1,723 | py | Python | tests/test_changer.py | mo-mo-666/seat-change-for-class | af823a6fdbb104ad67adc21614815dfd7a36f32d | [
"MIT"
] | null | null | null | tests/test_changer.py | mo-mo-666/seat-change-for-class | af823a6fdbb104ad67adc21614815dfd7a36f32d | [
"MIT"
] | 4 | 2020-03-02T17:43:35.000Z | 2020-07-23T19:47:59.000Z | tests/test_changer.py | mo-mo-666/seat-change-for-class | af823a6fdbb104ad67adc21614815dfd7a36f32d | [
"MIT"
] | null | null | null | import unittest
import random
from stchger.changer import SeatChanger
class TestSeatChanger(unittest.TestCase):
def setUp(self):
random.seed(0)
self.seat_places = ((0, 1), (0, 2), (1, 0), (1, 1), (1, 2))
self.members = [{"num": i} for i in range(1, 6)]
def initializer(*args, **k... | 33.134615 | 86 | 0.625653 |
343b4b6789a5a374d9dc9f2cf79c20424d80fcdb | 2,099 | py | Python | data/scripts/210619_validate_dataset_SNR.py | zieglerad/damselfly | d0ee9b13aa5981a91f62765cba6a263b584e7f25 | [
"MIT"
] | null | null | null | data/scripts/210619_validate_dataset_SNR.py | zieglerad/damselfly | d0ee9b13aa5981a91f62765cba6a263b584e7f25 | [
"MIT"
] | null | null | null | data/scripts/210619_validate_dataset_SNR.py | zieglerad/damselfly | d0ee9b13aa5981a91f62765cba6a263b584e7f25 | [
"MIT"
] | null | null | null | import h5py
import numpy as np
import os
import damselfly as df
damselpath = '/home/az396/project/damselfly'
simdata_name = 'df1'
simdata_date = '210617'
#augdata_date = '210617'
#augdata_name = 'df4'
#ncopies_list = [25, 10, 10]
#split_train = 0.6
#splitgroups = ['train', 'test', 'val']
#noisefractions = [0.2, 0.... | 29.56338 | 182 | 0.65698 |
4f841e653f033fcb0e5c4baa2a3e158aa9d3b65e | 27,317 | py | Python | localstack/services/firehose/provider.py | doytsujin/localstack | 46ffd646af553f381cc567e4a7a06f604640c1c7 | [
"Apache-2.0"
] | 1 | 2022-03-17T07:22:23.000Z | 2022-03-17T07:22:23.000Z | localstack/services/firehose/provider.py | doytsujin/localstack | 46ffd646af553f381cc567e4a7a06f604640c1c7 | [
"Apache-2.0"
] | null | null | null | localstack/services/firehose/provider.py | doytsujin/localstack | 46ffd646af553f381cc567e4a7a06f604640c1c7 | [
"Apache-2.0"
] | null | null | null | import base64
import json
import logging
import threading
import time
import uuid
from datetime import datetime
from typing import Dict, List
import requests
from localstack.aws.api import RequestContext
from localstack.aws.api.firehose import (
AmazonopensearchserviceDestinationConfiguration,
Amazonopensearc... | 42.549844 | 122 | 0.664714 |
ba6dddbe205892afc0816474e6d780ada99b6935 | 3,627 | py | Python | tests/test_example_nem12.py | aguinane/nem-writer | 8d7d0e328e3f82831a94367cc7f02cfa88d19cd0 | [
"MIT"
] | 2 | 2020-08-13T07:44:25.000Z | 2021-01-12T12:40:12.000Z | tests/test_example_nem12.py | aguinane/nem-writer | 8d7d0e328e3f82831a94367cc7f02cfa88d19cd0 | [
"MIT"
] | 4 | 2018-02-14T03:48:43.000Z | 2020-09-25T19:13:11.000Z | tests/test_example_nem12.py | aguinane/nem-writer | 8d7d0e328e3f82831a94367cc7f02cfa88d19cd0 | [
"MIT"
] | 3 | 2018-02-14T03:13:38.000Z | 2021-07-02T03:10:05.000Z | import csv
import pytest
import nemreader as nr
from nemwriter import NEM12
TEST_FILES = [
"examples/actual_interval.csv",
"examples/multiple_quality.csv",
]
def import_export_nem12(input_file, zip_output=False):
""" Create export from import """
# Read in example
ex = nr.read_nem_f... | 32.972727 | 79 | 0.56879 |
29070383b782643fdba8c091b3328048a5815044 | 10,787 | py | Python | rest_friendship/views.py | Visitey/Visitey-Server | e91c0ac52e943af9a739c42a6a3fe8603994c6b6 | [
"MIT"
] | 1 | 2018-06-06T09:46:00.000Z | 2018-06-06T09:46:00.000Z | rest_friendship/views.py | Visitey/Visitey-Server | e91c0ac52e943af9a739c42a6a3fe8603994c6b6 | [
"MIT"
] | null | null | null | rest_friendship/views.py | Visitey/Visitey-Server | e91c0ac52e943af9a739c42a6a3fe8603994c6b6 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import get_object_or_404
from rest_framework import viewsets, status
from rest_framework.decorators import action
from rest_framework.exceptions import NotFound
from rest_framework.response import Response
from... | 42.468504 | 116 | 0.61296 |
5958144ab9dcbab444b2531304c5235b58ba9a47 | 2,147 | py | Python | tests/unit/modules/ssh_test.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 2 | 2015-09-21T14:13:30.000Z | 2016-02-12T11:33:46.000Z | tests/unit/modules/ssh_test.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 1 | 2019-09-06T13:57:28.000Z | 2019-09-06T13:57:28.000Z | tests/unit/modules/ssh_test.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 2 | 2017-01-05T16:14:59.000Z | 2019-01-31T23:15:25.000Z | # -*- coding: utf-8 -*-
# import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON
)
# Import Salt Libs
ensure_in_syspath('../../')
fro... | 31.573529 | 100 | 0.650675 |
06c5b25555036ade2dfac710d861ea11e366284d | 1,539 | py | Python | example/shop/models.py | Jyrno42/django-thorbanks | a8e2daf20b981aecb0c8ee76b0474b6c8e2baad1 | [
"BSD-3-Clause"
] | null | null | null | example/shop/models.py | Jyrno42/django-thorbanks | a8e2daf20b981aecb0c8ee76b0474b6c8e2baad1 | [
"BSD-3-Clause"
] | null | null | null | example/shop/models.py | Jyrno42/django-thorbanks | a8e2daf20b981aecb0c8ee76b0474b6c8e2baad1 | [
"BSD-3-Clause"
] | null | null | null | import logging
from django.db import models
from django.dispatch.dispatcher import receiver
from thorbanks.signals import transaction_failed, transaction_succeeded
class Order(models.Model):
amount = models.FloatField()
transaction = models.OneToOneField(
"thorbanks_models.Transaction", null=True, ... | 33.456522 | 98 | 0.71475 |
c212ee5d2fd513e15160e95a81385662dd0032b0 | 1,915 | py | Python | test/functional/feature_help.py | akshaynexus/pigeoncoin-dash | ba18234d79405739e7c4f8341a6eb7ee74f1bc5d | [
"MIT"
] | 3 | 2020-06-08T05:11:20.000Z | 2021-04-19T04:59:30.000Z | test/functional/feature_help.py | akshaynexus/pigeoncoin-dash | ba18234d79405739e7c4f8341a6eb7ee74f1bc5d | [
"MIT"
] | null | null | null | test/functional/feature_help.py | akshaynexus/pigeoncoin-dash | ba18234d79405739e7c4f8341a6eb7ee74f1bc5d | [
"MIT"
] | 5 | 2020-09-18T01:16:26.000Z | 2021-04-25T18:57:35.000Z | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Verify that starting pigeond with -h works as expected."""
import subprocess
from test_framework.test_frame... | 40.744681 | 100 | 0.675196 |
22ca6abfc215581164550ae6784664835c7341bd | 914 | py | Python | test_run.py | caoxuwen/bitgym | 0a6796a039290122430ebc13c8d7ad9ff741921a | [
"MIT"
] | 1 | 2018-09-07T10:10:29.000Z | 2018-09-07T10:10:29.000Z | test_run.py | caoxuwen/bitgym | 0a6796a039290122430ebc13c8d7ad9ff741921a | [
"MIT"
] | null | null | null | test_run.py | caoxuwen/bitgym | 0a6796a039290122430ebc13c8d7ad9ff741921a | [
"MIT"
] | null | null | null | import random
import numpy as np
import pandas as pd
import trading_env
#df = pd.read_hdf('dataset/SGXTW.h5', 'STW')
df = pd.read_hdf('dataset/SGXTWsample.h5', 'STW')
env = trading_env.make(env_id='training_v1', obs_data_len=256, step_len=128,
df=df, fee=0.1, max_position=5, deal_col_name='Pric... | 31.517241 | 78 | 0.584245 |
c324fad7835680720f59485f2a627dfb413d81ff | 560 | py | Python | recursion/questions/reverseString.py | devclassio/algorithms | ab6a41f3399d8ae58acf0aebb285ca6de744433c | [
"MIT"
] | 5 | 2021-01-18T03:27:44.000Z | 2021-06-22T16:22:35.000Z | recursion/questions/reverseString.py | devclassio/algorithms | ab6a41f3399d8ae58acf0aebb285ca6de744433c | [
"MIT"
] | null | null | null | recursion/questions/reverseString.py | devclassio/algorithms | ab6a41f3399d8ae58acf0aebb285ca6de744433c | [
"MIT"
] | null | null | null | '''
Write a function that reverses a string. The input string is given as an array of characters char[].
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
'''
class Solution:
def reverseString(self, s):
middle = len(s) / 2
... | 29.473684 | 125 | 0.592857 |
5d68032b96c17aed732301a5c474a7ce64b26044 | 3,078 | py | Python | toontown/estate/GameSprite.py | CrankySupertoon01/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2021-02-13T22:40:50.000Z | 2021-02-13T22:40:50.000Z | toontown/estate/GameSprite.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | toontown/estate/GameSprite.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | import math
class GameSprite:
colorRed = (1, 0, 0, 1)
colorBlue = (0, 0, 1, 1)
colorGreen = (0, 1, 0, 1)
colorYellow = (1, 1, 0, 1)
colorPurple = (1, 0, 1, 1)
colorGhostRed = (1, 0, 0, 0.5)
colorGhostBlue = (0, 0, 1, 0.5)
colorGhostGreen = (0, 1, 0, 0.5)
colorGhostYellow = (1, 1, 0... | 30.475248 | 70 | 0.545159 |
957b194c724df2471e78cc85ad1c8041df65411b | 7,218 | py | Python | salt/states/cyg.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | 1 | 2022-03-12T00:03:19.000Z | 2022-03-12T00:03:19.000Z | salt/states/cyg.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | 2 | 2022-03-02T16:11:35.000Z | 2022-03-03T08:04:30.000Z | salt/states/cyg.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | null | null | null | """
Installation of Cygwin packages.
A state module to manage cygwin packages. Packages can be installed
or removed.
.. code-block:: yaml
dos2unix:
cyg.installed
"""
import logging
log = logging.getLogger(__name__)
def __virtual__():
"""
Only load if cyg module is available in __salt__.
"""... | 27.868726 | 87 | 0.590053 |
e9e66f44a7ef6f94579947a0d6ff3763f600396d | 5,552 | py | Python | monai/handlers/segmentation_saver.py | Scitator/MONAI | a42b563acf0c7504cee18ee84c8af2eff6e948a7 | [
"Apache-2.0"
] | 1 | 2020-07-09T08:03:22.000Z | 2020-07-09T08:03:22.000Z | monai/handlers/segmentation_saver.py | Scitator/MONAI | a42b563acf0c7504cee18ee84c8af2eff6e948a7 | [
"Apache-2.0"
] | null | null | null | monai/handlers/segmentation_saver.py | Scitator/MONAI | a42b563acf0c7504cee18ee84c8af2eff6e948a7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 MONAI Consortium
# 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, s... | 44.416 | 117 | 0.62536 |
cef498298349df112d7b15b01037c8160848d7a8 | 9,438 | py | Python | utils/help.py | Saizuo/EpicBot | 45cebe79b7bf90c0a067162fb3646a176cb6394a | [
"BSD-3-Clause"
] | 3 | 2021-09-13T11:28:49.000Z | 2022-02-21T15:16:35.000Z | utils/help.py | Saizuo/EpicBot | 45cebe79b7bf90c0a067162fb3646a176cb6394a | [
"BSD-3-Clause"
] | 1 | 2021-09-27T07:45:29.000Z | 2021-09-27T07:45:29.000Z | utils/help.py | Saizuo/EpicBot | 45cebe79b7bf90c0a067162fb3646a176cb6394a | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2021 Nirlep_5252_
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
d... | 46.722772 | 179 | 0.672706 |
ffc206bc5c8c134b0040b31cde26ce6ab00f5b40 | 274 | py | Python | demo.py | yoidea/markov_chain | 265da10b574a6bf69e06fc52d549ca3980a6c005 | [
"MIT"
] | null | null | null | demo.py | yoidea/markov_chain | 265da10b574a6bf69e06fc52d549ca3980a6c005 | [
"MIT"
] | 2 | 2018-05-24T13:03:41.000Z | 2018-05-29T03:46:55.000Z | demo.py | yoidea/markov_chain | 265da10b574a6bf69e06fc52d549ca3980a6c005 | [
"MIT"
] | null | null | null | from ghostwriter import make_sentence, build_chain, get_words
def main():
words = get_words('text.txt')
print(words)
chain = build_chain(words)
print(chain)
sentence = make_sentence(chain, 20)
print(sentence)
if __name__ == '__main__':
main() | 19.571429 | 61 | 0.678832 |
494fac71ef574da510bc9b7a9d1f2b95e7072c7c | 20,647 | py | Python | test/functional/wallet.py | coindroid/sucrecoin | b7506a64634f3dfa81d27c94c02709197e9244e5 | [
"MIT"
] | 30 | 2017-12-15T15:21:46.000Z | 2021-07-27T21:43:25.000Z | test/functional/wallet.py | SucrecoinProject/Sucreold2019 | c6d19ccce4649462325156a01e8d6aa9b7fb8a73 | [
"MIT"
] | null | null | null | test/functional/wallet.py | SucrecoinProject/Sucreold2019 | c6d19ccce4649462325156a01e8d6aa9b7fb8a73 | [
"MIT"
] | 26 | 2017-12-17T11:53:36.000Z | 2020-12-28T18:17:19.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Sucrecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet."""
from test_framework.test_framewo... | 47.573733 | 181 | 0.643435 |
1d1b6c3a1f290b49429d7c3a16a4075b4361a10c | 5,628 | py | Python | modules/feedparser/urls.py | whanderley/eden | 08ced3be3d52352c54cbd412ed86128fbb68b1d2 | [
"MIT"
] | 2 | 2019-11-25T20:34:52.000Z | 2021-06-04T20:05:46.000Z | modules/feedparser/urls.py | whanderley/eden | 08ced3be3d52352c54cbd412ed86128fbb68b1d2 | [
"MIT"
] | 1 | 2020-01-29T15:33:17.000Z | 2020-01-29T15:33:17.000Z | modules/feedparser/urls.py | whanderley/eden | 08ced3be3d52352c54cbd412ed86128fbb68b1d2 | [
"MIT"
] | 3 | 2019-11-30T20:25:55.000Z | 2022-02-03T17:12:16.000Z | # Copyright 2010-2019 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistrib... | 34.527607 | 120 | 0.627932 |
b3c391f877f436293f9b684bb077c1f649956d06 | 12,543 | py | Python | src/pretix/base/views/tasks.py | Janfred/pretix | bdd9751f0e5c440d1c8b56c933db2288e4014f4c | [
"Apache-2.0"
] | 1,248 | 2015-04-24T13:32:06.000Z | 2022-03-29T07:01:36.000Z | src/pretix/base/views/tasks.py | Janfred/pretix | bdd9751f0e5c440d1c8b56c933db2288e4014f4c | [
"Apache-2.0"
] | 2,113 | 2015-02-18T18:58:16.000Z | 2022-03-31T11:12:32.000Z | src/pretix/base/views/tasks.py | thegcat/pretix | 451d3fce0575d85a0ea93fd64aa0631feaced967 | [
"Apache-2.0"
] | 453 | 2015-05-13T09:29:06.000Z | 2022-03-24T13:39:16.000Z | #
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 Raphael Michel and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by ... | 40.856678 | 145 | 0.613649 |
b272749e1d124e928f966b9409ac277028b34cbf | 6,640 | py | Python | proliantutils/exception.py | mail2nsrajesh/proliantutils | e39fd72626800b4318642f8954371f76d9422384 | [
"Apache-2.0"
] | 12 | 2016-09-14T21:59:39.000Z | 2019-10-09T17:02:14.000Z | proliantutils/exception.py | openstack/deb-python-proliantutils | b9229a0ab3e7c7af0b9e59968a5c6c7fea53bd88 | [
"Apache-2.0"
] | null | null | null | proliantutils/exception.py | openstack/deb-python-proliantutils | b9229a0ab3e7c7af0b9e59968a5c6c7fea53bd88 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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... | 30.181818 | 78 | 0.69744 |
955176efc0c61ee4f7f78af777a3106932fc8f56 | 316 | py | Python | t_report/config/docs.py | sammish/t_report | c70c1033da2932a953171d82e677a8782c98d699 | [
"MIT"
] | null | null | null | t_report/config/docs.py | sammish/t_report | c70c1033da2932a953171d82e677a8782c98d699 | [
"MIT"
] | null | null | null | t_report/config/docs.py | sammish/t_report | c70c1033da2932a953171d82e677a8782c98d699 | [
"MIT"
] | null | null | null | """
Configuration for docs
"""
# source_link = "https://github.com/[org_name]/t_report"
# docs_base_url = "https://[org_name].github.io/t_report"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"
def get_context(context):
context.brand_html = "T Report"
| 26.333333 | 68 | 0.721519 |
3aae5cb5df533d299a6488ce2a1bbb41e7b474cc | 329 | py | Python | locale/pot/api/core/_autosummary/pyvista-ExplicitStructuredGrid-plot_over_circular_arc_normal-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 4 | 2020-08-07T08:19:19.000Z | 2020-12-04T09:51:11.000Z | locale/pot/api/core/_autosummary/pyvista-UnstructuredGrid-plot_over_circular_arc_normal-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 19 | 2020-08-06T00:24:30.000Z | 2022-03-30T19:22:24.000Z | locale/pot/api/core/_autosummary/pyvista-RectilinearGrid-plot_over_circular_arc_normal-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 1 | 2021-03-09T07:50:40.000Z | 2021-03-09T07:50:40.000Z | # Sample a dataset along a high resolution circular arc and plot.
#
from pyvista import examples
mesh = examples.load_uniform()
normal = normal = [0, 0, 1]
polar = [0, 9, 0]
angle = 90
center = [mesh.bounds[0], mesh.bounds[2], mesh.bounds[4]]
mesh.plot_over_circular_arc_normal(center, polar=polar, angle=angle) # docte... | 32.9 | 85 | 0.729483 |
847e344b73f18ecd897e7ee0dff83c66d501effe | 2,437 | py | Python | src/tbm_utils/misc.py | mgbowen/tbm-utils | c09070d70c4dd7c9976360de92d14f7a14cd9632 | [
"MIT"
] | null | null | null | src/tbm_utils/misc.py | mgbowen/tbm-utils | c09070d70c4dd7c9976360de92d14f7a14cd9632 | [
"MIT"
] | 2 | 2021-01-06T09:08:35.000Z | 2021-08-28T17:55:47.000Z | src/tbm_utils/misc.py | whatsnowplaying/tbm-utils | c09070d70c4dd7c9976360de92d14f7a14cd9632 | [
"MIT"
] | 2 | 2019-10-28T10:34:34.000Z | 2021-07-18T20:27:10.000Z | __all__ = [
'filter_filepaths_by_dates',
'get_filepaths'
]
import math
import platform
import re
from pathlib import Path, PurePath
import pendulum
from .decorators import cast_to_list
def filter_filepaths_by_dates(
filepaths,
*,
creation_dates=None,
modification_dates=None,
):
def _match_created_date(filep... | 22.357798 | 60 | 0.732048 |
237d438e2cf713b03dc9505ce145db6503a5fe46 | 87 | py | Python | modules/darutils/__init__.py | Medisur/journalmanagement | bc356e8d3354529a14a5e04bec3d80c03ed1c0ec | [
"MIT"
] | 1 | 2019-04-16T08:53:16.000Z | 2019-04-16T08:53:16.000Z | modules/darutils/__init__.py | Medisur/journalmanagement | bc356e8d3354529a14a5e04bec3d80c03ed1c0ec | [
"MIT"
] | null | null | null | modules/darutils/__init__.py | Medisur/journalmanagement | bc356e8d3354529a14a5e04bec3d80c03ed1c0ec | [
"MIT"
] | null | null | null |
from .asset import Asset
from .document import Document
from .manifest import Manifest | 21.75 | 30 | 0.827586 |
be36703b4eb08f01f094fffca1e0bfc984338322 | 820 | py | Python | Ex01AP2/Principal.py | icaromachado/AP2UNIGRANRIO | e7c1200463deeabd020a90ddc7f31764c7f3806a | [
"MIT"
] | null | null | null | Ex01AP2/Principal.py | icaromachado/AP2UNIGRANRIO | e7c1200463deeabd020a90ddc7f31764c7f3806a | [
"MIT"
] | null | null | null | Ex01AP2/Principal.py | icaromachado/AP2UNIGRANRIO | e7c1200463deeabd020a90ddc7f31764c7f3806a | [
"MIT"
] | null | null | null | lista = list()
pessoas = dict()
idad = media = 0
alt = altu_med = 0
while True:
pessoas.clear()
pessoas['codigo'] = int( input('Código: '))
pessoas['nome'] = str( input('Nome: '))
pessoas['idade']=int( input('Idade: '))
idad += pessoas['idade']
pessoas['altura'] = float( input('Altura: '))
a... | 29.285714 | 77 | 0.589024 |
ac20278c8533c5ecf9e2bd8bad593743d6167040 | 384 | py | Python | swarmdjango/core/views/sponsorViewSet.py | YCP-Swarm-Robotics-Capstone-2020-2021/swarm-website-backend | 081d1930cc9283ee299d373f91f7c127f466c104 | [
"MIT"
] | null | null | null | swarmdjango/core/views/sponsorViewSet.py | YCP-Swarm-Robotics-Capstone-2020-2021/swarm-website-backend | 081d1930cc9283ee299d373f91f7c127f466c104 | [
"MIT"
] | 51 | 2020-08-31T16:50:09.000Z | 2021-05-10T03:04:18.000Z | swarmdjango/core/views/sponsorViewSet.py | YCP-Swarm-Robotics-Capstone-2020-2021/swarm-website-backend | 081d1930cc9283ee299d373f91f7c127f466c104 | [
"MIT"
] | null | null | null | from django_filters.rest_framework import DjangoFilterBackend
from core.models import Sponsor
from core.serializers import serializers
from rest_framework import viewsets
class SponsorViewSet(viewsets.ModelViewSet):
queryset = Sponsor.objects.all()
serializer_class = serializers.SponsorSerializer
filter_... | 29.538462 | 61 | 0.817708 |
90de4e816f0cf9a72889bc013beac814619c9415 | 12,457 | py | Python | activitysim/abm/models/atwork_subtour_destination.py | SEMCOG/SEMCOG_ActSim | cc18cce84b2e4b5f380f58c7919953d2cd03ee73 | [
"BSD-3-Clause"
] | null | null | null | activitysim/abm/models/atwork_subtour_destination.py | SEMCOG/SEMCOG_ActSim | cc18cce84b2e4b5f380f58c7919953d2cd03ee73 | [
"BSD-3-Clause"
] | 1 | 2021-06-30T23:39:37.000Z | 2021-06-30T23:39:37.000Z | activitysim/abm/models/atwork_subtour_destination.py | SEMCOG/SEMCOG_ActSim | cc18cce84b2e4b5f380f58c7919953d2cd03ee73 | [
"BSD-3-Clause"
] | null | null | null | # ActivitySim
# See full license in LICENSE.txt.
import logging
import pandas as pd
from activitysim.core import tracing
from activitysim.core import config
from activitysim.core import pipeline
from activitysim.core import simulate
from activitysim.core import inject
from activitysim.core.interaction_sample_simulat... | 37.521084 | 113 | 0.670707 |
4360a69bd6c15f0f2e969f2cfb53581c2e4a4067 | 14,428 | py | Python | delira/training/backends/tf_eager/trainer.py | gedoensmax/delira | 545e2ccbe56ed382d300cf3d00317e9a0e3ab5f6 | [
"BSD-2-Clause"
] | null | null | null | delira/training/backends/tf_eager/trainer.py | gedoensmax/delira | 545e2ccbe56ed382d300cf3d00317e9a0e3ab5f6 | [
"BSD-2-Clause"
] | null | null | null | delira/training/backends/tf_eager/trainer.py | gedoensmax/delira | 545e2ccbe56ed382d300cf3d00317e9a0e3ab5f6 | [
"BSD-2-Clause"
] | null | null | null | from delira.training.backends.tf_eager.utils import create_optims_default
from delira.training.backends.tf_eager.utils import convert_to_numpy
from delira.training.base_trainer import BaseNetworkTrainer
from delira.io.tf import save_checkpoint_eager, load_checkpoint_eager
from delira.models.backends.tf_eager import Abs... | 38.474667 | 79 | 0.574092 |
d51de63dddb3abe5bc513ee6067dadd3cded9844 | 2,235 | py | Python | examples/python/matrix_set_lendingclub.py | bjrnfrdnnd/transitionMatrix | c4b26f9f496c876729f175464a6a101719addc63 | [
"Apache-2.0"
] | null | null | null | examples/python/matrix_set_lendingclub.py | bjrnfrdnnd/transitionMatrix | c4b26f9f496c876729f175464a6a101719addc63 | [
"Apache-2.0"
] | null | null | null | examples/python/matrix_set_lendingclub.py | bjrnfrdnnd/transitionMatrix | c4b26f9f496c876729f175464a6a101719addc63 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
# (c) 2017-2019 Open Risk, all rights reserved
#
# TransitionMatrix is licensed under the Apache 2.0 license a copy of which is included
# in the source distribution of TransitionMatrix. This is notwithstanding any licenses of
# third-party software included in this distribution. You may not use this... | 37.25 | 96 | 0.715436 |
b8cc8f13f36754f7b7ff42509af5c8d68ef3b39d | 16,042 | py | Python | edk2basetools/Workspace/MetaFileTable.py | YuweiChen1110/edk2-basetools | cfd05c928492b7ffd1329634cfcb089db995eeca | [
"BSD-2-Clause-Patent"
] | 7 | 2020-09-08T01:16:14.000Z | 2021-12-25T06:32:42.000Z | edk2basetools/Workspace/MetaFileTable.py | YuweiChen1110/edk2-basetools | cfd05c928492b7ffd1329634cfcb089db995eeca | [
"BSD-2-Clause-Patent"
] | 25 | 2020-11-02T23:28:42.000Z | 2022-03-29T01:57:40.000Z | edk2basetools/Workspace/MetaFileTable.py | YuweiChen1110/edk2-basetools | cfd05c928492b7ffd1329634cfcb089db995eeca | [
"BSD-2-Clause-Patent"
] | 18 | 2020-09-10T02:54:03.000Z | 2021-11-29T06:41:52.000Z | ## @file
# This file is used to create/update/query/erase a meta file table
#
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
import uuid
import edk2basetools.Common.EdkLogger as EdkL... | 37.220418 | 155 | 0.564206 |
8b8ef3a517246ca513c42c7ba047f62a101104ec | 7,423 | py | Python | cpp_src/cmd/reindexer_server/test/specs/mixins/helper_mixin.py | AlexSnet/reindexer | 6de57939bbd5968954427ef0b3ca58ef9134caaa | [
"Apache-2.0"
] | 695 | 2017-07-07T16:54:23.000Z | 2022-03-19T09:48:30.000Z | cpp_src/cmd/reindexer_server/test/specs/mixins/helper_mixin.py | AlexSnet/reindexer | 6de57939bbd5968954427ef0b3ca58ef9134caaa | [
"Apache-2.0"
] | 63 | 2018-01-18T02:57:48.000Z | 2022-03-04T10:28:05.000Z | cpp_src/cmd/reindexer_server/test/specs/mixins/helper_mixin.py | AlexSnet/reindexer | 6de57939bbd5968954427ef0b3ca58ef9134caaa | [
"Apache-2.0"
] | 72 | 2017-07-12T21:12:59.000Z | 2021-11-28T14:35:06.000Z | import time
class HelperMixin(object):
def helper_update_testdata_db(self):
self.test_db = 'test_db_' + str(self.test_timestamp)
def helper_update_testdata_ns(self):
self.test_ns = 'test_ns_' + str(self.test_timestamp)
def helper_update_testdata_item(self):
self.test_item = 'test... | 32.414847 | 122 | 0.587768 |
b225909eee54585f5a982b8410695389f8cb444d | 18,237 | py | Python | google/cloud/aiplatform/metadata/resource.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform/metadata/resource.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform/metadata/resource.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 39.051392 | 121 | 0.609037 |
d3424afe1ab08bc1eb35229326eed2ffc044e798 | 2,479 | py | Python | solution/args/argparse.py | taeukkkim/temp | 91c90fe5da4678424d8aacacbf15773dc624021d | [
"MIT"
] | 5 | 2021-11-10T09:44:42.000Z | 2022-03-20T06:14:42.000Z | solution/args/argparse.py | taeukkkim/temp | 91c90fe5da4678424d8aacacbf15773dc624021d | [
"MIT"
] | null | null | null | solution/args/argparse.py | taeukkkim/temp | 91c90fe5da4678424d8aacacbf15773dc624021d | [
"MIT"
] | 7 | 2021-11-10T23:54:03.000Z | 2022-01-03T02:55:50.000Z | import dataclasses
import re
import sys
import copy
import json
import yaml
import argparse
from enum import Enum
from pathlib import Path
from dataclasses import dataclass, field
from typing import Any, Iterable, List, NewType, Optional, Tuple, Union, Dict
from transformers.hf_argparser import HfArgumentParser as Arg... | 37.560606 | 117 | 0.588544 |
0e560a7e319d799e6a9601993bc4b7b0c8640705 | 3,852 | py | Python | tests/test_stanza_xep_0033.py | isabella232/slixmpp | e15e6735f1dbfc66a5d43efe9fa9e7f5c9d1610a | [
"BSD-3-Clause"
] | null | null | null | tests/test_stanza_xep_0033.py | isabella232/slixmpp | e15e6735f1dbfc66a5d43efe9fa9e7f5c9d1610a | [
"BSD-3-Clause"
] | 1 | 2021-02-24T07:58:40.000Z | 2021-02-24T07:58:40.000Z | tests/test_stanza_xep_0033.py | isabella232/slixmpp | e15e6735f1dbfc66a5d43efe9fa9e7f5c9d1610a | [
"BSD-3-Clause"
] | null | null | null | import unittest
from slixmpp import Message
from slixmpp.test import SlixTest
import slixmpp.plugins.xep_0033 as xep_0033
from slixmpp.xmlstream import register_stanza_plugin
class TestAddresses(SlixTest):
def setUp(self):
register_stanza_plugin(Message, xep_0033.Addresses)
def testAddAddress(self):... | 33.495652 | 87 | 0.521288 |
86d40f9d4fcf4d5dbe7676126146f989c854c9e5 | 225 | py | Python | anaf/documents/hmodule.py | tovmeod/anaf | 80e4a00532ce6f4ce76c5ffc858ff90c759a9879 | [
"BSD-3-Clause"
] | 2 | 2016-03-15T13:17:26.000Z | 2017-03-22T15:39:01.000Z | anaf/documents/hmodule.py | tovmeod/anaf | 80e4a00532ce6f4ce76c5ffc858ff90c759a9879 | [
"BSD-3-Clause"
] | 4 | 2021-03-19T21:42:58.000Z | 2022-03-11T23:13:07.000Z | anaf/documents/hmodule.py | tovmeod/anaf | 80e4a00532ce6f4ce76c5ffc858ff90c759a9879 | [
"BSD-3-Clause"
] | 4 | 2016-08-31T16:55:41.000Z | 2020-04-22T18:48:54.000Z | """
Documents: module definition
"""
PROPERTIES = {
'title': 'Documents',
'details': 'Manage documents',
'url': '/documents/',
'system': False,
'type': 'minor',
}
URL_PATTERNS = [
'^/documents/',
]
| 13.235294 | 34 | 0.551111 |
8e34c3691fd5be62853f09e6ac91970d58498063 | 136 | py | Python | core/post/__init__.py | codebypatrick/flask-starter | c45050b3dffcc0767bf16ea68d735082188c8b31 | [
"MIT"
] | null | null | null | core/post/__init__.py | codebypatrick/flask-starter | c45050b3dffcc0767bf16ea68d735082188c8b31 | [
"MIT"
] | 3 | 2020-03-24T17:31:29.000Z | 2021-02-02T22:10:42.000Z | core/post/__init__.py | codebypatrick/flask-starter | c45050b3dffcc0767bf16ea68d735082188c8b31 | [
"MIT"
] | null | null | null | from flask import Blueprint
post = Blueprint('post', __name__, template_folder='templates', url_prefix='/blog')
from . import views
| 17 | 83 | 0.75 |
c0a6fd12b08055ad4d3bb542d37d1c2d2e102555 | 517 | py | Python | PriceTracker/TrackerAmazon.py | cyamonide/price-tracker | 4549fc0e86b6158d64dbe9f5bc44b8f3b72ef2ef | [
"MIT"
] | null | null | null | PriceTracker/TrackerAmazon.py | cyamonide/price-tracker | 4549fc0e86b6158d64dbe9f5bc44b8f3b72ef2ef | [
"MIT"
] | null | null | null | PriceTracker/TrackerAmazon.py | cyamonide/price-tracker | 4549fc0e86b6158d64dbe9f5bc44b8f3b72ef2ef | [
"MIT"
] | null | null | null | from PriceTrackerBase import simple_get
from bs4 import BeautifulSoup
def getPrice(url):
"""
Scrapes price of product from Amazon
"""
# Retrieve HTML
html = BeautifulSoup(simple_get(url), 'html.parser')
# Isolate price
for meta in html.select('meta'):
try:
if meta['itemprop'] == 'price':
... | 19.884615 | 54 | 0.644101 |
0604cc7717ad22aa84817c4000fcf3c1899bcbf1 | 13,127 | py | Python | lang/arreply.py | CUKURTEAM/BRAND | 9ab884a11067df252d7591cb141a92f39e0749ba | [
"MIT"
] | null | null | null | lang/arreply.py | CUKURTEAM/BRAND | 9ab884a11067df252d7591cb141a92f39e0749ba | [
"MIT"
] | null | null | null | lang/arreply.py | CUKURTEAM/BRAND | 9ab884a11067df252d7591cb141a92f39e0749ba | [
"MIT"
] | null | null | null | doneadd = "☆︙تم تفعيل المجموعة ([{}])"
doneadd2 = "☆︙تم تفعيل المجموعة ([{}])"
doneadded = "👤︙المجموعة ([{}]) مفعلة"
disabled = "👤︙المجموعة ([{}]) معطلة"
disabl = "☆︙تم تعطيل المجموعة ([{}])"
userNocc = "☆︙عذراً لايمكنني الوصول الى (الايدي|المعرف)"
locked = """◀️︙بواسطه ⌁ {}
❎︙{} بالفعل مقفوله في المجموعة"""
... | 21.988275 | 89 | 0.622762 |
48839491520501068e336bbb9d70f5bec0375a72 | 646 | py | Python | test/test_marker.py | satejsoman/matplotlib2tikz | 583a66f6842d236ee42d85485de9c6a503585893 | [
"MIT"
] | 1 | 2021-05-25T20:47:41.000Z | 2021-05-25T20:47:41.000Z | test/test_marker.py | satejsoman/matplotlib2tikz | 583a66f6842d236ee42d85485de9c6a503585893 | [
"MIT"
] | null | null | null | test/test_marker.py | satejsoman/matplotlib2tikz | 583a66f6842d236ee42d85485de9c6a503585893 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
from helpers import assert_equality
def plot():
from matplotlib import pyplot as plt
import numpy as np
fig, ax = plt.subplots()
with plt.style.context(("ggplot")):
t = np.linspace(0, 2 * np.pi, 11)
s = np.sin(t)
c = np.cos(t)
ax.plot(t, s, "k... | 23.071429 | 59 | 0.54644 |
88a93a24bac846420ecd6b2d7888518d1cae7cac | 7,434 | py | Python | resultstoreui/resultstoreui_utils.py | google/resultstoreui | 4a7a6123845d36de99355582669c65381e63edc5 | [
"Apache-2.0"
] | 6 | 2020-06-26T19:12:00.000Z | 2022-03-30T17:13:10.000Z | resultstoreui/resultstoreui_utils.py | google/resultstoreui | 4a7a6123845d36de99355582669c65381e63edc5 | [
"Apache-2.0"
] | 13 | 2020-05-20T18:15:49.000Z | 2022-02-27T09:48:22.000Z | resultstoreui/resultstoreui_utils.py | google/resultstoreui | 4a7a6123845d36de99355582669c65381e63edc5 | [
"Apache-2.0"
] | 6 | 2020-11-27T23:31:37.000Z | 2022-03-13T22:23:48.000Z | import socket
import os
import getpass
import uuid
import pathlib
from google.protobuf import timestamp_pb2
from google.cloud import storage
from google import auth
from resultstoreapi.cloud.devtools.resultstore_v2.proto import common_pb2
from resultstoreapi.cloud.devtools.resultstore_v2.proto import (
invocation_p... | 31.5 | 84 | 0.678504 |
1ff90a3e4e239a8d040d2a79ecae197ecb34d6ad | 793 | py | Python | Stream-2/Back-End-Development/21.Visualising-With-Matplotlib-Intro/4.Pie-Charts/pie_chart.py | GunnerJnr/_CodeInstitute | efba0984a3dc71558eef97724c85e274a712798c | [
"MIT"
] | 4 | 2017-10-10T14:00:40.000Z | 2021-01-27T14:08:26.000Z | Stream-2/Back-End-Development/21.Visualising-With-Matplotlib-Intro/4.Pie-Charts/pie_chart.py | GunnerJnr/_CodeInstitute | efba0984a3dc71558eef97724c85e274a712798c | [
"MIT"
] | 115 | 2019-10-24T11:18:33.000Z | 2022-03-11T23:15:42.000Z | Stream-2/Back-End-Development/21.Visualising-With-Matplotlib-Intro/4.Pie-Charts/pie_chart.py | GunnerJnr/_CodeInstitute | efba0984a3dc71558eef97724c85e274a712798c | [
"MIT"
] | 5 | 2017-09-22T21:42:39.000Z | 2020-02-07T02:18:11.000Z | import matplotlib.pyplot as plt
# sets the relevant sizes for the pie slices
slices = [7,2,2,13]
# set the different activities each slice represents
activities = ['sleeping','eating','working','playing']
# set the colours we wish to use for the slices
cols = ['c','m','r','b']
# now we plot the pie slices and feed it... | 33.041667 | 72 | 0.650694 |
0924b54ae43dd962c278468ef2eeae79d14ac802 | 1,286 | py | Python | examples/mcscf/03-natural_orbital.py | robert-anderson/pyscf | cdc56e168cb15f47e8cdc791a92d689fa9b655af | [
"Apache-2.0"
] | 501 | 2018-12-06T23:48:17.000Z | 2022-03-31T11:53:18.000Z | examples/mcscf/03-natural_orbital.py | robert-anderson/pyscf | cdc56e168cb15f47e8cdc791a92d689fa9b655af | [
"Apache-2.0"
] | 710 | 2018-11-26T22:04:52.000Z | 2022-03-30T03:53:12.000Z | examples/mcscf/03-natural_orbital.py | robert-anderson/pyscf | cdc56e168cb15f47e8cdc791a92d689fa9b655af | [
"Apache-2.0"
] | 273 | 2018-11-26T10:10:24.000Z | 2022-03-30T12:25:28.000Z | #!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
'''
Generally, the CASSCF solver does NOT return the natural orbitals.
1. Attribute .natorb controls whether the active space orbitals are transformed
to natural orbitals in the results.
2. When .natorb is set, the natural orbitals may NOT be sort... | 25.215686 | 79 | 0.707621 |
4709c045c3c0fa9975bccd554d99a4c61673ac17 | 2,957 | py | Python | networkx/algorithms/link_analysis/tests/test_hits.py | SultanOrazbayev/networkx | 5be9755636fa4da71da2e28f8467336d3c0164a7 | [
"BSD-3-Clause"
] | 2 | 2020-02-25T14:07:05.000Z | 2020-11-21T20:29:37.000Z | networkx/algorithms/link_analysis/tests/test_hits.py | SultanOrazbayev/networkx | 5be9755636fa4da71da2e28f8467336d3c0164a7 | [
"BSD-3-Clause"
] | 2 | 2020-10-16T04:18:16.000Z | 2021-11-19T20:00:15.000Z | networkx/algorithms/link_analysis/tests/test_hits.py | SultanOrazbayev/networkx | 5be9755636fa4da71da2e28f8467336d3c0164a7 | [
"BSD-3-Clause"
] | 1 | 2021-08-18T03:14:44.000Z | 2021-08-18T03:14:44.000Z | import pytest
import networkx as nx
np = pytest.importorskip("numpy")
sp = pytest.importorskip("scipy")
import scipy.sparse # call as sp.sparse
from networkx.algorithms.link_analysis.hits_alg import _hits_python
# Example from
# A. Langville and C. Meyer, "A survey of eigenvector methods of web
# information retrie... | 33.224719 | 88 | 0.585391 |
89b5607a055415b7d032fcb5cd12b4227e3ce7c2 | 947 | py | Python | salvia/wallet/did_wallet/did_info.py | mikando/salvia-blockchain | 02181d0b5a063374f01eea951570dbc661bddc34 | [
"Apache-2.0"
] | 6 | 2021-09-13T17:20:49.000Z | 2022-02-09T04:31:47.000Z | salvia/wallet/did_wallet/did_info.py | mikando/salvia-blockchain | 02181d0b5a063374f01eea951570dbc661bddc34 | [
"Apache-2.0"
] | 21 | 2021-09-20T00:56:54.000Z | 2022-03-22T01:12:12.000Z | salvia/wallet/did_wallet/did_info.py | mikando/salvia-blockchain | 02181d0b5a063374f01eea951570dbc661bddc34 | [
"Apache-2.0"
] | 9 | 2021-09-13T17:54:04.000Z | 2022-03-15T08:38:35.000Z | from dataclasses import dataclass
from typing import List, Optional, Tuple
from salvia.types.blockchain_format.sized_bytes import bytes32
from salvia.util.ints import uint64
from salvia.util.streamable import streamable, Streamable
from salvia.wallet.lineage_proof import LineageProof
from salvia.types.blockchain_forma... | 39.458333 | 92 | 0.797254 |
bd1648fbf64db79e2c7f7207dd157da4c8fcaf0b | 1,049 | py | Python | src/initialization.py | danielefdf/nene | 889f2fe88f5fea738a3a6ffa89a33c8d5dec8f97 | [
"MIT"
] | null | null | null | src/initialization.py | danielefdf/nene | 889f2fe88f5fea738a3a6ffa89a33c8d5dec8f97 | [
"MIT"
] | null | null | null | src/initialization.py | danielefdf/nene | 889f2fe88f5fea738a3a6ffa89a33c8d5dec8f97 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from enum import Enum
import numpy as np
class Initialization:
class WeightType(Enum):
ZERO = 1 # zero initialization
RANDOM = 2 # random gaussian distribution
class BiasType(Enum):
ZERO = 1 # zero initialization
RANDOM = 2 ... | 8.131783 | 53 | 0.482364 |
2227f6588caa84477e014a609959d2332c437142 | 7,883 | py | Python | karp/tests/unit/test_entry_handlers.py | spraakbanken/karp-backend-v6-tmp | e5b78157bd999df18c188973ae2a337015b6f35d | [
"MIT"
] | 1 | 2021-12-08T15:33:42.000Z | 2021-12-08T15:33:42.000Z | karp/tests/unit/test_entry_handlers.py | spraakbanken/karp-backend-v6-tmp | e5b78157bd999df18c188973ae2a337015b6f35d | [
"MIT"
] | null | null | null | karp/tests/unit/test_entry_handlers.py | spraakbanken/karp-backend-v6-tmp | e5b78157bd999df18c188973ae2a337015b6f35d | [
"MIT"
] | null | null | null | from typing import Dict, Optional
import pytest
from .adapters import bootstrap_test_app
from karp.services import messagebus
from karp.domain import events, errors, commands
from karp.utility.unique_id import make_unique_id
def make_create_resource_command(
resource_id: str, config: Optional[Dict] = None
) -> c... | 31.532 | 86 | 0.533046 |
17d2a6d6eadc709c42612beb4b077ac6c0d2b07e | 665 | py | Python | app.py | ObliviousCloud/mission-to-mars | 8f0aa2097e1e3edac3a517a1fc718fbd24cef510 | [
"ADSL"
] | null | null | null | app.py | ObliviousCloud/mission-to-mars | 8f0aa2097e1e3edac3a517a1fc718fbd24cef510 | [
"ADSL"
] | null | null | null | app.py | ObliviousCloud/mission-to-mars | 8f0aa2097e1e3edac3a517a1fc718fbd24cef510 | [
"ADSL"
] | null | null | null | # Import flask and pymongo
from flask import Flask, render_template, redirect, jsonify
from flask_pymongo import PyMongo
import pymongo
import scrape_mars
app = Flask(__name__)
# Use flask_pymongo to set up mongo connection
app.config["MONGO_URI"] = "mongodb://localhost:27017/mars_db"
mongo = PyMongo(app)
@app.ro... | 19 | 61 | 0.729323 |
26f2930a4e0d658112a596e202ea01273e0bc166 | 630 | py | Python | ACM-Solution/NAKANJ.py | wasi0013/Python-CodeBase | 4a7a36395162f68f84ded9085fa34cc7c9b19233 | [
"MIT"
] | 2 | 2016-04-26T15:40:40.000Z | 2018-07-18T10:16:42.000Z | ACM-Solution/NAKANJ.py | wasi0013/Python-CodeBase | 4a7a36395162f68f84ded9085fa34cc7c9b19233 | [
"MIT"
] | 1 | 2016-04-26T15:44:15.000Z | 2016-04-29T14:44:40.000Z | ACM-Solution/NAKANJ.py | wasi0013/Python-CodeBase | 4a7a36395162f68f84ded9085fa34cc7c9b19233 | [
"MIT"
] | 1 | 2018-10-02T16:12:19.000Z | 2018-10-02T16:12:19.000Z |
def c(a,b):
q=[]
q.append(a)
try:
while 1:
x,y,z=q.pop(0)
if(x<0 or x>7 or y>7 or y<0):continue
if x==b[0] and y==b[1]:return z
q.append([x+1,y+2,z+1])
q.append([x+2,y+1,z+1])
q.append([x+2,y-1,z+1])
q.a... | 27.391304 | 66 | 0.385714 |
55838c871a8f87f9e6a177145fbd8f4a0e3d47ff | 73,372 | py | Python | kikit/panelize.py | srg74/KiKit | d13c61db61a76742ccf42f88eaab0ea25eefa53c | [
"MIT"
] | null | null | null | kikit/panelize.py | srg74/KiKit | d13c61db61a76742ccf42f88eaab0ea25eefa53c | [
"MIT"
] | null | null | null | kikit/panelize.py | srg74/KiKit | d13c61db61a76742ccf42f88eaab0ea25eefa53c | [
"MIT"
] | null | null | null | import itertools
from pcbnewTransition import pcbnew, isV6
from kikit import sexpr
from kikit.common import normalize
from typing import Any, Callable, Dict, List, Tuple, Union
from pcbnew import (GetBoard, LoadBoard,
FromMM, ToMM, wxPoint, wxRect, wxRectMM, wxPointMM)
from enum import Enum
from s... | 40.67184 | 147 | 0.617238 |
eb1df0ca5d2c8d26200cbabb14e96965434fb135 | 3,661 | py | Python | models/gdes/top_10l/top5.py | udday2014/HebbianLearning | e0d17e53e3db8ce54b8fdd901702d2d6e0633732 | [
"MIT"
] | 6 | 2020-01-08T05:36:09.000Z | 2022-02-09T21:07:04.000Z | models/gdes/top_10l/top5.py | GabrieleLagani/HebbianLearning | 1a6cc34e5e762bea583d784d6e4b9ad74b8822c8 | [
"MIT"
] | null | null | null | models/gdes/top_10l/top5.py | GabrieleLagani/HebbianLearning | 1a6cc34e5e762bea583d784d6e4b9ad74b8822c8 | [
"MIT"
] | 1 | 2021-09-10T03:31:13.000Z | 2021-09-10T03:31:13.000Z | import torch.nn as nn
import torch.nn.functional as F
from neurolab import params as P
from neurolab import utils
from neurolab.model import Model
class Net(Model):
# Layer names
CONV6 = 'conv6'
RELU6 = 'relu6'
BN6 = 'bn6'
CONV7 = 'conv7'
RELU7 = 'relu7'
POOL7 = 'pool7'
BN7 = 'bn7'
CONV8 = 'conv8'
RELU8 = ... | 33.281818 | 116 | 0.722753 |
40b2b8016874b643deaa348f51a16fb5c6656fc8 | 3,643 | py | Python | jumpscale/packages/vdc_dashboard/chats/monitoringstack.py | threefoldtech/js-sdk | 811f783ac34a60225175bab2d806802a87b9d5c7 | [
"Apache-2.0"
] | 13 | 2020-09-02T09:05:08.000Z | 2022-03-12T02:43:24.000Z | jumpscale/packages/vdc_dashboard/chats/monitoringstack.py | threefoldtech/js-sdk | 811f783ac34a60225175bab2d806802a87b9d5c7 | [
"Apache-2.0"
] | 1,998 | 2020-06-15T11:46:10.000Z | 2022-03-24T22:12:41.000Z | jumpscale/packages/vdc_dashboard/chats/monitoringstack.py | threefoldtech/js-sdk | 811f783ac34a60225175bab2d806802a87b9d5c7 | [
"Apache-2.0"
] | 8 | 2020-09-29T06:50:35.000Z | 2021-06-14T03:30:52.000Z | from jumpscale.loader import j
from jumpscale.sals.chatflows.chatflows import chatflow_step, StopChatFlow
from jumpscale.packages.vdc_dashboard.sals.solutions_chatflow import SolutionsChatflowDeploy
from jumpscale.sals.marketplace import deployer
from jumpscale.sals.reservation_chatflow import DeploymentFailed
from jum... | 41.397727 | 219 | 0.659621 |
2097a0af1fb0ec0fc078b8fb7944a5fd264d1bd8 | 86 | py | Python | basics/py/01_04_import_function.py | mathkin-dwarf/python-cheat-sheets | f6b9249315275bb82d554ff4b48f88a9e014a03f | [
"MIT"
] | null | null | null | basics/py/01_04_import_function.py | mathkin-dwarf/python-cheat-sheets | f6b9249315275bb82d554ff4b48f88a9e014a03f | [
"MIT"
] | null | null | null | basics/py/01_04_import_function.py | mathkin-dwarf/python-cheat-sheets | f6b9249315275bb82d554ff4b48f88a9e014a03f | [
"MIT"
] | 2 | 2022-02-21T21:10:54.000Z | 2022-02-21T21:19:43.000Z | # 特定の関数のみimport
# radians : 角度を弧度に変換する関数
from math import radians
print(radians(90))
| 14.333333 | 24 | 0.77907 |
94c849d4d387254de31c777e9d0bc58fc26dd88d | 22,657 | py | Python | checkpoints/sum/train/hotel_with_summ/batch_size_4-notes_supervised-true_summary_short/code_snapshot/models/summarization.py | Saibo-creator/Text-Summrize-Project | d5ce54193110452a18cc0b223360c2bd004b4b28 | [
"Apache-2.0"
] | null | null | null | checkpoints/sum/train/hotel_with_summ/batch_size_4-notes_supervised-true_summary_short/code_snapshot/models/summarization.py | Saibo-creator/Text-Summrize-Project | d5ce54193110452a18cc0b223360c2bd004b4b28 | [
"Apache-2.0"
] | null | null | null | checkpoints/sum/train/hotel_with_summ/batch_size_4-notes_supervised-true_summary_short/code_snapshot/models/summarization.py | Saibo-creator/Text-Summrize-Project | d5ce54193110452a18cc0b223360c2bd004b4b28 | [
"Apache-2.0"
] | null | null | null | # summarization.py
"""
Unsupervised summarization model
"""
import pdb
import time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.nn_utils import move_to_cuda, calc_clf_acc, convert_to_onehot, LabelSmoothing
from project_settings import PAD_ID, EDOC_ID
#defined on... | 54.859564 | 275 | 0.557488 |
a3ca17d020f6faba8aa4cd2673643a345da81040 | 535 | py | Python | plotly/validators/scatter3d/marker/colorbar/_nticks.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/scatter3d/marker/colorbar/_nticks.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/scatter3d/marker/colorbar/_nticks.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class NticksValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self,
plotly_name='nticks',
parent_name='scatter3d.marker.colorbar',
**kwargs
):
super(NticksValidator, self).__init__(
plotly_name=plotl... | 26.75 | 69 | 0.596262 |
209baf3b84efbcae4e34aa0a60804a07d3302b37 | 16,803 | py | Python | NDATools/BuildPackage.py | jacob-lee/nda-tools | e9a4e676c69e4eb228a958d2c90f6c146b2ec811 | [
"MIT"
] | 27 | 2018-12-03T18:24:18.000Z | 2022-03-21T13:55:02.000Z | NDATools/BuildPackage.py | jacob-lee/nda-tools | e9a4e676c69e4eb228a958d2c90f6c146b2ec811 | [
"MIT"
] | 35 | 2018-11-14T21:55:07.000Z | 2022-02-25T01:23:59.000Z | NDATools/BuildPackage.py | jacob-lee/nda-tools | e9a4e676c69e4eb228a958d2c90f6c146b2ec811 | [
"MIT"
] | 13 | 2019-01-23T15:55:56.000Z | 2021-07-06T15:33:53.000Z | from __future__ import with_statement
from __future__ import absolute_import
import re
import sys
import requests.packages.urllib3.util
from tqdm import tqdm
import boto3
import botocore
import signal
from NDATools.S3Authentication import S3Authentication
if sys.version_info[0] < 3:
input = raw_input
import requ... | 46.289256 | 176 | 0.550735 |
77f6c6bd665d4dcc689a7249f802f98e0d371805 | 773 | py | Python | store/migrations/0006_ratings.py | gamersdestiny/e-commerce | 0fb885a8439c1658a5fdca08e3d4ca6557c147a5 | [
"MIT"
] | null | null | null | store/migrations/0006_ratings.py | gamersdestiny/e-commerce | 0fb885a8439c1658a5fdca08e3d4ca6557c147a5 | [
"MIT"
] | null | null | null | store/migrations/0006_ratings.py | gamersdestiny/e-commerce | 0fb885a8439c1658a5fdca08e3d4ca6557c147a5 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-16 15:08
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('store', '0005_category_product'),
]
operations = [
migrations.CreateModel(
name='Ratings',
... | 30.92 | 117 | 0.591203 |
cbebc4cc26dc2edfc4836a7bc26b8ca2034d08bb | 580 | py | Python | tools/golem_build.py | ganadist/r8 | 850b5a4725954b677103a3a575239d0f330c0b0f | [
"Apache-2.0",
"BSD-3-Clause"
] | 8 | 2019-02-16T19:27:05.000Z | 2020-10-30T20:10:42.000Z | tools/golem_build.py | ganadist/r8 | 850b5a4725954b677103a3a575239d0f330c0b0f | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tools/golem_build.py | ganadist/r8 | 850b5a4725954b677103a3a575239d0f330c0b0f | [
"Apache-2.0",
"BSD-3-Clause"
] | 5 | 2019-03-03T04:49:03.000Z | 2021-11-23T15:47:38.000Z | #!/usr/bin/env python
# Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# Utility script to make it easier to update what golem builds.
import gradle
import s... | 29 | 76 | 0.712069 |
a447d020a2276c81c7f2dc404808870b35045829 | 61 | py | Python | moco_wrapper/const.py | nethad/moco-wrapper | 012f9aab6e9fa60e3ccdf7254f0366b108651899 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | moco_wrapper/const.py | nethad/moco-wrapper | 012f9aab6e9fa60e3ccdf7254f0366b108651899 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | moco_wrapper/const.py | nethad/moco-wrapper | 012f9aab6e9fa60e3ccdf7254f0366b108651899 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | """Moco Wrapper constants"""
from .endpoints import API_PATH | 20.333333 | 31 | 0.770492 |
c1dabdf2953b00ae11081fbc01a48e2b7578089d | 5,330 | py | Python | src/vehicle.py | flurinus/IntTripAssignment | 9e6ce4c7ba21bb989537b6492b8f05b7cbb5a14e | [
"BSD-3-Clause"
] | 1 | 2022-03-27T14:29:54.000Z | 2022-03-27T14:29:54.000Z | src/vehicle.py | flurinus/IntTripAssignment | 9e6ce4c7ba21bb989537b6492b8f05b7cbb5a14e | [
"BSD-3-Clause"
] | null | null | null | src/vehicle.py | flurinus/IntTripAssignment | 9e6ce4c7ba21bb989537b6492b8f05b7cbb5a14e | [
"BSD-3-Clause"
] | 1 | 2020-04-08T01:41:29.000Z | 2020-04-08T01:41:29.000Z | import simpy
import random
from parameter import Parameter
class Vehicle(object):
def __init__(self, vehSeatCapacity, rollingStockType, simEnv):
assert(vehSeatCapacity > 0), "vehSeatCapacity (%s) must be positive" % vehSeatCapacity
self.doorServiceRateMean = Parameter.boardAlight... | 39.481481 | 106 | 0.662477 |
35798452b5adbfdf6c3d2afb1792e7350a0f82c7 | 24,772 | py | Python | lib/galaxy/tools/parser/output_actions.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | 2 | 2017-10-23T14:44:12.000Z | 2018-01-14T10:37:28.000Z | lib/galaxy/tools/parser/output_actions.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | 30 | 2016-10-20T15:35:12.000Z | 2018-10-02T15:59:54.000Z | lib/galaxy/tools/parser/output_actions.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | 4 | 2017-06-12T09:54:31.000Z | 2019-03-15T12:02:39.000Z | """
Support for dynamically modifying output attributes.
"""
import logging
import os.path
import re
import string
from galaxy import util
log = logging.getLogger(__name__)
# Attributes tool developer may want to query on dataset collections.
COLLECTION_ATTRIBUTES = ["collection_type"]
class ToolOutputActionGroup... | 37.307229 | 225 | 0.654166 |
2d00f7ec7478e19e5559aa5dfc497d86158fb0f5 | 6,118 | py | Python | src/python/pants/backend/python/lint/docformatter/rules_integration_test.py | stuhood/pants | 107b8335a03482516f64aefa98aadf9f5278b2ee | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/lint/docformatter/rules_integration_test.py | stuhood/pants | 107b8335a03482516f64aefa98aadf9f5278b2ee | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/lint/docformatter/rules_integration_test.py | stuhood/pants | 107b8335a03482516f64aefa98aadf9f5278b2ee | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from typing import List, Optional, Tuple
from pants.backend.python.lint.docformatter.rules import (
DocformatterConfiguration,
DocformatterConfigurations,
)
from pants.backend.pyt... | 45.318519 | 100 | 0.697614 |
7cdbcf77f608d99c0b6e3aa30a67d1310b84ac6e | 4,694 | py | Python | resources/models.py | noemiGyorgy/swapi | dcd95f37d853296c17cdb1467bd7e71a8c5d82d1 | [
"BSD-3-Clause"
] | null | null | null | resources/models.py | noemiGyorgy/swapi | dcd95f37d853296c17cdb1467bd7e71a8c5d82d1 | [
"BSD-3-Clause"
] | null | null | null | resources/models.py | noemiGyorgy/swapi | dcd95f37d853296c17cdb1467bd7e71a8c5d82d1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
class DateTimeModel(models.Model):
""" A base model with created and edited datetime fields """
class Meta:
abstract = True
created = models.DateTimeField(auto_now_add=True)
edited = models.DateTimeField(auto_now=True)
... | 22.786408 | 93 | 0.692586 |
e76de95e0f74e4b4f31fc671904226d17c4d8d86 | 1,122 | py | Python | Python-B/code.py | reenanair79/ga-learner-dsmp-repo | d02526f32062ca99d80fb0424d79ddb1438b9237 | [
"MIT"
] | null | null | null | Python-B/code.py | reenanair79/ga-learner-dsmp-repo | d02526f32062ca99d80fb0424d79ddb1438b9237 | [
"MIT"
] | null | null | null | Python-B/code.py | reenanair79/ga-learner-dsmp-repo | d02526f32062ca99d80fb0424d79ddb1438b9237 | [
"MIT"
] | null | null | null | # --------------
# Code starts here
mathematics={"Geoffrey Hinton":78,"Andrew Ng":95,"Sebastian Raschka":65,"Yoshua Benjio":50,"Hilary Mason":70,"Corinna Cortes":66,"Peter Warden":75}
topper=max(mathematics,key = mathematics.get)
print(topper)
# Code ends here
# --------------
# Code starts here
courses={"Math":... | 16.746269 | 147 | 0.679144 |
030908e51a26595c1b2acb55fcf3e7f82776059d | 43,691 | py | Python | tensorflow/python/keras/layers/convolutional_recurrent.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 36 | 2016-12-17T15:25:25.000Z | 2022-01-29T21:50:53.000Z | tensorflow/python/keras/layers/convolutional_recurrent.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 59 | 2019-06-17T09:37:49.000Z | 2022-01-19T01:21:34.000Z | tensorflow/python/keras/layers/convolutional_recurrent.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 36 | 2017-07-27T21:12:40.000Z | 2022-02-03T16:45:56.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.140301 | 83 | 0.641803 |
058e0d95ae0b5b5e6abbe6dc3fad65023812d1e4 | 10,310 | py | Python | hub_module/modules/text/sentiment_analysis/emotion_detection_textcnn/module.py | 18621579069/PaddleHub-yu | 15e8bcef2addf239081e235bdcfd039de12330e0 | [
"Apache-2.0"
] | 4 | 2021-02-25T03:27:38.000Z | 2021-05-15T03:20:23.000Z | hub_module/modules/text/sentiment_analysis/emotion_detection_textcnn/module.py | 18621579069/PaddleHub-yu | 15e8bcef2addf239081e235bdcfd039de12330e0 | [
"Apache-2.0"
] | null | null | null | hub_module/modules/text/sentiment_analysis/emotion_detection_textcnn/module.py | 18621579069/PaddleHub-yu | 15e8bcef2addf239081e235bdcfd039de12330e0 | [
"Apache-2.0"
] | 2 | 2021-03-01T07:04:01.000Z | 2021-05-14T05:54:18.000Z | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import os
import paddle.fluid as fluid
import paddlehub as hub
from paddlehub.common.paddle_helper import add_vars_prefix
from paddlehub.module.module import moduleinfo, serv... | 39.96124 | 158 | 0.57323 |
1fcdfc33013c8ee8c6ad4911cd76440071c63281 | 444 | py | Python | data/scripts/templates/object/static/structure/general/shared_web_01.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/static/structure/general/shared_web_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/static/structure/general/shared_web_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/structure/general/shared_web_01.iff"
result.attribute_template_id = -1
... | 26.117647 | 70 | 0.722973 |
23b9d1bcc6bbd3d73e5b8ee763f2a7a0a2c83620 | 2,245 | py | Python | libs/dictionary.py | tanakonDigiOranic/fastapi-molog-wms | 91942916a9afec4dc13bc734ba429b2fbae3cac5 | [
"MIT"
] | null | null | null | libs/dictionary.py | tanakonDigiOranic/fastapi-molog-wms | 91942916a9afec4dc13bc734ba429b2fbae3cac5 | [
"MIT"
] | null | null | null | libs/dictionary.py | tanakonDigiOranic/fastapi-molog-wms | 91942916a9afec4dc13bc734ba429b2fbae3cac5 | [
"MIT"
] | null | null | null | from libs.settings import OPEN_URL, OPEN_APP_KEY, OPEN_SECRET_KEY, MOLOG_USERNAME, MOLOG_PASSWORD
from libs.autogen import gen_signature, gen_timestamp, read_token
from libs.mologutils import gen_token
import requests
import json
# auto refresh token
gen_token()
class rest_molog(object):
def __init__(self):
... | 34.015152 | 145 | 0.629399 |
f23a4ce9b81b15c207ea4714acdcac245389caad | 17,514 | py | Python | src/pyhf/tensor/numpy_backend.py | aryan26roy/pyhf | c3d0acb2591f34fc3bd169fb525fa1f6b4c8f369 | [
"Apache-2.0"
] | null | null | null | src/pyhf/tensor/numpy_backend.py | aryan26roy/pyhf | c3d0acb2591f34fc3bd169fb525fa1f6b4c8f369 | [
"Apache-2.0"
] | null | null | null | src/pyhf/tensor/numpy_backend.py | aryan26roy/pyhf | c3d0acb2591f34fc3bd169fb525fa1f6b4c8f369 | [
"Apache-2.0"
] | null | null | null | """NumPy Tensor Library Module."""
import numpy as np
import logging
from scipy.special import gammaln, xlogy
from scipy import special
from scipy.stats import norm, poisson
log = logging.getLogger(__name__)
class _BasicPoisson:
def __init__(self, rate):
self.rate = rate
def sample(self, sample_sha... | 32.736449 | 130 | 0.55487 |
5197bb7fde1dc8be9cab20857f8646ff658d5e1c | 4,261 | py | Python | lib/data/EvalDataset.py | Ashish013/pifuhd | 223d51854e6282ad0554816f67c1d60d70ea3202 | [
"MIT"
] | null | null | null | lib/data/EvalDataset.py | Ashish013/pifuhd | 223d51854e6282ad0554816f67c1d60d70ea3202 | [
"MIT"
] | null | null | null | lib/data/EvalDataset.py | Ashish013/pifuhd | 223d51854e6282ad0554816f67c1d60d70ea3202 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import os
import random
import numpy as np
from PIL import Image, ImageOps
from PIL.ImageFilter import GaussianBlur
import cv2
import torch
import json
from torch.utils.data import Dataset
import torchvision.transforms as transforms
def crop_i... | 32.280303 | 254 | 0.562309 |
949a1f77758093ad5f0e379b6d15f0a51fd0882d | 18,217 | py | Python | tests/ci/rally_verify.py | jogeo/rally-openstack | 83437e7c5925d5d647cd28f1821b6d51687b0123 | [
"Apache-2.0"
] | null | null | null | tests/ci/rally_verify.py | jogeo/rally-openstack | 83437e7c5925d5d647cd28f1821b6d51687b0123 | [
"Apache-2.0"
] | null | null | null | tests/ci/rally_verify.py | jogeo/rally-openstack | 83437e7c5925d5d647cd28f1821b6d51687b0123 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# 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 ... | 33.121818 | 79 | 0.597683 |
1c69dd6c60c88d2c0d5ac69e8f9bd07b6b341f29 | 68,284 | py | Python | tdda/rexpy/testrexpy.py | robertn01/tdda | e851389a4a051042a2a84295b2ff3c0ed1de176f | [
"MIT"
] | null | null | null | tdda/rexpy/testrexpy.py | robertn01/tdda | e851389a4a051042a2a84295b2ff3c0ed1de176f | [
"MIT"
] | null | null | null | tdda/rexpy/testrexpy.py | robertn01/tdda | e851389a4a051042a2a84295b2ff3c0ed1de176f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
URLs1
http\:\/\/[a-z]{3,4}\.[a-z]{3,4}
http\:\/\/[a-z]{5,19}\.com\/
[a-z]{4,5}\:\/\/[a-z]{3}\.[a-z]{6,19}\.com
http\:\/\/www\.[a-z]{6,19}\.com\/
http\:\/\/www\.[a-z]{6,19}\.co\.uk\/
** With s replacing space and backslashes removed, spaced in groups:
111111111 222 33333333333 4... | 38.974886 | 83 | 0.413948 |
94ea346d650ad834ba9cfb818399f472fe4494b1 | 1,274 | py | Python | test/dummy_test.py | s-bl/ALLogger | 03850a2423cffcc6e77de90f9430db9098fd01fc | [
"MIT"
] | null | null | null | test/dummy_test.py | s-bl/ALLogger | 03850a2423cffcc6e77de90f9430db9098fd01fc | [
"MIT"
] | null | null | null | test/dummy_test.py | s-bl/ALLogger | 03850a2423cffcc6e77de90f9430db9098fd01fc | [
"MIT"
] | null | null | null | from time import sleep
import numpy as np
import os
import allogger
def main():
allogger.basic_configure(enable=False, logdir='/tmp/allogger/dummy', default_outputs=['tensorboard'], hdf_writer_params=dict(
min_time_diff_btw_disc_writes=10, precision=2,
), debug=True, default_path_exists='ask')
all... | 36.4 | 133 | 0.689168 |
fc56688110159b1d6dacbee60e3d757b613271d9 | 428 | py | Python | app/core/migrations/0005_recipe_image.py | stevebaker01/recipe_app_api | 5a50527e94f6c9e8e60f6c3eda301b696aadb447 | [
"MIT"
] | null | null | null | app/core/migrations/0005_recipe_image.py | stevebaker01/recipe_app_api | 5a50527e94f6c9e8e60f6c3eda301b696aadb447 | [
"MIT"
] | null | null | null | app/core/migrations/0005_recipe_image.py | stevebaker01/recipe_app_api | 5a50527e94f6c9e8e60f6c3eda301b696aadb447 | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-08-18 02:30
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
... | 21.4 | 93 | 0.621495 |
dd660ed1cd3561da96ca503ea47edd65e90a32fb | 58,280 | py | Python | apps/log_databus/views/collector_views.py | yiqiwang-17/bk-log | 7b356fced63b667baea300cfd194ad70a842c3ee | [
"MIT"
] | null | null | null | apps/log_databus/views/collector_views.py | yiqiwang-17/bk-log | 7b356fced63b667baea300cfd194ad70a842c3ee | [
"MIT"
] | null | null | null | apps/log_databus/views/collector_views.py | yiqiwang-17/bk-log | 7b356fced63b667baea300cfd194ad70a842c3ee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
------------------------------------------------... | 39.646259 | 117 | 0.523439 |
4879b47d3abbe84cf836bd5e61f1791231c177ed | 968 | py | Python | leetcode/python/79_word_search.py | VVKot/leetcode-solutions | 7d6e599b223d89a7861929190be715d3b3604fa4 | [
"MIT"
] | 4 | 2019-04-22T11:57:36.000Z | 2019-10-29T09:12:56.000Z | leetcode/python/79_word_search.py | VVKot/coding-competitions | 7d6e599b223d89a7861929190be715d3b3604fa4 | [
"MIT"
] | null | null | null | leetcode/python/79_word_search.py | VVKot/coding-competitions | 7d6e599b223d89a7861929190be715d3b3604fa4 | [
"MIT"
] | null | null | null | class Solution:
def dfs(self, board, y, x, word):
if not word:
return True
rows = len(board)
cols = len(board[0])
if not (0 <= y < rows and 0 <= x < cols):
return False
if board[y][x] != word[0]:
return False
temp = board[y][x]
... | 29.333333 | 52 | 0.452479 |
ab58ae635440800945cf541cc704d2fcba48edfc | 812 | py | Python | test/output/test_networks.py | zlinzju/DeepReg | e808a4d80ea29233fa664df374e79af46d9ff60f | [
"Apache-2.0"
] | 1 | 2020-11-05T12:17:27.000Z | 2020-11-05T12:17:27.000Z | test/output/test_networks.py | zlinzju/DeepReg | e808a4d80ea29233fa664df374e79af46d9ff60f | [
"Apache-2.0"
] | null | null | null | test/output/test_networks.py | zlinzju/DeepReg | e808a4d80ea29233fa664df374e79af46d9ff60f | [
"Apache-2.0"
] | null | null | null | """
Unit test for special config settings
"""
from test.output.util import train_and_predict_with_config
def test_dvf_network():
# the model outputs dvf
train_and_predict_with_config(
test_name="unpaired_labeled_nifti_dvf",
config_path=[
"config/test/ddf.yaml",
"config... | 25.375 | 58 | 0.628079 |
8fab59b8b0388103346b709216ab8a97c000acb6 | 1,525 | py | Python | ibeis/viz/interact/interact_sver.py | SU-ECE-17-7/ibeis | b12a45b06d8ce8f52585494c15f6776f5889ed67 | [
"Apache-2.0"
] | null | null | null | ibeis/viz/interact/interact_sver.py | SU-ECE-17-7/ibeis | b12a45b06d8ce8f52585494c15f6776f5889ed67 | [
"Apache-2.0"
] | null | null | null | ibeis/viz/interact/interact_sver.py | SU-ECE-17-7/ibeis | b12a45b06d8ce8f52585494c15f6776f5889ed67 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import utool
from ibeis import viz
from ibeis.viz import viz_helpers as vh
from plottool import interact_helpers as ih
(print, print_, printDBG, rrr, profile) = utool.inject(
__name__, '[interact_sver]', DEBUG=False)
def ish... | 35.465116 | 91 | 0.615738 |
067e46afa84958b1eb7e4679c7f4f736b477bc04 | 2,547 | py | Python | onadata/apps/fsforms/viewsets/StageViewset.py | awemulya/fieldsight-kobocat | f302d084e30fb637d43ec638c701e01a3dddc721 | [
"BSD-2-Clause"
] | 38 | 2017-02-28T05:39:40.000Z | 2019-01-16T04:39:04.000Z | onadata/apps/fsforms/viewsets/StageViewset.py | awemulya/fieldsightt | f302d084e30fb637d43ec638c701e01a3dddc721 | [
"BSD-2-Clause"
] | 20 | 2017-04-27T09:14:27.000Z | 2019-01-17T06:35:52.000Z | onadata/apps/fsforms/viewsets/StageViewset.py | awemulya/fieldsightt | f302d084e30fb637d43ec638c701e01a3dddc721 | [
"BSD-2-Clause"
] | 5 | 2017-02-22T12:25:19.000Z | 2019-01-15T11:16:40.000Z | from __future__ import unicode_literals
from django.db.models import Q
from django.shortcuts import get_object_or_404
from rest_framework import viewsets
from onadata.apps.api.viewsets.xform_viewset import CsrfExemptSessionAuthentication
from onadata.apps.fieldsight.models import Site
from onadata.apps.fsforms.models ... | 35.375 | 115 | 0.730271 |
6f4368707988ee41aab02ab92c45ecd34827bebd | 2,970 | py | Python | sqlalchemy/sqlalchemy-0.3.6+codebay/sqlalchemy/logging.py | nakedible/vpnease-l2tp | 0fcda6a757f2bc5c37f4753b3cd8b1c6d282db5c | [
"WTFPL"
] | 5 | 2015-04-16T08:36:17.000Z | 2017-05-12T17:20:12.000Z | sqlalchemy/sqlalchemy-0.3.6+codebay/sqlalchemy/logging.py | nakedible/vpnease-l2tp | 0fcda6a757f2bc5c37f4753b3cd8b1c6d282db5c | [
"WTFPL"
] | null | null | null | sqlalchemy/sqlalchemy-0.3.6+codebay/sqlalchemy/logging.py | nakedible/vpnease-l2tp | 0fcda6a757f2bc5c37f4753b3cd8b1c6d282db5c | [
"WTFPL"
] | 4 | 2015-03-19T14:39:51.000Z | 2019-01-23T08:22:55.000Z | # logging.py - adapt python logging module to SQLAlchemy
# Copyright (C) 2006, 2007 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Provides a few functions used by instances to turn on/off their... | 38.076923 | 120 | 0.742088 |
b65cbf7d8698cd626ed6ae4ede8896ec5c2839e9 | 37,360 | py | Python | scripts/misc/train_with_tv_original.py | zgjslc/Film-Recovery-master1 | 4497a9930398c9e826ac364056a79e5bcbf6c953 | [
"Apache-2.0"
] | null | null | null | scripts/misc/train_with_tv_original.py | zgjslc/Film-Recovery-master1 | 4497a9930398c9e826ac364056a79e5bcbf6c953 | [
"Apache-2.0"
] | null | null | null | scripts/misc/train_with_tv_original.py | zgjslc/Film-Recovery-master1 | 4497a9930398c9e826ac364056a79e5bcbf6c953 | [
"Apache-2.0"
] | null | null | null | """
Name: train_with_constrain.py
Desc: This script contains the training and testing code of Unwrap Film.
Notations:
||rgb
Mean: The original render image in color space.
Shape: [batch_size, 3, 256, 256]
Range: 0 ~ 255 -----> -1 ~ 1
||threeD_map :
Mean: Three coordinate map as g... | 59.967897 | 409 | 0.551392 |
54af1f991199afdfb0ddd472701ae9f3c52ca3a8 | 3,247 | py | Python | modules/python/midas.py | farre/midas | f31a0e6eea6e74186a1dad11c1a81bd913ef3c4d | [
"MIT"
] | null | null | null | modules/python/midas.py | farre/midas | f31a0e6eea6e74186a1dad11c1a81bd913ef3c4d | [
"MIT"
] | 16 | 2022-02-09T09:46:20.000Z | 2022-03-28T13:03:31.000Z | modules/python/midas.py | farre/midas | f31a0e6eea6e74186a1dad11c1a81bd913ef3c4d | [
"MIT"
] | null | null | null | import gdb
import gdb.types
import os
import sys
import json
import logging
import logging.handlers
from os import path
def resolveExtensionFile(fileName):
extensionPath = os.path.dirname(os.path.realpath(__file__))
return "{}/../../{}".format(extensionPath, fileName)
misc_handler = logging.handlers.Watche... | 37.755814 | 124 | 0.822298 |
83eddfe484e6b7d3459c6fb9abdd71496ecbc5d6 | 24,393 | py | Python | tilutil/imageutils.py | ekinsokmen/phoshare | 24f66771d0a5952075ec4b2e37ca315719e54a82 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-08-07T21:17:53.000Z | 2019-10-14T13:08:11.000Z | tilutil/imageutils.py | ekinsokmen/phoshare | 24f66771d0a5952075ec4b2e37ca315719e54a82 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tilutil/imageutils.py | ekinsokmen/phoshare | 24f66771d0a5952075ec4b2e37ca315719e54a82 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | '''Helpers to use with images files
@author: tsporkert@gmail.com
'''
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licen... | 35.977876 | 105 | 0.595622 |
a20c73f3ac069a0d98b089856f3dab86b60030d1 | 551 | py | Python | manage.py | fchevitarese/django-orm-standalone-boilerplate | 165740dcb20762ec03c6dcf5c419fea3de9ba513 | [
"MIT"
] | 2 | 2018-06-15T12:29:37.000Z | 2020-08-10T10:42:31.000Z | manage.py | fchevitarese/django-orm-standalone-boilerplate | 165740dcb20762ec03c6dcf5c419fea3de9ba513 | [
"MIT"
] | null | null | null | manage.py | fchevitarese/django-orm-standalone-boilerplate | 165740dcb20762ec03c6dcf5c419fea3de9ba513 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault(
'DJANGO_SETTINGS_MODULE', 'standalone.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import ... | 32.411765 | 73 | 0.676951 |
a112163e39e1eb927ed9847497cca558a417f42e | 782 | py | Python | service/api/api_v1/endpoints/hello.py | Savimbi/kubernetes-fastapi | 738bfa89ed3ef94dbe454309877ef96b3f21ad72 | [
"MIT"
] | null | null | null | service/api/api_v1/endpoints/hello.py | Savimbi/kubernetes-fastapi | 738bfa89ed3ef94dbe454309877ef96b3f21ad72 | [
"MIT"
] | null | null | null | service/api/api_v1/endpoints/hello.py | Savimbi/kubernetes-fastapi | 738bfa89ed3ef94dbe454309877ef96b3f21ad72 | [
"MIT"
] | null | null | null | from fastapi import APIRouter
from service.core.models.output import MessageOutput
from service.core.models.input import MessageInput
from service.core.logic.business_logic import run_prime_factor_calculation
router = APIRouter()
@router.post("/hello", response_model=MessageOutput, tags=["hello post"])
def hello_end... | 31.28 | 128 | 0.725064 |
296fe9afd31b494235c19c638e137621f23b76cc | 18,400 | py | Python | wagtail/wagtailcore/blocks/stream_block.py | patphongs/wagtail | 32555f7a1c599c139e0f26c22907c9612af2e015 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailcore/blocks/stream_block.py | patphongs/wagtail | 32555f7a1c599c139e0f26c22907c9612af2e015 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailcore/blocks/stream_block.py | patphongs/wagtail | 32555f7a1c599c139e0f26c22907c9612af2e015 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, unicode_literals
import collections
import uuid
from django import forms
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.core.exceptions import NON_FIELD_ERRORS, ValidationError
from django.forms.utils import ErrorList
from django.template.loa... | 40.798226 | 121 | 0.621739 |
24e773bb3c698ce85f243bcb0616772496601163 | 7,064 | py | Python | tests/extension/types_/axi_/ram_to_axi/types_axi_ram_to_axi.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | tests/extension/types_/axi_/ram_to_axi/types_axi_ram_to_axi.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | tests/extension/types_/axi_/ram_to_axi/types_axi_ram_to_axi.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import sys
import os
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))))
from veriloggen i... | 25.781022 | 84 | 0.601925 |
1042f67ea9721713d0d770bf1a780facc0952c27 | 3,165 | py | Python | torchfcn/ext/fcn.berkeleyvision.org/pascalcontext-fcn16s/net.py | linesd/pytorch-fcn | 5907fb7765bdcc0cff8b2819d6548a277f2e2231 | [
"MIT"
] | 3,520 | 2015-06-10T01:34:11.000Z | 2022-03-31T06:50:32.000Z | pascalcontext-fcn16s/net.py | DongdongBai/fcn.berkeleyvision.org | 1305c7378a9f0ab44b2c936f4d60e4687e3d8743 | [
"BSD-2-Clause"
] | 151 | 2017-02-21T03:06:49.000Z | 2022-03-27T13:47:52.000Z | pascalcontext-fcn16s/net.py | DongdongBai/fcn.berkeleyvision.org | 1305c7378a9f0ab44b2c936f4d60e4687e3d8743 | [
"BSD-2-Clause"
] | 1,771 | 2015-07-09T00:27:07.000Z | 2022-03-19T12:19:31.000Z | import caffe
from caffe import layers as L, params as P
from caffe.coord_map import crop
def conv_relu(bottom, nout, ks=3, stride=1, pad=1):
conv = L.Convolution(bottom, kernel_size=ks, stride=stride,
num_output=nout, pad=pad,
param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)])
... | 37.678571 | 79 | 0.652133 |
0111702c74bc0ab196b95163bc1b34be55066fa1 | 3,311 | py | Python | 2015/04_TheIdealStockingStuffer/test_miner.py | deanearlwright/AdventOfCode | ca4cf6315c0efa38bd7748fb6f4bc99e7934871d | [
"MIT"
] | 1 | 2021-01-03T23:09:28.000Z | 2021-01-03T23:09:28.000Z | 2015/04_TheIdealStockingStuffer/test_miner.py | deanearlwright/AdventOfCode | ca4cf6315c0efa38bd7748fb6f4bc99e7934871d | [
"MIT"
] | 6 | 2020-12-26T21:02:42.000Z | 2020-12-26T21:02:52.000Z | 2015/04_TheIdealStockingStuffer/test_miner.py | deanearlwright/AdventOfCode | ca4cf6315c0efa38bd7748fb6f4bc99e7934871d | [
"MIT"
] | null | null | null | # ======================================================================
# The Ideal Stocking Stuffer
# Advent of Code 2015 Day 04 -- Eric Wastl -- https://adventofcode.com
#
# Python implementation by Dr. Dean Earl Wright III
# ======================================================================
# ===============... | 35.98913 | 77 | 0.408034 |
f311a0d4fc25e1e69886eb89c723d954b32f44c4 | 253 | py | Python | RiskQuantLib/Property/ProfitAndLoss/profitAndLoss.py | SyuyaMurakami/RiskQuantLib-Doc | 2503befc24c2e422e51f8b9f468c8d8439e11c65 | [
"MIT"
] | 1 | 2021-12-29T12:18:45.000Z | 2021-12-29T12:18:45.000Z | RiskQuantLib/Property/ProfitAndLoss/profitAndLoss.py | SyuyaMurakami/RiskQuantLib-Doc | 2503befc24c2e422e51f8b9f468c8d8439e11c65 | [
"MIT"
] | null | null | null | RiskQuantLib/Property/ProfitAndLoss/profitAndLoss.py | SyuyaMurakami/RiskQuantLib-Doc | 2503befc24c2e422e51f8b9f468c8d8439e11c65 | [
"MIT"
] | 1 | 2021-12-08T02:14:34.000Z | 2021-12-08T02:14:34.000Z | #!/usr/bin/python
#coding = utf-8
from RiskQuantLib.Property.NumberProperty.numberProperty import numberProperty
class profitAndLoss(numberProperty):
def __init__(self,value,unit = 'RMB'):
super(profitAndLoss,self).__init__(value,unit)
| 21.083333 | 78 | 0.758893 |
1fbd5a1c6c99f486e81112612978a0c58a73890e | 2,605 | py | Python | services/core-api/app/api/utils/access_decorators.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | 1 | 2021-09-17T20:41:45.000Z | 2021-09-17T20:41:45.000Z | services/core-api/app/api/utils/access_decorators.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | null | null | null | services/core-api/app/api/utils/access_decorators.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | null | null | null | from functools import wraps
from app.extensions import jwt
from flask_jwt_oidc.exceptions import AuthError
from werkzeug.exceptions import Forbidden
VIEW_ALL = "core_view_all"
MINE_EDIT = "core_edit_mines"
MINE_ADMIN = "core_admin"
EDIT_PARTY = "core_edit_parties"
EDIT_PERMIT = "core_edit_permits"
EDIT_EXPLOSIVES_PERM... | 26.05 | 71 | 0.767754 |
f3cdb25cfa18a26eb56a1ca301d6738a70655454 | 655 | py | Python | game/scheduler.py | bj-baniya/testmysite | 71fb9302ba4f5f034d53c0984e8e4b3189951f9f | [
"MIT"
] | null | null | null | game/scheduler.py | bj-baniya/testmysite | 71fb9302ba4f5f034d53c0984e8e4b3189951f9f | [
"MIT"
] | 4 | 2021-03-18T23:32:09.000Z | 2021-09-22T18:32:32.000Z | game/scheduler.py | bj-baniya/testmysite | 71fb9302ba4f5f034d53c0984e8e4b3189951f9f | [
"MIT"
] | null | null | null | from datetime import datetime
from apscheduler.schedulers.background import BackgroundScheduler
from channels.layers import get_channel_layer
from asgiref.sync import async_to_sync
import time
scheduler = BackgroundScheduler()
def start():
scheduler.start()
def add_new_job(roomname,context):
scheduler.add_... | 34.473684 | 98 | 0.770992 |
08b2afdda3e706adaabede4d0b3e2c0e7a2261c4 | 5,504 | py | Python | chaospy/quadrature/sparse_grid.py | eneelo/chaospy | da31792fa5d58c231a77e04234b32cb90df6c6d8 | [
"MIT"
] | null | null | null | chaospy/quadrature/sparse_grid.py | eneelo/chaospy | da31792fa5d58c231a77e04234b32cb90df6c6d8 | [
"MIT"
] | null | null | null | chaospy/quadrature/sparse_grid.py | eneelo/chaospy | da31792fa5d58c231a77e04234b32cb90df6c6d8 | [
"MIT"
] | null | null | null | """Smolyak sparse grid constructor."""
from collections import defaultdict
from itertools import product
import numpy
from scipy.special import comb
import numpoly
import chaospy
def construct_sparse_grid(
order,
dist,
growth=None,
recurrence_algorithm="stieltjes",
rule="gaus... | 34.4 | 86 | 0.587028 |
0c503de1af6b467709390105c8f11594423993de | 1,030 | bzl | Python | foreign_cc/private/make_script.bzl | alexeagle/rules_foreign_cc | 3f91f6b56f3bad5c1c277a5987d277139559ceb3 | [
"Apache-2.0"
] | null | null | null | foreign_cc/private/make_script.bzl | alexeagle/rules_foreign_cc | 3f91f6b56f3bad5c1c277a5987d277139559ceb3 | [
"Apache-2.0"
] | 1 | 2021-03-16T19:03:24.000Z | 2021-03-16T19:03:24.000Z | foreign_cc/private/make_script.bzl | alexeagle/rules_foreign_cc | 3f91f6b56f3bad5c1c277a5987d277139559ceb3 | [
"Apache-2.0"
] | null | null | null | # buildifier: disable=module-docstring
# buildifier: disable=function-docstring
def create_make_script(
root,
inputs,
make_commands):
ext_build_dirs = inputs.ext_build_dirs
script = pkgconfig_script(ext_build_dirs)
script.append("##symlink_contents_to_dir## $$EXT_BUILD_ROOT$$/{} $$... | 33.225806 | 100 | 0.704854 |
09d7d633e36421b06d1563920d92e1fc248e515d | 3,836 | py | Python | pyOptomip/hp816x_N77Det_instrParameters.py | StephenHLin/pyOptomip | c7a58a920eddfcda5ac8223f0fb0d1d3c6d30750 | [
"MIT"
] | 1 | 2020-12-01T12:59:27.000Z | 2020-12-01T12:59:27.000Z | pyOptomip/hp816x_N77Det_instrParameters.py | StephenHLin/pyOptomip | c7a58a920eddfcda5ac8223f0fb0d1d3c6d30750 | [
"MIT"
] | null | null | null | pyOptomip/hp816x_N77Det_instrParameters.py | StephenHLin/pyOptomip | c7a58a920eddfcda5ac8223f0fb0d1d3c6d30750 | [
"MIT"
] | 1 | 2020-12-01T12:59:27.000Z | 2020-12-01T12:59:27.000Z | # The MIT License (MIT)
# Copyright (c) 2015 Michael Caverley
# 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, c... | 44.604651 | 100 | 0.673358 |
53054a7ffd6b3dcb9b72e17477e20f376361689b | 1,733 | py | Python | generics/models.py | catthu/Platform17 | 9aa62a2f4a84794987769e0d0ed6c37e4672f05e | [
"MIT"
] | null | null | null | generics/models.py | catthu/Platform17 | 9aa62a2f4a84794987769e0d0ed6c37e4672f05e | [
"MIT"
] | null | null | null | generics/models.py | catthu/Platform17 | 9aa62a2f4a84794987769e0d0ed6c37e4672f05e | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
# Create your models here.
DEFAULT_ITEM_LOCATION = 5 # Room of Holding (Storage)
DEFAULT_CHARACTER_LOCATION = 6
class Room(models.Model):
name = models.CharField(max_length = 200)
code_name = models.CharField(max_length = 200, null = True, ... | 43.325 | 111 | 0.72764 |
aee46bc93690c08cd5f28a4178d6782dc819d14f | 6,270 | py | Python | python/pyarrow/tests/test_tensor.py | timkpaine/arrow | a96297e65e17e728e4321cdecc7ace146e1363fb | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | 9,734 | 2016-02-17T13:22:12.000Z | 2022-03-31T09:35:00.000Z | python/pyarrow/tests/test_tensor.py | timkpaine/arrow | a96297e65e17e728e4321cdecc7ace146e1363fb | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | 11,470 | 2016-02-19T15:30:28.000Z | 2022-03-31T23:27:21.000Z | python/pyarrow/tests/test_tensor.py | XpressAI/arrow | eafd885e06f6bbc1eb169ed64016f804c1810bec | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | 2,637 | 2016-02-17T10:56:29.000Z | 2022-03-31T08:20:13.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 28.894009 | 74 | 0.638915 |
770d5cf53b5e549df4d52f51c2f2240fcb36fdd8 | 17,166 | py | Python | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/CADD/workflows/docking/PrepareReceptor_0.1_net.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | 8 | 2021-12-14T21:30:01.000Z | 2022-02-14T11:30:03.000Z | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/CADD/workflows/docking/PrepareReceptor_0.1_net.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | null | null | null | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/CADD/workflows/docking/PrepareReceptor_0.1_net.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | null | null | null | #!/bin/ksh ~/.mgltools/pythonsh
########################################################################
#
# Vision Network - Python source code - file generated by vision
# Thursday 24 February 2011 03:10:56
#
# The Scripps Research Institute (TSRI)
# Molecular Graphics Lab
# La Jolla, CA ... | 51.861027 | 254 | 0.745019 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.