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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6465ec953aa31c663361905e0dd437d030f9aaad | 19,936 | py | Python | theano/tensor/nnet/tests/test_sigm.py | yingzha/Theano | c0b294ec4fd63ff34d13ab36ac2201dbae3a7897 | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/nnet/tests/test_sigm.py | yingzha/Theano | c0b294ec4fd63ff34d13ab36ac2201dbae3a7897 | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/nnet/tests/test_sigm.py | yingzha/Theano | c0b294ec4fd63ff34d13ab36ac2201dbae3a7897 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, print_function, division
import unittest
import numpy
from theano.compat import imap
import theano.tensor.inplace
from theano.tensor import basic as tensor
from theano import tensor as T
from theano import config
from theano.gof.opt import check_stack_trace
from theano.tests im... | 40.852459 | 84 | 0.557033 |
ab8151148c8bace9913fa3b696ff54d85bfdeb7b | 3,909 | py | Python | djnic/web/urls.py | avdata99/nic | 70399bd78fd2b4b496d338e7959867ad12cdf477 | [
"MIT"
] | 8 | 2021-05-01T13:03:22.000Z | 2021-12-17T21:50:04.000Z | djnic/web/urls.py | avdata99/nic | 70399bd78fd2b4b496d338e7959867ad12cdf477 | [
"MIT"
] | 16 | 2020-11-20T23:18:22.000Z | 2021-04-08T20:09:35.000Z | djnic/web/urls.py | OpenDataCordoba/nic | f9528856e13d106bdfb476cab1236bc5b8a92183 | [
"MIT"
] | null | null | null | from django.contrib.auth.decorators import login_required
from django.urls import path
from .views import (HomeView, AboutView, SearchResultsView,
PrivaciPolicyView, TermsView, LoginView)
from .views_dominio import (DominioView, UltimosCaidos,
UltimosRegistrados, Judicia... | 54.291667 | 106 | 0.707086 |
c17a1bfbe3157cda28db8a60a119f7c0ea3d3945 | 1,196 | py | Python | src/jt/jcc/__about__.py | karpierz/jtypes.jcc | 6cb029345034ec9ba1d671d5e20b72f5e1a17f8b | [
"Apache-2.0"
] | null | null | null | src/jt/jcc/__about__.py | karpierz/jtypes.jcc | 6cb029345034ec9ba1d671d5e20b72f5e1a17f8b | [
"Apache-2.0"
] | null | null | null | src/jt/jcc/__about__.py | karpierz/jtypes.jcc | 6cb029345034ec9ba1d671d5e20b72f5e1a17f8b | [
"Apache-2.0"
] | null | null | null | # Copyright 2015-2018 Adam Karpierz
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
__all__ = ('__title__', '__summary__', '__uri__', '__version_info__',
'__version__', '__author__', '__maintainer__', '__email__',
'__copyright__', '__license__')
__ti... | 52 | 95 | 0.640468 |
6e7e67baf6985d8a887379c761824a063da1b58d | 77 | py | Python | src/losses.py | stephrenny/fontGAN | 9f558d00024be962f85f8e0dc0531541098d120d | [
"MIT"
] | null | null | null | src/losses.py | stephrenny/fontGAN | 9f558d00024be962f85f8e0dc0531541098d120d | [
"MIT"
] | 2 | 2021-07-03T05:24:19.000Z | 2021-07-03T05:25:29.000Z | src/losses.py | stephrenny/fontGAN | 9f558d00024be962f85f8e0dc0531541098d120d | [
"MIT"
] | null | null | null | import torch.nn.functional as F
class ChannelWiseCrossEntropyLoss:
pass
| 15.4 | 34 | 0.805195 |
96d14864e1664191ab177ee19f442897ef255752 | 39,662 | py | Python | dble/main_dble.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:48:52.000Z | 2022-03-13T21:48:52.000Z | dble/main_dble.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | dble/main_dble.py | gunpowder78/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... | 37.594313 | 80 | 0.683954 |
95c67ea5da0ed93aa4b8aa1e4aa606fac5433c1e | 10,934 | py | Python | src/pymap3d/ecef.py | scienceopen/python-mapping | fb6147542fc0cab9e2f3b07713605f074a30e086 | [
"BSD-2-Clause"
] | null | null | null | src/pymap3d/ecef.py | scienceopen/python-mapping | fb6147542fc0cab9e2f3b07713605f074a30e086 | [
"BSD-2-Clause"
] | null | null | null | src/pymap3d/ecef.py | scienceopen/python-mapping | fb6147542fc0cab9e2f3b07713605f074a30e086 | [
"BSD-2-Clause"
] | null | null | null | """ Transforms involving ECEF: earth-centered, earth-fixed frame """
from __future__ import annotations
try:
from numpy import (
radians,
sin,
cos,
tan,
arctan as atan,
hypot,
degrees,
arctan2 as atan2,
sqrt,
finfo,
where,
... | 21.481336 | 100 | 0.555698 |
68f7fb03bacaea539b391909596b4bb635605567 | 17 | py | Python | login.py | Adolph-Anthony/Test | 7ef1579d72d611c0a324039e3ed953ace44271bd | [
"MIT"
] | 1 | 2019-06-08T06:53:25.000Z | 2019-06-08T06:53:25.000Z | login.py | Adolph-Anthony/Test | 7ef1579d72d611c0a324039e3ed953ace44271bd | [
"MIT"
] | null | null | null | login.py | Adolph-Anthony/Test | 7ef1579d72d611c0a324039e3ed953ace44271bd | [
"MIT"
] | null | null | null | num = 1
bnum =2
| 4.25 | 7 | 0.529412 |
192254af4f359492cbac140de39395ed30afecbb | 92,642 | py | Python | src/cryptography/hazmat/backends/openssl/backend.py | BabaSSL/python-crypto | 902af94027bff146a992a7d41a251fb1052eb3f0 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/cryptography/hazmat/backends/openssl/backend.py | BabaSSL/python-crypto | 902af94027bff146a992a7d41a251fb1052eb3f0 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/cryptography/hazmat/backends/openssl/backend.py | BabaSSL/python-crypto | 902af94027bff146a992a7d41a251fb1052eb3f0 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2022-03-31T04:00:31.000Z | 2022-03-31T04:00:31.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
import collections
import contextlib
import itertools
import typing
import warnings
from contextlib import contextmanager
from cryptograp... | 37.890389 | 79 | 0.62191 |
5c482090064cec453ead1abb7391a11d0adaf02e | 491 | py | Python | setup.py | lrosique/Mish | 697feab0bfe6f0c631a6f1622fe528dca20d2a38 | [
"MIT"
] | null | null | null | setup.py | lrosique/Mish | 697feab0bfe6f0c631a6f1622fe528dca20d2a38 | [
"MIT"
] | null | null | null | setup.py | lrosique/Mish | 697feab0bfe6f0c631a6f1622fe528dca20d2a38 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='Mish',
version='1.0.0',
url='https://github.com/digantamisra98/Mish',
packages=find_packages(),
author='Diganta Misra',
author_email="mishradiganta91@gmail.com",
description='Mish activation function package',
long_description='A ... | 32.733333 | 104 | 0.723014 |
00ead52b6d0db9f0dfa43d94828409976d51f146 | 3,702 | py | Python | libqtile/widget/net.py | jagguli/qtile | 6f418c484f9ce3841d426b0b41e818270754995a | [
"MIT"
] | null | null | null | libqtile/widget/net.py | jagguli/qtile | 6f418c484f9ce3841d426b0b41e818270754995a | [
"MIT"
] | null | null | null | libqtile/widget/net.py | jagguli/qtile | 6f418c484f9ce3841d426b0b41e818270754995a | [
"MIT"
] | null | null | null | # Copyright (c) 2014 Rock Neurotiko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, dist... | 35.941748 | 114 | 0.594814 |
4f90e6c3b1d8721cb849940acc6a21864ef3abe7 | 34,471 | py | Python | tests/support/case.py | bartlaarhoven/salt | cf8456528382ab76950d7f6b5f6249da4471f265 | [
"Apache-2.0"
] | null | null | null | tests/support/case.py | bartlaarhoven/salt | cf8456528382ab76950d7f6b5f6249da4471f265 | [
"Apache-2.0"
] | null | null | null | tests/support/case.py | bartlaarhoven/salt | cf8456528382ab76950d7f6b5f6249da4471f265 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
====================================
Custom Salt TestCase Implementations
====================================
Custom reusable :class:`TestCase<python2:unittest.TestCase>`
implementations.
'''
# pylint: disable=repr-f... | 37.025779 | 118 | 0.523019 |
9df3795f6244627a5c6b48ca7e40621f87973140 | 91 | py | Python | ProjectEuler/p001.py | dominicschaff/random | 14a19b976a09c768ab8844b7cda237c17a92c9ae | [
"MIT"
] | null | null | null | ProjectEuler/p001.py | dominicschaff/random | 14a19b976a09c768ab8844b7cda237c17a92c9ae | [
"MIT"
] | null | null | null | ProjectEuler/p001.py | dominicschaff/random | 14a19b976a09c768ab8844b7cda237c17a92c9ae | [
"MIT"
] | null | null | null | ans = 0
for i in xrange(1000):
if i % 3 == 0 or i % 5 == 0:
ans += i
print ans | 15.166667 | 32 | 0.461538 |
fae4b2243f50c168d68d1ce25f5dec0447daf49f | 124 | py | Python | vsm/extensions/clustering/__init__.py | inpho/vsm | d5fc930ccc95f275e10e151c8f05db2c05aba01f | [
"MIT"
] | 31 | 2015-01-30T20:09:48.000Z | 2021-08-13T12:57:49.000Z | vsm/extensions/clustering/__init__.py | inpho/vsm | d5fc930ccc95f275e10e151c8f05db2c05aba01f | [
"MIT"
] | 80 | 2015-01-30T19:08:40.000Z | 2019-11-02T20:15:56.000Z | vsm/extensions/clustering/__init__.py | inpho/vsm | d5fc930ccc95f275e10e151c8f05db2c05aba01f | [
"MIT"
] | 10 | 2015-09-18T01:52:23.000Z | 2019-07-14T08:22:06.000Z | """
[Documentation concerning the clustering extension]
"""
from __future__ import absolute_import
from .manifold import *
| 17.714286 | 51 | 0.790323 |
654030a901e9822842664cd077e2bca5b4a0ef20 | 56,496 | py | Python | sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models.py | GoWang/azure-sdk-for-python | f241e3734a50953c2a37c10d2d84eb4c013b3ba0 | [
"MIT"
] | 2 | 2019-08-23T21:14:00.000Z | 2021-09-07T18:32:34.000Z | sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models.py | GoWang/azure-sdk-for-python | f241e3734a50953c2a37c10d2d84eb4c013b3ba0 | [
"MIT"
] | 2 | 2021-11-03T06:10:36.000Z | 2021-12-01T06:29:39.000Z | sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models.py | GoWang/azure-sdk-for-python | f241e3734a50953c2a37c10d2d84eb4c013b3ba0 | [
"MIT"
] | 1 | 2021-12-18T20:01:22.000Z | 2021-12-18T20:01:22.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 39.124654 | 140 | 0.649816 |
2e510abeeb83eb0c9b96bf16477ab138c1199765 | 5,902 | py | Python | Demo/swing/JythonConsole/Console.py | clach04/bb_import_jython | 4529a0f578186a1c33c476300294ab42658eaf7c | [
"CNRI-Jython"
] | 332 | 2015-08-22T12:43:56.000Z | 2022-03-17T01:05:43.000Z | Demo/swing/JythonConsole/Console.py | clach04/bb_import_jython | 4529a0f578186a1c33c476300294ab42658eaf7c | [
"CNRI-Jython"
] | 36 | 2015-05-30T08:39:19.000Z | 2022-03-04T20:42:33.000Z | Demo/swing/JythonConsole/Console.py | clach04/bb_import_jython | 4529a0f578186a1c33c476300294ab42658eaf7c | [
"CNRI-Jython"
] | 74 | 2015-05-29T17:18:53.000Z | 2022-01-15T14:06:44.000Z | """This is a substantially improved version of the older Interpreter.py demo
It creates a simple GUI JPython console window with simple history
as well as the ability to interupt running code (with the ESC key).
Like Interpreter.py, this is still just a demo, and needs substantial
work before serious use.
Thanks to G... | 27.971564 | 95 | 0.722636 |
d0d365b733e91ad0928ca0e0c5b17186d62f1020 | 3,131 | py | Python | imdb/imdb/settings.py | KarolinaSzwedo/WebscrapingProject | fb59c476df8632a449290f9a4374501673729d7c | [
"MIT"
] | 1 | 2021-05-02T20:21:26.000Z | 2021-05-02T20:21:26.000Z | imdb/imdb/settings.py | KarolinaSzwedo/WebscrapingProject | fb59c476df8632a449290f9a4374501673729d7c | [
"MIT"
] | null | null | null | imdb/imdb/settings.py | KarolinaSzwedo/WebscrapingProject | fb59c476df8632a449290f9a4374501673729d7c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Scrapy settings for imdb project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics... | 33.666667 | 103 | 0.769403 |
9521c368fce59c29fda98de5e98c8012fad17929 | 2,147 | py | Python | scripts/study_test_statistics.py | TarekHC/iact_event_types | d570adc99d743e04ace4a866097acb8c097bbc13 | [
"BSD-3-Clause"
] | null | null | null | scripts/study_test_statistics.py | TarekHC/iact_event_types | d570adc99d743e04ace4a866097acb8c097bbc13 | [
"BSD-3-Clause"
] | null | null | null | scripts/study_test_statistics.py | TarekHC/iact_event_types | d570adc99d743e04ace4a866097acb8c097bbc13 | [
"BSD-3-Clause"
] | null | null | null | import argparse
from pathlib import Path
import copy
from event_types import event_types
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description=(
'Train event classes model with various training features.'
'Results are saved in the models directory.'
)
... | 35.196721 | 97 | 0.688402 |
329b60bf4f8c34b0ae4e6314937159317dbd461d | 41,543 | py | Python | toontown/minigame/DistributedCannonGame.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 99 | 2019-11-02T22:25:00.000Z | 2022-02-03T03:48:00.000Z | toontown/minigame/DistributedCannonGame.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 42 | 2019-11-03T05:31:08.000Z | 2022-03-16T22:50:32.000Z | toontown/minigame/DistributedCannonGame.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 57 | 2019-11-03T07:47:37.000Z | 2022-03-22T00:41:49.000Z | from direct.directnotify import DirectNotifyGlobal
from pandac.PandaModules import *
from toontown.toonbase.ToonBaseGlobal import *
from .DistributedMinigame import *
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from direct.fsm import ClassicFSM, State
from direct.fsm import ... | 42.005056 | 281 | 0.637027 |
ba20f302325344d5fb62931fe6199078ebf42ded | 4,455 | py | Python | program_synthesis/naps/examples/seq2seq/bleu.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 123 | 2018-06-09T00:49:39.000Z | 2022-03-09T05:41:20.000Z | program_synthesis/naps/examples/seq2seq/bleu.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 9 | 2018-06-12T01:01:17.000Z | 2022-03-18T09:06:39.000Z | program_synthesis/naps/examples/seq2seq/bleu.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 24 | 2018-06-09T00:42:46.000Z | 2021-09-29T08:23:32.000Z | """Implementation of the BLEU metric copied from
https://github.com/tensorflow/tensor2tensor/blob/758991dd35abc510e93caa5c01c6476bb2380b6e/tensor2tensor/utils/bleu_hook.py
"""
import collections
import math
import numpy as np
from six.moves import xrange
from six.moves import zip
def get_ngrams(segment, max_order):
... | 39.078947 | 122 | 0.65679 |
b1999d9566b53c3151056f2cb1cfe70fdbd20805 | 154,958 | py | Python | tensorflow/python/keras/backend.py | gehring/tensorflow | e6d171a2afcf0b7a1f77f125751727232480edbe | [
"Apache-2.0"
] | 3 | 2018-11-03T14:20:08.000Z | 2019-05-24T08:45:35.000Z | tensorflow/python/keras/backend.py | gehring/tensorflow | e6d171a2afcf0b7a1f77f125751727232480edbe | [
"Apache-2.0"
] | 1 | 2018-11-08T10:31:15.000Z | 2018-11-08T10:31:15.000Z | tensorflow/python/keras/backend.py | gehring/tensorflow | e6d171a2afcf0b7a1f77f125751727232480edbe | [
"Apache-2.0"
] | null | null | null | # 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... | 30.176826 | 95 | 0.656268 |
e37a6736cbeb3a898320d6dd57b1dc2a547378a0 | 14,031 | py | Python | devito/ir/support/vector.py | YanivHollander/devito | 81feda266b685207e5ba01dee29c9173e940876c | [
"MIT"
] | 1 | 2020-06-08T20:44:35.000Z | 2020-06-08T20:44:35.000Z | devito/ir/support/vector.py | FabioLuporini/devito | 0c019a7034e862bb5e7dd255c7e3306e38925607 | [
"MIT"
] | 3 | 2020-11-30T05:38:22.000Z | 2022-03-07T14:02:05.000Z | devito/ir/support/vector.py | FabioLuporini/devito | 0c019a7034e862bb5e7dd255c7e3306e38925607 | [
"MIT"
] | 1 | 2021-01-05T07:27:35.000Z | 2021-01-05T07:27:35.000Z | from collections import OrderedDict
from sympy import true
from devito.tools import as_tuple, is_integer, memoized_meth
from devito.types import Dimension
__all__ = ['Vector', 'LabeledVector', 'vmin', 'vmax']
class Vector(tuple):
"""
An object in an N-dimensional space.
The elements of a vector can b... | 35.521519 | 87 | 0.560259 |
964b6e4600fd10a3cf9d2e285e29f0c3fcabcffe | 5,472 | py | Python | syft/execution/placeholder.py | stephenjfox/PySyft | a27deed0d07c199de039fafd323164640c9c8f6d | [
"Apache-2.0"
] | null | null | null | syft/execution/placeholder.py | stephenjfox/PySyft | a27deed0d07c199de039fafd323164640c9c8f6d | [
"Apache-2.0"
] | null | null | null | syft/execution/placeholder.py | stephenjfox/PySyft | a27deed0d07c199de039fafd323164640c9c8f6d | [
"Apache-2.0"
] | null | null | null | import syft
from syft.generic.frameworks.hook import hook_args
from syft.execution.placeholder_id import PlaceholderId
from syft.generic.tensor import AbstractTensor
from syft.workers.abstract import AbstractWorker
from syft_proto.execution.v1.placeholder_pb2 import Placeholder as PlaceholderPB
class PlaceHolder(Abst... | 37.22449 | 105 | 0.657712 |
27516ff1a5c27b436a779f860c98c2e9d1c65467 | 460 | py | Python | protector/reserved_reasons.py | 0rang3max/django-protector | 4b65309ca7e8f2192e34bbdd531253d38dbb6240 | [
"MIT"
] | null | null | null | protector/reserved_reasons.py | 0rang3max/django-protector | 4b65309ca7e8f2192e34bbdd531253d38dbb6240 | [
"MIT"
] | null | null | null | protector/reserved_reasons.py | 0rang3max/django-protector | 4b65309ca7e8f2192e34bbdd531253d38dbb6240 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
TEST_REASON = 'TEST REASON'
GENERIC_GROUP_UPDATE_REASON = 'Groups were created due to foreign key links update'
def ADMIN_PANEL_DELETE_REASON(user):
if not user or not user.username:
user = 'unknown user'
return 'Relation was deleted through admin panel by {}'.... | 30.666667 | 83 | 0.758696 |
d88654692a78198730e578e535b8fecae87cf63b | 840 | py | Python | tests/helpers.py | maldieve/luma.lcd | 6c0daff278b976c4aa1b14bc82a83494dcd41dbb | [
"MIT"
] | null | null | null | tests/helpers.py | maldieve/luma.lcd | 6c0daff278b976c4aa1b14bc82a83494dcd41dbb | [
"MIT"
] | null | null | null | tests/helpers.py | maldieve/luma.lcd | 6c0daff278b976c4aa1b14bc82a83494dcd41dbb | [
"MIT"
] | 3 | 2018-11-04T19:58:21.000Z | 2021-03-12T13:26:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Richard Hull and contributors
# See LICENSE.rst for details.
try:
from unittest.mock import call, Mock
except ImportError:
from mock import call, Mock # noqa: F401
import pytest
import luma.core.error
serial = Mock(unsafe=True)
def setup_function(function):
... | 25.454545 | 85 | 0.707143 |
6403ce3adda29eefd6496278091d11dc60eab801 | 6,029 | py | Python | alphazero/model.py | bartekx43/AlphaTTT | a01c38833a7f841483146bebeef73323d527d812 | [
"MIT"
] | null | null | null | alphazero/model.py | bartekx43/AlphaTTT | a01c38833a7f841483146bebeef73323d527d812 | [
"MIT"
] | null | null | null | alphazero/model.py | bartekx43/AlphaTTT | a01c38833a7f841483146bebeef73323d527d812 | [
"MIT"
] | null | null | null | import os
import sys
import numpy as np
from copy import deepcopy
from collections import deque
import torch
from torch import nn
from torch import optim
from torch.nn import functional as F
sys.path.append(os.path.join(os.environ["HOME"], "AlphaTTT"))
from environment import Environment
from alphazero.mcts import ... | 32.413978 | 155 | 0.674573 |
85d80323fc6a009355f64803d5ab24442af23832 | 228 | py | Python | src/fetch_waveforms.py | ngroebner/brady_fmf | a7d37fa3873c32ed65a9ab394441c39e64f33b3e | [
"MIT"
] | null | null | null | src/fetch_waveforms.py | ngroebner/brady_fmf | a7d37fa3873c32ed65a9ab394441c39e64f33b3e | [
"MIT"
] | null | null | null | src/fetch_waveforms.py | ngroebner/brady_fmf | a7d37fa3873c32ed65a9ab394441c39e64f33b3e | [
"MIT"
] | null | null | null | import obspy
POROTOMO_CONTINUOUS_NODAL_WAVEFORM_PATH = "https://nrel-pds-porotomo.s3.amazonaws.com/Nodal"
def fetch_waveform(remote_filename, remote_path):
url = remote_filename + remote_path
return obspy.read(url)[0]
| 28.5 | 92 | 0.789474 |
09216ffcab9bd5ad85ae63687316c304270acc89 | 4,199 | py | Python | SentEval/senteval/cn/lcqmc.py | leotmc/simcse | e0b62fcef5dadeeef55aef3b640ab219860c201b | [
"MIT"
] | null | null | null | SentEval/senteval/cn/lcqmc.py | leotmc/simcse | e0b62fcef5dadeeef55aef3b640ab219860c201b | [
"MIT"
] | null | null | null | SentEval/senteval/cn/lcqmc.py | leotmc/simcse | e0b62fcef5dadeeef55aef3b640ab219860c201b | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, unicode_literals
import os
import logging
import numpy as np
import io
from senteval.tools.validation import KFoldClassifier
from sklearn.metrics import f1_score
class LCQMCEval(object):
def __init__(self, task_path, tokenizer, seed=1111):
... | 43.739583 | 83 | 0.520362 |
f10a3adda86331999e9f7feb223bd6d8e58dbfe1 | 274 | py | Python | mathbook/notation/calculus.py | hyunjongkimmath/mathbook | 058f1b804824198ab35e1273ad9091e66985fde6 | [
"Apache-2.0"
] | null | null | null | mathbook/notation/calculus.py | hyunjongkimmath/mathbook | 058f1b804824198ab35e1273ad9091e66985fde6 | [
"Apache-2.0"
] | null | null | null | mathbook/notation/calculus.py | hyunjongkimmath/mathbook | 058f1b804824198ab35e1273ad9091e66985fde6 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/notation.calculus.ipynb (unless otherwise specified).
__all__ = []
# Cell
if __name__ == '__main__':
embed_markdown_file('notation.real_valued_function.md',
destination=DESTINATION, origin=ORIGIN) | 34.25 | 101 | 0.70073 |
bcdbf7410f344c5a99aaf487a0272b0349df7086 | 53,129 | py | Python | torchbnn/_impl/utils.py | wilsonify/bayesian-sde | 528f41ac10e65cb8f1ea047a48e3057bb6a777fc | [
"MIT"
] | 14 | 2021-12-04T18:00:28.000Z | 2022-03-30T23:27:29.000Z | torchbnn/_impl/utils.py | wilsonify/bayesian-sde | 528f41ac10e65cb8f1ea047a48e3057bb6a777fc | [
"MIT"
] | 1 | 2022-02-11T03:35:00.000Z | 2022-02-11T03:35:00.000Z | torchbnn/_impl/utils.py | wilsonify/bayesian-sde | 528f41ac10e65cb8f1ea047a48e3057bb6a777fc | [
"MIT"
] | 2 | 2021-12-09T17:00:48.000Z | 2022-03-04T15:15:33.000Z | """All-purpose utility file with helpers for
- PyTorch tensor processing (flattening, unflattening, vjp, jvp),
- plotting,
- custom gradient checking (gradient wrt parameters, and second-order gradients),
- meters (ema, online average),
- ema model averaging,
- google cloud storage utilities,
- custom context managers... | 36.142177 | 157 | 0.623746 |
f5464b94f85e682fd395f439ad8f648737392db0 | 306 | py | Python | tests/settings.py | HireAnEsquire/django3-js-reverse | 4b7297d9a0a003c5aa68c723c11f88f784c58354 | [
"MIT"
] | null | null | null | tests/settings.py | HireAnEsquire/django3-js-reverse | 4b7297d9a0a003c5aa68c723c11f88f784c58354 | [
"MIT"
] | null | null | null | tests/settings.py | HireAnEsquire/django3-js-reverse | 4b7297d9a0a003c5aa68c723c11f88f784c58354 | [
"MIT"
] | null | null | null | import os
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}
SECRET_KEY = "wtf"
ROOT_URLCONF = None
USE_TZ = True
INSTALLED_APPS = ("django_js_reverse",)
ALLOWED_HOSTS = ["testserver"]
MIDDLEWARE_CLASSES = ()
STATIC_ROOT = os.path.join(os.path.dirname(__file__), "tmp")
| 27.818182 | 85 | 0.715686 |
86b4c1bed80154a9310f41c4182aeef6555eb5dc | 766 | py | Python | setup.py | fagcinsk/yaml-expressions | 0e136808c63de2449f276d0f6e5bd76bc869793c | [
"MIT"
] | 1 | 2021-09-28T07:31:47.000Z | 2021-09-28T07:31:47.000Z | setup.py | fagci/yaml-expressions | 0e136808c63de2449f276d0f6e5bd76bc869793c | [
"MIT"
] | null | null | null | setup.py | fagci/yaml-expressions | 0e136808c63de2449f276d0f6e5bd76bc869793c | [
"MIT"
] | null | null | null | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="yaml-expressions",
version="0.2.1",
author="Mikhail Yudin",
author_email="fagci.nsk@gmail.com",
description=("Jinja2 templates for yaml. Make dynamic rules ... | 27.357143 | 79 | 0.659269 |
30ba1c572287967e82cfb743301dc5b6b61be64f | 1,863 | py | Python | cirq-google/cirq_google/json_resolver_cache.py | JiahaoYao/Cirq | b8334a190f9236d6874dd1403eaf36d98f417594 | [
"Apache-2.0"
] | null | null | null | cirq-google/cirq_google/json_resolver_cache.py | JiahaoYao/Cirq | b8334a190f9236d6874dd1403eaf36d98f417594 | [
"Apache-2.0"
] | null | null | null | cirq-google/cirq_google/json_resolver_cache.py | JiahaoYao/Cirq | b8334a190f9236d6874dd1403eaf36d98f417594 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Cirq Developers
#
# 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 agreed to in ... | 44.357143 | 95 | 0.779388 |
41a5af25b9af8af0eeeac1c54f76bca011414d8d | 23,043 | py | Python | tests/validation/tests/v3_api/test_upgrade.py | esne/rancher | e2c9dc741dba2cd02702a97996ba38004812f821 | [
"Apache-2.0"
] | null | null | null | tests/validation/tests/v3_api/test_upgrade.py | esne/rancher | e2c9dc741dba2cd02702a97996ba38004812f821 | [
"Apache-2.0"
] | 1 | 2021-02-23T19:12:08.000Z | 2021-02-23T19:12:08.000Z | tests/validation/tests/v3_api/test_upgrade.py | esne/rancher | e2c9dc741dba2cd02702a97996ba38004812f821 | [
"Apache-2.0"
] | 1 | 2020-11-26T18:09:18.000Z | 2020-11-26T18:09:18.000Z | import base64
import pytest
from .common import * # NOQA
from .test_secrets import (
create_and_validate_workload_with_secret_as_env_variable,
create_and_validate_workload_with_secret_as_volume,
validate_workload_with_secret,
create_secret)
from .test_service_discovery import create_dns_record
clust... | 35.073059 | 79 | 0.682637 |
b746a0e90395df711318dbb7d73bfedcc37a94bf | 1,000 | py | Python | containment/activate.py | zancas/containment | 7fd97b6d2c43b1a9348c0bb243478ced83aa82e2 | [
"MIT"
] | null | null | null | containment/activate.py | zancas/containment | 7fd97b6d2c43b1a9348c0bb243478ced83aa82e2 | [
"MIT"
] | null | null | null | containment/activate.py | zancas/containment | 7fd97b6d2c43b1a9348c0bb243478ced83aa82e2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Contains the activate command and helper methods.
Functions:
activate: Activate the given project. If no project name is given, activate
the current directory.
"""
import os
import pathlib
from .types import ProjectId
def activate(project: ProjectId = None):
"""
Usage... | 25.641026 | 79 | 0.667 |
92749a8a26ed3def1ead31fb887eeb5ebfbaf5ca | 8,176 | py | Python | modelling/sapphire/compress.py | parallelpro/Yaguang_stripped_rg_repo | 993f7459827b8e8f820a26768b5d2a281fe81709 | [
"MIT"
] | null | null | null | modelling/sapphire/compress.py | parallelpro/Yaguang_stripped_rg_repo | 993f7459827b8e8f820a26768b5d2a281fe81709 | [
"MIT"
] | null | null | null | modelling/sapphire/compress.py | parallelpro/Yaguang_stripped_rg_repo | 993f7459827b8e8f820a26768b5d2a281fe81709 | [
"MIT"
] | null | null | null | '''
Combine mesa outputs (history + frequencies), and store in hdf5 format.
Three versions:
1) Complete grid: 2+3.
2) Classic grid: parameters that are present in the ".history" files.
From protostar to the end (Dnu~10muHz),
including every time step.
3) Radial frequency grid: parameters in the ".history" fi... | 41.928205 | 232 | 0.590631 |
e7c85adede8f20832b5b25a14dec7a533ac51dd4 | 3,203 | py | Python | homeassistant/components/azure_service_bus/notify.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 23 | 2017-11-15T21:03:53.000Z | 2021-03-29T21:33:48.000Z | homeassistant/components/azure_service_bus/notify.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 87 | 2020-07-06T22:22:54.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/azure_service_bus/notify.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Support for azure service bus notification."""
import json
import logging
from azure.servicebus.aio import Message, ServiceBusClient
from azure.servicebus.common.errors import (
MessageSendFailed,
ServiceBusConnectionError,
ServiceBusResourceNotFound,
)
import voluptuous as vol
from homeassistant.compo... | 29.934579 | 81 | 0.665938 |
df26f721a77f2c8d9e8c7047c41f8bbeae337675 | 3,099 | py | Python | tests/test_3DMFS_only.py | eudoxos/imfractal | a33c5ae5771ba9d4437cb665c0c48dc492e74025 | [
"BSD-3-Clause"
] | null | null | null | tests/test_3DMFS_only.py | eudoxos/imfractal | a33c5ae5771ba9d4437cb665c0c48dc492e74025 | [
"BSD-3-Clause"
] | null | null | null | tests/test_3DMFS_only.py | eudoxos/imfractal | a33c5ae5771ba9d4437cb665c0c48dc492e74025 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2016 Rodrigo Baravalle
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following... | 33.684783 | 106 | 0.673443 |
9c65c25ea44ec808ea3758167ef30bcffa559484 | 1,040 | py | Python | question/admin.py | RohanDukare/OnlineVoting | e1c355fab0fdd21cc63c4be9e16fc55731479f17 | [
"MIT"
] | 7 | 2019-05-17T06:12:57.000Z | 2021-02-07T03:48:57.000Z | question/admin.py | RohanDukare/OnlineVoting | e1c355fab0fdd21cc63c4be9e16fc55731479f17 | [
"MIT"
] | null | null | null | question/admin.py | RohanDukare/OnlineVoting | e1c355fab0fdd21cc63c4be9e16fc55731479f17 | [
"MIT"
] | 5 | 2019-05-17T06:13:10.000Z | 2021-02-07T03:49:21.000Z | from django.contrib import admin
from question.models import question,Reward
from Registration.models import Voter,Candidate
def Add_Candidate(modeladmin, request, queryset):
for que in queryset:
date= que.mnth
cand=Candidate.objects.all()
for x in cand:
s2=Reward(v_Id=x)
... | 29.714286 | 72 | 0.649038 |
6f82e5d904cd4f80c6b1260391528cba109c83aa | 13,669 | py | Python | airflow/settings.py | BeeXiong/airflow | 4aa272d15463ce9866dc2b2a3b83c34192f6f353 | [
"Apache-2.0"
] | 1 | 2016-12-22T00:34:58.000Z | 2016-12-22T00:34:58.000Z | airflow/settings.py | BeeXiong/airflow | 4aa272d15463ce9866dc2b2a3b83c34192f6f353 | [
"Apache-2.0"
] | 21 | 2016-06-27T15:25:06.000Z | 2017-11-23T17:41:04.000Z | airflow/settings.py | BeeXiong/airflow | 4aa272d15463ce9866dc2b2a3b83c34192f6f353 | [
"Apache-2.0"
] | 3 | 2021-02-23T07:52:47.000Z | 2021-03-02T06:33:44.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 34.002488 | 106 | 0.689224 |
068effa6fc4b040626081d3e4bad1e0f9dd66a1e | 4,342 | py | Python | src/oscarapicheckout/mixins.py | James7777/django-oscar-api-checkout | b7e7693ad542a3b86ab7759c5309a1b0025c28e4 | [
"ISC"
] | null | null | null | src/oscarapicheckout/mixins.py | James7777/django-oscar-api-checkout | b7e7693ad542a3b86ab7759c5309a1b0025c28e4 | [
"ISC"
] | null | null | null | src/oscarapicheckout/mixins.py | James7777/django-oscar-api-checkout | b7e7693ad542a3b86ab7759c5309a1b0025c28e4 | [
"ISC"
] | null | null | null | from decimal import Decimal
from django.conf import settings
from django.db import transaction
from django.utils.translation import gettext_lazy as _
from oscar.core.loading import get_class, get_model
Order = get_model('order', 'Order')
order_placed = get_class('order.signals', 'order_placed')
class OrderCreatorMix... | 49.340909 | 123 | 0.64947 |
b42793966c601e8de8faf23fa39c74a163e0ddcf | 1,224 | py | Python | get_youtube_view.py | nicetone/Python | 85fd9cc7e00f3bbeed5355ce392128ff22de459b | [
"MIT"
] | 28,321 | 2015-01-03T15:36:19.000Z | 2022-03-31T10:11:54.000Z | get_youtube_view.py | nicetone/Python | 85fd9cc7e00f3bbeed5355ce392128ff22de459b | [
"MIT"
] | 544 | 2015-01-19T14:28:09.000Z | 2022-03-29T04:05:21.000Z | get_youtube_view.py | nicetone/Python | 85fd9cc7e00f3bbeed5355ce392128ff22de459b | [
"MIT"
] | 13,366 | 2015-01-03T15:45:14.000Z | 2022-03-31T11:50:26.000Z | """
Created on Thu Apr 27 16:28:36 2017
@author: barnabysandeford
"""
# Currently works for Safari, but just change to whichever
# browser you're using.
import time
# Added pafy to get video length for the user
import pafy
# Changed the method of opening the browser.
# Selenium allows for the page to be refreshed.
f... | 24.979592 | 81 | 0.718954 |
60ad1642435064e912eba9f89db833f7667747ac | 1,510 | py | Python | code/demo.py | HBvision/CAM2DaSiamRPN | e54cb63d8b3d790b7d9015c3d143f1a88aed23ab | [
"MIT"
] | null | null | null | code/demo.py | HBvision/CAM2DaSiamRPN | e54cb63d8b3d790b7d9015c3d143f1a88aed23ab | [
"MIT"
] | null | null | null | code/demo.py | HBvision/CAM2DaSiamRPN | e54cb63d8b3d790b7d9015c3d143f1a88aed23ab | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# DaSiamRPN
# Licensed under The MIT License
# Written by Qiang Wang (wangqiang2015 at ia.ac.cn)
# --------------------------------------------------------
#!/usr/bin/python
import numpy as np
import glob, cv2, torch
from os.path import realpath, dirname, joi... | 32.826087 | 93 | 0.647682 |
32edca22c71bde636f7c05d7c0de4415d98ed494 | 732 | py | Python | ElevatorBot/commands/destiny/roles/get.py | LukasSchmid97/destinyBloodoakStats | 1420802ce01c3435ad5c283f44eb4531d9b22c38 | [
"MIT"
] | 3 | 2019-10-19T11:24:50.000Z | 2021-01-29T12:02:17.000Z | ElevatorBot/commands/destiny/roles/get.py | LukasSchmid97/destinyBloodoakStats | 1420802ce01c3435ad5c283f44eb4531d9b22c38 | [
"MIT"
] | 29 | 2019-10-14T12:26:10.000Z | 2021-07-28T20:50:29.000Z | ElevatorBot/commands/destiny/roles/get.py | LukasSchmid97/destinyBloodoakStats | 1420802ce01c3435ad5c283f44eb4531d9b22c38 | [
"MIT"
] | 2 | 2019-10-13T17:11:09.000Z | 2020-05-13T15:29:04.000Z | from dis_snek.models import InteractionContext, sub_command
from ElevatorBot.commands.base import BaseScale
from ElevatorBot.core.destiny.roles import Roles
class RoleGet(BaseScale):
@sub_command(
base_name="roles",
base_description="Various commands concerning Destiny 2 achievement discord roles... | 29.28 | 91 | 0.702186 |
73c0ec356e18c9a1ba62b7c03a48f7001924d73a | 741 | py | Python | packages/byfire/controlpanel/migrations/0007_auto_20200918_1559.py | rusty-eagle/ByFire | 1e127c3629793b2c27b173e649488c0b3332ebb1 | [
"MIT"
] | null | null | null | packages/byfire/controlpanel/migrations/0007_auto_20200918_1559.py | rusty-eagle/ByFire | 1e127c3629793b2c27b173e649488c0b3332ebb1 | [
"MIT"
] | null | null | null | packages/byfire/controlpanel/migrations/0007_auto_20200918_1559.py | rusty-eagle/ByFire | 1e127c3629793b2c27b173e649488c0b3332ebb1 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-18 15:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('controlpanel', '0006_iptable_removable'),
]
operations = [
migrations.AddField(
model_name='iptable',
name='chain',
... | 30.875 | 229 | 0.589744 |
1e05698b5ae32b23b54c100a8e1f0f7dac8e4907 | 8,843 | py | Python | tests/core_tests/user_logging_tests.py | ahmedhas32/Brainless | 39e4d8dc86cc34f31d4adad0479e3a7a50891030 | [
"MIT"
] | 1 | 2020-02-28T12:12:21.000Z | 2020-02-28T12:12:21.000Z | tests/core_tests/user_logging_tests.py | ahmedhas32/Brainless | 39e4d8dc86cc34f31d4adad0479e3a7a50891030 | [
"MIT"
] | null | null | null | tests/core_tests/user_logging_tests.py | ahmedhas32/Brainless | 39e4d8dc86cc34f31d4adad0479e3a7a50891030 | [
"MIT"
] | null | null | null | # This set of tests id specifically designed to make sure brainless is user friendly- throwing useful warnings where possible about what specific actions the user can take to avoid an error, instead of throwing the non-obvious error messages that the underlying libraries will choke on.
import datetime
import dill
from ... | 32.039855 | 286 | 0.716951 |
51630525378160fbb8455f2bcf03c587d8c4e702 | 2,868 | py | Python | networking_ovn/common/constants.py | mail2nsrajesh/networking-ovn | 6173ab9da0d646842e1c0f8c137846a3f0a5d8bd | [
"Apache-2.0"
] | null | null | null | networking_ovn/common/constants.py | mail2nsrajesh/networking-ovn | 6173ab9da0d646842e1c0f8c137846a3f0a5d8bd | [
"Apache-2.0"
] | null | null | null | networking_ovn/common/constants.py | mail2nsrajesh/networking-ovn | 6173ab9da0d646842e1c0f8c137846a3f0a5d8bd | [
"Apache-2.0"
] | null | null | null | # 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... | 44.8125 | 79 | 0.73152 |
dd62168ebadbf26974046b4d1f5978544f42c636 | 2,817 | py | Python | hello/tests/test_twitter.py | qwergram/GroupProject1 | 75a93fd636a2590db223800f54ee891fb1554400 | [
"MIT"
] | 1 | 2016-04-22T13:33:31.000Z | 2016-04-22T13:33:31.000Z | hello/tests/test_twitter.py | jeremytedwards/StockTalk | 75a93fd636a2590db223800f54ee891fb1554400 | [
"MIT"
] | 2 | 2016-03-29T05:29:04.000Z | 2016-03-29T18:20:39.000Z | hello/tests/test_twitter.py | jeremytedwards/StockTalk | 75a93fd636a2590db223800f54ee891fb1554400 | [
"MIT"
] | 2 | 2016-04-16T00:24:14.000Z | 2021-04-09T15:27:40.000Z | from django.test import TestCase
from hello.twitter_api import (
TwitterCli,
get_twitter_comments,
json_into_table,
save_tweets
)
import io
import json
try:
from urllib.error import HTTPError
except ImportError:
from urllib2 import HTTPError
with io.open("hello/tests/example_twit.json") as sa... | 32.011364 | 142 | 0.642173 |
030716fc6fd4e7e7895ef043fe08592b47b15d55 | 849 | py | Python | interface/cores.py | mrcbnu/Projeto_Maria | 24385a1b8dd606447aa4bd89f7e11d661170ebde | [
"MIT"
] | null | null | null | interface/cores.py | mrcbnu/Projeto_Maria | 24385a1b8dd606447aa4bd89f7e11d661170ebde | [
"MIT"
] | null | null | null | interface/cores.py | mrcbnu/Projeto_Maria | 24385a1b8dd606447aa4bd89f7e11d661170ebde | [
"MIT"
] | null | null | null | def cor(x):
'''
Função que gera um codigo de cores no padrão escape sequence ANSI.
:param x: numero de posição do codigo ANSI na tupla cores.
:return: retorna o codigo da cor.
'''
cores = (
'\033[m', # 0 - sem cor
'\033[1;30m', # 1 - branco
'\033[1;7;30m', # 2... | 29.275862 | 70 | 0.449941 |
9f3b0491b96bd0e52ae936c673f137a636359745 | 1,904 | py | Python | compact_classifiers/crc_csen/csen/csen.py | meteahishali/methods-early-cov19 | c0c538ca95430c2a9ab9fc7453b51e29bad0648d | [
"MIT"
] | 2 | 2021-04-30T07:26:58.000Z | 2021-12-03T01:08:14.000Z | compact_classifiers/crc_csen/csen/csen.py | meteahishali/methods-early-cov19 | c0c538ca95430c2a9ab9fc7453b51e29bad0648d | [
"MIT"
] | null | null | null | compact_classifiers/crc_csen/csen/csen.py | meteahishali/methods-early-cov19 | c0c538ca95430c2a9ab9fc7453b51e29bad0648d | [
"MIT"
] | null | null | null | import os
os.environ["CUDA_VISIBLE_DEVICES"]="1"
import tensorflow as tf
import numpy as np
import argparse
## Functions
from utils_csen import *
from networks import *
np.random.seed(10) # numpy is good about making repeatable output
tf.random.set_seed(10) # on the other hand, this is basically useless (see issue 91... | 31.733333 | 110 | 0.690126 |
7ef391c7653c29a3afa600e63bff6c5078c6a4dc | 661 | py | Python | ansys-grantami-bomanalytics-openapi/tests/test_common_indicator_definition.py | pyansys/grantami-bomanalytics-openapi | 2879348388d6d7bbdd3b5082c5b7759b4ed28ab7 | [
"MIT"
] | null | null | null | ansys-grantami-bomanalytics-openapi/tests/test_common_indicator_definition.py | pyansys/grantami-bomanalytics-openapi | 2879348388d6d7bbdd3b5082c5b7759b4ed28ab7 | [
"MIT"
] | 2 | 2022-02-18T15:56:36.000Z | 2022-02-24T11:44:59.000Z | ansys-grantami-bomanalytics-openapi/tests/test_common_indicator_definition.py | pyansys/grantami-bomanalytics-openapi | 2879348388d6d7bbdd3b5082c5b7759b4ed28ab7 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Granta.BomAnalyticsServices
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: V1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pytest # noqa: F401
from ansy... | 26.44 | 119 | 0.757943 |
c40a27a5e22e42153d2f6fe0060ac079d9207554 | 85,232 | py | Python | core/controllers/admin_test.py | swyuan27/oppia | da4c733659b8813eccf738ff8be19123ebcdeb15 | [
"Apache-2.0"
] | 5,422 | 2015-08-14T01:56:44.000Z | 2022-03-31T23:31:56.000Z | core/controllers/admin_test.py | swyuan27/oppia | da4c733659b8813eccf738ff8be19123ebcdeb15 | [
"Apache-2.0"
] | 14,178 | 2015-08-14T05:21:45.000Z | 2022-03-31T23:54:10.000Z | core/controllers/admin_test.py | swyuan27/oppia | da4c733659b8813eccf738ff8be19123ebcdeb15 | [
"Apache-2.0"
] | 3,574 | 2015-08-14T04:20:06.000Z | 2022-03-29T01:52:37.000Z | # Copyright 2014 The Oppia 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 applicable ... | 38.77707 | 80 | 0.631652 |
1848586a1cc15ecb52f6e2bee2d8b5bffc076955 | 1,075 | py | Python | test/functional/create_cache.py | allforonebusiness/AllForOneBusiness | 63978033c60e2106adb7c6d9ba4bd3a4fc159ce6 | [
"MIT"
] | null | null | null | test/functional/create_cache.py | allforonebusiness/AllForOneBusiness | 63978033c60e2106adb7c6d9ba4bd3a4fc159ce6 | [
"MIT"
] | null | null | null | test/functional/create_cache.py | allforonebusiness/AllForOneBusiness | 63978033c60e2106adb7c6d9ba4bd3a4fc159ce6 | [
"MIT"
] | 4 | 2019-11-13T21:49:01.000Z | 2020-11-29T20:17:14.000Z | #!/usr/bin/env python3
# Copyright (c) 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Create a blockchain cache.
Creating a cache of the blockchain speeds up test execution when running
mu... | 32.575758 | 86 | 0.739535 |
b990f3308aaf4e6162cc8877b7b0d3d87b9b4062 | 26,047 | py | Python | scipy/weave/build_tools.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | 8 | 2015-10-07T00:37:32.000Z | 2022-01-21T17:02:33.000Z | scipy/weave/build_tools.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | null | null | null | scipy/weave/build_tools.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | 8 | 2015-05-09T14:23:57.000Z | 2018-11-15T05:56:00.000Z | """ Tools for compiling C/C++ code to extension modules
The main function, build_extension(), takes the C/C++ file
along with some other options and builds a Python extension.
It uses distutils for most of the heavy lifting.
choose_compiler() is also useful (mainly on windows anyway)
for trying to... | 42.215559 | 100 | 0.592813 |
8f8571985f0e3faa8ef0a5c4e8cc42ac81812e12 | 3,101 | py | Python | Transfer/YOLOv4-pytorch/utils/voc.py | chakkritte/EEEA-Net | 260c2a5c673a806315fc5b529b9c9112c48ca8ae | [
"Apache-2.0"
] | 3 | 2021-08-30T01:36:52.000Z | 2021-11-05T07:36:28.000Z | Transfer/YOLOv4-pytorch/utils/voc.py | chakkritte/EEEA-Net | 260c2a5c673a806315fc5b529b9c9112c48ca8ae | [
"Apache-2.0"
] | 1 | 2021-11-29T12:00:56.000Z | 2021-11-30T04:07:28.000Z | Transfer/YOLOv4-pytorch/utils/voc.py | chakkritte/EEEA-Net | 260c2a5c673a806315fc5b529b9c9112c48ca8ae | [
"Apache-2.0"
] | 2 | 2021-08-17T10:06:59.000Z | 2021-08-30T01:36:57.000Z | import sys
sys.path.append("..")
import xml.etree.ElementTree as ET
import config.yolov4_config as cfg
import os
from tqdm import tqdm
def parse_voc_annotation(data_path, file_type, anno_path, use_difficult_bbox=False):
"""
phase pascal voc annotation, eg:[image_global_path xmin,ymin,xmax,ymax,cls_id]
:p... | 45.602941 | 123 | 0.65495 |
2f9c4b05ba763b2f662df74ad734db7d66b04325 | 6,040 | py | Python | packages/python/plotly/plotly/validators/isosurface/hoverlabel/__init__.py | pragyagarg642/plotly.py | 141aa6dcb3f838b2102db6ecc9ae1bdb70daf20b | [
"MIT"
] | 2 | 2020-04-11T19:28:30.000Z | 2020-05-04T03:16:20.000Z | packages/python/plotly/plotly/validators/isosurface/hoverlabel/__init__.py | pragyagarg642/plotly.py | 141aa6dcb3f838b2102db6ecc9ae1bdb70daf20b | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/isosurface/hoverlabel/__init__.py | pragyagarg642/plotly.py | 141aa6dcb3f838b2102db6ecc9ae1bdb70daf20b | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="namelengthsrc", parent_name="isosurface.hoverlabel", **kwargs
):
super(NamelengthsrcValidator, self).__init__(
plotly_name=plotly_name,
... | 32.473118 | 88 | 0.604636 |
f1c3fced83db2ca746b150334fe983806111c09f | 1,558 | py | Python | ch02_base/DNN/.ipynb_checkpoints/linear_regression-checkpoint.py | pythonProjectLearn/PytorchLearning | 835ce23656e5816f5fbc9018f85f8613bff8f24c | [
"MIT"
] | 1 | 2022-03-18T03:46:19.000Z | 2022-03-18T03:46:19.000Z | ch02_base/DNN/linear_regression.py | pythonProjectLearn/PytorchLearning | 835ce23656e5816f5fbc9018f85f8613bff8f24c | [
"MIT"
] | null | null | null | ch02_base/DNN/linear_regression.py | pythonProjectLearn/PytorchLearning | 835ce23656e5816f5fbc9018f85f8613bff8f24c | [
"MIT"
] | null | null | null | # encoding:utf-8
import torch
import torch.nn as nn
import numpy as np
import matplotlib.pyplot as plt
# Hyper-parameters
input_size = 1
output_size = 1
num_epochs = 60
learning_rate = 0.001
# Toy dataset
x_train = np.array([[3.3], [4.4], [5.5], [6.71], [6.93], [4.168],
[9.779], [6.182], [7.59], [... | 28.327273 | 87 | 0.620026 |
1d2f9c470508cffaf490a3f266311eb364c49b16 | 2,308 | py | Python | saas/management/commands/compile_stats.py | gikoluo/djaodjin-saas | badd7894ac327191008a1b3a0ebd0d07b55908c3 | [
"BSD-2-Clause"
] | 383 | 2015-03-07T06:19:39.000Z | 2022-03-12T20:53:37.000Z | saas/management/commands/compile_stats.py | gikoluo/djaodjin-saas | badd7894ac327191008a1b3a0ebd0d07b55908c3 | [
"BSD-2-Clause"
] | 146 | 2015-03-25T22:45:44.000Z | 2022-02-22T08:49:35.000Z | saas/management/commands/compile_stats.py | gikoluo/djaodjin-saas | badd7894ac327191008a1b3a0ebd0d07b55908c3 | [
"BSD-2-Clause"
] | 111 | 2015-02-12T22:13:07.000Z | 2022-03-11T05:45:53.000Z | # Copyright (c) 2016, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | 44.384615 | 77 | 0.729203 |
b2d845ee88f1442c6e590ab66b6d96df8c22450d | 35,761 | py | Python | models/networks.py | xijiali/BDBNet | e176be588652b1b4951d6f1eec6c434bae6a723b | [
"MIT"
] | null | null | null | models/networks.py | xijiali/BDBNet | e176be588652b1b4951d6f1eec6c434bae6a723b | [
"MIT"
] | null | null | null | models/networks.py | xijiali/BDBNet | e176be588652b1b4951d6f1eec6c434bae6a723b | [
"MIT"
] | null | null | null | # encoding: utf-8
import copy
import itertools
import numpy as np
import torch
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
import random
from scipy.spatial.distance import cdist
from sklearn.preprocessing import normalize
from torch import nn, optim
from torch.utils.data import dataloader... | 36.52809 | 105 | 0.583289 |
b965fe5b5a9dfae00bdef7fca597fcb55713e26e | 1,133 | py | Python | src/mnist_config.py | kppw99/UG_FedAVG | 61f6fcfedfed1136b19c12a6603231cda884e22f | [
"MIT"
] | 3 | 2021-09-23T02:10:17.000Z | 2022-01-16T03:38:34.000Z | src/mnist_config.py | kppw99/Uncert_FedAVG | 61f6fcfedfed1136b19c12a6603231cda884e22f | [
"MIT"
] | 1 | 2022-02-25T08:03:34.000Z | 2022-02-25T08:03:34.000Z | src/mnist_config.py | kppw99/Uncert_FedAVG | 61f6fcfedfed1136b19c12a6603231cda884e22f | [
"MIT"
] | 1 | 2022-02-23T11:49:25.000Z | 2022-02-23T11:49:25.000Z | # For MNIST Dataset
## COMMON #######################################
BATCH_SIZE = 64
NUM_OF_LOCAL = 10
COR_LOCAL_RATIO = 1.0
CENTRAL_EPOCHS = 50
PRE_TRAIN = True
UNCERT_FEDAVG_LIST = [0, 1, 2] # fl_origin=0, fl_with_pre_train=1, fl_with_uncertainty=2
COR_MODE_LIST = [0, 1, 2] # label_flipping=0, label_shuffling=1,... | 33.323529 | 89 | 0.517211 |
547c50b8459471dec84ec4893730cb7068fc2ab9 | 3,601 | py | Python | awwardsApp/models.py | derrickmacharia/Awwards | 3e07d6e78ba1628fc087e0f865f7930e39891d11 | [
"MIT"
] | null | null | null | awwardsApp/models.py | derrickmacharia/Awwards | 3e07d6e78ba1628fc087e0f865f7930e39891d11 | [
"MIT"
] | null | null | null | awwardsApp/models.py | derrickmacharia/Awwards | 3e07d6e78ba1628fc087e0f865f7930e39891d11 | [
"MIT"
] | null | null | null | from django.db import models
from cloudinary.models import CloudinaryField
import datetime as dt
from django.contrib.auth.models import User
from django.db.models.deletion import CASCADE
from django.db.models.fields import related
# Create your models here.
class Category(models.Model):
name = models.CharField(max... | 27.280303 | 94 | 0.6787 |
9c42ebb57a1bc38f21fbf4b40f771fcda30e72e7 | 4,033 | py | Python | 01-insert_to_mysql/03-drug.py | rionbr/DDIIndy | 63737cd05e92f496e7fa51fecc1c7542edba1f2e | [
"MIT"
] | null | null | null | 01-insert_to_mysql/03-drug.py | rionbr/DDIIndy | 63737cd05e92f496e7fa51fecc1c7542edba1f2e | [
"MIT"
] | null | null | null | 01-insert_to_mysql/03-drug.py | rionbr/DDIIndy | 63737cd05e92f496e7fa51fecc1c7542edba1f2e | [
"MIT"
] | null | null | null | # coding=utf-8
# Author: Rion B Correia
# Date: April 01, 2020
#
# Description:
# Parses the DrugBank XML and load drugs to MySQL.
#
import configparser
import pandas as pd
pd.set_option('display.max_rows', 50)
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
import sqlalchemy
from sqlalch... | 30.55303 | 112 | 0.606496 |
03b261badc573678fc4b923433420521eafca0bd | 1,926 | py | Python | robot/lib/pgm_utils.py | BrightBurningPark/Naruda-office_support_robot | 0204fcb1dfac79eb7e03ac6b98bbd7ab34ab9608 | [
"MIT"
] | 1 | 2019-05-17T22:35:49.000Z | 2019-05-17T22:35:49.000Z | robot/lib/pgm_utils.py | BrightBurningPark/Naruda-office_support_robot | 0204fcb1dfac79eb7e03ac6b98bbd7ab34ab9608 | [
"MIT"
] | 4 | 2020-02-14T23:47:33.000Z | 2021-05-08T21:00:04.000Z | robot/lib/pgm_utils.py | BrightBurningPark/Naruda-office_support_robot | 0204fcb1dfac79eb7e03ac6b98bbd7ab34ab9608 | [
"MIT"
] | null | null | null | '''
pgm_utils.py : Python utilties for PGM files
Copyright (C) 2014 Simon D. Levy
This code is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your opti... | 25.68 | 73 | 0.606957 |
f7d77ab05f40c57917f893daf6c73925e081409f | 217 | py | Python | examples/optimizers/misc/create_doa.py | anukaal/opytimizer | 5f1ccc0da80e6a4cabd99578fa24cf4f6466f9b9 | [
"Apache-2.0"
] | 528 | 2018-10-01T20:00:09.000Z | 2022-03-27T11:15:31.000Z | examples/optimizers/misc/create_doa.py | anukaal/opytimizer | 5f1ccc0da80e6a4cabd99578fa24cf4f6466f9b9 | [
"Apache-2.0"
] | 17 | 2019-10-30T00:47:03.000Z | 2022-03-21T11:39:28.000Z | examples/optimizers/misc/create_doa.py | anukaal/opytimizer | 5f1ccc0da80e6a4cabd99578fa24cf4f6466f9b9 | [
"Apache-2.0"
] | 35 | 2018-10-01T20:03:23.000Z | 2022-03-20T03:54:15.000Z | from opytimizer.optimizers.misc import DOA
# One should declare a hyperparameters object based
# on the desired algorithm that will be used
params = {
'r': 1.0
}
# Creates a DOA optimizer
o = DOA(params=params)
| 19.727273 | 51 | 0.737327 |
e9e41610c66bcbf73a241051894bfafac78d053b | 13,217 | py | Python | miniserver_gateway/connectors/shelly/clients/coap.py | FastyBird/miniserver-gateway | 22b880ad578eb6af5522cf8207311959175bfafd | [
"Apache-2.0"
] | null | null | null | miniserver_gateway/connectors/shelly/clients/coap.py | FastyBird/miniserver-gateway | 22b880ad578eb6af5522cf8207311959175bfafd | [
"Apache-2.0"
] | 1 | 2021-07-26T22:39:12.000Z | 2021-07-26T22:39:12.000Z | miniserver_gateway/connectors/shelly/clients/coap.py | FastyBird/miniserver-gateway | 22b880ad578eb6af5522cf8207311959175bfafd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# Copyright 2021. FastyBird s.r.o.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 32.158151 | 110 | 0.420292 |
2c53d9dc74b2df2abefae7400b418409ecb73f29 | 3,687 | py | Python | src/clean_align/08_mkdataset.py | shyyhs/CourseraParallelCorpusMining | da533d3c66b0d2b22de694965e31a95890c000f3 | [
"Apache-2.0"
] | 4 | 2019-12-11T12:05:58.000Z | 2022-03-22T17:58:27.000Z | src/clean_align/08_mkdataset.py | shyyhs/CourseraParallelCorpusMining | da533d3c66b0d2b22de694965e31a95890c000f3 | [
"Apache-2.0"
] | null | null | null | src/clean_align/08_mkdataset.py | shyyhs/CourseraParallelCorpusMining | da533d3c66b0d2b22de694965e31a95890c000f3 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import glob
from os.path import basename, dirname
lang1 = "en"
lang2 = "ja"
ids_folder = "./06_ids"
cleaned_folder = "./07_parallel_by_ids"
train_folder = "./08_mkdataset/train"
train_lst = "./08_mkdataset/train_lst.txt"
combined_folder = "./08_mkdataset/combine"
analysis_file = "./08_mkdataset... | 29.261905 | 72 | 0.621915 |
59532724b4184fc0528b8a96dd2f46abf609409b | 1,508 | py | Python | openstack/network/v2/service_profile.py | horion/openstacksdk | cbb0e12e1dc944847f2ba0e67bf35b9c7a67b3a3 | [
"Apache-2.0"
] | 99 | 2018-03-28T15:41:45.000Z | 2022-01-23T17:22:13.000Z | openstack/network/v2/service_profile.py | horion/openstacksdk | cbb0e12e1dc944847f2ba0e67bf35b9c7a67b3a3 | [
"Apache-2.0"
] | 5 | 2018-05-25T16:54:23.000Z | 2021-11-21T02:27:16.000Z | openstack/network/v2/service_profile.py | horion/openstacksdk | cbb0e12e1dc944847f2ba0e67bf35b9c7a67b3a3 | [
"Apache-2.0"
] | 104 | 2018-04-06T14:33:54.000Z | 2022-03-01T01:58:09.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 32.782609 | 75 | 0.71817 |
0032458dff48583970881f5e275fc2afd35718e7 | 2,556 | py | Python | services/dy-dash/cc-rabbit-1d/tools/update_compose_labels.py | GitHK/osparc-services-forked | a8ab08ff7c32de8f1abde015c1515e8cf61426c0 | [
"MIT"
] | 2 | 2019-08-16T16:54:48.000Z | 2020-06-10T05:50:35.000Z | services/dy-dash/cc-rabbit-1d/tools/update_compose_labels.py | GitHK/osparc-services-forked | a8ab08ff7c32de8f1abde015c1515e8cf61426c0 | [
"MIT"
] | 63 | 2019-07-04T07:03:42.000Z | 2022-02-09T18:03:55.000Z | services/dy-dash/cc-rabbit-1d/tools/update_compose_labels.py | GitHK/osparc-services-forked | a8ab08ff7c32de8f1abde015c1515e8cf61426c0 | [
"MIT"
] | 9 | 2019-04-17T07:11:10.000Z | 2020-06-03T13:42:58.000Z | #!/bin/python
""" Update a docker-compose file with json files in a path
Usage: python update_compose_labels --c docker-compose.yml -f folder/path
:return: error code
"""
import argparse
import json
import logging
import sys
from enum import IntEnum
from pathlib import Path
from typing import Dict
import yaml
... | 30.795181 | 121 | 0.6741 |
855f9a28e4483df78bec364462823af2fe0ffc18 | 907 | py | Python | doc/python_api/examples/gpu.5.py | juangea/B28_boneMaster | 6be9d19951ed460829d379aa90953b14a9f281f2 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 116 | 2015-11-02T16:36:53.000Z | 2021-06-08T20:36:18.000Z | doc/python_api/examples/gpu.5.py | juangea/B28_boneMaster | 6be9d19951ed460829d379aa90953b14a9f281f2 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 39 | 2016-04-25T12:18:34.000Z | 2021-03-01T19:06:36.000Z | doc/python_api/examples/gpu.5.py | juangea/B28_boneMaster | 6be9d19951ed460829d379aa90953b14a9f281f2 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 19 | 2016-01-24T14:24:00.000Z | 2020-07-19T05:26:24.000Z | """
Mesh with Random Vertex Colors
------------------------------
"""
import bpy
import gpu
import numpy as np
from random import random
from gpu_extras.batch import batch_for_shader
mesh = bpy.context.active_object.data
mesh.calc_loop_triangles()
vertices = np.empty((len(mesh.vertices), 3), 'f')
indices = np.empty((... | 24.513514 | 86 | 0.692393 |
8e909ca838896df5b18379ffccb263d5e79aef36 | 302 | py | Python | src/main.py | MiguelReuter/Volley-ball-game | 67d830cc528f3540b236d8191f582adb1827dbde | [
"MIT"
] | 4 | 2019-04-15T20:39:29.000Z | 2022-02-04T10:51:37.000Z | src/main.py | MiguelReuter/Volley-ball-game | 67d830cc528f3540b236d8191f582adb1827dbde | [
"MIT"
] | null | null | null | src/main.py | MiguelReuter/Volley-ball-game | 67d830cc528f3540b236d8191f582adb1827dbde | [
"MIT"
] | 1 | 2019-11-30T01:05:29.000Z | 2019-11-30T01:05:29.000Z | # encoding : UTF8
from os import environ
environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1' # disable welcome message from pygame
import pygame
from Engine import GameEngine
if __name__ == "__main__":
pygame.init()
game_engine = GameEngine()
game_engine.run()
pygame.display.quit()
pygame.quit()
| 16.777778 | 82 | 0.741722 |
151eba8a4e41cfcc64758662458e195a8c99bc9b | 1,217 | py | Python | serializeObjects.py | UPRM-Moonbuggy-Telemetry/OnBoard-Scripts | 5b383d6b9fc034fec682c1407f867e0a29a6276e | [
"MIT"
] | 2 | 2020-02-10T15:46:02.000Z | 2020-02-27T06:28:24.000Z | serializeObjects.py | UPRM-Moonbuggy-Telemetry/OnBoard-Scripts | 5b383d6b9fc034fec682c1407f867e0a29a6276e | [
"MIT"
] | 15 | 2019-03-01T17:46:35.000Z | 2021-02-02T15:51:17.000Z | serializeObjects.py | UPRM-Moonbuggy-Telemetry/OnBoard-Scripts | 5b383d6b9fc034fec682c1407f867e0a29a6276e | [
"MIT"
] | 6 | 2019-02-13T19:22:54.000Z | 2020-02-19T22:30:39.000Z | import json
from serial import Serial
from datetime import datetime
from radiodata.radiodata import RadioData
from radio_to_csv.csv_script_test import generate_random_positions, generate_random_data
from env_variables import BUGGY_ID, SEND_JSON_PORT, BAUDRATE
# import serial.tools.list_ports as ports
def get_buggy_... | 28.97619 | 103 | 0.709121 |
d65431df67f6c133d2799ea36563c04a4be2cbb3 | 610 | py | Python | dbaas/physical/admin/engine.py | jaeko44/python_dbaas | 4fafa4ad70200fec1436c326c751761922ec9fa8 | [
"BSD-3-Clause"
] | null | null | null | dbaas/physical/admin/engine.py | jaeko44/python_dbaas | 4fafa4ad70200fec1436c326c751761922ec9fa8 | [
"BSD-3-Clause"
] | null | null | null | dbaas/physical/admin/engine.py | jaeko44/python_dbaas | 4fafa4ad70200fec1436c326c751761922ec9fa8 | [
"BSD-3-Clause"
] | 1 | 2017-07-02T08:46:17.000Z | 2017-07-02T08:46:17.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..service.engine import EngineService
class EngineAdmin(admin.DjangoServicesAdmin):
service_class = EngineService
search_fields = ("engine_type__name",)
list_display = ("engine_type", "v... | 33.888889 | 72 | 0.722951 |
2f23e546b322fb4ac3418dacff63ff17091aedbf | 1,954 | py | Python | synth.py | pmakani/java-asset | 1790e4ee8945333f1f2cd23f6b74c9bbd885b74b | [
"Apache-2.0"
] | null | null | null | synth.py | pmakani/java-asset | 1790e4ee8945333f1f2cd23f6b74c9bbd885b74b | [
"Apache-2.0"
] | null | null | null | synth.py | pmakani/java-asset | 1790e4ee8945333f1f2cd23f6b74c9bbd885b74b | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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 or agreed to in writing, s... | 39.08 | 112 | 0.743091 |
6693659e576b15d8b6c34891af665e0bc1df6373 | 13,469 | py | Python | api/resources/resources.py | p3t3r67x0/mail_api | 3eed7c1c7d12b2a9692f8acb3fa26d39666799a5 | [
"MIT"
] | null | null | null | api/resources/resources.py | p3t3r67x0/mail_api | 3eed7c1c7d12b2a9692f8acb3fa26d39666799a5 | [
"MIT"
] | 3 | 2021-03-10T13:02:04.000Z | 2022-01-22T11:20:11.000Z | api/resources/resources.py | p3t3r67x0/mail_api | 3eed7c1c7d12b2a9692f8acb3fa26d39666799a5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from datetime import datetime, timedelta
from sqlalchemy.exc import IntegrityError
from flask import jsonify, request, g
from flask_restful import Resource, reqparse, inputs
from flask_jwt_extended import create_access_token, create_refresh_token, jwt_required, jwt_refresh_token_required, get_j... | 37.310249 | 159 | 0.628406 |
ce16fdfdea34121b6d82755e7b3c89ed3d769939 | 413 | py | Python | data/tag.py | Ultra03/BottyMcBotface | 40226c1bdf2d05ff7835101f7a8a389828ec70b0 | [
"MIT"
] | null | null | null | data/tag.py | Ultra03/BottyMcBotface | 40226c1bdf2d05ff7835101f7a8a389828ec70b0 | [
"MIT"
] | null | null | null | data/tag.py | Ultra03/BottyMcBotface | 40226c1bdf2d05ff7835101f7a8a389828ec70b0 | [
"MIT"
] | null | null | null | import mongoengine
from datetime import datetime
class Tag(mongoengine.EmbeddedDocument):
name = mongoengine.StringField(required=True)
content = mongoengine.StringField(required=True)
added_by_tag = mongoengine.StringField()
added_by_id = mongoengine.IntField()
added_date = mongoen... | 37.545455 | 66 | 0.748184 |
252963ed569f9fd137b06ad4bc6c0646065b8115 | 2,643 | py | Python | ankisync2/util.py | sosie-js/ankisync2 | a41580197eab7f180f02a38a4aa912eb54cfaa93 | [
"MIT"
] | 39 | 2020-02-12T23:41:24.000Z | 2022-02-28T15:46:23.000Z | ankisync2/util.py | sosie-js/ankisync2 | a41580197eab7f180f02a38a4aa912eb54cfaa93 | [
"MIT"
] | 9 | 2019-08-02T18:25:07.000Z | 2022-02-07T23:14:43.000Z | ankisync2/util.py | sosie-js/ankisync2 | a41580197eab7f180f02a38a4aa912eb54cfaa93 | [
"MIT"
] | 6 | 2019-09-09T14:27:48.000Z | 2021-08-31T08:13:00.000Z | from hashlib import sha1
import re
from html.entities import name2codepoint
import dataclasses, json
def checksum(data):
if isinstance(data, str):
data = data.encode("utf-8")
return sha1(data).hexdigest()
def field_checksum(data):
# 32 bit unsigned number from first 8 digits of sha1 hash
ret... | 25.911765 | 81 | 0.523269 |
6e658d42c99a5ad753635045b98ee0c2d2b1d40a | 658 | py | Python | dbReports/iondb/security/admin.py | konradotto/TS | bf088bd8432b1e3f4b8c8c083650a30d9ef2ae2e | [
"Apache-2.0"
] | 125 | 2015-01-22T05:43:23.000Z | 2022-03-22T17:15:59.000Z | dbReports/iondb/security/admin.py | konradotto/TS | bf088bd8432b1e3f4b8c8c083650a30d9ef2ae2e | [
"Apache-2.0"
] | 59 | 2015-02-10T09:13:06.000Z | 2021-11-11T02:32:38.000Z | dbReports/iondb/security/admin.py | konradotto/TS | bf088bd8432b1e3f4b8c8c083650a30d9ef2ae2e | [
"Apache-2.0"
] | 98 | 2015-01-17T01:25:10.000Z | 2022-03-18T17:29:42.000Z | # Copyright (C) 2017 Ion Torrent Systems, Inc. All Rights Reserved
from __future__ import absolute_import
from iondb.security.models import SecureString
from django.contrib import admin
import logging
logger = logging.getLogger(__name__)
class SecureStringAdmin(admin.ModelAdmin):
"""Admin interface for """
... | 25.307692 | 66 | 0.726444 |
f99236a7784e88b8f4aff822855f1ac8ff870971 | 7,255 | py | Python | venv/lib/python3.6/site-packages/django/conf/__init__.py | xiegudong45/typeidea | db6504a232d120d6ffa185730bd35b9b9ecffa6c | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | venv/lib/python3.6/site-packages/django/conf/__init__.py | xiegudong45/typeidea | db6504a232d120d6ffa185730bd35b9b9ecffa6c | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | virtual/lib/python3.6/site-packages/django/conf/__init__.py | ngishjonathan/gallery | dd67f28887316d6277927c667f6641d26317b0b8 | [
"MIT"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import importlib
import os
import time
from django.conf import... | 35.915842 | 102 | 0.634459 |
b1f23b8a80b76786ccc75fe1c7999cfb96358df5 | 5,107 | py | Python | tools/visualization.py | cwiep/query-by-online-handwriting | d38178b1c558f11f6bc2bae2840737fb6c8ea89a | [
"Apache-2.0"
] | 3 | 2016-09-29T08:28:23.000Z | 2022-01-24T17:19:38.000Z | tools/visualization.py | cwiep/query-by-online-handwriting | d38178b1c558f11f6bc2bae2840737fb6c8ea89a | [
"Apache-2.0"
] | null | null | null | tools/visualization.py | cwiep/query-by-online-handwriting | d38178b1c558f11f6bc2bae2840737fb6c8ea89a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Christian Wieprecht
@license: Apache License, Version 2.0
"""
import numpy as np
from matplotlib.patches import Circle, Rectangle
from matplotlib.lines import Line2D
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from scipy.stats import linregress
def visualize_descrip... | 39.284615 | 120 | 0.579205 |
ca1732ac4eaea6eda4fd472fb701ee0b11426251 | 1,684 | py | Python | setup.py | MichaelAquilina/jmespath.py | b530ae5b56cf26965ef8a569a47badbcfc089bd3 | [
"MIT"
] | null | null | null | setup.py | MichaelAquilina/jmespath.py | b530ae5b56cf26965ef8a569a47badbcfc089bd3 | [
"MIT"
] | 1 | 2021-04-20T21:17:16.000Z | 2021-04-20T21:17:16.000Z | setup.py | MichaelAquilina/jmespath.py | b530ae5b56cf26965ef8a569a47badbcfc089bd3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import io
import sys
import warnings
from setuptools import setup, find_packages
if sys.version_info[:2] <= (2, 6) or ((3, 0) <= sys.version_info[:2] <= (3, 3)):
python_ver = '.'.join(str(x) for x in sys.version_info[:3])
warnings.warn(
'You are using Python {0}, which will no... | 33.68 | 80 | 0.603919 |
5a86eb624428e6116de4d3ea21e83072be52786a | 1,552 | py | Python | layers/modules/classify_loss.py | DerekRay/2020-instanceSeg | a08ad95e64726db53cc32a5f90aaa13ae3cdb6a3 | [
"MIT"
] | 25 | 2020-11-03T03:03:03.000Z | 2021-12-19T08:08:46.000Z | layers/modules/classify_loss.py | DerekRay/2020-instanceSeg | a08ad95e64726db53cc32a5f90aaa13ae3cdb6a3 | [
"MIT"
] | 5 | 2020-11-03T07:34:09.000Z | 2022-02-03T03:12:53.000Z | layers/modules/classify_loss.py | DerekRay/2020-instanceSeg | a08ad95e64726db53cc32a5f90aaa13ae3cdb6a3 | [
"MIT"
] | 7 | 2020-11-15T13:07:46.000Z | 2022-01-20T03:29:11.000Z | import torch.nn.functional as F
from torch import nn
class CrossEntropyLoss(nn.Module):
def __init__(self, weight=None, ignore_index=255, reduction='mean'):
''' NLLLoss: negative log likelihood loss.
# nll_loss: weights: None | a tensor of size C
pred in [N, C, d1, d2, .... | 37.853659 | 106 | 0.597938 |
6f17656dce1a19e07cd9c6dcf92ceea39bdeae64 | 6,560 | py | Python | cup/net/__init__.py | ice1995/CUP | 4075c921085cd2fa9235c57cfec5c21f2a734bdf | [
"Apache-2.0"
] | null | null | null | cup/net/__init__.py | ice1995/CUP | 4075c921085cd2fa9235c57cfec5c21f2a734bdf | [
"Apache-2.0"
] | null | null | null | cup/net/__init__.py | ice1995/CUP | 4075c921085cd2fa9235c57cfec5c21f2a734bdf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: [CUP] - See LICENSE for details.
"""
:description:
network related module
"""
from __future__ import print_function
import os
import sys
import time
import socket
import struct
import warnings
try:
import fcntl
except ImportError as error:
# 'Seems r... | 26.24 | 80 | 0.621951 |
e312e4353d3a7eb0dbe88c85c1603c835c60cea9 | 996 | py | Python | leetcode.com/python/373_Find_K_Pairs_with_Smallest_Sums.py | vansh-tiwari/coding-interview-gym | 68345725dee0007f52b7ea3550adda35ddcf1955 | [
"MIT"
] | 713 | 2019-11-19T16:11:25.000Z | 2022-03-31T02:27:52.000Z | leetcode.com/python/373_Find_K_Pairs_with_Smallest_Sums.py | arunsank/coding-interview-gym | 8131e3a82795707e144fe55d765b6c15bdb97306 | [
"MIT"
] | 7 | 2020-01-16T17:07:18.000Z | 2021-11-15T18:24:39.000Z | leetcode.com/python/373_Find_K_Pairs_with_Smallest_Sums.py | arunsank/coding-interview-gym | 8131e3a82795707e144fe55d765b6c15bdb97306 | [
"MIT"
] | 393 | 2019-11-18T17:55:45.000Z | 2022-03-28T20:26:32.000Z | import heapq
class Solution(object):
def kSmallestPairs(self, nums1, nums2, k):
"""
:type nums1: List[int]
:type nums2: List[int]
:type k: int
:rtype: List[List[int]]
"""
maxHeap = []
for nums1Idx in range(min(k, len(nums1))):
for nums2Id... | 34.344828 | 86 | 0.516064 |
df6e019915b50fde28945f9de7ac138cc30f615c | 1,253 | py | Python | utils/migrations/0006_auto_20200626_2340.py | schiederme/peering-manager | 2d29427fd4f2b91a5208f31e1a7ad69eaf82924c | [
"Apache-2.0"
] | null | null | null | utils/migrations/0006_auto_20200626_2340.py | schiederme/peering-manager | 2d29427fd4f2b91a5208f31e1a7ad69eaf82924c | [
"Apache-2.0"
] | 8 | 2022-03-02T20:47:24.000Z | 2022-03-28T23:23:49.000Z | utils/migrations/0006_auto_20200626_2340.py | schiederme/peering-manager | 2d29427fd4f2b91a5208f31e1a7ad69eaf82924c | [
"Apache-2.0"
] | 1 | 2021-01-25T01:58:22.000Z | 2021-01-25T01:58:22.000Z | # Generated by Django 3.0.7 on 2020-06-26 21:40
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("contenttypes", "0002_remove_content_type_name"),
("utils", "0005_tag_taggeditem"),
]
operations = [
... | 30.560976 | 85 | 0.581006 |
990ae3497a25a4c17fb373f653990d791cc6237a | 1,032 | py | Python | ceph_report/__init__.py | Mirantis/ceph-monitoring | 2de4a90fb102337606732a46a382505047bfa1aa | [
"Apache-2.0"
] | 5 | 2016-09-19T10:42:15.000Z | 2018-09-05T11:18:03.000Z | ceph_report/__init__.py | Mirantis/ceph-monitoring | 2de4a90fb102337606732a46a382505047bfa1aa | [
"Apache-2.0"
] | 2 | 2016-10-18T09:15:19.000Z | 2018-03-21T10:24:54.000Z | ceph_report/__init__.py | Mirantis/ceph-monitoring | 2de4a90fb102337606732a46a382505047bfa1aa | [
"Apache-2.0"
] | 9 | 2016-10-17T13:20:01.000Z | 2019-01-09T14:33:48.000Z | import json
import logging.config
from pathlib import Path
from typing import Optional
files_folder = Path(__file__).resolve().parent.parent / 'ceph_report_files'
def get_file(name: str) -> Path:
return files_folder / name
def setup_logging(log_config_file: Path, log_level: str, out_folder: Optional[Path], pe... | 27.891892 | 115 | 0.686047 |
1ce9c4aa8ed052e3d7eb7aeba4fc298f4c7a1169 | 6,821 | py | Python | packaging/setup/plugins/ovirt-engine-common/ovirt-engine/db/connection.py | dangel101/ovirt-engine | 47bfc7ebc5de447ab457cca2dc03ed936203c1d1 | [
"Apache-2.0"
] | null | null | null | packaging/setup/plugins/ovirt-engine-common/ovirt-engine/db/connection.py | dangel101/ovirt-engine | 47bfc7ebc5de447ab457cca2dc03ed936203c1d1 | [
"Apache-2.0"
] | null | null | null | packaging/setup/plugins/ovirt-engine-common/ovirt-engine/db/connection.py | dangel101/ovirt-engine | 47bfc7ebc5de447ab457cca2dc03ed936203c1d1 | [
"Apache-2.0"
] | null | null | null | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2015 Red Hat, 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
#
# Unl... | 35.159794 | 77 | 0.579974 |
d96f0d6fa30ff8a61e0edcfc9b89335efe97364a | 9,653 | py | Python | webterminal/consumers.py | kevindwei/adminset | 5045704d2a042f647396ca191700e00dd9618663 | [
"Apache-2.0"
] | null | null | null | webterminal/consumers.py | kevindwei/adminset | 5045704d2a042f647396ca191700e00dd9618663 | [
"Apache-2.0"
] | 1 | 2018-04-26T03:08:24.000Z | 2018-04-26T03:50:47.000Z | webterminal/consumers.py | kevindwei/adminset | 5045704d2a042f647396ca191700e00dd9618663 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import paramiko
import socket
from channels.generic.websockets import WebsocketConsumer
try:
import simplejson as json
except ImportError:
import json
from webterminal.interactive import interactive_shell,get_redis_instance,SshTerminalThread,InterActiveShellThread
import sys
from django.... | 45.966667 | 210 | 0.583031 |
4cd13db82f19a3e5e59d5b406a88d41a8e5f56f1 | 621 | py | Python | sanity-checking-pruning/utils/eval.py | MitchellX/Pruning | c1c0a094d7e427319da775bda4752bb2ddbd6ee8 | [
"MIT"
] | 38 | 2020-10-20T08:56:49.000Z | 2022-03-29T00:59:44.000Z | sanity-checking-pruning/utils/eval.py | MitchellX/Pruning | c1c0a094d7e427319da775bda4752bb2ddbd6ee8 | [
"MIT"
] | 1 | 2020-11-05T08:59:49.000Z | 2020-11-07T16:04:45.000Z | sanity-checking-pruning/utils/eval.py | MitchellX/Pruning | c1c0a094d7e427319da775bda4752bb2ddbd6ee8 | [
"MIT"
] | 5 | 2020-10-28T03:10:42.000Z | 2022-03-27T11:19:18.000Z | # ========== adopted from https://github.com/Eric-mingjie/rethinking-network-pruning ============
from __future__ import print_function, absolute_import
__all__ = ['accuracy']
def accuracy(output, target, topk=(1,)):
"""Computes the precision@k for the specified values of k"""
maxk = max(topk)
batch_size ... | 32.684211 | 97 | 0.63285 |
6343d726afdf768f8ed39f4e72a925633d976e0d | 2,421 | py | Python | VicBikeMap/settings/dev.py | amitra/BikeMaps | eb80eed2e3159ad9c4e46427a9f488e1221794fa | [
"MIT"
] | null | null | null | VicBikeMap/settings/dev.py | amitra/BikeMaps | eb80eed2e3159ad9c4e46427a9f488e1221794fa | [
"MIT"
] | null | null | null | VicBikeMap/settings/dev.py | amitra/BikeMaps | eb80eed2e3159ad9c4e46427a9f488e1221794fa | [
"MIT"
] | null | null | null | """
Django settings for VicBikeMap project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
from VicBikeMap.settings.base import *
import os
# SECURITY WARNING: k... | 25.21875 | 117 | 0.559686 |
cb85f27643621b68261c4bd2562e88e4c497f883 | 58,356 | py | Python | KiBuzzard/deps/svg2mod/svg2mod/svg2mod.py | HDR/KiBuzzard | b9e2cff0783b7cda9b8d68f2d2b5077b48d3a838 | [
"MIT"
] | 240 | 2021-01-11T14:49:24.000Z | 2022-03-29T22:33:49.000Z | KiBuzzard/deps/svg2mod/svg2mod/svg2mod.py | HDR/KiBuzzard | b9e2cff0783b7cda9b8d68f2d2b5077b48d3a838 | [
"MIT"
] | 77 | 2021-01-12T20:23:30.000Z | 2022-03-28T12:14:34.000Z | KiBuzzard/deps/svg2mod/svg2mod/svg2mod.py | HDR/KiBuzzard | b9e2cff0783b7cda9b8d68f2d2b5077b48d3a838 | [
"MIT"
] | 28 | 2021-01-17T05:44:11.000Z | 2022-01-11T19:58:46.000Z | # Copyright (C) 2021 -- svg2mod developers < GitHub.com / svg2mod >
# This program 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 2 of the License, or
# (at your option) any later version.
#
#... | 30.204969 | 149 | 0.468538 |
26ffd8285acca299b468603fe4daaeb53fe5df69 | 19,637 | py | Python | pyhecdss/pyhecdss.py | HenryDane/pyhecdss | 5f45e850297bab5f53dba7441bff59ad92f41758 | [
"MIT"
] | null | null | null | pyhecdss/pyhecdss.py | HenryDane/pyhecdss | 5f45e850297bab5f53dba7441bff59ad92f41758 | [
"MIT"
] | null | null | null | pyhecdss/pyhecdss.py | HenryDane/pyhecdss | 5f45e850297bab5f53dba7441bff59ad92f41758 | [
"MIT"
] | null | null | null | from . import pyheclib
import pandas as pd
import numpy as np
import os
import time
import warnings
# some static functions
def set_message_level(level):
"""
set the verbosity level of the HEC-DSS library
level ranges from "bort" only (level 0) to "internal" (level >10)
"""
pyheclib.hec_... | 45.667442 | 168 | 0.57356 |
71553b7312a690906a418b0153213bf7c02730b3 | 8,268 | py | Python | cfr/util.py | ghamarian/inference | 1711535ad84b0165d4be4a89d1a61af7fd2405a4 | [
"MIT"
] | null | null | null | cfr/util.py | ghamarian/inference | 1711535ad84b0165d4be4a89d1a61af7fd2405a4 | [
"MIT"
] | null | null | null | cfr/util.py | ghamarian/inference | 1711535ad84b0165d4be4a89d1a61af7fd2405a4 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import pandas as pd
SQRT_CONST = 1e-10
FLAGS = tf.app.flags.FLAGS
def validation_split(D_exp, val_fraction):
""" Construct a train/validation split """
n = D_exp['x'].shape[0]
if val_fraction > 0:
n_valid = int(val_fraction * n)
n_train = n - n... | 27.019608 | 117 | 0.548863 |
b7296d60d0273dec2289ca1b24db8633a88ee063 | 310 | py | Python | pycon_tw/simple_areas.py | NigrumAquila/py_checkio | df437c2c3ad325d84714665000e3299a70e91f32 | [
"MIT"
] | null | null | null | pycon_tw/simple_areas.py | NigrumAquila/py_checkio | df437c2c3ad325d84714665000e3299a70e91f32 | [
"MIT"
] | null | null | null | pycon_tw/simple_areas.py | NigrumAquila/py_checkio | df437c2c3ad325d84714665000e3299a70e91f32 | [
"MIT"
] | null | null | null | import math
def simple_areas(*args):
if len(args) == 3:
a = args[0]
b = args[1]
c = args[2]
p=(a+b+c)/2.0
return math.sqrt((p*(p-a)*(p-b)*(p-c))) #12*9*8*7
elif len(args) == 2:
return args[0]*args[1]
else:
return ((args[0]/2.0)**2)*math.pi
| 22.142857 | 58 | 0.454839 |
9985c50892b8695d997b52981225b0c7f6f88911 | 4,359 | py | Python | examples/api/tibrvcmlisten.py | arienchen/pytibrv | 9c198805bc9ac217e9a7f730d3c2dba32bf77336 | [
"BSD-3-Clause"
] | 12 | 2017-03-17T15:02:02.000Z | 2021-11-05T08:48:20.000Z | examples/api/tibrvcmlisten.py | arienchen/pytibrv | 9c198805bc9ac217e9a7f730d3c2dba32bf77336 | [
"BSD-3-Clause"
] | null | null | null | examples/api/tibrvcmlisten.py | arienchen/pytibrv | 9c198805bc9ac217e9a7f730d3c2dba32bf77336 | [
"BSD-3-Clause"
] | 6 | 2019-10-04T23:12:25.000Z | 2021-08-02T21:39:41.000Z | ##
# tibrvcmlisten.py - generic CM Rendezvous subscriber
#
# rewrite TIBRV example: tibrvcmlisten.c
#
# LAST MODIFIED: V1.0 2016-12-26 ARIEN arien.chen@gmail.com
#
import sys
import signal
import getopt
import time
from pytibrv.api import *
from pytibrv.status import *
from pytibrv.msg import *
from pytibrv.tport impor... | 26.101796 | 105 | 0.607938 |
78904411205d8c9a5a1b107b799044f962b8a54e | 1,664 | py | Python | configs/foveabox/fovea_r50_fpn_4x4_1x_coco.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | configs/foveabox/fovea_r50_fpn_4x4_1x_coco.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | configs/foveabox/fovea_r50_fpn_4x4_1x_coco.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../_base_/datasets/coco_detection.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
# model settings
model = dict(
type='FOVEA',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
froze... | 31.396226 | 80 | 0.554688 |
ec7a1fa84768f9c3a2181dd9d513416887e755d9 | 11,795 | pyw | Python | tools.pyw | arcandio/MDNovelTools | 1173009da386df6cd139b6ce95d806d1bf8440af | [
"MIT"
] | 1 | 2017-08-04T18:55:43.000Z | 2017-08-04T18:55:43.000Z | tools.pyw | arcandio/MDNovelTools | 1173009da386df6cd139b6ce95d806d1bf8440af | [
"MIT"
] | 17 | 2017-05-17T21:09:29.000Z | 2017-05-23T19:46:34.000Z | tools.pyw | arcandio/MDNovelTools | 1173009da386df6cd139b6ce95d806d1bf8440af | [
"MIT"
] | 1 | 2018-11-20T04:33:00.000Z | 2018-11-20T04:33:00.000Z | """
MD Novel Tools
tree view
http://www.tkdocs.com/tutorial/tree.html
https://docs.python.org/3/library/tkinter.ttk.html#tkinter.ttk.Treeview
https://docs.python.org/3/library/tkinter.html
http://www.tkdocs.com/tutorial/styles.html
-Double spaces in a target file
insert at position
-build
-build w... | 33.039216 | 101 | 0.561848 |
81b50d1e9ba3dfadf21d1059b3946e0f7a0e9bb5 | 12,813 | py | Python | src/simulator/__init__.py | mikepfrank/dynamic | 01581e5f671f3ab34eb5bec45c2cab508a1b6928 | [
"Unlicense"
] | 2 | 2019-01-25T07:18:56.000Z | 2021-12-18T05:16:40.000Z | src/simulator/__init__.py | mikepfrank/dynamic | 01581e5f671f3ab34eb5bec45c2cab508a1b6928 | [
"Unlicense"
] | null | null | null | src/simulator/__init__.py | mikepfrank/dynamic | 01581e5f671f3ab34eb5bec45c2cab508a1b6928 | [
"Unlicense"
] | null | null | null | #|==============================================================================
#| TOP OF FILE: simulator/__init__.py
#|------------------------------------------------------------------------------
#| The below module documentation string will be displayed by pydoc3.
#|vvvvvvvvvvvvvvvvvvvvvvvvvv... | 48.350943 | 87 | 0.532584 |
3b21b08954a70553f68d861e23bfa1018038397a | 4,753 | py | Python | mlflow/server/__init__.py | PeterSulcs/mlflow | 14c48e7bb1ca6cd6a3c1b249a486cd98bd5e7051 | [
"Apache-2.0"
] | 10,351 | 2018-07-31T02:52:49.000Z | 2022-03-31T23:33:13.000Z | mlflow/server/__init__.py | PeterSulcs/mlflow | 14c48e7bb1ca6cd6a3c1b249a486cd98bd5e7051 | [
"Apache-2.0"
] | 3,733 | 2018-07-31T01:38:51.000Z | 2022-03-31T23:56:25.000Z | mlflow/server/__init__.py | PeterSulcs/mlflow | 14c48e7bb1ca6cd6a3c1b249a486cd98bd5e7051 | [
"Apache-2.0"
] | 2,596 | 2018-07-31T06:38:39.000Z | 2022-03-31T23:56:32.000Z | import os
import shlex
import sys
import textwrap
from flask import Flask, send_from_directory, Response
from mlflow.server import handlers
from mlflow.server.handlers import (
get_artifact_handler,
STATIC_PREFIX_ENV_VAR,
_add_static_prefix,
get_model_version_artifact_handler,
)
from mlflow.utils.proc... | 34.194245 | 99 | 0.738271 |
f0b1a058c0fb8ea1902b35fdd585a44c34901f8b | 1,155 | py | Python | t/unit/utils/test_div.py | nlundquist/kombu | 483cadced77d82a6ecd0be553b91ce92f04f9617 | [
"BSD-3-Clause"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/kombu-4.3.0/t/unit/utils/test_div.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/kombu-4.3.0/t/unit/utils/test_div.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | from __future__ import absolute_import, unicode_literals
import pickle
from io import StringIO, BytesIO
from kombu.utils.div import emergency_dump_state
class MyStringIO(StringIO):
def close(self):
pass
class MyBytesIO(BytesIO):
def close(self):
pass
class test_emergency_dump_state:
... | 23.1 | 69 | 0.609524 |
04b5aa32ec75db3a9feacbc79a8273f48aeafff0 | 3,817 | py | Python | supertokens_python/recipe/emailverification/recipe_implementation.py | SKOOTUK/supertokens-python | c0751dd5af911835199223efbe5a91e7c1f1f954 | [
"Apache-2.0"
] | null | null | null | supertokens_python/recipe/emailverification/recipe_implementation.py | SKOOTUK/supertokens-python | c0751dd5af911835199223efbe5a91e7c1f1f954 | [
"Apache-2.0"
] | 3 | 2022-02-21T18:42:06.000Z | 2022-03-04T11:54:15.000Z | supertokens_python/recipe/emailverification/recipe_implementation.py | SKOOTUK/supertokens-python | c0751dd5af911835199223efbe5a91e7c1f1f954 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
#
# This software is licensed under the Apache License, Version 2.0 (the
# "License") as published by the Apache Software Foundation.
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at... | 44.905882 | 148 | 0.718103 |
f5d525ace743ca6bb9c445d6c8cf771e483c4559 | 65,959 | py | Python | src/main/python/org/broadinstitute/hellbender/gcnvkernel/models/model_denoising_calling.py | ericsong/gatk | a9230ee9a7dbcdf3346febf878ebf769f7437225 | [
"BSD-3-Clause"
] | 2 | 2020-11-05T22:15:12.000Z | 2021-12-18T17:18:59.000Z | src/main/python/org/broadinstitute/hellbender/gcnvkernel/models/model_denoising_calling.py | ericsong/gatk | a9230ee9a7dbcdf3346febf878ebf769f7437225 | [
"BSD-3-Clause"
] | null | null | null | src/main/python/org/broadinstitute/hellbender/gcnvkernel/models/model_denoising_calling.py | ericsong/gatk | a9230ee9a7dbcdf3346febf878ebf769f7437225 | [
"BSD-3-Clause"
] | 1 | 2021-12-27T10:14:15.000Z | 2021-12-27T10:14:15.000Z | import argparse
import collections
import inspect
import json
import logging
from abc import abstractmethod
from typing import List, Tuple, Set, Dict, Optional
import numpy as np
import pymc3 as pm
import scipy.sparse as sp
import theano as th
import theano.sparse as tst
import theano.tensor as tt
from pymc3 import No... | 51.93622 | 120 | 0.652436 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.