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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
96fc97b3e2e36b994710eb0688b02a2f2af90727 | 387 | py | Python | setup.py | sansbacon/pangadfs-pydfsoptimizer | 4a0ee4bcfe5e4d228136b5a32690d410c521880c | [
"Apache-2.0"
] | null | null | null | setup.py | sansbacon/pangadfs-pydfsoptimizer | 4a0ee4bcfe5e4d228136b5a32690d410c521880c | [
"Apache-2.0"
] | null | null | null | setup.py | sansbacon/pangadfs-pydfsoptimizer | 4a0ee4bcfe5e4d228136b5a32690d410c521880c | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
def run():
setup(
name='pangadfs-pydfs',
packages=find_packages(),
entry_points={
'pangadfs.pool': ['pool_pydfs = pydfs:PyDfsPool'],
'pangadfs.populate': ['populate_pydfs = pydfs:PyDfsPopulate'],
},
... | 21.5 | 73 | 0.560724 |
1eba5e5190a1f7dcf15c864b00b303a817b7726a | 1,241 | py | Python | firmware_kmk/lib/kmk/extensions/__init__.py | telzo2000/NumAtreus_pico | 3c8558e80869eca3ee753de21a02afc8108e5fcf | [
"MIT"
] | 1 | 2022-01-21T06:09:18.000Z | 2022-01-21T06:09:18.000Z | firmware_kmk/lib/kmk/extensions/__init__.py | telzo2000/NumAtreus_pico | 3c8558e80869eca3ee753de21a02afc8108e5fcf | [
"MIT"
] | 1 | 2021-09-07T21:42:32.000Z | 2021-09-07T21:44:19.000Z | firmware_kmk/lib/kmk/extensions/__init__.py | telzo2000/NumAtreus_pico | 3c8558e80869eca3ee753de21a02afc8108e5fcf | [
"MIT"
] | 1 | 2021-09-07T21:37:16.000Z | 2021-09-07T21:37:16.000Z | class InvalidExtensionEnvironment(Exception):
pass
class Extension:
_enabled = True
def enable(self, keyboard):
self._enabled = True
self.on_runtime_enable(keyboard)
def disable(self, keyboard):
self._enabled = False
self.on_runtime_disable(keyboard)
# The belo... | 23.865385 | 63 | 0.681708 |
48aaaadb735b639bcae569dd64ce944fadbf97b1 | 240 | py | Python | Course-2004/Lesson 2/hw3.py | kasztp/python-lessons | 2a159ad5e1186c749b96c5d0ede45b7142c6bbb5 | [
"MIT"
] | 35 | 2015-05-18T08:08:41.000Z | 2022-03-07T09:38:02.000Z | Course-2004/Lesson 2/hw3.py | kasztp/python-lessons | 2a159ad5e1186c749b96c5d0ede45b7142c6bbb5 | [
"MIT"
] | 1 | 2021-09-29T02:08:26.000Z | 2021-09-29T02:08:26.000Z | Course-2004/Lesson 2/hw3.py | kasztp/python-lessons | 2a159ad5e1186c749b96c5d0ede45b7142c6bbb5 | [
"MIT"
] | 40 | 2015-04-28T00:38:54.000Z | 2022-02-13T14:18:34.000Z | num1 = float(eval(input('Please enter a number: ')))
if num1 < 0:
num1 *= 2
else:
num1 *= 3
num2 = float(eval(input('Please enter a number: ')))
if num2 < 0:
num2 *= 2
else:
num2 *= 3
print(('The result is', num1 + num2))
| 17.142857 | 52 | 0.575 |
7b3645d969730ab46156d48b6a65b4151d9901ee | 75 | py | Python | run.py | monicabgs/via_hacka | 67ef12878efa48bbe262a6533e7c50cc1ab7ebc7 | [
"MIT"
] | null | null | null | run.py | monicabgs/via_hacka | 67ef12878efa48bbe262a6533e7c50cc1ab7ebc7 | [
"MIT"
] | null | null | null | run.py | monicabgs/via_hacka | 67ef12878efa48bbe262a6533e7c50cc1ab7ebc7 | [
"MIT"
] | null | null | null | from app import manager
if __name__ == "__main__":
manager.run()
| 12.5 | 26 | 0.64 |
c6cb537a78cf501e7e26ceba7be8c4f74006276b | 1,178 | py | Python | prediction/train_model.py | CovResearchProject/prediction | 1e176a73bedff09bb1a9989c767967b8eb24f10a | [
"MIT"
] | null | null | null | prediction/train_model.py | CovResearchProject/prediction | 1e176a73bedff09bb1a9989c767967b8eb24f10a | [
"MIT"
] | null | null | null | prediction/train_model.py | CovResearchProject/prediction | 1e176a73bedff09bb1a9989c767967b8eb24f10a | [
"MIT"
] | null | null | null |
from src import *
#get the data
df = get_data()
date_time = pd.to_datetime(df.pop('Date'), format='%d/%m/%Y')
timestamp_s = date_time.map(pd.Timestamp.timestamp)
#split
column_indices = {name: i for i, name in enumerate(df.columns)}
n = len(df)
train_df = df[0:int(n*0.8)]
val_df = df[int(n*0.8):int... | 25.608696 | 73 | 0.613752 |
1338e6aefa64b9d97d9b9b5b1edf75493c33d02f | 5,202 | py | Python | src/pyasn1/type/useful.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 184 | 2017-12-20T21:50:06.000Z | 2022-03-19T13:24:58.000Z | src/pyasn1/type/useful.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 68 | 2016-12-12T20:38:47.000Z | 2020-07-26T18:28:49.000Z | src/pyasn1/type/useful.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 136 | 2018-01-09T22:52:06.000Z | 2022-02-24T13:26:18.000Z | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
import datetime
from pyasn1.type import univ, char, tag
from pyasn1.compat import string, dateandtime
from pyasn1 import error
__all__ = ['ObjectDescriptor', 'Generaliz... | 27.967742 | 104 | 0.566705 |
17fb8a968c2c6f2c69d754a6500d41339ec0c793 | 592 | py | Python | mne/stats/__init__.py | Anevar/mne-python | 15b19ed6b9364ae4787f0df2fd7e689b3c0a30bb | [
"BSD-3-Clause"
] | 2 | 2015-09-27T20:33:49.000Z | 2020-04-22T19:10:56.000Z | mne/stats/__init__.py | Anevar/mne-python | 15b19ed6b9364ae4787f0df2fd7e689b3c0a30bb | [
"BSD-3-Clause"
] | null | null | null | mne/stats/__init__.py | Anevar/mne-python | 15b19ed6b9364ae4787f0df2fd7e689b3c0a30bb | [
"BSD-3-Clause"
] | 1 | 2018-09-15T09:45:38.000Z | 2018-09-15T09:45:38.000Z | """Functions for statistical analysis"""
from .parametric import f_threshold_twoway_rm, f_twoway_rm
from .permutations import permutation_t_test
from .cluster_level import (permutation_cluster_test,
permutation_cluster_1samp_test,
spatio_temporal_cluster_1samp_te... | 45.538462 | 63 | 0.633446 |
28ac1eef8fc1d6bdd1715ee3928268e278e7376e | 600 | py | Python | photonsdi/constants.py | felixheld/photonSDI | 674925db3275efff3a936bf610a68839ffdf81b2 | [
"BSD-2-Clause"
] | 8 | 2018-02-05T05:35:06.000Z | 2021-04-08T13:49:42.000Z | photonsdi/constants.py | felixheld/photon-sdi | 674925db3275efff3a936bf610a68839ffdf81b2 | [
"BSD-2-Clause"
] | 1 | 2018-08-01T07:29:21.000Z | 2018-08-02T17:16:51.000Z | photonsdi/constants.py | felixheld/photon-sdi | 674925db3275efff3a936bf610a68839ffdf81b2 | [
"BSD-2-Clause"
] | 3 | 2017-12-17T12:03:45.000Z | 2020-08-26T06:56:12.000Z | # common constants and defines for the SDI core
SDI_ELEMENTARY_STREAM_DATA_WIDTH = 10
# the 10 bit SDI data words are transmitted LSB first
SDI_LINE_LENGTH_WIDTH = 12 # 1080p resolution at maximum for now
SDI_LINE_NUMBER_WIDTH = 11
SDI_FIRST_PIXEL_NUMBER = 0 # pixel 0 is in the middle of a line(!)
SDI_FIRST_LINE_N... | 26.086957 | 67 | 0.785 |
ebd25c23413074ac23d55dfd9bb770f3aab1a3b8 | 3,129 | py | Python | django_extensions/management/commands/runscript.py | google-code-export/django-command-extensions | 581988d8027928fc0193e2dcf730c87ebdcfbc19 | [
"MIT"
] | 3 | 2015-12-25T14:45:36.000Z | 2016-11-28T09:58:03.000Z | django_extensions/management/commands/runscript.py | clones/django-command-extensions | cb18dbb5fc352b4fd1ac9696a15724466915367b | [
"MIT"
] | null | null | null | django_extensions/management/commands/runscript.py | clones/django-command-extensions | cb18dbb5fc352b4fd1ac9696a15724466915367b | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand
from django.core.management.color import no_style
from optparse import make_option
import sys
import os
try:
set
except NameError:
from sets import Set as set # Python 2.3 fallback
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
... | 32.59375 | 88 | 0.512304 |
5fcc1b5eb7f71ab02d8783fba695eb6dbbbfcd78 | 21 | py | Python | megumi/version.py | dev-techmoe/megumi | 67d5626b168dada5f42671a81eca46ea8b7a603c | [
"MIT"
] | 4 | 2020-10-28T08:37:49.000Z | 2022-03-30T05:39:27.000Z | megumi/version.py | dev-techmoe/megumi | 67d5626b168dada5f42671a81eca46ea8b7a603c | [
"MIT"
] | null | null | null | megumi/version.py | dev-techmoe/megumi | 67d5626b168dada5f42671a81eca46ea8b7a603c | [
"MIT"
] | null | null | null | VERSION = '0.0.1-dev' | 21 | 21 | 0.619048 |
9018b81faf932eaf4e7ccb632bba5c8736218337 | 3,168 | py | Python | attribution/distributions.py | cmu-transparency/lib-attribution | 248d10ac5518a220205081ff6a5954fa594d4d78 | [
"MIT"
] | 5 | 2020-09-16T21:22:59.000Z | 2021-08-12T01:03:31.000Z | attribution/distributions.py | cmu-transparency/lib-attribution | 248d10ac5518a220205081ff6a5954fa594d4d78 | [
"MIT"
] | 1 | 2021-06-25T10:35:19.000Z | 2021-06-27T08:17:07.000Z | attribution/distributions.py | cmu-transparency/lib-attribution | 248d10ac5518a220205081ff6a5954fa594d4d78 | [
"MIT"
] | 1 | 2021-08-12T01:03:48.000Z | 2021-08-12T01:03:48.000Z | '''
Docstring for the distributions module.
'''
import keras.backend as K
class Doi(object):
'''
Interface for a distribution of interest.
The *distribution of interest* lets us specify the set of instances over
which we want our explanations to be faithful.
'''
def __call__(self, z):
... | 30.461538 | 80 | 0.598801 |
9de3d202b88f174c676ea874dbd04cccff69a2d7 | 2,924 | py | Python | peering/api/nested_serializers.py | schiederme/peering-manager | 2d29427fd4f2b91a5208f31e1a7ad69eaf82924c | [
"Apache-2.0"
] | null | null | null | peering/api/nested_serializers.py | schiederme/peering-manager | 2d29427fd4f2b91a5208f31e1a7ad69eaf82924c | [
"Apache-2.0"
] | 8 | 2022-03-02T20:47:24.000Z | 2022-03-28T23:23:49.000Z | peering/api/nested_serializers.py | schiederme/peering-manager | 2d29427fd4f2b91a5208f31e1a7ad69eaf82924c | [
"Apache-2.0"
] | 1 | 2021-01-25T01:58:22.000Z | 2021-01-25T01:58:22.000Z | from rest_framework import serializers
from peering.models import (
AutonomousSystem,
BGPGroup,
Community,
Configuration,
DirectPeeringSession,
Email,
InternetExchange,
InternetExchangePeeringSession,
Router,
RoutingPolicy,
)
from utils.api import WritableNestedSerializer
clas... | 26.581818 | 88 | 0.674419 |
750a1cefc589595ff95d5df6c9a6745a6f2a58d6 | 116 | py | Python | fdap/app/contracts/jsonable.py | miniyus/AutomaticPosting-Python | 0627066e60d5cd474ed858e1567bcf6b5b1d9336 | [
"MIT"
] | null | null | null | fdap/app/contracts/jsonable.py | miniyus/AutomaticPosting-Python | 0627066e60d5cd474ed858e1567bcf6b5b1d9336 | [
"MIT"
] | 1 | 2021-11-06T02:30:37.000Z | 2021-11-06T02:30:37.000Z | fdap/app/contracts/jsonable.py | miniyus/AutomaticPosting-Python | 0627066e60d5cd474ed858e1567bcf6b5b1d9336 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
class Jsonable(ABC):
@abstractmethod
def to_json(self):
pass
| 12.888889 | 35 | 0.672414 |
51bf30ebd084b5c6b621ac2b1c94f155822f69b8 | 3,740 | py | Python | script/setmgt_ip.py | shaitmm/NetDevOps | 19478519f6c792353045fcfed7c56bc10428e680 | [
"MIT"
] | 1 | 2019-04-30T06:24:33.000Z | 2019-04-30T06:24:33.000Z | script/setmgt_ip.py | shaitmm/NetDevOps | 19478519f6c792353045fcfed7c56bc10428e680 | [
"MIT"
] | null | null | null | script/setmgt_ip.py | shaitmm/NetDevOps | 19478519f6c792353045fcfed7c56bc10428e680 | [
"MIT"
] | null | null | null | import threading
from telnet import Telnet
devices_info = [{'port': 33281, 'hostname': 'xrv1', 'username': 'admin', 'password': 'admin',"mgt_ip": "172.20.3.101"},
{'port': 33282, 'hostname': 'xrv2', 'username': 'admin', 'password': 'admin',"mgt_ip": "172.20.3.102"},
{'port': 33283, 'hos... | 62.333333 | 122 | 0.549198 |
0b910a08d3d51359e454c67aa645f16c9e6ecc0a | 10,674 | py | Python | testing/sdk_tasks.py | danielitit/dcos-commons | 69ba6429bdcfc4a2ffd0240d163730034e31a3c5 | [
"Apache-2.0"
] | null | null | null | testing/sdk_tasks.py | danielitit/dcos-commons | 69ba6429bdcfc4a2ffd0240d163730034e31a3c5 | [
"Apache-2.0"
] | 1 | 2018-01-26T04:16:31.000Z | 2018-01-26T04:16:31.000Z | testing/sdk_tasks.py | minyk/dcos-etcd | bcd7cd86d87c7ce164862dd28a5aee2a0ae53e15 | [
"Apache-2.0"
] | null | null | null | '''Utilities relating to running commands and HTTP requests
************************************************************************
FOR THE TIME BEING WHATEVER MODIFICATIONS ARE APPLIED TO THIS FILE
SHOULD ALSO BE APPLIED TO sdk_tasks IN ANY OTHER PARTNER REPOS
********************************************************... | 39.977528 | 114 | 0.647836 |
f397fc2520e8500967c1ca9fccba6f1479f74b7f | 4,984 | py | Python | TheNounProjectAPI/collections.py | CubieDev/TheNounProjectAPI | 6db6031800047421146bc72e74060b8af9a7b3be | [
"MIT"
] | 8 | 2019-10-18T21:07:33.000Z | 2021-01-10T01:36:23.000Z | TheNounProjectAPI/collections.py | CubieDev/TheNounProjectAPI | 6db6031800047421146bc72e74060b8af9a7b3be | [
"MIT"
] | 1 | 2020-07-20T14:00:21.000Z | 2020-08-24T10:13:04.000Z | TheNounProjectAPI/collections.py | CubieDev/TheNounProjectAPI | 6db6031800047421146bc72e74060b8af9a7b3be | [
"MIT"
] | 1 | 2021-07-22T01:52:04.000Z | 2021-07-22T01:52:04.000Z |
from typing import Union, List
from TheNounProjectAPI.core import Core
from TheNounProjectAPI.call import Call
from TheNounProjectAPI.models import CollectionModel
from TheNounProjectAPI.exceptions import IncorrectType
class Collections(Core):
@Call.collection
def get_collection_by_id(self, _id: int) -> Col... | 38.045802 | 132 | 0.663122 |
e95a075b37d06493f60d307539257b25b9a827f9 | 3,897 | py | Python | src/oci/apigateway/models/work_request_error.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/apigateway/models/work_request_error.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/apigateway/models/work_request_error.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 28.866667 | 245 | 0.62176 |
e32c3691bda9c5d923f1504d775f876a0dab2710 | 4,213 | py | Python | src/models/TextRank/summarize_textrank.py | Carouge/TextSummarization | 570260dcfccfeaa9ca74fe5b57abd1f81631a74e | [
"MIT"
] | 3 | 2018-06-11T11:10:23.000Z | 2018-12-27T05:18:33.000Z | src/models/TextRank/summarize_textrank.py | MachineLearningUCU/TextSummarization | 570260dcfccfeaa9ca74fe5b57abd1f81631a74e | [
"MIT"
] | 1 | 2018-12-25T13:04:55.000Z | 2019-05-15T13:36:24.000Z | src/models/TextRank/summarize_textrank.py | Carouge/TextSummarization | 570260dcfccfeaa9ca74fe5b57abd1f81631a74e | [
"MIT"
] | null | null | null | from gensim.summarization.summarizer import summarize
from nltk.corpus import stopwords
from nltk.tokenize import RegexpTokenizer
from nltk.translate.bleu_score import sentence_bleu
from rouge import Rouge
import pandas as pd
def summarize_doc(content, len_words):
"""
Summarization of one document using TextR... | 52.6625 | 200 | 0.68977 |
25eab122ff7f84114f276f0e15407eefb53d09e7 | 4,696 | py | Python | opta/commands/deploy.py | run-x/opta | 64606498334f2b1aa79f5a431465eafdf5ca5ed7 | [
"Apache-2.0"
] | 595 | 2021-05-21T22:30:48.000Z | 2022-03-31T15:40:25.000Z | opta/commands/deploy.py | run-x/opta | 64606498334f2b1aa79f5a431465eafdf5ca5ed7 | [
"Apache-2.0"
] | 463 | 2021-05-24T21:32:59.000Z | 2022-03-31T17:12:33.000Z | opta/commands/deploy.py | run-x/opta | 64606498334f2b1aa79f5a431465eafdf5ca5ed7 | [
"Apache-2.0"
] | 29 | 2021-05-21T22:27:52.000Z | 2022-03-28T16:43:45.000Z | import os
from pathlib import Path
from typing import Optional
import click
from opta.amplitude import amplitude_client
from opta.commands.apply import _apply
from opta.commands.local_flag import _clean_tf_folder, _handle_local_flag
from opta.commands.push import _push, is_service_config
from opta.core.terraform impo... | 30.69281 | 175 | 0.638416 |
300c26be8f6b33c0cdd4a57e75648e444a25d763 | 3,136 | py | Python | python/examples/ocr/rec_web_server.py | BohaoWu/Serving | fe7fb5465bfbf6dae587aaf080ad27c08a0f7057 | [
"Apache-2.0"
] | null | null | null | python/examples/ocr/rec_web_server.py | BohaoWu/Serving | fe7fb5465bfbf6dae587aaf080ad27c08a0f7057 | [
"Apache-2.0"
] | null | null | null | python/examples/ocr/rec_web_server.py | BohaoWu/Serving | fe7fb5465bfbf6dae587aaf080ad27c08a0f7057 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.465116 | 97 | 0.676658 |
72ec20938f12666aac22b02ba34eff699ba7ab83 | 7,741 | py | Python | youtube_dl/extractor/ooyala.py | LyleH/youtube-dl | 7564b09ef5c09454908f78cb91c3bd2d6daacac5 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/ooyala.py | LyleH/youtube-dl | 7564b09ef5c09454908f78cb91c3bd2d6daacac5 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/ooyala.py | LyleH/youtube-dl | 7564b09ef5c09454908f78cb91c3bd2d6daacac5 | [
"Unlicense"
] | null | null | null | from __future__ import unicode_literals
import re
import base64
from .common import InfoExtractor
from ..utils import (
int_or_none,
float_or_none,
ExtractorError,
unsmuggle_url,
determine_ext,
)
from ..compat import compat_urllib_parse_urlencode
class OoyalaBaseIE(InfoExtractor):
_PLAYER_BAS... | 41.395722 | 334 | 0.547474 |
2972ccf8562d98df247283d9cf2791dd1d527e84 | 2,302 | py | Python | fastai2/callback/data.py | antoinebon/fastai2 | c14315d5a73565a54301acd2c41a4f04c4042f54 | [
"Apache-2.0"
] | null | null | null | fastai2/callback/data.py | antoinebon/fastai2 | c14315d5a73565a54301acd2c41a4f04c4042f54 | [
"Apache-2.0"
] | null | null | null | fastai2/callback/data.py | antoinebon/fastai2 | c14315d5a73565a54301acd2c41a4f04c4042f54 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/14a_callback.data.ipynb (unless otherwise specified).
__all__ = ['CollectDataCallback', 'WeightedDL', 'weighted_dataloaders', 'PartialDL', 'partial_dataloaders']
# Cell
from ..basics import *
# Cell
class CollectDataCallback(Callback):
"Collect all batches, along w... | 39.689655 | 114 | 0.69722 |
9bd533514b2edeec5ac3f2dfa365f2e254b1d3d8 | 161 | py | Python | core/primitive/hex.py | ponyatov/metaLpy | 96149313e8083536ade1c331825242f6996f05b3 | [
"MIT"
] | null | null | null | core/primitive/hex.py | ponyatov/metaLpy | 96149313e8083536ade1c331825242f6996f05b3 | [
"MIT"
] | null | null | null | core/primitive/hex.py | ponyatov/metaLpy | 96149313e8083536ade1c331825242f6996f05b3 | [
"MIT"
] | null | null | null | ## @file
from .integer import *
## machine hexadecimal number
## @ingroup primitive
class Hex(Integer):
def __init__(self, V):
super().__init__(V)
| 16.1 | 29 | 0.658385 |
5e710f9f16ace8ecf5a682859004354ab3d05002 | 3,342 | py | Python | tests/functional/test_linux_changes.py | xianfang-qian/docker_ci | 0ff773d1e7d9420ef6a05a63bc56b32952b71192 | [
"Apache-2.0"
] | null | null | null | tests/functional/test_linux_changes.py | xianfang-qian/docker_ci | 0ff773d1e7d9420ef6a05a63bc56b32952b71192 | [
"Apache-2.0"
] | null | null | null | tests/functional/test_linux_changes.py | xianfang-qian/docker_ci | 0ff773d1e7d9420ef6a05a63bc56b32952b71192 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import pathlib
import re
import pytest
@pytest.mark.usefixtures('_is_not_distribution')
@pytest.mark.parametrize('_is_not_distribution', [('base', 'internal_dev',
... | 47.742857 | 116 | 0.581388 |
0175fd276c2a3a99e791e0b48b2744b44f849b76 | 5,081 | py | Python | tensorflow_model_analysis/metrics/ndcg_test.py | hbrylkowski/model-analysis | 3ffa05396ca8cbb92755a40f58528a8808f63c5b | [
"Apache-2.0"
] | null | null | null | tensorflow_model_analysis/metrics/ndcg_test.py | hbrylkowski/model-analysis | 3ffa05396ca8cbb92755a40f58528a8808f63c5b | [
"Apache-2.0"
] | null | null | null | tensorflow_model_analysis/metrics/ndcg_test.py | hbrylkowski/model-analysis | 3ffa05396ca8cbb92755a40f58528a8808f63c5b | [
"Apache-2.0"
] | 1 | 2020-06-04T23:26:00.000Z | 2020-06-04T23:26:00.000Z | # Lint as: python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 33.427632 | 80 | 0.562291 |
11b9e1768f2a80246c72fd3440dfe071f9171dcf | 987 | py | Python | blog/admin.py | arminadm/django_projects | 8134e764d87f582f946634942a3d4a1448192dc7 | [
"MIT"
] | null | null | null | blog/admin.py | arminadm/django_projects | 8134e764d87f582f946634942a3d4a1448192dc7 | [
"MIT"
] | null | null | null | blog/admin.py | arminadm/django_projects | 8134e764d87f582f946634942a3d4a1448192dc7 | [
"MIT"
] | null | null | null | from django.contrib import admin
from blog.models import Post, Category, Comment
from django_summernote.admin import SummernoteModelAdmin
# Register your models here.
class postAdmin(SummernoteModelAdmin):
date_hierarchy = 'created_date'
empty_value_display = '-empty-'
list_display = ('id', 'author', 'title... | 37.961538 | 88 | 0.713273 |
eab06e8abfa4fc3b0feb03ba8f2808416b86dd15 | 174 | py | Python | serendipiart/plot/shape.py | tobiade/serendipi-art | 481383c2a8fbeab6955c8250e3e488a47b862d88 | [
"MIT"
] | null | null | null | serendipiart/plot/shape.py | tobiade/serendipi-art | 481383c2a8fbeab6955c8250e3e488a47b862d88 | [
"MIT"
] | null | null | null | serendipiart/plot/shape.py | tobiade/serendipi-art | 481383c2a8fbeab6955c8250e3e488a47b862d88 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import Tuple
@dataclass
class Shape:
xcoords: list[float]
ycoords: list[float]
colour: Tuple[float, float, float]
| 17.4 | 38 | 0.735632 |
3eeedda1b66b938af6ec6ec80c27c6cf424cc7bf | 12,408 | py | Python | lib/datasets/pascal_voc_rbg.py | JakeCowton/faster-rcnn.pytorch | 4d80b91b24a2235eda6dbe5c3faf42bd9d56e07b | [
"MIT"
] | null | null | null | lib/datasets/pascal_voc_rbg.py | JakeCowton/faster-rcnn.pytorch | 4d80b91b24a2235eda6dbe5c3faf42bd9d56e07b | [
"MIT"
] | null | null | null | lib/datasets/pascal_voc_rbg.py | JakeCowton/faster-rcnn.pytorch | 4d80b91b24a2235eda6dbe5c3faf42bd9d56e07b | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ i... | 39.642173 | 89 | 0.543923 |
b45467dddd8e76fc03339f3af197443120b75cdd | 6,705 | py | Python | python/fastscore/v2/models/active_model_info.py | modelop/fastscore-sdk | 2206a4b9294cd83b6b8c2470193070bdc35a9061 | [
"Apache-2.0"
] | 2 | 2018-06-05T19:14:30.000Z | 2019-02-06T17:15:10.000Z | python/fastscore/v2/models/active_model_info.py | modelop/fastscore-sdk | 2206a4b9294cd83b6b8c2470193070bdc35a9061 | [
"Apache-2.0"
] | 2 | 2018-02-20T21:58:43.000Z | 2018-10-07T10:10:54.000Z | python/fastscore/v2/models/active_model_info.py | modelop/fastscore-sdk | 2206a4b9294cd83b6b8c2470193070bdc35a9061 | [
"Apache-2.0"
] | 1 | 2017-12-29T20:38:06.000Z | 2017-12-29T20:38:06.000Z | # coding: utf-8
"""
FastScore API (proxy)
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.7
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
im... | 23.946429 | 116 | 0.542878 |
a82446226f1b451f0a42e792e4a31ed3f9db80dd | 601 | py | Python | collect_ros_data/check_file.py | kuriatsu/CarlaAutoLogging | 0a578e21961abe991c9efdc41bc923dfea00cdd7 | [
"Apache-2.0"
] | null | null | null | collect_ros_data/check_file.py | kuriatsu/CarlaAutoLogging | 0a578e21961abe991c9efdc41bc923dfea00cdd7 | [
"Apache-2.0"
] | null | null | null | collect_ros_data/check_file.py | kuriatsu/CarlaAutoLogging | 0a578e21961abe991c9efdc41bc923dfea00cdd7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import pickle
import sys
if __name__ == "__main__":
with open(sys.argv[1], 'rb') as f:
data = pickle.load(f)
with open("last_int_distance.txt", 'r') as f_2:
intervention_mieage = float(f_2.read())
if len(data.get("drive_data")) > 10:
i... | 23.115385 | 51 | 0.569052 |
d8b1e807afe02ab558ddaec75074e7f39c4e4ebe | 21,350 | py | Python | tests/template_tests/syntax_tests/i18n/test_blocktrans.py | andreip/django | c61d1361d027a729d07d277879950ff133c19f4c | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2020-09-25T04:02:25.000Z | 2020-10-15T00:01:00.000Z | tests/template_tests/syntax_tests/i18n/test_blocktrans.py | djk2/django | 6b00af50146335485d8414c42efec7d8dd5397fc | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/template_tests/syntax_tests/i18n/test_blocktrans.py | djk2/django | 6b00af50146335485d8414c42efec7d8dd5397fc | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2017-08-03T13:06:19.000Z | 2017-08-03T13:06:19.000Z | import os
from threading import local
from django.template import Context, Template, TemplateSyntaxError
from django.test import SimpleTestCase, override_settings
from django.utils import translation
from django.utils.safestring import mark_safe
from django.utils.translation import trans_real
from ...utils import set... | 49.193548 | 116 | 0.575597 |
5382a0486560db333f78c33ad8859217c4f7a4d7 | 2,181 | py | Python | mmt/utils/time_handler.py | jianzhnie/MultimodalTransformer | 6cd4ca8034a53da361149745aecead68fbe304a0 | [
"Apache-2.0"
] | 1 | 2021-11-08T14:32:24.000Z | 2021-11-08T14:32:24.000Z | mmt/utils/time_handler.py | jianzhnie/MultimodalTransformer | 6cd4ca8034a53da361149745aecead68fbe304a0 | [
"Apache-2.0"
] | null | null | null | mmt/utils/time_handler.py | jianzhnie/MultimodalTransformer | 6cd4ca8034a53da361149745aecead68fbe304a0 | [
"Apache-2.0"
] | null | null | null | '''
Author: jianzhnie
Date: 2021-11-18 18:22:32
LastEditTime: 2021-12-03 17:21:47
LastEditors: jianzhnie
Description:
'''
import signal
import time
import torch
import torch.distributed as dist
def timed_generator(gen):
start = time.time()
for g in gen:
end = time.time()
t = end - start
... | 23.202128 | 75 | 0.612105 |
9ed80e31be85239a0e1b368c80a8a74d915edbd4 | 3,157 | py | Python | qgevalcap/eval.py | p208p2002/nqg | ee77c279f4276dfde1e37540e8dbd6d3786747d9 | [
"MIT"
] | 2 | 2021-12-08T06:53:08.000Z | 2022-03-30T06:51:23.000Z | qgevalcap/eval.py | p208p2002/nqg | ee77c279f4276dfde1e37540e8dbd6d3786747d9 | [
"MIT"
] | null | null | null | qgevalcap/eval.py | p208p2002/nqg | ee77c279f4276dfde1e37540e8dbd6d3786747d9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
__author__ = 'xinya'
from bleu.bleu import Bleu
from meteor.meteor import Meteor
from rouge.rouge import Rouge
from cider.cider import Cider
from collections import defaultdict
from argparse import ArgumentParser
import sys
# reload(sys)
# import importlib,sys
# importlib.reload(sys)
# sys.set... | 29.231481 | 124 | 0.558125 |
18f1b3248fff8057d1aa6bff4293936a41ce109e | 2,098 | py | Python | VisualPython/lib/pywidgets.py | ADKosm/YaRPO | b1437a052ecbd3de1a40b108f4718d24b1a67f24 | [
"MIT"
] | null | null | null | VisualPython/lib/pywidgets.py | ADKosm/YaRPO | b1437a052ecbd3de1a40b108f4718d24b1a67f24 | [
"MIT"
] | null | null | null | VisualPython/lib/pywidgets.py | ADKosm/YaRPO | b1437a052ecbd3de1a40b108f4718d24b1a67f24 | [
"MIT"
] | null | null | null | import os
import sys
sys.path.append(os.getcwd())
from libpywidgets import *
class Object:
def __init__(self, p, d = True):
self.pointer = p
self.toDel = d
def get_class_name(self):
return Object_GetClassName(self.pointer)
def __del__(self):
if self.toDel:
Ob... | 29.971429 | 131 | 0.682555 |
6b96d78af02f6a47affed0bcc608fcecac2397b0 | 2,859 | py | Python | jax_dft/jax_dft/np_utils_test.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-19T04:26:12.000Z | 2022-03-19T04:26:12.000Z | jax_dft/jax_dft/np_utils_test.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | jax_dft/jax_dft/np_utils_test.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 34.865854 | 75 | 0.697796 |
dfbc2c7b65b590e0269c9292750a058ed6a9a25d | 6,268 | py | Python | tree.py | cognitobuoy/Search-Algorithms-Python | 01cf5720488c0fe08a9e604ceae60b562545da18 | [
"MIT"
] | 1 | 2021-05-13T12:57:12.000Z | 2021-05-13T12:57:12.000Z | tree.py | cognitobuoy/Search-Algorithms-Python | 01cf5720488c0fe08a9e604ceae60b562545da18 | [
"MIT"
] | 1 | 2021-05-21T23:16:31.000Z | 2021-05-21T23:16:31.000Z | tree.py | cognitobuoy/Search-Algorithms-Python | 01cf5720488c0fe08a9e604ceae60b562545da18 | [
"MIT"
] | null | null | null | import time
import math
import heapq
from tkinter import constants
LEFT = 0
RIGHT = 1
DEPTH_FIRST = 0
BREATH_FIRST = 1
UNIFORM_COST = 2
class Node:
def __init__(self, key, x=0, y=0):
self.path_cost = 0
self.parent = None
self.right = None
self.left = None
self.key = key
... | 27.734513 | 116 | 0.547064 |
341e32c301c598958cc6e90a51fe3a0741eee3f2 | 1,239 | py | Python | pennylane/templates/subroutines/__init__.py | ryanlevy/pennylane | fb03b09d17267ebd0b9050432f9eeb84b5dff200 | [
"Apache-2.0"
] | null | null | null | pennylane/templates/subroutines/__init__.py | ryanlevy/pennylane | fb03b09d17267ebd0b9050432f9eeb84b5dff200 | [
"Apache-2.0"
] | 1 | 2021-05-27T05:36:41.000Z | 2021-05-27T05:36:41.000Z | pennylane/templates/subroutines/__init__.py | ryanlevy/pennylane | fb03b09d17267ebd0b9050432f9eeb84b5dff200 | [
"Apache-2.0"
] | 1 | 2021-07-11T11:45:14.000Z | 2021-07-11T11:45:14.000Z | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 44.25 | 119 | 0.810331 |
9e568c6bd415300ba400e7c0c28b6d0144fd70ea | 538 | py | Python | programs/pgm04_18.py | danielsunzhongyuan/python_practice | 79bc88db1c52ee2f5607f6f9fec1bbacea2804ff | [
"Apache-2.0"
] | null | null | null | programs/pgm04_18.py | danielsunzhongyuan/python_practice | 79bc88db1c52ee2f5607f6f9fec1bbacea2804ff | [
"Apache-2.0"
] | null | null | null | programs/pgm04_18.py | danielsunzhongyuan/python_practice | 79bc88db1c52ee2f5607f6f9fec1bbacea2804ff | [
"Apache-2.0"
] | null | null | null | #
# This file contains the Python code from Program 4.18 of
# "Data Structures and Algorithms
# with Object-Oriented Design Patterns in Python"
# by Bruno R. Preiss.
#
# Copyright (c) 2003 by Bruno R. Preiss, P.Eng. All rights reserved.
#
# http://www.brpreiss.com/books/opus7/programs/pgm04_18.txt
#
class LinkedList(o... | 24.454545 | 69 | 0.644981 |
548c2d2e8ad39afeec3634c158bb310c65ee64ec | 1,267 | py | Python | bcompiler/tests/test_integration.py | hammerheadlemon/bcompiler | 9cf48352fff24dad1b165e9674cf6c44b1e1fc0f | [
"MIT"
] | null | null | null | bcompiler/tests/test_integration.py | hammerheadlemon/bcompiler | 9cf48352fff24dad1b165e9674cf6c44b1e1fc0f | [
"MIT"
] | 7 | 2019-02-28T19:14:01.000Z | 2020-03-31T05:35:45.000Z | bcompiler/tests/test_integration.py | yulqen/bcompiler | 9cf48352fff24dad1b165e9674cf6c44b1e1fc0f | [
"MIT"
] | 2 | 2019-02-19T16:51:29.000Z | 2019-04-21T08:58:38.000Z | import csv
import os
import subprocess
from bcompiler import __version__
from ..utils import OUTPUT_DIR
def test_bcompiler_help():
output = subprocess.run(['bcompiler', '-h'], stdout=subprocess.PIPE, encoding='utf-8')
assert output.stdout.startswith('usage')
def test_bcompiler_version():
output = subpr... | 32.487179 | 101 | 0.716654 |
0cb95376e55d3c2da7318f6156be0fb09988c167 | 3,762 | py | Python | order/views.py | rzr911/ice_cream_api | 9382bfeeeeebc71fe7cd6c33ab86420da9c510a5 | [
"MIT"
] | null | null | null | order/views.py | rzr911/ice_cream_api | 9382bfeeeeebc71fe7cd6c33ab86420da9c510a5 | [
"MIT"
] | null | null | null | order/views.py | rzr911/ice_cream_api | 9382bfeeeeebc71fe7cd6c33ab86420da9c510a5 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from rest_framework import viewsets
from rest_framework import status, viewsets
from rest_framework.response import Response
from icecream.models import IceCream
from order.models import Order, StatusChoices
from order.serializers import OrderCreateUpdateReadSerializer, OrderCheckou... | 38.783505 | 108 | 0.64487 |
a79c4b15b0b1b8c629f7975ac7409ff4f520c617 | 2,193 | py | Python | transportation.py | stscicrawford/travelreform | 252dfc67a1be5f5876efeb74a6fea88416221e50 | [
"BSD-3-Clause"
] | null | null | null | transportation.py | stscicrawford/travelreform | 252dfc67a1be5f5876efeb74a6fea88416221e50 | [
"BSD-3-Clause"
] | 5 | 2018-05-25T14:19:38.000Z | 2018-05-25T14:48:15.000Z | transportation.py | stscicrawford/travelreform | 252dfc67a1be5f5876efeb74a6fea88416221e50 | [
"BSD-3-Clause"
] | 3 | 2018-05-25T14:29:04.000Z | 2018-05-25T14:33:40.000Z | from flask import Flask, render_template, flash, request
from wtforms import Form, TextField, TextAreaField, validators, StringField, SubmitField, SelectField, DateField
# App config.
DEBUG = True
app = Flask(__name__)
app.config.from_object(__name__)
app.config['SECRET_KEY'] = '7d441f27d441f27567d441f2b6176a'
class... | 36.55 | 112 | 0.622891 |
580a29cb9f3bba2eb18421e001c7cf7b0ef9a075 | 5,424 | py | Python | libcloud/storage/drivers/google_storage.py | wrigri/libcloud | 26a54f158392e07e75fb1fd9a808db635ee35e2c | [
"Apache-2.0"
] | 3 | 2016-06-03T03:40:18.000Z | 2018-09-24T05:28:47.000Z | libcloud/storage/drivers/google_storage.py | wrigri/libcloud | 26a54f158392e07e75fb1fd9a808db635ee35e2c | [
"Apache-2.0"
] | 1 | 2015-10-26T21:29:56.000Z | 2015-10-27T17:29:20.000Z | libcloud/storage/drivers/google_storage.py | wrigri/libcloud | 26a54f158392e07e75fb1fd9a808db635ee35e2c | [
"Apache-2.0"
] | 2 | 2018-09-24T05:28:42.000Z | 2020-12-31T05:11:04.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 use ... | 37.150685 | 79 | 0.673304 |
990eeb49e158a1c7d0a3acdd5368ac91e18d1c20 | 996 | py | Python | agent/src/agent/cli/prompt/pipeline/sage.py | eacherkan-aternity/daria | 7c77a2f52c09c852017b16949a848fa51f0fb579 | [
"Apache-2.0"
] | 16 | 2019-04-03T08:31:54.000Z | 2021-01-24T17:12:04.000Z | agent/src/agent/cli/prompt/pipeline/sage.py | eacherkan-aternity/daria | 7c77a2f52c09c852017b16949a848fa51f0fb579 | [
"Apache-2.0"
] | 10 | 2020-01-20T14:59:06.000Z | 2022-01-21T10:19:16.000Z | agent/src/agent/cli/prompt/pipeline/sage.py | eacherkan-aternity/daria | 7c77a2f52c09c852017b16949a848fa51f0fb579 | [
"Apache-2.0"
] | 5 | 2021-01-08T19:23:03.000Z | 2021-11-09T14:15:49.000Z | import click
from .schemaless import SchemalessPrompter
class SagePrompter(SchemalessPrompter):
def prompt_config(self):
self.set_query()
self.prompt_delay()
self.prompt_interval()
self.prompt_days_to_backfill()
# self.data_preview()
self.set_values()
self... | 34.344828 | 115 | 0.601406 |
60e8bad3a1515020a39e1fbbccf489256ef99f65 | 19,765 | py | Python | pypeit/deprecated/ech_coadd.py | ykwang1/PypeIt | a96cff699f1284905ce7ef19d06a9027cd333c63 | [
"BSD-3-Clause"
] | 107 | 2018-08-06T07:07:20.000Z | 2022-02-28T14:33:42.000Z | pypeit/deprecated/ech_coadd.py | ykwang1/PypeIt | a96cff699f1284905ce7ef19d06a9027cd333c63 | [
"BSD-3-Clause"
] | 889 | 2018-07-26T12:14:33.000Z | 2022-03-18T22:49:42.000Z | pypeit/deprecated/ech_coadd.py | ykwang1/PypeIt | a96cff699f1284905ce7ef19d06a9027cd333c63 | [
"BSD-3-Clause"
] | 74 | 2018-09-25T17:03:07.000Z | 2022-03-10T23:59:24.000Z | """ Routine for Echelle coaddition
"""
import numpy as np
from astropy import stats
from astropy.io import fits
from astropy import units
import matplotlib.pyplot as plt
from pypeit.core import coadd
from pypeit.core import load
from pypeit import msgs
from linetools.spectra.utils import collate
from linetools.spectr... | 51.204663 | 135 | 0.601366 |
8b0f281127dcf9d8d01f930a5ee6894777028820 | 1,592 | py | Python | lpips/base_model.py | stevenwudi/stylegan2-pytorch-toonify | c03330d316159a3ced3d41c0f6a3f377955fcc54 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2022-01-11T12:58:14.000Z | 2022-01-11T12:58:14.000Z | lpips/base_model.py | stevenwudi/stylegan2-pytorch-toonify | c03330d316159a3ced3d41c0f6a3f377955fcc54 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | lpips/base_model.py | stevenwudi/stylegan2-pytorch-toonify | c03330d316159a3ced3d41c0f6a3f377955fcc54 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2021-07-19T03:40:32.000Z | 2021-07-19T03:40:32.000Z | import os
import numpy as np
import torch
from torch.autograd import Variable
from pdb import set_trace as st
class BaseModel():
def __init__(self):
pass;
def name(self):
return 'BaseModel'
def initialize(self, use_gpu=True, gpu_ids=[0]):
self.use_gpu = use_gpu
sel... | 27.448276 | 77 | 0.65892 |
bbccf0c7c97187561b67023aeb51ce30864b8a98 | 21,099 | py | Python | bips/workflows/gablab/wips/fmri/first_level/first_level_ev.py | akeshavan/BrainImagingPipelines | 39915b5a313d049a0bb3ccd3a82a9a83e1241b11 | [
"Apache-2.0"
] | 1 | 2017-12-03T00:12:26.000Z | 2017-12-03T00:12:26.000Z | bips/workflows/gablab/wips/fmri/first_level/first_level_ev.py | akeshavan/BrainImagingPipelines | 39915b5a313d049a0bb3ccd3a82a9a83e1241b11 | [
"Apache-2.0"
] | null | null | null | bips/workflows/gablab/wips/fmri/first_level/first_level_ev.py | akeshavan/BrainImagingPipelines | 39915b5a313d049a0bb3ccd3a82a9a83e1241b11 | [
"Apache-2.0"
] | null | null | null | # Import Stuff
from ...scripts.base import create_first
import os
from .....base import MetaWorkflow, load_config, register_workflow
from traits.api import HasTraits, Directory, Bool
import traits.api as traits
from .....flexible_datagrabber import Data, DataBase
"""
Part 1: Define a MetaWorkflow
"""
mwf = MetaWorkfl... | 43.68323 | 258 | 0.610977 |
30fee36ee591cab0b842ce988516c663f87581ea | 1,131 | py | Python | plgx-esp-ui/polylogyx/dao/rules_dao.py | eclecticiq/eiq-er-ce | ebb12d5c4e0ee144f8166576924b8ce8dc5dfc94 | [
"MIT"
] | null | null | null | plgx-esp-ui/polylogyx/dao/rules_dao.py | eclecticiq/eiq-er-ce | ebb12d5c4e0ee144f8166576924b8ce8dc5dfc94 | [
"MIT"
] | null | null | null | plgx-esp-ui/polylogyx/dao/rules_dao.py | eclecticiq/eiq-er-ce | ebb12d5c4e0ee144f8166576924b8ce8dc5dfc94 | [
"MIT"
] | 2 | 2021-11-12T10:25:02.000Z | 2022-03-30T06:33:52.000Z | from polylogyx.models import db, Rule
def get_rule_by_id(rule_id):
return Rule.query.filter(Rule.id == rule_id).first()
def get_rule_name_by_id(rule_id):
rule=Rule.query.filter(Rule.id == rule_id).first()
return rule.name
def get_all_rules():
return Rule.query.all()
def get_rule_by_name(rule_name):
... | 51.409091 | 237 | 0.821397 |
7663a193b4d2f0d448037793d402dc0d0564872b | 10,285 | py | Python | change_detection/xbd_hi_resolution_attempt/model/damage_classification.py | ai4er-cdt/gtc-exposure | f0504d8c40c3553ba1466faef3d802ced09bd984 | [
"RSA-MD"
] | 1 | 2022-01-05T14:27:19.000Z | 2022-01-05T14:27:19.000Z | change_detection/xbd_hi_resolution_attempt/model/damage_classification.py | Riya0001/gtc-exposure | f0504d8c40c3553ba1466faef3d802ced09bd984 | [
"RSA-MD"
] | 12 | 2020-12-11T10:12:10.000Z | 2021-01-29T10:05:30.000Z | change_detection/xbd_hi_resolution_attempt/model/damage_classification.py | Riya0001/gtc-exposure | f0504d8c40c3553ba1466faef3d802ced09bd984 | [
"RSA-MD"
] | 3 | 2020-12-10T11:25:19.000Z | 2022-01-05T14:26:28.000Z | #####################################################################################################################################################################
# xView2 ... | 41.979592 | 170 | 0.537385 |
d5265de74e9d816b5bd866e7f4e0b34d39c11ddb | 568 | py | Python | setup.py | dani0805/auprico-auth | 5965381da1d2c468f1afd532deb85c0a23c4ff93 | [
"Apache-2.0"
] | null | null | null | setup.py | dani0805/auprico-auth | 5965381da1d2c468f1afd532deb85c0a23c4ff93 | [
"Apache-2.0"
] | 8 | 2019-12-04T22:44:16.000Z | 2022-02-10T08:21:31.000Z | setup.py | dani0805/auprico-auth | 5965381da1d2c468f1afd532deb85c0a23c4ff93 | [
"Apache-2.0"
] | null | null | null | import os
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.md')).read()
setup(
name='auprico-auth',
version='0.1',
packages=['auprico_auth'],
description='automated processes and intelligent components - auth package',
long_des... | 28.4 | 80 | 0.684859 |
965530022f6062f67a9566a63afc1c4e324a69f2 | 4,367 | py | Python | tests/test_test.py | kbh2o/slash | 532b7e3acdf46103ece5b86f21c29f9b58587289 | [
"BSD-3-Clause"
] | 70 | 2015-12-05T12:33:10.000Z | 2022-03-03T04:56:58.000Z | tests/test_test.py | kbh2o/slash | 532b7e3acdf46103ece5b86f21c29f9b58587289 | [
"BSD-3-Clause"
] | 711 | 2015-10-06T11:01:48.000Z | 2022-02-09T12:40:47.000Z | tests/test_test.py | kbh2o/slash | 532b7e3acdf46103ece5b86f21c29f9b58587289 | [
"BSD-3-Clause"
] | 37 | 2015-10-13T11:00:51.000Z | 2022-02-08T07:28:11.000Z | from .utils import (
TestCase,
CustomException,
run_tests_in_session,
make_runnable_tests,
)
import itertools
import slash
class TestTest(TestCase):
"""
Test the :class:`Test` class, which is the quickest way to create test classes in Slash
"""
def test_test_class(self):
ev... | 34.385827 | 99 | 0.54866 |
0af35e4f31a36db9e77c724c71a7a362f5801b27 | 74 | py | Python | src/data/__init__.py | silasbrack/metric-laplace-approximation | 50f82c2e0b5a0b859751c37724998f77652207ab | [
"MIT"
] | null | null | null | src/data/__init__.py | silasbrack/metric-laplace-approximation | 50f82c2e0b5a0b859751c37724998f77652207ab | [
"MIT"
] | null | null | null | src/data/__init__.py | silasbrack/metric-laplace-approximation | 50f82c2e0b5a0b859751c37724998f77652207ab | [
"MIT"
] | null | null | null | from .cifar100 import CIFAR100DataModule
from .svhn import SVHNDataModule
| 24.666667 | 40 | 0.864865 |
ecc86a1f7b403f57821dde2a2b4f0619c0d6cae3 | 1,288 | py | Python | netdissect/autoeval.py | mcartagenah/ganspace | f297c090257939dce1eef0eb87e6d9c4c19928a8 | [
"Apache-2.0"
] | 1,711 | 2018-11-22T08:56:26.000Z | 2022-03-30T21:03:58.000Z | netdissect/autoeval.py | mcartagenah/ganspace | f297c090257939dce1eef0eb87e6d9c4c19928a8 | [
"Apache-2.0"
] | 54 | 2020-04-07T23:32:19.000Z | 2022-03-27T15:06:26.000Z | netdissect/autoeval.py | mcartagenah/ganspace | f297c090257939dce1eef0eb87e6d9c4c19928a8 | [
"Apache-2.0"
] | 284 | 2018-11-27T02:05:21.000Z | 2021-12-19T05:41:21.000Z | from collections import defaultdict
from importlib import import_module
def autoimport_eval(term):
'''
Used to evaluate an arbitrary command-line constructor specifying
a class, with automatic import of global module names.
'''
class DictNamespace(object):
def __init__(self, d):
... | 33.894737 | 76 | 0.583851 |
1de24c2c186880753c271803fbc4d3396a5ff1ab | 1,038 | py | Python | src/wizard/controller/frmRequiredComboValidator.py | UCHIC/ODMStreamingDataLoader | 711886167a068754efff6dfbd604e3e19e545253 | [
"BSD-3-Clause"
] | null | null | null | src/wizard/controller/frmRequiredComboValidator.py | UCHIC/ODMStreamingDataLoader | 711886167a068754efff6dfbd604e3e19e545253 | [
"BSD-3-Clause"
] | null | null | null | src/wizard/controller/frmRequiredComboValidator.py | UCHIC/ODMStreamingDataLoader | 711886167a068754efff6dfbd604e3e19e545253 | [
"BSD-3-Clause"
] | null | null | null | import string
import wx
class RequiredComboValidator(wx.PyValidator):
'''
This validator will ensure that whatever it's added to gets
filled out.
'''
def __init__(self):
super(RequiredComboValidator, self).__init__()
self.Bind(wx.EVT_COMBOBOX, self.onCombo)
def Clone(self):
... | 25.317073 | 86 | 0.615607 |
8666c5515b6c4f630762311d5b9c5085d4702569 | 2,391 | py | Python | NeuralNetwork/SchoolAdmissions/gradient.py | marcelaldecoa/DLND-Labs | 2aab4c693dbb0989e19d90fd717ce88ced29a07c | [
"MIT"
] | null | null | null | NeuralNetwork/SchoolAdmissions/gradient.py | marcelaldecoa/DLND-Labs | 2aab4c693dbb0989e19d90fd717ce88ced29a07c | [
"MIT"
] | null | null | null | NeuralNetwork/SchoolAdmissions/gradient.py | marcelaldecoa/DLND-Labs | 2aab4c693dbb0989e19d90fd717ce88ced29a07c | [
"MIT"
] | null | null | null | import numpy as np
from data_prep import features, targets, features_test, targets_test
def sigmoid(x):
"""
Calculate sigmoid
"""
return 1 / (1 + np.exp(-x))
# TODO: We haven't provided the sigmoid_prime function like we did in
# the previous lesson to encourage you to come up with a more
# ... | 33.676056 | 82 | 0.66123 |
7417c6f39654076ebc0568baf67107b4d808e995 | 8,845 | py | Python | tests/catalyst/metrics/functional/test_cmc_metric.py | tadejsv/catalyst | 2553ce8fd7cecc025ad88819aea73faf8abb229b | [
"Apache-2.0"
] | 206 | 2018-10-05T19:16:47.000Z | 2019-01-19T21:10:41.000Z | tests/catalyst/metrics/functional/test_cmc_metric.py | tadejsv/catalyst | 2553ce8fd7cecc025ad88819aea73faf8abb229b | [
"Apache-2.0"
] | 20 | 2018-10-07T06:30:49.000Z | 2019-01-17T17:26:15.000Z | tests/catalyst/metrics/functional/test_cmc_metric.py | tadejsv/catalyst | 2553ce8fd7cecc025ad88819aea73faf8abb229b | [
"Apache-2.0"
] | 22 | 2018-10-06T12:34:08.000Z | 2019-01-10T16:00:48.000Z | # flake8: noqa
from typing import List, Tuple
from itertools import chain
import numpy as np
import pytest
import torch
from catalyst.metrics.functional._cmc_score import (
cmc_score,
cmc_score_count,
masked_cmc_score,
)
EPS = 1e-4
TEST_DATA_SIMPLE = (
# (distance_matrix, conformity_matrix, topk, ... | 29.781145 | 89 | 0.562691 |
2474e1ff3056bb33e73940415fc89f13a98f3904 | 1,321 | py | Python | test/test_reports_report_subreports.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | test/test_reports_report_subreports.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | test/test_reports_report_subreports.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Copyright 2016 SmartBear Software
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 l... | 26.959184 | 89 | 0.74489 |
f6174a67fee2e6a0c65fc1d6ce4ba4b1887712e7 | 368 | py | Python | src/molecule/test/scenarios/cleanup/molecule/default/tests/test_default.py | gardar/molecule | 756fc33512a294ebbdb1e0de8aac2dabb642609e | [
"MIT"
] | 1,599 | 2015-11-18T01:40:26.000Z | 2018-10-29T16:42:52.000Z | src/molecule/test/scenarios/cleanup/molecule/default/tests/test_default.py | gardar/molecule | 756fc33512a294ebbdb1e0de8aac2dabb642609e | [
"MIT"
] | 1,232 | 2015-11-18T16:56:02.000Z | 2018-10-27T03:51:50.000Z | molecule/test/scenarios/cleanup/molecule/default/tests/test_default.py | corserp/molecule | 48921fa43c3c4647a3f835c79290959af945a522 | [
"MIT"
] | 290 | 2015-11-19T18:16:41.000Z | 2018-10-29T18:09:13.000Z | """Testinfra tests."""
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
def test_hosts_file(host):
"""Validate host file."""
f = host.file("/etc/hosts")
assert f.exists
asser... | 19.368421 | 63 | 0.692935 |
416b3a56a73aba623f2a49d4a24bde74fa343eee | 5,172 | py | Python | serveradmin/graphite/views.py | dreis2211/serveradmin | 39b286e3df96f8c007662ff8bec1d33ed1778698 | [
"MIT"
] | 1 | 2021-07-13T16:07:22.000Z | 2021-07-13T16:07:22.000Z | serveradmin/graphite/views.py | dreis2211/serveradmin | 39b286e3df96f8c007662ff8bec1d33ed1778698 | [
"MIT"
] | null | null | null | serveradmin/graphite/views.py | dreis2211/serveradmin | 39b286e3df96f8c007662ff8bec1d33ed1778698 | [
"MIT"
] | null | null | null | from urllib.request import (
HTTPBasicAuthHandler,
HTTPPasswordMgrWithDefaultRealm,
build_opener
)
from django.http import (
Http404, HttpResponse, HttpResponseBadRequest, HttpResponseServerError
)
from django.template.response import TemplateResponse
from django.contrib.auth.decorators import login_re... | 36.422535 | 76 | 0.651392 |
de1946191f13d17b3224021705be368279a2b07f | 10,173 | py | Python | sharppy/viz/ship.py | skovic/SHARPpy | 19175269ab11fe06c917b5d10376862a4716e1db | [
"BSD-3-Clause"
] | 163 | 2015-01-05T06:57:16.000Z | 2022-03-15T04:19:42.000Z | sharppy/viz/ship.py | skovic/SHARPpy | 19175269ab11fe06c917b5d10376862a4716e1db | [
"BSD-3-Clause"
] | 187 | 2015-01-20T05:30:55.000Z | 2022-03-28T17:50:38.000Z | sharppy/viz/ship.py | skovic/SHARPpy | 19175269ab11fe06c917b5d10376862a4716e1db | [
"BSD-3-Clause"
] | 110 | 2015-01-06T05:55:47.000Z | 2022-03-15T18:40:21.000Z | import numpy as np
import os
from qtpy import QtGui, QtCore, QtWidgets
import sharppy.sharptab as tab
import sharppy.databases.inset_data as inset_data
from sharppy.sharptab.constants import *
import platform
## routine written by Kelton Halbert and Greg Blumberg
## keltonhalbert@ou.edu and wblumberg@ou.edu
__all__ ... | 35.694737 | 113 | 0.578394 |
bc810abe075ca43d20d03f6dab9590064a1aff50 | 4,424 | py | Python | userbot/modules/quotly.py | Musthofaalfian/toxic | 1663255a586d6a0119cb94b670f927c30f694f91 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/quotly.py | Musthofaalfian/toxic | 1663255a586d6a0119cb94b670f927c30f694f91 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/quotly.py | Musthofaalfian/toxic | 1663255a586d6a0119cb94b670f927c30f694f91 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Port From UniBorg to UserBot by MoveAngel
import random
import requests
from asyncio.exceptions import TimeoutError
... | 38.807018 | 104 | 0.605108 |
1489d40e03eb36d9d00625138e1da9c41d5245a1 | 2,086 | py | Python | yt/data_objects/tests/test_ellipsoid.py | semeraro/yt | 0511823034e63a9cde02372b1258225b527cb154 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-09-15T08:17:43.000Z | 2021-09-15T08:17:43.000Z | yt/data_objects/tests/test_ellipsoid.py | semeraro/yt | 0511823034e63a9cde02372b1258225b527cb154 | [
"BSD-3-Clause-Clear"
] | 2 | 2021-09-15T16:10:39.000Z | 2021-09-16T14:23:31.000Z | yt/data_objects/tests/test_ellipsoid.py | stonnes/yt | aad3cfa3b4ebab7838352ab467275a27c26ff363 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-04-21T07:01:51.000Z | 2021-04-21T07:01:51.000Z | import numpy as np
from yt.testing import assert_array_less, fake_random_ds
def setup():
from yt.config import ytcfg
ytcfg["yt", "log_level"] = 50
ytcfg["yt", "internals", "within_testing"] = True
def _difference(x1, x2, dw):
rel = x1 - x2
rel[rel > dw / 2.0] -= dw
rel[rel < -dw / 2.0] += ... | 34.196721 | 75 | 0.477948 |
6f301367e51ffd502026ca6bfbf19bdb0e3da6c9 | 3,615 | py | Python | auto_push.py | ariua91/auto-push-to-vd | 7fbc58a0feb952d96adf9965c3b5097258761bb2 | [
"MIT"
] | null | null | null | auto_push.py | ariua91/auto-push-to-vd | 7fbc58a0feb952d96adf9965c3b5097258761bb2 | [
"MIT"
] | 1 | 2021-06-01T23:15:58.000Z | 2021-06-01T23:15:58.000Z | auto_push.py | ariua91/auto-push-to-vd | 7fbc58a0feb952d96adf9965c3b5097258761bb2 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
import requests
from secret_keys import ENV, CLIENT_ID, CLIENT_SECRET, COOKIE, RANDOM_TASK_ID
LOGFN = 'logs/' + datetime.strftime(datetime.utcnow() + timedelta(hours=8),
'%y-%U-logs.txt')
VERBOSE = True
def write_to_log(logfn, logtext):
... | 27.180451 | 84 | 0.541355 |
837059149243e65f4207d9d88cd8c335b99fc501 | 912 | py | Python | icon_validator/rules/workflow_validators/workflow_profanity_validator.py | rapid7/icon-integrations-validators | 673e588f8c6aa02bdb6c5e82556fdc59fe3a7280 | [
"MIT"
] | 6 | 2020-11-10T03:07:00.000Z | 2022-02-24T18:07:57.000Z | icon_validator/rules/workflow_validators/workflow_profanity_validator.py | rapid7/icon-integrations-validators | 673e588f8c6aa02bdb6c5e82556fdc59fe3a7280 | [
"MIT"
] | 17 | 2020-01-21T16:02:04.000Z | 2022-01-12T15:11:26.000Z | icon_validator/rules/workflow_validators/workflow_profanity_validator.py | rapid7/icon-integrations-validators | 673e588f8c6aa02bdb6c5e82556fdc59fe3a7280 | [
"MIT"
] | 2 | 2020-12-26T11:33:23.000Z | 2021-09-30T22:22:43.000Z | from icon_validator.rules.validator import KomandPluginValidator
from icon_validator.exceptions import ValidationException
from icon_validator.rules.lists.lists import profanity_list
class WorkflowProfanityValidator(KomandPluginValidator):
@staticmethod
def validate_profanity(spec):
"""
Check... | 33.777778 | 97 | 0.690789 |
f252070393abf13f19a83accd551841a228e4a35 | 2,711 | py | Python | mutagene/profiles/profile.py | neksa/pymutagene | 1122d64a5ab843a4960124933f78f3c2e388a792 | [
"CC0-1.0"
] | 3 | 2020-05-18T07:00:46.000Z | 2022-02-20T02:55:48.000Z | mutagene/profiles/profile.py | neksa/pymutagene | 1122d64a5ab843a4960124933f78f3c2e388a792 | [
"CC0-1.0"
] | 31 | 2020-03-13T16:28:34.000Z | 2021-02-27T22:12:15.000Z | mutagene/profiles/profile.py | neksa/pymutagene | 1122d64a5ab843a4960124933f78f3c2e388a792 | [
"CC0-1.0"
] | 3 | 2020-03-24T20:01:44.000Z | 2020-11-26T17:30:39.000Z | # from collections import defaultdict
# from mutagene.dna import complementary_nucleotide
from collections import Counter
from operator import add
from functools import reduce
import numpy as np
from numpy.random import multinomial
from sklearn.utils import resample
from mutagene.io.profile import write_profile_file... | 37.136986 | 122 | 0.722243 |
7bf84dd64131d00e60a5ff0f65ee26562715a947 | 6,141 | py | Python | raspberry-pi-env/default_methods.py | kb2623/raspi-trash-bin | 8b695a167eddbb9f189cd1663af8158ad61e421a | [
"MIT"
] | null | null | null | raspberry-pi-env/default_methods.py | kb2623/raspi-trash-bin | 8b695a167eddbb9f189cd1663af8158ad61e421a | [
"MIT"
] | null | null | null | raspberry-pi-env/default_methods.py | kb2623/raspi-trash-bin | 8b695a167eddbb9f189cd1663af8158ad61e421a | [
"MIT"
] | null | null | null | from datetime import date, datetime
from time import sleep
from multiprocessing import Lock
import numpy as np
import gpiozero as gpio
from default_server import data_dir
# Led diodi
led1, led2 = gpio.RGBLED(red=9, green=10, blue=11), gpio.RGBLED(red=16, green=20, blue=21)
# Vecfunkciski gumbi
button1, button2, but... | 24.762097 | 115 | 0.721218 |
1651ddd6b04a74f30787fa1575dbb8209e1e87c5 | 2,106 | py | Python | django_pluggableappsettings/tests/travis_ci.py | kocunop/django-pluggableappsettings | d4fd7c4b1c979d46cc8590f85fd0504107ae33e5 | [
"MIT"
] | null | null | null | django_pluggableappsettings/tests/travis_ci.py | kocunop/django-pluggableappsettings | d4fd7c4b1c979d46cc8590f85fd0504107ae33e5 | [
"MIT"
] | null | null | null | django_pluggableappsettings/tests/travis_ci.py | kocunop/django-pluggableappsettings | d4fd7c4b1c979d46cc8590f85fd0504107ae33e5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
__author__ = 'Tim Schneider <tim.schneider@northbridge-development.de>'
__copyright__ = "Copyright 2015, Northbridge Development Konrad & Schneider GbR"
__credits__ = ["Tim Schneider", ]
__maintainer__ = "Tim Schneider"
__email__ = "mail@northbridge-developm... | 23.931818 | 80 | 0.694682 |
af295c5a9cfec2b61f6a63aded7cc2c7e89274dc | 1,706 | py | Python | tests/bootstrap/success/filtering_tests.py | varajala/microtest | f8399fc6eeab2fcbabba09716f9808311c056ab6 | [
"MIT"
] | null | null | null | tests/bootstrap/success/filtering_tests.py | varajala/microtest | f8399fc6eeab2fcbabba09716f9808311c056ab6 | [
"MIT"
] | null | null | null | tests/bootstrap/success/filtering_tests.py | varajala/microtest | f8399fc6eeab2fcbabba09716f9808311c056ab6 | [
"MIT"
] | null | null | null | import sys
import subprocess
import microtest
import os
import tempfile
def run_microtest_as_module(directory: str) -> str:
cmd = [sys.executable, '-m', 'microtest', directory]
stream = tempfile.TemporaryFile(mode='w+')
proc = subprocess.Popen(cmd, stdout = stream, cwd = directory)
proc.wait()
... | 27.079365 | 92 | 0.714537 |
3344522306e3df32145630511589a4b2e56d3767 | 5,171 | py | Python | tests/asset_viewer/files/models/misc/compress.py | duhnnie/3-dreams-of-black | 15aded97f57a82e5a4c95c4e74bcd603b3fc6e1e | [
"Apache-2.0"
] | 475 | 2015-01-02T07:49:46.000Z | 2022-03-17T04:01:47.000Z | tests/asset_viewer/files/models/misc/compress.py | duhnnie/3-dreams-of-black | 15aded97f57a82e5a4c95c4e74bcd603b3fc6e1e | [
"Apache-2.0"
] | 3 | 2015-03-06T10:51:03.000Z | 2019-09-10T19:39:39.000Z | tests/asset_viewer/files/models/misc/compress.py | duhnnie/3-dreams-of-black | 15aded97f57a82e5a4c95c4e74bcd603b3fc6e1e | [
"Apache-2.0"
] | 130 | 2015-01-15T02:08:21.000Z | 2021-12-20T19:15:22.000Z | #!/usr/bin/python2.6
# v0.2
import sys
import os
import simplejson as json
import re
BITS = 9
TARGET_SCALE = (1 << (BITS - 1) - 1)
JS_TPL = """
var req = new XMLHttpRequest();
req.open('GET', "%s", false);
req.send(null);
if (req.status == 200 || req.status == 0) {
var numVertices = %s;
var numMorphTargets = mod... | 25.984925 | 76 | 0.612067 |
9353d05b51f8a35958215df7530fdf1b7108275b | 1,418 | py | Python | httpstan/routes.py | mjcarter95/httpstan | 4a15b0316d7cb0a50193555d80fb1785f557f645 | [
"ISC"
] | 35 | 2017-05-18T21:30:06.000Z | 2022-03-12T08:26:07.000Z | httpstan/routes.py | mjcarter95/httpstan | 4a15b0316d7cb0a50193555d80fb1785f557f645 | [
"ISC"
] | 420 | 2017-05-18T18:43:41.000Z | 2022-03-07T16:39:53.000Z | httpstan/routes.py | mjcarter95/httpstan | 4a15b0316d7cb0a50193555d80fb1785f557f645 | [
"ISC"
] | 15 | 2017-06-10T20:47:56.000Z | 2022-03-02T15:24:10.000Z | """Routes for httpstan.
Routes for the HTTP server are defined here.
"""
import aiohttp.web
import httpstan.views as views
def setup_routes(app: aiohttp.web.Application) -> None:
"""Add routes to Application.
Arguments:
app (aiohttp.Application): Application to which routes should be added.
""... | 45.741935 | 94 | 0.74189 |
2563c314268f81d1bdcbf7af02f0c282de4fc66c | 661 | py | Python | venv/bin/rst2html.py | anthodemorais/spaces | e2f4b70bf2438a39ce1e1bd954f8dc98bea5280d | [
"MIT"
] | null | null | null | venv/bin/rst2html.py | anthodemorais/spaces | e2f4b70bf2438a39ce1e1bd954f8dc98bea5280d | [
"MIT"
] | null | null | null | venv/bin/rst2html.py | anthodemorais/spaces | e2f4b70bf2438a39ce1e1bd954f8dc98bea5280d | [
"MIT"
] | null | null | null | #!/Users/anthonydemorais/Documents/travail/supinternet/python/spaces/venv/bin/python3
# $Id: rst2html.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing HTML.
""... | 27.541667 | 85 | 0.748865 |
b08b9775941e4f217aed30bc5436a2f0294daa4e | 585 | py | Python | app/news/migrations/0002_newsentry_pub_date.py | mooja/ssip3 | d42daee2b3b9d692a1fda4163bc6f0c6e970b79b | [
"MIT"
] | null | null | null | app/news/migrations/0002_newsentry_pub_date.py | mooja/ssip3 | d42daee2b3b9d692a1fda4163bc6f0c6e970b79b | [
"MIT"
] | null | null | null | app/news/migrations/0002_newsentry_pub_date.py | mooja/ssip3 | d42daee2b3b9d692a1fda4163bc6f0c6e970b79b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-14 00:24
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('news', '0001_initial'),
]
oper... | 24.375 | 106 | 0.634188 |
cd8760fb624bf50dc3139f4c7543817702c659f8 | 1,613 | py | Python | distribution/service/demandservice.py | beehive-spg/beehive-drone-distribution | dc3cb6036497680bb839fa7a1d3995c02cc70873 | [
"Apache-2.0"
] | null | null | null | distribution/service/demandservice.py | beehive-spg/beehive-drone-distribution | dc3cb6036497680bb839fa7a1d3995c02cc70873 | [
"Apache-2.0"
] | null | null | null | distribution/service/demandservice.py | beehive-spg/beehive-drone-distribution | dc3cb6036497680bb839fa7a1d3995c02cc70873 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import json
from foundation.logger import Logger
from distribution.service import buildingservice, routeservice, hiveservice, distributionservice
logger = Logger(__name__)
def update_demand(message):
decoded_message = message.decode("utf-8")
loaded_message = json.loads(decoded_message)
logge... | 31.627451 | 96 | 0.781773 |
c634d9dd675c4072ffe69668c814f7613c9d4005 | 8,516 | py | Python | model/unetdsbn.py | zzzqzhou/Dual-Normalization | b9831b6e2662a950600ba37ada087ba8ce93f60c | [
"MIT"
] | 12 | 2022-03-10T09:24:41.000Z | 2022-03-30T03:36:51.000Z | model/unetdsbn.py | zzzqzhou/Dual-Normalization | b9831b6e2662a950600ba37ada087ba8ce93f60c | [
"MIT"
] | 1 | 2022-03-30T09:41:23.000Z | 2022-03-30T09:41:23.000Z | model/unetdsbn.py | zzzqzhou/Dual-Normalization | b9831b6e2662a950600ba37ada087ba8ce93f60c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
2D Unet-like architecture code in Pytorch
"""
import math
import numpy as np
from model.layers import *
from model.dsbn import DomainSpecificBatchNorm2d
import torch.nn as nn
import torch.nn.functional as F
import torch
class MyUpsample2(nn.Module):
def forward(self, x):
return ... | 41.950739 | 131 | 0.616721 |
5a1241e9fac3d2e57827aed8785350cc88f5ae3d | 689 | py | Python | .circleci/compare_runs.py | KalyanovD/daal4py | 7b75aa795863415a1ae35e24ac4357ab7b6e2faa | [
"Apache-2.0"
] | null | null | null | .circleci/compare_runs.py | KalyanovD/daal4py | 7b75aa795863415a1ae35e24ac4357ab7b6e2faa | [
"Apache-2.0"
] | null | null | null | .circleci/compare_runs.py | KalyanovD/daal4py | 7b75aa795863415a1ae35e24ac4357ab7b6e2faa | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import os
import sys
import operator
qoi_list = ['failed', 'passed', 'xpassed', 'xfailed', 'skipped', 'deselected']
def get_counts(tkn):
data = [x.split() for x in os.getenv(tkn).split(',')]
counts = {x[-1]: int(x[-2]) for x in data if len(x) > 0 and x[-1] in qoi_list}
return counts
def... | 23.758621 | 82 | 0.640058 |
0f9645f7a5a8612d98de2550706151a52c2cbeaf | 248 | py | Python | templates_advanced/pythons_auth/urls.py | DiyanKalaydzhiev23/Django-Framework | e20a58e123add27e70faee641e35279b07474ed8 | [
"MIT"
] | null | null | null | templates_advanced/pythons_auth/urls.py | DiyanKalaydzhiev23/Django-Framework | e20a58e123add27e70faee641e35279b07474ed8 | [
"MIT"
] | null | null | null | templates_advanced/pythons_auth/urls.py | DiyanKalaydzhiev23/Django-Framework | e20a58e123add27e70faee641e35279b07474ed8 | [
"MIT"
] | null | null | null | from django.urls import path
from pythons_auth import views
urlpatterns = [
path('register/', views.register_view, name="register"),
path('login/', views.login_view, name="login"),
path('logout/', views.logout_view, name="logout"),
]
| 24.8 | 60 | 0.697581 |
48d3ef115fb4cdb4a2cc13e556947fc5770756a4 | 811 | py | Python | setup.py | EvaSDK/freezegun | 9f416a85a12a8aad327b85e5dbdba4506cb6e915 | [
"Apache-2.0"
] | null | null | null | setup.py | EvaSDK/freezegun | 9f416a85a12a8aad327b85e5dbdba4506cb6e915 | [
"Apache-2.0"
] | null | null | null | setup.py | EvaSDK/freezegun | 9f416a85a12a8aad327b85e5dbdba4506cb6e915 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
from setuptools import setup, find_packages
requires = ['six']
if sys.version_info[0] == 2:
requires += ['python-dateutil>=1.0, != 2.0']
else:
# Py3k
requires += ['python-dateutil>=2.0']
setup(
name='freezegun',
version='0.3.1',
description='Let your Python t... | 25.34375 | 60 | 0.621455 |
6251e286d1c084845cd8d8b657ea0cd032477ba4 | 728 | py | Python | tests/unit/util/iterables/test_index_of.py | GSH-LAN/byceps | ab8918634e90aaa8574bd1bb85627759cef122fe | [
"BSD-3-Clause"
] | 33 | 2018-01-16T02:04:51.000Z | 2022-03-22T22:57:29.000Z | tests/unit/util/iterables/test_index_of.py | GSH-LAN/byceps | ab8918634e90aaa8574bd1bb85627759cef122fe | [
"BSD-3-Clause"
] | 7 | 2019-06-16T22:02:03.000Z | 2021-10-02T13:45:31.000Z | tests/unit/util/iterables/test_index_of.py | GSH-LAN/byceps | ab8918634e90aaa8574bd1bb85627759cef122fe | [
"BSD-3-Clause"
] | 14 | 2019-06-01T21:39:24.000Z | 2022-03-14T17:56:43.000Z | """
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
import pytest
from byceps.util.iterables import index_of
@pytest.mark.parametrize(
'iterable, predicate, expected',
[
(
[],
lambda x: x > 3,
None,
),
... | 18.666667 | 54 | 0.442308 |
a5f6ea066e7632f57688d44f3ef272358ee5db02 | 8,929 | py | Python | myapp/search_engine/index_ranking.py | estherflores/IRWA-final-project | ac076f8481f1c15d65f04c43c82510825ec86351 | [
"Apache-2.0"
] | null | null | null | myapp/search_engine/index_ranking.py | estherflores/IRWA-final-project | ac076f8481f1c15d65f04c43c82510825ec86351 | [
"Apache-2.0"
] | null | null | null | myapp/search_engine/index_ranking.py | estherflores/IRWA-final-project | ac076f8481f1c15d65f04c43c82510825ec86351 | [
"Apache-2.0"
] | null | null | null | import sys
sys.path.append('myapp')
from myapp.search_engine.text_processing import json_data, json_data1, cleanText, all_tweets
from myapp.search_engine.search_engine import DocumentInfo
import math
import array
import numpy as np
import collections
from numpy import linalg as la
from collections import defaultdict
... | 43.556098 | 189 | 0.628402 |
6f79e8844f8ef087bb3f3d10d9b76b12b119d149 | 954 | py | Python | bwi_logging/src/get_distance.py | YuqianJiang/bwi_experimental | aa0915f170c6c1720a34d0ab24d5b287a9b1bb6d | [
"BSD-3-Clause"
] | null | null | null | bwi_logging/src/get_distance.py | YuqianJiang/bwi_experimental | aa0915f170c6c1720a34d0ab24d5b287a9b1bb6d | [
"BSD-3-Clause"
] | null | null | null | bwi_logging/src/get_distance.py | YuqianJiang/bwi_experimental | aa0915f170c6c1720a34d0ab24d5b287a9b1bb6d | [
"BSD-3-Clause"
] | null | null | null |
import time
import rosbag
import rospy
import datetime
if rospy.has_param('bag_file'):
bag_file = rospy.get_param('bag_file', '')
print('bag_file: ' + bag_file)
else:
exit('please set the bag_file first: "rosparam set bag_file /path/to/your/bag_file"')
bag = rosbag.Bag(bag_file)
time_start = -1
time_consumed ... | 21.2 | 87 | 0.706499 |
329b4b247ec9ac3694f2f6e241fe3ddd33da54bd | 1,074 | py | Python | xmnlp/sentiment/__init__.py | mokeyish/xmnlp | 7b47dddb7dfcdcf26031370f7f6ea9cbcd2b8a4c | [
"Apache-2.0"
] | null | null | null | xmnlp/sentiment/__init__.py | mokeyish/xmnlp | 7b47dddb7dfcdcf26031370f7f6ea9cbcd2b8a4c | [
"Apache-2.0"
] | null | null | null | xmnlp/sentiment/__init__.py | mokeyish/xmnlp | 7b47dddb7dfcdcf26031370f7f6ea9cbcd2b8a4c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# -------------------------------------------#
# author: sean lee #
# email: xmlee97@gmail.com #
# -------------------------------------------#
import os
import threading
from typing import Tuple
from xmnlp import config
from xmnlp.sentiment.sentime... | 25.571429 | 80 | 0.55959 |
e0f1546d5f21dd2fc6842646d89974f74205c5b5 | 2,435 | py | Python | maltego_trx/server.py | tlansec/maltego-trx | 10040637d68e594933566cf2064b4121581cd02c | [
"MIT"
] | null | null | null | maltego_trx/server.py | tlansec/maltego-trx | 10040637d68e594933566cf2064b4121581cd02c | [
"MIT"
] | null | null | null | maltego_trx/server.py | tlansec/maltego-trx | 10040637d68e594933566cf2064b4121581cd02c | [
"MIT"
] | null | null | null | import logging
from flask import Flask, request
from maltego_trx.maltego import MaltegoMsg
from .registry import mapping
log = logging.getLogger("maltego.server")
logging.basicConfig(level=logging.DEBUG)
URL_TEMPLATE = '/run/<transform_name>/'
def get_exception_message(msg="An exception occurred with the transfor... | 32.905405 | 122 | 0.670226 |
9318b4928476f52bc0f04d74f44c5a6286706e88 | 3,329 | py | Python | pubnub/endpoints/push/add_channels_to_push.py | natekspencer/pubnub-python | 453ba34104b4067077546d5d9ba3b206559494d1 | [
"MIT"
] | 146 | 2015-01-05T03:14:53.000Z | 2022-03-16T16:51:52.000Z | pubnub/endpoints/push/add_channels_to_push.py | natekspencer/pubnub-python | 453ba34104b4067077546d5d9ba3b206559494d1 | [
"MIT"
] | 48 | 2015-01-15T15:27:41.000Z | 2022-03-21T14:17:05.000Z | pubnub/endpoints/push/add_channels_to_push.py | natekspencer/pubnub-python | 453ba34104b4067077546d5d9ba3b206559494d1 | [
"MIT"
] | 128 | 2015-01-05T03:40:59.000Z | 2022-03-02T20:50:58.000Z | from pubnub.endpoints.endpoint import Endpoint
from pubnub.errors import PNERR_CHANNEL_MISSING, PNERR_PUSH_DEVICE_MISSING, PNERROR_PUSH_TYPE_MISSING, \
PNERR_PUSH_TOPIC_MISSING
from pubnub.exceptions import PubNubException
from pubnub.enums import HttpMethod, PNOperationType, PNPushType, PNPushEnvironment
from pubn... | 32.009615 | 104 | 0.67678 |
07ff2c4df2b4784a00f87f2311775242c12db59c | 6,540 | py | Python | aerosandbox/numpy/array.py | scivm/AeroSandbox | 616c579e49bc13c3023364773705eaac7df10da7 | [
"MIT"
] | 1 | 2021-04-07T08:59:31.000Z | 2021-04-07T08:59:31.000Z | aerosandbox/numpy/array.py | scivm/AeroSandbox | 616c579e49bc13c3023364773705eaac7df10da7 | [
"MIT"
] | null | null | null | aerosandbox/numpy/array.py | scivm/AeroSandbox | 616c579e49bc13c3023364773705eaac7df10da7 | [
"MIT"
] | null | null | null | import numpy as _onp
import casadi as _cas
from typing import List, Tuple
from aerosandbox.numpy.determine_type import is_casadi_type
def array(array_like, dtype=None):
"""
Initializes a new array. Creates a NumPy array if possible; if not, creates a CasADi array.
See syntax here: https://numpy.org/doc/s... | 30.138249 | 120 | 0.600612 |
6db82d600df199c54243326ce341288eb4a9fb0f | 720 | py | Python | flask_hougou.py | ColdFc/test | a0be1d71cee99351763205efb6224142ec208687 | [
"MIT"
] | 9 | 2019-05-24T07:01:18.000Z | 2019-05-24T12:35:20.000Z | flask_hougou.py | ColdFc/test | a0be1d71cee99351763205efb6224142ec208687 | [
"MIT"
] | null | null | null | flask_hougou.py | ColdFc/test | a0be1d71cee99351763205efb6224142ec208687 | [
"MIT"
] | null | null | null | from flask import Flask
from flask import request
app = Flask(__name__, static_url_path="", static_folder="static")
class Config(object):
DEBUG = True
app.config.from_object(Config)
@app.route("/", methods=["GET"])
def index():
with open("templates/home.html", "rb") as f:
content = f.read()
r... | 19.459459 | 65 | 0.634722 |
d299a8e08b4562ae6130f10390f98c2d94a6764a | 4,432 | py | Python | client/tools/interop_cli.py | derekbt96/interop | 13f044c831d81745f75c7baa46d0aba6694f01a9 | [
"Apache-2.0"
] | null | null | null | client/tools/interop_cli.py | derekbt96/interop | 13f044c831d81745f75c7baa46d0aba6694f01a9 | [
"Apache-2.0"
] | null | null | null | client/tools/interop_cli.py | derekbt96/interop | 13f044c831d81745f75c7baa46d0aba6694f01a9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# CLI for interacting with interop server.
from __future__ import print_function
import argparse
import datetime
import getpass
import logging
import pprint
import sys
import time
from auvsi_suas.client.client import AsyncClient
from auvsi_suas.client.types import Telemetry
from mavlink_proxy im... | 30.777778 | 77 | 0.684341 |
e5348b0815c09d1c91c919bfe004799a2a2ab442 | 3,680 | py | Python | src/dab_tuning_lib.py | Opendigitalradio/ODR-StaticPrecorrection | 984c14bf46ebd7dc66954a653c8f17212ed97efb | [
"MIT"
] | null | null | null | src/dab_tuning_lib.py | Opendigitalradio/ODR-StaticPrecorrection | 984c14bf46ebd7dc66954a653c8f17212ed97efb | [
"MIT"
] | null | null | null | src/dab_tuning_lib.py | Opendigitalradio/ODR-StaticPrecorrection | 984c14bf46ebd7dc66954a653c8f17212ed97efb | [
"MIT"
] | 1 | 2019-06-20T02:37:34.000Z | 2019-06-20T02:37:34.000Z | import numpy as np
import matplotlib.pyplot as plt
import src.dab_util as du
def calc_signal_sholder_ratio(fft, sampling_rate, debug = False, debug_path="", suffix=""):
fft_size = fft.shape[0]
n_sig = (du.freq_to_fft_sample(-du.c["bw"]/2., fft_size, sampling_rate),
du.freq_to_fft_sample( du.c["bw... | 39.569892 | 105 | 0.625815 |
b01162212f2ec87fd88da8b75c2b06a24c351949 | 31,643 | py | Python | sec_certs/dataset/common_criteria.py | J08nY/sec-certs | d25a4a7c830c587a45eb8e37d99f8794dec1a5eb | [
"MIT"
] | 2 | 2021-03-24T11:56:15.000Z | 2021-04-12T12:22:16.000Z | sec_certs/dataset/common_criteria.py | J08nY/sec-certs | d25a4a7c830c587a45eb8e37d99f8794dec1a5eb | [
"MIT"
] | 73 | 2021-04-12T14:04:04.000Z | 2022-03-31T15:40:26.000Z | sec_certs/dataset/common_criteria.py | J08nY/sec-certs | d25a4a7c830c587a45eb8e37d99f8794dec1a5eb | [
"MIT"
] | 3 | 2021-03-26T16:15:49.000Z | 2021-05-10T07:26:23.000Z | import copy
import itertools
import json
import locale
import shutil
import tempfile
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
from typing import Callable, ClassVar, Dict, Iterator, List, Mapping, Optional, Set, Tuple, Union
import numpy as np
import pandas as pd
from bs4... | 40.207116 | 195 | 0.650349 |
12d8a599b02540c52a40a84d7f4c7e59b412d3b8 | 2,023 | py | Python | src/si/util/metrics.py | mpereira19/Si | 09a85512724e4cd3a7f65e297f26149586e80fc0 | [
"Apache-2.0"
] | null | null | null | src/si/util/metrics.py | mpereira19/Si | 09a85512724e4cd3a7f65e297f26149586e80fc0 | [
"Apache-2.0"
] | null | null | null | src/si/util/metrics.py | mpereira19/Si | 09a85512724e4cd3a7f65e297f26149586e80fc0 | [
"Apache-2.0"
] | null | null | null | import numpy as np
__all__ = ['accuracy_score', 'mse', 'mse_prime', 'cross_entropy', 'cross_entropy_prime', 'r2_score']
def accuracy_score(y_true, y_pred):
"""
Classification performance metric that computes the accuracy of y_true
and y_pred.
:param numpy.array y_true: array-like of shape (n_samples,... | 31.123077 | 102 | 0.669303 |
1de7ba497471d8458956563bc44026d5c4c4be12 | 3,544 | py | Python | src/olympia/reviewers/tests/test_review_scenarios.py | gijsk/addons-server | 7c38f379e3a0b4a5ca231f98ac0c049450c224bd | [
"BSD-3-Clause"
] | null | null | null | src/olympia/reviewers/tests/test_review_scenarios.py | gijsk/addons-server | 7c38f379e3a0b4a5ca231f98ac0c049450c224bd | [
"BSD-3-Clause"
] | null | null | null | src/olympia/reviewers/tests/test_review_scenarios.py | gijsk/addons-server | 7c38f379e3a0b4a5ca231f98ac0c049450c224bd | [
"BSD-3-Clause"
] | null | null | null | """Real life review scenarios.
For different add-on and file statuses, test reviewing them, and make sure then
end up in the correct state.
"""
import pytest
from olympia import amo
from olympia.addons.models import Addon
from olympia.amo.tests import user_factory
from olympia.files.models import File
from olympia.re... | 39.377778 | 79 | 0.705418 |
e9bb21e414dffe8a1185aad71f2ff5c8f19c1257 | 513 | py | Python | start.py | nanotech-empa/aiidalab-empa-molecules | ca2c5a2f1811c17702c032776ebdd51e9a2deecb | [
"MIT"
] | null | null | null | start.py | nanotech-empa/aiidalab-empa-molecules | ca2c5a2f1811c17702c032776ebdd51e9a2deecb | [
"MIT"
] | 6 | 2022-01-14T13:54:40.000Z | 2022-03-04T09:48:45.000Z | start.py | nanotech-empa/aiidalab-empa-molecules | ca2c5a2f1811c17702c032776ebdd51e9a2deecb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import ipywidgets as ipw
template = """
<table>
<tr>
<td valign="top"><ul>
<li><a href="{appbase}/spin_calculation.ipynb" target="_blank">Spin calculations</a></li>
</ul></td>
<td valign="top"><ul>
<li><a href="{appbase}/search.ipynb" target="_blank">Search results</a></li>
</u... | 20.52 | 93 | 0.641326 |
a16f15baa121f434b0889b0d3194ba6749caad3a | 14,631 | py | Python | sdk/python/pulumi_azure_native/servicefabric/v20190301/application_type_version.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/servicefabric/v20190301/application_type_version.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/servicefabric/v20190301/application_type_version.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... | 46.300633 | 1,523 | 0.6653 |
64fd40f3d22abae8926e17a0df01ed050cddd0b2 | 10,992 | py | Python | robloxapi/group.py | cringxy/robloxapi | 2cf130803874d23f1ad009facff4506d7429c800 | [
"MIT"
] | 1 | 2020-07-21T14:22:54.000Z | 2020-07-21T14:22:54.000Z | robloxapi/group.py | g-h-0-s-t/robloxapi | c586b6408696ccd71d84c3eeabf61fff7e82b1c6 | [
"MIT"
] | null | null | null | robloxapi/group.py | g-h-0-s-t/robloxapi | c586b6408696ccd71d84c3eeabf61fff7e82b1c6 | [
"MIT"
] | null | null | null | import json
import logging
import re
import asyncio
from typing import List, Tuple
from bs4 import BeautifulSoup
from .utils.errors import RoleError, NotFound
from .utils.classes import Role, Shout, WallPost, Action
from .joinrequest import JoinRequest
from .groupmember import GroupMember
from .user import User
from .a... | 40.862454 | 205 | 0.579694 |
2df0a55ad1038f9c58ae836c77e28984b145da97 | 1,362 | py | Python | output/models/ibm_data/valid/d4_3_15/d4_3_15v15_xsd/d4_3_15v15.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ibm_data/valid/d4_3_15/d4_3_15v15_xsd/d4_3_15v15.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ibm_data/valid/d4_3_15/d4_3_15v15_xsd/d4_3_15v15.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import List, Optional
@dataclass
class ElementType1:
class Meta:
name = "elementType1"
sub_element1: List["RootType"] = field(
default_factory=list,
metadata={
"name": "subElement1",
"type": "Element",
... | 18.916667 | 43 | 0.501468 |
ed738c6e6e37bff439f01d01d7d3e698f27f2924 | 2,293 | py | Python | uiautomator2/version.py | jihunim/uiautomator2 | b8a6f8d75931774c586b0b45a40f240b0a4cc34b | [
"MIT"
] | null | null | null | uiautomator2/version.py | jihunim/uiautomator2 | b8a6f8d75931774c586b0b45a40f240b0a4cc34b | [
"MIT"
] | null | null | null | uiautomator2/version.py | jihunim/uiautomator2 | b8a6f8d75931774c586b0b45a40f240b0a4cc34b | [
"MIT"
] | null | null | null | # coding: utf-8
#
__apk_version__ = '1.1.7'
# 1.1.7 fix dumpHierarchy XML charactor error
# 1.1.6 fix android P support
# 1.1.5 waitForExists use UiObject2 method first then fallback to UiObject.waitForExists
# 1.1.4 add ADB_EDITOR_CODE broadcast support, fix bug (toast捕获导致app闪退)
# 1.1.3 use thread to make watchers.wa... | 48.787234 | 117 | 0.746184 |
f1bd93ebbee1a438268c08367cdebbc7e2761c69 | 6,613 | py | Python | generate/poems.py | krimkus/pyambic-pentameter | f2355f78a9c073a27acaff23398da2511ac95a42 | [
"MIT"
] | null | null | null | generate/poems.py | krimkus/pyambic-pentameter | f2355f78a9c073a27acaff23398da2511ac95a42 | [
"MIT"
] | null | null | null | generate/poems.py | krimkus/pyambic-pentameter | f2355f78a9c073a27acaff23398da2511ac95a42 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import json
import random
from .syllables import count_syllables, fulfills_scansion, remaining_scheme, rhyme_fingerprint, valid_option
def get_file(filepath):
'''
Read a file and return a list of chunks of text, separated by paragraph
breaks (two empty lines in a row).
When m... | 27.102459 | 108 | 0.590806 |
0181103f00bb13c396d743c7dc15a4ce73e2258e | 1,512 | py | Python | tests/integration_tests/test_esc50_script.py | karolpiczak/echonet | 11b633105a4459972c65ace906974b47a810fedf | [
"MIT"
] | 3 | 2020-03-21T04:24:22.000Z | 2021-07-26T10:36:11.000Z | tests/integration_tests/test_esc50_script.py | karoldvl/audionet | 11b633105a4459972c65ace906974b47a810fedf | [
"MIT"
] | null | null | null | tests/integration_tests/test_esc50_script.py | karoldvl/audionet | 11b633105a4459972c65ace906974b47a810fedf | [
"MIT"
] | 1 | 2020-07-28T10:43:09.000Z | 2020-07-28T10:43:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test reproducibility of the original implementation of the ESC-ConvNet paper."""
import os
import re
import subprocess
from subprocess import PIPE, STDOUT
import pytest
@pytest.mark.timeout(2400)
def test_results_reproducibility(device):
if device == 'gpu0':
... | 32.869565 | 89 | 0.562169 |
f83117dd71f80a4fd403b408e6d76ac032acda2f | 7,150 | py | Python | tree/tree/tree/tree.py | Sewar-web/data-structures-and-algorithms1 | d94f706fb3a30c114bd08a6c2d9b7ed269bc9a21 | [
"MIT"
] | null | null | null | tree/tree/tree/tree.py | Sewar-web/data-structures-and-algorithms1 | d94f706fb3a30c114bd08a6c2d9b7ed269bc9a21 | [
"MIT"
] | null | null | null | tree/tree/tree/tree.py | Sewar-web/data-structures-and-algorithms1 | d94f706fb3a30c114bd08a6c2d9b7ed269bc9a21 | [
"MIT"
] | 1 | 2021-06-26T09:19:43.000Z | 2021-06-26T09:19:43.000Z | class Node:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
class Binary_Tree:
def __init__(self):
self.root = None
def pre_order(self):
output = []
try:
if not self.root:
r... | 23.754153 | 109 | 0.437622 |
47dadf94cc0553e0ab004c656c2eb1e9811fed5d | 67 | py | Python | src/lesson_language_tools/inspect_getsource_class.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | 3 | 2018-08-14T09:33:52.000Z | 2022-03-21T12:31:58.000Z | src/lesson_language_tools/inspect_getsource_class.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | null | null | null | src/lesson_language_tools/inspect_getsource_class.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | null | null | null | import inspect
import example
print(inspect.getsource(example.A))
| 13.4 | 35 | 0.820896 |
517ddb8c76755a08da77e0ed0863c64c22e5e50a | 2,123 | py | Python | commentarea/models.py | wxzsan/pQper | c1c76153fadb2dfd01fac1dca2a8d2a27f0e0f2c | [
"MIT"
] | 7 | 2020-10-25T14:54:52.000Z | 2022-03-09T13:30:24.000Z | commentarea/models.py | wxzsan/pQper | c1c76153fadb2dfd01fac1dca2a8d2a27f0e0f2c | [
"MIT"
] | 12 | 2020-12-11T03:13:35.000Z | 2020-12-30T14:45:12.000Z | commentarea/models.py | wxzsan/pQper | c1c76153fadb2dfd01fac1dca2a8d2a27f0e0f2c | [
"MIT"
] | 4 | 2020-10-25T15:07:35.000Z | 2021-01-02T11:23:33.000Z | from django.db import models
# Create your models here.
class Paper(models.Model):
title = models.CharField(max_length=255)
path = models.CharField(max_length=255)
#paper = models.FileField(upload_to = 'papers')
def __str__(self):
return str(self.id) + '--' + self.title
class PaperFile(models... | 45.170213 | 106 | 0.757419 |
38ef71003625ad41e60815c775f0cde74ee80f22 | 618 | py | Python | manage.py | xiaojieluo/flask_restapi_template | 70b93c90d3cf9dd53a4dcbeb05bf2f67b81bfc01 | [
"Apache-2.0"
] | null | null | null | manage.py | xiaojieluo/flask_restapi_template | 70b93c90d3cf9dd53a4dcbeb05bf2f67b81bfc01 | [
"Apache-2.0"
] | null | null | null | manage.py | xiaojieluo/flask_restapi_template | 70b93c90d3cf9dd53a4dcbeb05bf2f67b81bfc01 | [
"Apache-2.0"
] | null | null | null | from werkzeug.exceptions import HTTPException
from app import create_app
from app.libs.error import APIException
from app.libs.error_code import ServerError
app = create_app()
@app.errorhandler(Exception)
def framework_error(e):
''' 全局拦截异常'''
if isinstance(e, APIException):
return e
if isinstance(... | 22.888889 | 50 | 0.647249 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.