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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a889474da1674ff6d74e67cb38bb170c37f1149b | 22,552 | py | Python | tests/test_utils/test_generator.py | deepakunni3/biolinkml | ca3567a59297e585d7f384df9d5c0bc9fecdb0b7 | [
"CC0-1.0"
] | 25 | 2019-07-05T01:16:18.000Z | 2021-03-22T20:49:25.000Z | tests/test_utils/test_generator.py | deepakunni3/biolinkml | ca3567a59297e585d7f384df9d5c0bc9fecdb0b7 | [
"CC0-1.0"
] | 299 | 2019-03-05T15:15:30.000Z | 2021-04-08T23:25:41.000Z | tests/test_utils/test_generator.py | deepakunni3/biolinkml | ca3567a59297e585d7f384df9d5c0bc9fecdb0b7 | [
"CC0-1.0"
] | 19 | 2019-05-23T17:46:47.000Z | 2021-03-25T06:45:55.000Z | import logging
import os
import unittest
from io import StringIO
from pprint import pprint
from typing import Union, TextIO, cast
from biolinkml import LOCAL_METAMODEL_YAML_FILE
from biolinkml.meta import SchemaDefinition, ClassDefinition, SlotDefinition, TypeDefinition, SubsetDefinition, \
ElementName, SlotDefini... | 34.221548 | 119 | 0.580968 |
866ff0d306ca694141f7997cea233ebec27bb1cd | 295 | py | Python | utils/post_search.py | Ndirangug/music-cleaner_py | 366ee5e5033a235da87f2184cafbdfe1534da957 | [
"MIT"
] | 1 | 2021-02-22T21:22:49.000Z | 2021-02-22T21:22:49.000Z | utils/post_search.py | Ndirangug/music-cleaner_py | 366ee5e5033a235da87f2184cafbdfe1534da957 | [
"MIT"
] | null | null | null | utils/post_search.py | Ndirangug/music-cleaner_py | 366ee5e5033a235da87f2184cafbdfe1534da957 | [
"MIT"
] | null | null | null | from typing import List
from musicfile.musicfile import MusicFile
def on_success(success_list: List[MusicFile], music_file: MusicFile):
music_file.save_to_disk()
success_list.append(music_file)
def on_fail(fails_list: List[MusicFile], music_file):
fails_list.append(music_file)
| 22.692308 | 69 | 0.789831 |
3dc92cca2247e677ef75ebaea4512a7795b169a9 | 627 | py | Python | doc/examples/produce_consume.py | mcieslik-mctp/papy | 708e50827b5db46bbea081982cb74b9b0e464064 | [
"MIT"
] | 23 | 2015-01-12T10:28:48.000Z | 2020-05-09T20:50:26.000Z | doc/examples/produce_consume.py | mcieslik-mctp/papy | 708e50827b5db46bbea081982cb74b9b0e464064 | [
"MIT"
] | null | null | null | doc/examples/produce_consume.py | mcieslik-mctp/papy | 708e50827b5db46bbea081982cb74b9b0e464064 | [
"MIT"
] | 11 | 2015-02-05T05:56:19.000Z | 2019-05-18T08:17:27.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from papy.core import Piper
def l33t(inbox):
word = inbox[0]
leet_yuk = (word.replace('e', '3').replace('o', '0'), 'yuk')
print "I'll produce: %s and %s" % leet_yuk
return leet_yuk
def noyuk(inbox):
print "I got 2 words and 2 yuks: %s" % inbox
word... | 22.392857 | 64 | 0.649123 |
96625ac671b15033d13bf0bee527f01cc289622c | 14,676 | py | Python | tensorflow_addons/text/tests/crf_test.py | AchilleMascia/addons | c946906946b537b007f65977e9284fb474465468 | [
"Apache-2.0"
] | 1 | 2021-06-08T05:44:30.000Z | 2021-06-08T05:44:30.000Z | tensorflow_addons/text/tests/crf_test.py | Ankur3107/addons | af6866a2e6d9ddbc79d612d7cb04a8a5befe4a47 | [
"Apache-2.0"
] | null | null | null | tensorflow_addons/text/tests/crf_test.py | Ankur3107/addons | af6866a2e6d9ddbc79d612d7cb04a8a5befe4a47 | [
"Apache-2.0"
] | 1 | 2021-09-24T05:10:28.000Z | 2021-09-24T05:10:28.000Z | # Copyright 2019 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... | 39.880435 | 88 | 0.647315 |
7912c6eec12c5c34027995840199f9afc72b3f79 | 196,943 | py | Python | venv/lib/python3.9/site-packages/google/cloud/videointelligence_v1/proto/video_intelligence_pb2.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.9/site-packages/google/cloud/videointelligence_v1/proto/video_intelligence_pb2.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.9/site-packages/google/cloud/videointelligence_v1/proto/video_intelligence_pb2.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/videointelligence_v1/proto/video_intelligence.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.pro... | 36.169513 | 14,099 | 0.642526 |
21191feb118a63e5718459cf76044665d8942b15 | 9,282 | py | Python | plot_adj.py | RICE-EIC/GCoD | 6633859513e56b8843c4d6486e214364a0a4c74c | [
"Apache-2.0"
] | 3 | 2022-03-30T22:49:55.000Z | 2022-03-31T15:30:32.000Z | plot_adj.py | RICE-EIC/GCoD | 6633859513e56b8843c4d6486e214364a0a4c74c | [
"Apache-2.0"
] | null | null | null | plot_adj.py | RICE-EIC/GCoD | 6633859513e56b8843c4d6486e214364a0a4c74c | [
"Apache-2.0"
] | null | null | null | import os
import torch
import argparse
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from get_boundary import my_get_bd
from torch_geometric.datasets import Planetoid
import torch_geometric.transforms as T
from torch_sparse import SparseTensor
device = torch.device("cpu")
def mySaveFig(pltm,fntm... | 39 | 132 | 0.59513 |
124df925449936b4b5de7ada87848cd7b5653b17 | 13,583 | py | Python | strawberry/field.py | Aadityajoshi151/strawberry | d4ba2647bfb0cbfc78ae35c2d29237fc5bb59f49 | [
"MIT"
] | null | null | null | strawberry/field.py | Aadityajoshi151/strawberry | d4ba2647bfb0cbfc78ae35c2d29237fc5bb59f49 | [
"MIT"
] | null | null | null | strawberry/field.py | Aadityajoshi151/strawberry | d4ba2647bfb0cbfc78ae35c2d29237fc5bb59f49 | [
"MIT"
] | null | null | null | import builtins
import dataclasses
import inspect
import sys
from typing import (
TYPE_CHECKING,
Any,
Awaitable,
Callable,
Dict,
List,
Mapping,
Optional,
Sequence,
Type,
TypeVar,
Union,
overload,
)
from backports.cached_property import cached_property # type: ignore... | 33.291667 | 117 | 0.644482 |
c4760e87e8d189ba578893cefdbfacb88f41477d | 1,835 | py | Python | setup.py | moonryul/fastai-v0.7 | e94bbbec1e07ebb2e59194d1fd564e2a98315123 | [
"Apache-2.0"
] | null | null | null | setup.py | moonryul/fastai-v0.7 | e94bbbec1e07ebb2e59194d1fd564e2a98315123 | [
"Apache-2.0"
] | null | null | null | setup.py | moonryul/fastai-v0.7 | e94bbbec1e07ebb2e59194d1fd564e2a98315123 | [
"Apache-2.0"
] | null | null | null |
# coding: utf-8
""" Setup script for installing fastai """
#from distutils.core import setup
from setuptools import setup
setup(
name = "fastai",
packages = ['fastai', 'fastai/models', 'fastai/models/cifar10'],
version = '0.7.0',
description = "The fastai deep learning and machine learning library."... | 47.051282 | 172 | 0.643597 |
fd7845ff6aa611d6f179050a7844576f08bfd56a | 5,442 | py | Python | saltlint/cli.py | mjtrangoni/salt-lint | 79dce3cc061c7a2358b33118906bf39bf43213d5 | [
"MIT"
] | null | null | null | saltlint/cli.py | mjtrangoni/salt-lint | 79dce3cc061c7a2358b33118906bf39bf43213d5 | [
"MIT"
] | null | null | null | saltlint/cli.py | mjtrangoni/salt-lint | 79dce3cc061c7a2358b33118906bf39bf43213d5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
# Modified work Copyright (c) 2019 Warpnet B.V.
from __future__ import print_function
import optparse
import os
import sys
import tempfile
import codecs
from saltlint import formatters, NAME, VERSION
from saltlint.config import SaltLin... | 38.871429 | 96 | 0.596656 |
3905bb1c75b98574dd9dc393ecef12ead1ea32f2 | 874 | py | Python | .history/ClassFiles/deluxe_ice_cream_truck_20210617190551.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/deluxe_ice_cream_truck_20210617190551.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/deluxe_ice_cream_truck_20210617190551.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null |
from sympy import real_root
class Icecream:
max_scoops = 3
def __init__(self):
self.scoops = 0
def eat(self, scoops):
if self.scoops < scoops:
print("Not enough bites left!")
else:
self.scoops -= scoops
def add(self, scoops):
self.scoops +... | 19 | 56 | 0.583524 |
2e5a6336549e5d9ddff132b6bc381a7b6c6f24a4 | 284 | py | Python | Trabalho1.2/1165.py | MarcosAndre5/ProblemasURIonline | d8f9ac336802df35eca71235afcba181f93e26f9 | [
"MIT"
] | 1 | 2018-09-17T19:14:17.000Z | 2018-09-17T19:14:17.000Z | Trabalho1.2/1165.py | MarcosAndre5/ProblemasURIonline | d8f9ac336802df35eca71235afcba181f93e26f9 | [
"MIT"
] | null | null | null | Trabalho1.2/1165.py | MarcosAndre5/ProblemasURIonline | d8f9ac336802df35eca71235afcba181f93e26f9 | [
"MIT"
] | null | null | null | N = int(input())
for iteracoes in range(N):
divisiveis = 0
X = int(input())
for i in range(1, X + 1):
if X % i == 0:
divisiveis += 1
if divisiveis == 2:
print('{} eh primo'.format(X))
else:
print('{} nao eh primo'.format(X))
| 18.933333 | 42 | 0.482394 |
267cbc7dba6c2a92b5562b983535d8652f4e24a8 | 3,416 | py | Python | pyradar/Chapter06/non_coherent_integration_example.py | mberkanbicer/software | 89f8004f567129216b92c156bbed658a9c03745a | [
"Apache-2.0"
] | 1 | 2020-12-18T04:07:54.000Z | 2020-12-18T04:07:54.000Z | pyradar/Chapter06/non_coherent_integration_example.py | miltondsantos/software | d27375257b0260cad901837612fbca0174134229 | [
"Apache-2.0"
] | null | null | null | pyradar/Chapter06/non_coherent_integration_example.py | miltondsantos/software | d27375257b0260cad901837612fbca0174134229 | [
"Apache-2.0"
] | null | null | null | """
Project: RadarBook
File: non_coherent_integration_example.py
Created by: Lee A. Harrison
On: 10/11/2018
Created with: PyCharm
Copyright (C) 2019 Artech House (artech@artechhouse.com)
This file is part of Introduction to Radar Using Python and MATLAB
and can not be copied and/or distributed without the express perm... | 34.505051 | 104 | 0.685597 |
5bb5d1705607cea6c93530bae49c0e54daa6f11d | 18,503 | py | Python | tests/test_basic.py | Beercow/dissect.cstruct | 96e5c54cbd56892693a2f4ed00d17aa98a1ba083 | [
"MIT"
] | 3 | 2022-03-03T17:38:25.000Z | 2022-03-31T09:20:03.000Z | tests/test_basic.py | Beercow/dissect.cstruct | 96e5c54cbd56892693a2f4ed00d17aa98a1ba083 | [
"MIT"
] | 1 | 2022-03-30T08:05:33.000Z | 2022-03-30T08:07:57.000Z | tests/test_basic.py | Beercow/dissect.cstruct | 96e5c54cbd56892693a2f4ed00d17aa98a1ba083 | [
"MIT"
] | null | null | null | import os
import pytest
from io import BytesIO
from dissect import cstruct
from dissect.cstruct.cstruct import BytesInteger
def test_simple_types():
c = cstruct.cstruct()
assert c.uint32(b'\x01\x00\x00\x00') == 1
assert c.uint32[10](b"A" * 20 + b"B" * 20) == [0x41414141] * 5 + [0x42424242] * 5
assert ... | 23.936611 | 128 | 0.551208 |
b21a62e7d0025c267d55310724b63504eb2049af | 18,638 | py | Python | automol/tests/test_geom.py | snelliott/automol | d1f7d51c1bbe06ba7569ea7c75304618cebee198 | [
"Apache-2.0"
] | null | null | null | automol/tests/test_geom.py | snelliott/automol | d1f7d51c1bbe06ba7569ea7c75304618cebee198 | [
"Apache-2.0"
] | null | null | null | automol/tests/test_geom.py | snelliott/automol | d1f7d51c1bbe06ba7569ea7c75304618cebee198 | [
"Apache-2.0"
] | null | null | null | """ test automol.geom
"""
# import pytest
import numpy
import automol
from automol import geom
C2H2CLF_GEO = (('F', (2.994881276150, -1.414434615111, -0.807144415388)),
('C', (1.170155936996, 0.359360756989, -0.513323178859)),
('C', (-1.201356763194, -0.347546894407, -0.3408392500119)),... | 39.824786 | 79 | 0.643792 |
82285d80fba5592411655497918f63dc24299d7f | 3,309 | py | Python | src/pymodules/dhwidgets/eng_view.py | septag/darkhammer | dd7e32737059ce6dba0aa79f1ae4a59137db06a7 | [
"BSD-2-Clause"
] | 68 | 2015-01-06T08:38:32.000Z | 2022-01-20T15:26:17.000Z | src/pymodules/dhwidgets/eng_view.py | septag/darkhammer | dd7e32737059ce6dba0aa79f1ae4a59137db06a7 | [
"BSD-2-Clause"
] | null | null | null | src/pymodules/dhwidgets/eng_view.py | septag/darkhammer | dd7e32737059ce6dba0aa79f1ae4a59137db06a7 | [
"BSD-2-Clause"
] | 12 | 2015-10-31T11:30:15.000Z | 2020-04-13T18:31:17.000Z | import sys
from PyQt4 import QtCore, QtGui
import dheng
class qEngineView(QtGui.QWidget):
def __init__(self, parent):
super(qEngineView, self).__init__(parent)
self.setAttribute(QtCore.Qt.WA_PaintOnScreen, True)
self.setAttribute(QtCore.Qt.WA_NativeWindow, True)
self.setF... | 30.925234 | 90 | 0.55485 |
3cc2d0544363dea9f68423dd9486024ace28af2a | 9,464 | py | Python | src/the_tale/the_tale/clans/relations.py | Alacrate/the-tale | 43b211f3a99e93964e95abc20a8ed649a205ffcf | [
"BSD-3-Clause"
] | 85 | 2017-11-21T12:22:02.000Z | 2022-03-27T23:07:17.000Z | src/the_tale/the_tale/clans/relations.py | Alacrate/the-tale | 43b211f3a99e93964e95abc20a8ed649a205ffcf | [
"BSD-3-Clause"
] | 545 | 2017-11-04T14:15:04.000Z | 2022-03-27T14:19:27.000Z | src/the_tale/the_tale/clans/relations.py | Alacrate/the-tale | 43b211f3a99e93964e95abc20a8ed649a205ffcf | [
"BSD-3-Clause"
] | 45 | 2017-11-11T12:36:30.000Z | 2022-02-25T06:10:44.000Z |
import smart_imports
smart_imports.all()
class STATE(rels_django.DjangoEnum):
records = (('ACTIVE', 0, 'активна'),
('REMOVED', 1, 'удалена'),)
class ORDER_BY(rels_django.DjangoEnum):
order_field = rels.Column()
records = (('NAME_DESC', 0, 'имени▲', ('-name',)),
('NAME_AS... | 47.557789 | 121 | 0.597633 |
a69cc25794a18c507c64695cb4054782c98d041a | 9,179 | py | Python | textattack/models/self_models.py | chen-zichen/SelfTextAttack | d241122d91e871a5ed6adaf1afb21f6ba06dfcaa | [
"MIT"
] | null | null | null | textattack/models/self_models.py | chen-zichen/SelfTextAttack | d241122d91e871a5ed6adaf1afb21f6ba06dfcaa | [
"MIT"
] | null | null | null | textattack/models/self_models.py | chen-zichen/SelfTextAttack | d241122d91e871a5ed6adaf1afb21f6ba06dfcaa | [
"MIT"
] | 1 | 2022-03-06T22:41:03.000Z | 2022-03-06T22:41:03.000Z | import json
from collections import defaultdict
import torch
import torch.nn as nn
import torch.nn.functional as F
from transformers.models.bert.modeling_bert import BertEmbeddings, BertPooler, BertLayer, BertPreTrainedModel, BertModel
from transformers.models.bert.modeling_bert import SequenceClassifierOutput
from to... | 41.913242 | 120 | 0.631332 |
71532e1ddd6cbe092738e8e21a00f88c56f3b7a7 | 17,480 | py | Python | write_fresco.py | LLNL/ferdinand | af47b415ea1e9cb21a45b20d1f3854bc7f3a4d70 | [
"Apache-2.0"
] | null | null | null | write_fresco.py | LLNL/ferdinand | af47b415ea1e9cb21a45b20d1f3854bc7f3a4d70 | [
"Apache-2.0"
] | null | null | null | write_fresco.py | LLNL/ferdinand | af47b415ea1e9cb21a45b20d1f3854bc7f3a4d70 | [
"Apache-2.0"
] | null | null | null | ##############################################
# #
# Ferdinand 0.40, Ian Thompson, LLNL #
# #
# gnd,endf,fresco,azure,hyrma #
# #
######################################... | 41.818182 | 211 | 0.525629 |
e9ceff9002742dbc5808baf4ac2502fa3d62ec54 | 1,038 | py | Python | CalibTracker/SiStripLorentzAngle/python/SiStripLAProfileBooker_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CalibTracker/SiStripLorentzAngle/python/SiStripLAProfileBooker_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CalibTracker/SiStripLorentzAngle/python/SiStripLAProfileBooker_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | # The following comments couldn't be translated into the new config version:
# calibration
import FWCore.ParameterSet.Config as cms
sistripLAProfile = cms.EDAnalyzer("SiStripLAProfileBooker",
# input from trajectories
Tracks = cms.InputTag("generalTracks"),
UseStripCablingDB = cms.bool(False),
... | 27.315789 | 76 | 0.657996 |
589d41bef7396a22a27c0f9552fd533a3709df78 | 542 | py | Python | 05. Clustering/intro.py | Rocamadour7/ml_tutorial | 1b7e562b41453d7b5de19a74180ef8fbd136dbb9 | [
"MIT"
] | null | null | null | 05. Clustering/intro.py | Rocamadour7/ml_tutorial | 1b7e562b41453d7b5de19a74180ef8fbd136dbb9 | [
"MIT"
] | null | null | null | 05. Clustering/intro.py | Rocamadour7/ml_tutorial | 1b7e562b41453d7b5de19a74180ef8fbd136dbb9 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from matplotlib import style
import numpy as np
from sklearn.cluster import KMeans
style.use('ggplot')
X = np.array([[1, 1], [2, 3], [1, 3], [7, 8], [6, 9], [6, 7]])
# plt.scatter(X[:, 0], X[:, 1])
# plt.show()
clf = KMeans(n_clusters=2)
clf.fit(X)
centroids = clf.cluster_centers_
l... | 22.583333 | 62 | 0.594096 |
6ce403ac903eb727dfaa224afe124665e80980d4 | 8,151 | py | Python | src/synth1.py | intrlocutr/patch1 | 4560e945bad5699ff05f6086ef8b742311fb4b15 | [
"MIT"
] | null | null | null | src/synth1.py | intrlocutr/patch1 | 4560e945bad5699ff05f6086ef8b742311fb4b15 | [
"MIT"
] | null | null | null | src/synth1.py | intrlocutr/patch1 | 4560e945bad5699ff05f6086ef8b742311fb4b15 | [
"MIT"
] | null | null | null | import numpy as np
from typing import Union
from pandas import Series
from src.patches import PatchSchema
from sys import platform
from xdrlib import Packer
from struct import pack
from io import BytesIO
def s1_chunk_header(ver: int): return ('>21s11xB527xB4xB2xB',
b'Synth1 VST ... | 47.666667 | 120 | 0.595142 |
bb6561372181ef923b3661082ed96fbfe2283535 | 9,563 | py | Python | campy/graphics/gcolor.py | TristenSeth/campy | 9e726c342d682239e1c19e6f5645c0b2167d7fab | [
"MIT"
] | null | null | null | campy/graphics/gcolor.py | TristenSeth/campy | 9e726c342d682239e1c19e6f5645c0b2167d7fab | [
"MIT"
] | null | null | null | campy/graphics/gcolor.py | TristenSeth/campy | 9e726c342d682239e1c19e6f5645c0b2167d7fab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3 -tt
"""
File: gcolor.py
---------------
This file exports a GColor class that allows students to easily deal with colors.
We deal in a few abstractions:
A GColor should be thought of as an opaque data type that can be initialized from
any number of possible representations and serialized to man... | 27.799419 | 120 | 0.582662 |
d9602ab83b36031d06697fc7f5bdb31ebb732f7d | 5,449 | py | Python | docs/sphinxext/github.py | yarikoptic/python-client | ca302ad88cac860fd7848581937954f1a46c6a41 | [
"Apache-2.0"
] | null | null | null | docs/sphinxext/github.py | yarikoptic/python-client | ca302ad88cac860fd7848581937954f1a46c6a41 | [
"Apache-2.0"
] | null | null | null | docs/sphinxext/github.py | yarikoptic/python-client | ca302ad88cac860fd7848581937954f1a46c6a41 | [
"Apache-2.0"
] | null | null | null | """Define text roles for GitHub
* ghissue - Issue
* ghpull - Pull Request
* ghuser - User
Adapted from bitbucket example here:
https://bitbucket.org/birkenfeld/sphinx-contrib/src/tip/bitbucket/sphinxcontrib/bitbucket.py
Authors
-------
* Doug Hellmann
* Min RK
"""
#
# Original Copyright (c) 2010 Doug Hellmann. All... | 32.434524 | 92 | 0.648009 |
b3fb29ef60d9b4e852e68e0b10606493484d48a5 | 2,434 | py | Python | src/engine/SCons/Scanner/D.py | Valkatraz/scons | 5e70c65f633dcecc035751c9f0c6f894088df8a0 | [
"MIT"
] | 2 | 2019-11-21T14:40:00.000Z | 2020-10-25T15:44:53.000Z | src/engine/SCons/Scanner/D.py | Valkatraz/scons | 5e70c65f633dcecc035751c9f0c6f894088df8a0 | [
"MIT"
] | 3 | 2019-01-15T20:40:02.000Z | 2021-02-13T03:16:34.000Z | src/engine/SCons/Scanner/D.py | Valkatraz/scons | 5e70c65f633dcecc035751c9f0c6f894088df8a0 | [
"MIT"
] | 2 | 2019-12-23T05:06:28.000Z | 2020-01-16T12:57:55.000Z | """SCons.Scanner.D
Scanner for the Digital Mars "D" programming language.
Coded by Andy Friesen
17 Nov 2003
"""
#
# __COPYRIGHT__
#
# 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... | 32.891892 | 75 | 0.667625 |
b4e2e49249f48a2e5f2fa21745511203a7cf5385 | 664 | py | Python | semana_03/django/manage.py | luispaulojr/cursoPython | 24aaa73741508986d7f747be8f3822889be81025 | [
"MIT"
] | 1 | 2021-11-18T19:02:10.000Z | 2021-11-18T19:02:10.000Z | Django1/manage.py | Luferat/Curso_Python_Senac | a0710b25e4fedeacb1139c1c8f4e4a00c63dba73 | [
"MIT"
] | null | null | null | Django1/manage.py | Luferat/Curso_Python_Senac | a0710b25e4fedeacb1139c1c8f4e4a00c63dba73 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'olamundo.settings')
try:
from django.core.management import execute_from_command_line
except Imp... | 28.869565 | 73 | 0.679217 |
747472dbf6c760efb2300b9c6ffbf248dba2c191 | 6,477 | py | Python | pyformlang/rsa/recursive_automaton.py | IlyaEp/pyformlang | eef239844beff5e9da3be4a4a240440ece81c10b | [
"MIT"
] | 15 | 2020-06-25T14:38:27.000Z | 2022-03-09T17:55:07.000Z | pyformlang/rsa/recursive_automaton.py | IlyaEp/pyformlang | eef239844beff5e9da3be4a4a240440ece81c10b | [
"MIT"
] | 11 | 2020-09-23T09:48:35.000Z | 2021-08-24T08:37:47.000Z | pyformlang/rsa/recursive_automaton.py | IlyaEp/pyformlang | eef239844beff5e9da3be4a4a240440ece81c10b | [
"MIT"
] | 5 | 2020-03-08T19:00:17.000Z | 2021-08-15T12:38:05.000Z | """
Representation of a recursive automaton
"""
from typing import AbstractSet
from pyformlang.finite_automaton.finite_automaton import to_symbol
from pyformlang.finite_automaton.symbol import Symbol
from pyformlang.regular_expression import Regex
from pyformlang.cfg import CFG, Epsilon
from pyformlang.rsa.box impor... | 28.915179 | 98 | 0.603366 |
ee0d0f51a9a0cdf266c92c0af748411cb018def4 | 309 | py | Python | i2_slack_modules/__init__.py | simpleviewinc/icinga-slack-bot | 986f472f5afbc1d4df2cc00b419e0a2f08347d25 | [
"MIT"
] | 5 | 2019-07-01T09:17:09.000Z | 2021-07-29T02:38:34.000Z | i2_slack_modules/__init__.py | simpleviewinc/icinga-slack-bot | 986f472f5afbc1d4df2cc00b419e0a2f08347d25 | [
"MIT"
] | 46 | 2019-07-02T21:26:39.000Z | 2020-11-09T14:39:55.000Z | i2_slack_modules/__init__.py | simpleviewinc/icinga-slack-bot | 986f472f5afbc1d4df2cc00b419e0a2f08347d25 | [
"MIT"
] | 2 | 2020-09-29T18:30:12.000Z | 2021-03-23T16:07:50.000Z |
slack_max_message_text_length = 40000
slack_max_block_text_length = 3000
slack_max_message_blocks = 50
slack_max_message_attachments = 100
plural = lambda x: "s" if x != 1 else ""
yes_no = lambda x: "Yes" if x > 0 else "No"
enabled_disabled = lambda x: "✓ Enabled" if x else ":exclamation: Disabled"
# EOF
| 25.75 | 75 | 0.744337 |
58ef4b784e5048d71d2bad810af56b35d95c5ae1 | 1,892 | py | Python | python_framework/api/test/apitests/testone/api/src/controller/MyController.py | SamuelJansen/python_framework | a3e57def47c13edd67319f9bbca32be2bbb00f43 | [
"MIT"
] | 5 | 2020-09-02T20:05:44.000Z | 2022-03-04T21:02:13.000Z | python_framework/api/test/apitests/testone/api/src/controller/MyController.py | SamuelJansen/python_framework | a3e57def47c13edd67319f9bbca32be2bbb00f43 | [
"MIT"
] | 1 | 2021-05-23T22:55:58.000Z | 2021-05-24T15:33:50.000Z | python_framework/api/test/apitests/testone/api/src/controller/MyController.py | SamuelJansen/python_framework | a3e57def47c13edd67319f9bbca32be2bbb00f43 | [
"MIT"
] | 3 | 2020-11-01T01:13:09.000Z | 2022-02-22T15:01:19.000Z | from python_framework.api.src.enumeration.HttpStatus import HttpStatus
from python_framework.api.src.service.flask.FlaskManager import Controller, ControllerMethod
@Controller(url='/test-controller', tag='MyUrl', description='My url controller')
class MyController:
@ControllerMethod(
url = '/payload-valid... | 28.666667 | 92 | 0.629493 |
b1428f58aa518bda1533f20480595e10d8c6b12e | 15,522 | py | Python | pyu2f/tests/customauthenticator_test.py | dilipped/pyu2f | 80ad6253c613cfd21abd03c5f3c1f9219da30650 | [
"Apache-2.0"
] | 74 | 2017-02-09T15:52:09.000Z | 2022-03-31T14:56:51.000Z | pyu2f/tests/customauthenticator_test.py | dilipped/pyu2f | 80ad6253c613cfd21abd03c5f3c1f9219da30650 | [
"Apache-2.0"
] | 19 | 2017-02-04T03:58:46.000Z | 2022-01-27T10:38:22.000Z | pyu2f/tests/customauthenticator_test.py | dilipped/pyu2f | 80ad6253c613cfd21abd03c5f3c1f9219da30650 | [
"Apache-2.0"
] | 28 | 2017-03-03T23:54:00.000Z | 2022-01-01T20:37:21.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 41.172414 | 80 | 0.692888 |
e114703be8870c675a3d0a21e4f8361c6935aba3 | 1,023 | py | Python | alipay/aop/api/response/ZhimaCustomerEpCertificationQueryResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/ZhimaCustomerEpCertificationQueryResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/ZhimaCustomerEpCertificationQueryResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class ZhimaCustomerEpCertificationQueryResponse(AlipayResponse):
def __init__(self):
super(ZhimaCustomerEpCertificationQueryResponse, self).__init__()
self._failed_reason =... | 28.416667 | 114 | 0.695992 |
ee0d093df04c83d6fc31faec20c151a8ece69b9c | 8,032 | py | Python | django_transfer/__init__.py | smartfile/django-transfer | 16da37af9017ca2b9db932a181ea7da3277b73f3 | [
"MIT"
] | 47 | 2015-03-29T14:42:51.000Z | 2021-04-14T19:05:29.000Z | django_transfer/__init__.py | smartfile/django-transfer | 16da37af9017ca2b9db932a181ea7da3277b73f3 | [
"MIT"
] | 10 | 2015-05-08T16:06:44.000Z | 2020-04-13T22:43:22.000Z | django_transfer/__init__.py | smartfile/django-transfer | 16da37af9017ca2b9db932a181ea7da3277b73f3 | [
"MIT"
] | 14 | 2015-01-20T19:15:02.000Z | 2021-09-26T14:26:37.000Z | from __future__ import unicode_literals
import os
import re
import shutil
import mimetypes
import logging
from six.moves.urllib.parse import quote
from django.conf import settings
try:
from django.http import StreamingHttpResponse
except:
from django.http import HttpResponse as StreamingHttpResponse
from dja... | 36.343891 | 123 | 0.600224 |
4c06339202aa28cb7ada1f634d10124028028986 | 10,902 | py | Python | parse_for_sentry.py | mattrix27/sentry_breakpad_server | c62292c0fd91f8c0e0183e31e11e7403b19e533b | [
"MIT"
] | null | null | null | parse_for_sentry.py | mattrix27/sentry_breakpad_server | c62292c0fd91f8c0e0183e31e11e7403b19e533b | [
"MIT"
] | null | null | null | parse_for_sentry.py | mattrix27/sentry_breakpad_server | c62292c0fd91f8c0e0183e31e11e7403b19e533b | [
"MIT"
] | null | null | null | #ALRIGHT, well this is a long one and definitely should be the one to change if you're getting stuff on sentry but it doesn't look like/how what you want. It basically takes a stack trace from breakpad, goes through and tries to pick pieces and put them in the right place
from raven import Client
#module class for mo... | 69.43949 | 325 | 0.473032 |
ee104ba6867bbdd98b5724cd1ebd9a003f38694c | 1,970 | py | Python | Contents/Libraries/Shared/guessit/rules/common/comparators.py | jippo015/Sub-Zero.bundle | 734e0f7128c05c0f639e11e7dfc77daa1014064b | [
"MIT"
] | 1,553 | 2015-11-09T02:17:06.000Z | 2022-03-31T20:24:52.000Z | Contents/Libraries/Shared/guessit/rules/common/comparators.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 691 | 2015-11-05T21:32:26.000Z | 2022-03-17T10:52:45.000Z | Contents/Libraries/Shared/guessit/rules/common/comparators.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 162 | 2015-11-06T19:38:55.000Z | 2022-03-16T02:42:41.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Comparators
"""
try:
from functools import cmp_to_key
except ImportError:
from ...backports import cmp_to_key
def marker_comparator_predicate(match):
"""
Match predicate used in comparator
"""
return not match.private and \
match.nam... | 26.621622 | 111 | 0.662944 |
de0dd92cdeef3ab3217b6e5721d5aefac1399d62 | 14,979 | py | Python | gamelogic.py | YannThorimbert/TheRule | c33edfae26046ca54568bb34afd8a04888cd9f05 | [
"MIT"
] | null | null | null | gamelogic.py | YannThorimbert/TheRule | c33edfae26046ca54568bb34afd8a04888cd9f05 | [
"MIT"
] | null | null | null | gamelogic.py | YannThorimbert/TheRule | c33edfae26046ca54568bb34afd8a04888cd9f05 | [
"MIT"
] | null | null | null | import random
from collections import deque
import pygame
from pygame.math import Vector2 as V2
import thorpy
import ship as shipm
from hud import HUD
from parameters import W, H, ENGINE_FORCE, MOD_BULLET, BULLET_SPEED, ROCKET_SPEED, MOD_ROCKET
import parameters as p
import graphics as g
import menus
import thorpy.gam... | 32.563043 | 112 | 0.553775 |
1a072c5a3f158abe1b80532ee43ac466e55c23dc | 10,181 | py | Python | tests/test_cy_ndex.py | bdemchak/py4cytoscape | c0f6c13e00928c05485fa2bcc35d292418d3738a | [
"MIT"
] | 3 | 2020-05-07T19:51:11.000Z | 2020-08-12T09:21:43.000Z | tests/test_cy_ndex.py | bdemchak/py4cytoscape | c0f6c13e00928c05485fa2bcc35d292418d3738a | [
"MIT"
] | 11 | 2020-05-07T15:49:03.000Z | 2020-08-20T19:57:23.000Z | tests/test_cy_ndex.py | bdemchak/py4cytoscape | c0f6c13e00928c05485fa2bcc35d292418d3738a | [
"MIT"
] | 3 | 2020-05-26T18:35:57.000Z | 2020-08-19T09:51:19.000Z | # -*- coding: utf-8 -*-
""" Test functions cy_ndex.py.
"""
"""License:
Copyright 2020-2022 The Cytoscape Consortium
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 restrictio... | 59.538012 | 198 | 0.756016 |
1148208f1ff8a31a046f280b491d7550e4085368 | 18,541 | py | Python | euphony/thirdparty/Python-3.5.1/build/lib.linux-x86_64-3.5/_sysconfigdata.py | ZacBlanco/cse291w21 | 26cb5d447ce7ed9c3269ec3f1428ff495c024c49 | [
"Apache-2.0"
] | null | null | null | euphony/thirdparty/Python-3.5.1/build/lib.linux-x86_64-3.5/_sysconfigdata.py | ZacBlanco/cse291w21 | 26cb5d447ce7ed9c3269ec3f1428ff495c024c49 | [
"Apache-2.0"
] | null | null | null | euphony/thirdparty/Python-3.5.1/build/lib.linux-x86_64-3.5/_sysconfigdata.py | ZacBlanco/cse291w21 | 26cb5d447ce7ed9c3269ec3f1428ff495c024c49 | [
"Apache-2.0"
] | null | null | null | # system configuration generated and used by the sysconfig module
build_time_vars = {'ABIFLAGS': 'm',
'AC_APPLE_UNIVERSAL_BUILD': 0,
'AIX_GENUINE_CPLUSPLUS': 0,
'AR': 'ar',
'ARFLAGS': 'rc',
'ASDLGEN': 'python3 ./Parser/asdl_c.py',
'ASDLGEN_FILES': './Parser/asdl.py ./Parser/asdl_c.py',
'AST_ASDL': './Parser/Pyth... | 27.755988 | 95 | 0.670622 |
cc6be0469fa2cbb43d4592fb283c659d8cbd866b | 4,613 | py | Python | fury/shaders/tests/test_base.py | m-agour/fury | dadbb8e66938e964c25d01e6bed427e1fe7efc0c | [
"BSD-3-Clause"
] | null | null | null | fury/shaders/tests/test_base.py | m-agour/fury | dadbb8e66938e964c25d01e6bed427e1fe7efc0c | [
"BSD-3-Clause"
] | null | null | null | fury/shaders/tests/test_base.py | m-agour/fury | dadbb8e66938e964c25d01e6bed427e1fe7efc0c | [
"BSD-3-Clause"
] | null | null | null |
import numpy as np
import numpy.testing as npt
from fury import actor, window
from fury.shaders import (shader_to_actor, add_shader_callback,
attribute_to_actor, replace_shader_in_actor)
from fury.lib import numpy_support
vertex_dec = \
"""
uniform float time;
out vec4 myVertex... | 27.957576 | 73 | 0.563191 |
b6192d669c37fd5a08c153ef6c8e10d865b9014c | 5,419 | py | Python | Homography/homography.py | MZSHAN/Firebolt | 1e25b5ec6ea3695e979406df06f2c0833b16e110 | [
"Apache-2.0"
] | null | null | null | Homography/homography.py | MZSHAN/Firebolt | 1e25b5ec6ea3695e979406df06f2c0833b16e110 | [
"Apache-2.0"
] | null | null | null | Homography/homography.py | MZSHAN/Firebolt | 1e25b5ec6ea3695e979406df06f2c0833b16e110 | [
"Apache-2.0"
] | null | null | null | """
Further work:
1. This homography calculation will fail for matrix with large condition number
Rectify this
2. Implement algorithm to find the convex hull. Currently using matplotlib
3. Implement the SVD solver - currently using at the one from numpy for homograhy
"""
"""
Caveats:
Python I... | 33.450617 | 109 | 0.668943 |
224e6473dae0a91271c76f4d997ce3aad95d9d59 | 29,296 | py | Python | pandas/tools/merge.py | theandygross/pandas | d420334d7e3e52fd812e0648bb3ef8e90c10cc82 | [
"BSD-3-Clause"
] | null | null | null | pandas/tools/merge.py | theandygross/pandas | d420334d7e3e52fd812e0648bb3ef8e90c10cc82 | [
"BSD-3-Clause"
] | null | null | null | pandas/tools/merge.py | theandygross/pandas | d420334d7e3e52fd812e0648bb3ef8e90c10cc82 | [
"BSD-3-Clause"
] | null | null | null | """
SQL-style merge routines
"""
import numpy as np
from pandas.core.frame import DataFrame, _merge_doc
from pandas.core.groupby import get_group_index
from pandas.core.index import Index, MultiIndex, _get_combined_index
from pandas.core.internals import (IntBlock, BoolBlock, BlockManager,
... | 32.916854 | 80 | 0.583458 |
21d20fa31df349b81cbde549d520f5ec095f99e5 | 1,593 | py | Python | projectRoot/home/models.py | PeiyuLu/CP317-Beer-Finder | 09dcb742031d5e72a2f2a66baabc66ac65f6423b | [
"MIT"
] | null | null | null | projectRoot/home/models.py | PeiyuLu/CP317-Beer-Finder | 09dcb742031d5e72a2f2a66baabc66ac65f6423b | [
"MIT"
] | null | null | null | projectRoot/home/models.py | PeiyuLu/CP317-Beer-Finder | 09dcb742031d5e72a2f2a66baabc66ac65f6423b | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Brand(models.Model):
brand_name = models.CharField(max_length=50)
country_of_origin = models.CharField(max_length=50)
def __str__(self):
return self.brand_name
class BodyType(models.Model):
body_type_name = models.CharField(max_... | 30.056604 | 80 | 0.723164 |
a4928ebe10c6f2ca07217d315dadfa26b8519224 | 37,386 | py | Python | elderly_care_simulation/scripts/ControlPanel.py | shaykalyan/SE306-ROS | 59f69d835646145f9dab711d170168a26ede347a | [
"MIT"
] | 6 | 2017-06-10T01:37:30.000Z | 2019-10-16T11:58:15.000Z | elderly_care_simulation/scripts/ControlPanel.py | shaykalyan/SE306-ROS | 59f69d835646145f9dab711d170168a26ede347a | [
"MIT"
] | null | null | null | elderly_care_simulation/scripts/ControlPanel.py | shaykalyan/SE306-ROS | 59f69d835646145f9dab711d170168a26ede347a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
import roslib
import rospkg
import roslib; roslib.load_manifest('elderly_care_simulation')
from elderly_care_simulation.msg import DiceRollTrigger, EventTrigger, DiceRollReport, GuiComm
from Tkinter import *
from EventTriggerUtility import *
class DiceRollerGUI:
"""
TkInter G... | 52.142259 | 169 | 0.659097 |
dee62d4cafc2dfa407d126f67c782e8bfa7ec2ff | 833 | py | Python | Lib/test/test_importlib/source/test_path_hook.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | 1 | 2018-06-21T18:21:24.000Z | 2018-06-21T18:21:24.000Z | Lib/test/test_importlib/source/test_path_hook.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_importlib/source/test_path_hook.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | z .. zaimportuj util
machinery = util.import_importlib('importlib.machinery')
zaimportuj unittest
klasa PathHookTest:
"""Test the path hook dla source."""
def path_hook(self):
zwróć self.machinery.FileFinder.path_hook((self.machinery.SourceFileLoader,
self.machinery.SOURCE_SUFFIXES))
... | 25.242424 | 83 | 0.67467 |
27fe23abc7fb18ad1550aa8f5150ac92c284760b | 123,356 | py | Python | nova/virt/xenapi/vmops.py | karimull/nova | 9dcff4d4ed3e5ed5c0f58638c863562f4761495c | [
"Apache-2.0"
] | null | null | null | nova/virt/xenapi/vmops.py | karimull/nova | 9dcff4d4ed3e5ed5c0f58638c863562f4761495c | [
"Apache-2.0"
] | null | null | null | nova/virt/xenapi/vmops.py | karimull/nova | 9dcff4d4ed3e5ed5c0f58638c863562f4761495c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2010 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | 45.152269 | 79 | 0.596258 |
9df86b84b9037fca72144612aafd758c97264d6c | 2,888 | py | Python | bayesian_goty.py | woctezuma/steam-era-goty | e8366405fe719604ec17bfbcd3c6183b5af84b79 | [
"MIT"
] | 1 | 2019-03-11T12:35:36.000Z | 2019-03-11T12:35:36.000Z | bayesian_goty.py | woctezuma/steam-era-goty | e8366405fe719604ec17bfbcd3c6183b5af84b79 | [
"MIT"
] | 63 | 2018-05-14T19:26:47.000Z | 2022-03-01T20:05:07.000Z | bayesian_goty.py | woctezuma/steam-era-goty | e8366405fe719604ec17bfbcd3c6183b5af84b79 | [
"MIT"
] | null | null | null | import re
from compute_bayesian_rating import choose_prior, compute_bayesian_score
def load_input(filename, file_encoding='utf8'):
data = []
with open(filename, 'r', encoding=file_encoding) as f:
for line in f.readlines():
line = line.strip()
# Remove empty lines and comments... | 30.083333 | 104 | 0.640928 |
ff70567e0b90dc3103d2b6ac0cd50ca3b4e06205 | 1,336 | py | Python | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/DeleteLiveStreamsNotifyUrlConfigRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | 1 | 2019-12-23T12:36:43.000Z | 2019-12-23T12:36:43.000Z | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/DeleteLiveStreamsNotifyUrlConfigRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/DeleteLiveStreamsNotifyUrlConfigRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.111111 | 93 | 0.769461 |
264edb86fd683548a769bac0d0c27c668035938b | 1,651 | py | Python | airflow/ti_deps/deps/task_concurrency_dep.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 15,947 | 2019-01-05T13:51:02.000Z | 2022-03-31T23:33:16.000Z | airflow/ti_deps/deps/task_concurrency_dep.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 14,603 | 2019-01-05T09:43:19.000Z | 2022-03-31T23:11:59.000Z | airflow/ti_deps/deps/task_concurrency_dep.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 8,429 | 2019-01-05T19:45:47.000Z | 2022-03-31T22:13:01.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... | 39.309524 | 95 | 0.734101 |
35e13bcc3e8245047fc26ff4bb63be89419a04f9 | 2,982 | py | Python | neural_sp/models/modules/mocha/hma_test.py | ishine/neural_sp | 7995613541d994976b00d80dcc12e2835163acfb | [
"Apache-2.0"
] | 577 | 2018-09-17T14:39:34.000Z | 2022-03-29T10:48:09.000Z | neural_sp/models/modules/mocha/hma_test.py | ishine/neural_sp | 7995613541d994976b00d80dcc12e2835163acfb | [
"Apache-2.0"
] | 221 | 2019-04-21T01:44:09.000Z | 2022-02-10T02:08:47.000Z | neural_sp/models/modules/mocha/hma_test.py | ishine/neural_sp | 7995613541d994976b00d80dcc12e2835163acfb | [
"Apache-2.0"
] | 139 | 2019-01-09T02:18:00.000Z | 2022-03-29T07:40:08.000Z | # Copyright 2021 Kyoto University (Hirofumi Inaguma)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Monotonic attention in MoChA at test time."""
import logging
import torch
logger = logging.getLogger(__name__)
def hard_monotonic_attention(e_ma, aw_prev, eps_wait, p_threshold=0.5):
"""Monotonic... | 36.814815 | 88 | 0.539235 |
931a032f4061fac3f152b81aa5e33251d00bf1f9 | 16,789 | py | Python | astropy/coordinates/tests/test_earth.py | guntbert/astropy | f2d2add09e5b1638b2698f19a4d46fcca19e82be | [
"BSD-3-Clause"
] | null | null | null | astropy/coordinates/tests/test_earth.py | guntbert/astropy | f2d2add09e5b1638b2698f19a4d46fcca19e82be | [
"BSD-3-Clause"
] | 10 | 2017-03-15T16:14:43.000Z | 2018-11-22T14:40:54.000Z | astropy/coordinates/tests/test_earth.py | guntbert/astropy | f2d2add09e5b1638b2698f19a4d46fcca19e82be | [
"BSD-3-Clause"
] | 1 | 2020-01-23T00:41:10.000Z | 2020-01-23T00:41:10.000Z | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test initialization of angles not already covered by the API tests"""
import pickle
import pytest
import numpy as np
from astropy.coordinates.earth import EarthLocation, ELLIPSOIDS
from astropy.coordinates.angles import Longi... | 42.077694 | 80 | 0.627852 |
bbfe5126260b1a7f95bdde484e807e3fc865416f | 1,727 | bzl | Python | google/cloud/bigtable/bigtable_client_testing.bzl | VPeruS/google-cloud-cpp | 727bc4f4676a75a97cec91247bcdd78741cf7204 | [
"Apache-2.0"
] | 1 | 2021-05-15T00:31:18.000Z | 2021-05-15T00:31:18.000Z | google/cloud/bigtable/bigtable_client_testing.bzl | nschonni/google-cloud-cpp | 0f5e785f14fc21315d6c6fc98ace87da9182dbaa | [
"Apache-2.0"
] | null | null | null | google/cloud/bigtable/bigtable_client_testing.bzl | nschonni/google-cloud-cpp | 0f5e785f14fc21315d6c6fc98ace87da9182dbaa | [
"Apache-2.0"
] | 1 | 2021-08-16T23:38:37.000Z | 2021-08-16T23:38:37.000Z | # 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... | 36.744681 | 85 | 0.754488 |
a2a1ca58794d7dbefa5317df1912af85895b699e | 19,722 | py | Python | foundation/migrations/0001_initial.py | Venus9023/django_for_beginer | c12edb9d347f444f9817d0c6e13716284476820c | [
"BSD-3-Clause"
] | 1,440 | 2015-01-05T13:06:12.000Z | 2022-03-30T23:09:24.000Z | foundation/migrations/0001_initial.py | Venus9023/django_for_beginer | c12edb9d347f444f9817d0c6e13716284476820c | [
"BSD-3-Clause"
] | 711 | 2015-01-01T19:42:33.000Z | 2022-03-29T08:36:29.000Z | foundation/migrations/0001_initial.py | Venus9023/django_for_beginer | c12edb9d347f444f9817d0c6e13716284476820c | [
"BSD-3-Clause"
] | 887 | 2015-01-01T03:17:20.000Z | 2022-03-23T09:15:26.000Z | # Generated by Django 2.1.7 on 2019-04-16 21:54
from decimal import Decimal
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import djmoney.models.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swapp... | 80.170732 | 160 | 0.504462 |
abd461a71713d4f5b544ae99c94b32ba02a23b07 | 2,746 | py | Python | cfgov/scripts/unpublish_closed_jobs.py | Colin-Seifer/consumerfinance.gov | a1a943f7170b498707d642d6be97b9a97a2b52e3 | [
"CC0-1.0"
] | 156 | 2015-01-16T15:16:46.000Z | 2020-08-04T04:48:01.000Z | cfgov/scripts/unpublish_closed_jobs.py | Colin-Seifer/consumerfinance.gov | a1a943f7170b498707d642d6be97b9a97a2b52e3 | [
"CC0-1.0"
] | 3,604 | 2015-01-05T22:09:12.000Z | 2020-08-14T17:09:19.000Z | cfgov/scripts/unpublish_closed_jobs.py | Colin-Seifer/consumerfinance.gov | a1a943f7170b498707d642d6be97b9a97a2b52e3 | [
"CC0-1.0"
] | 102 | 2015-01-28T14:51:18.000Z | 2020-08-10T00:00:39.000Z | import json
import logging
import os
import sys
import requests
from bs4 import BeautifulSoup
from jobmanager.models.pages import JobListingPage
logger = logging.getLogger(__name__)
URL = os.environ.get("USAJOBS_ARCHIVE_URL")
HEADERS = {
"Host": os.environ.get("USAJOBS_HOST"),
"User-Agent": os.environ.get(... | 32.305882 | 78 | 0.621996 |
f08116efb1c23e8645c0720b4cabd2bbb6c9ff96 | 3,495 | py | Python | app/user/tests/test_user_api.py | nintran1995/python-django | 5662c0fa3d31c66b010c499a958b6ed9d4e24986 | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | nintran1995/python-django | 5662c0fa3d31c66b010c499a958b6ed9d4e24986 | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | nintran1995/python-django | 5662c0fa3d31c66b010c499a958b6ed9d4e24986 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
CREATE_USER_URL = reverse('user:create')
TOKEN_URL = reverse('user:token')
def create_user(**param):
"""Create... | 33.605769 | 78 | 0.612876 |
1255f04328d51a02df0daaff896777539715f83f | 3,265 | py | Python | blockchain/modular_division.py | czuo0303/Python | 4b71e2647b38f146e795a645957b311905c6c33f | [
"MIT"
] | 7 | 2020-03-29T08:20:07.000Z | 2022-03-19T06:41:19.000Z | blockchain/modular_division.py | Mathewsmusukuma/Python | 4866b1330bc7c77c0ed0e050e6b99efdeb026448 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | blockchain/modular_division.py | Mathewsmusukuma/Python | 4866b1330bc7c77c0ed0e050e6b99efdeb026448 | [
"MIT"
] | 4 | 2020-03-06T00:53:00.000Z | 2021-01-05T13:42:35.000Z | # Modular Division :
# An efficient algorithm for dividing b by a modulo n.
# GCD ( Greatest Common Divisor ) or HCF ( Highest Common Factor )
# Given three integers a, b, and n, such that gcd(a,n)=1 and n>1, the algorithm should return an integer x such that
# 0≤x≤n−1, and b/a=x(modn) (that is, b=ax(modn)).
... | 21.480263 | 116 | 0.562634 |
36e7bf5997962a6bd3cec0a4b44775d301048db9 | 13,018 | py | Python | heat/tests/openstack/nova/test_keypair.py | itachaaa/heat | a73fa991dbd93fbcfd93c3d19e74f1e8b5a0b870 | [
"Apache-2.0"
] | 1 | 2018-07-04T07:59:26.000Z | 2018-07-04T07:59:26.000Z | heat/tests/openstack/nova/test_keypair.py | ljzjohnson/heat | 9e463f4af77513980b1fd215d5d2ad3bf7b979f9 | [
"Apache-2.0"
] | 1 | 2018-07-26T22:07:09.000Z | 2018-07-26T22:07:09.000Z | heat/tests/openstack/nova/test_keypair.py | ljzjohnson/heat | 9e463f4af77513980b1fd215d5d2ad3bf7b979f9 | [
"Apache-2.0"
] | 3 | 2018-07-19T17:43:37.000Z | 2019-11-15T22:13:30.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
# ... | 44.735395 | 78 | 0.618912 |
c1de970f31dbc179cb8406254fa49bf48cea31b3 | 5,284 | py | Python | source/losses.py | strong-win/Timeband | 179ca45ce9cb3efb686d837c8df6cdad4932e59e | [
"MIT"
] | 8 | 2021-10-02T11:32:31.000Z | 2021-12-28T08:32:12.000Z | source/losses.py | strong-win/Timeband | 179ca45ce9cb3efb686d837c8df6cdad4932e59e | [
"MIT"
] | null | null | null | source/losses.py | strong-win/Timeband | 179ca45ce9cb3efb686d837c8df6cdad4932e59e | [
"MIT"
] | 1 | 2021-11-27T08:34:03.000Z | 2021-11-27T08:34:03.000Z | import torch
import torch.nn as nn
from .utils.initiate import init_device
class GANLoss(nn.Module):
def __init__(self, gan_mode="vanilla", real_label=0.9, fake_label=0.1):
"""
Initialize the GANLoss class.
Parameters:
gan_mode (str) - - the type of GAN objective. It currently... | 36.191781 | 107 | 0.618471 |
65120d80f8f560b4921a0f895a270cf3abdc71a3 | 800 | py | Python | files/day2/mp3/source_files/mp3_properties_kinship_blood.py | dih-sms2018-ughent/dih-sms2018-ughent.github.io | 9fa0a74d5e5b618c049cd696fb79ae40febeb868 | [
"MIT"
] | null | null | null | files/day2/mp3/source_files/mp3_properties_kinship_blood.py | dih-sms2018-ughent/dih-sms2018-ughent.github.io | 9fa0a74d5e5b618c049cd696fb79ae40febeb868 | [
"MIT"
] | null | null | null | files/day2/mp3/source_files/mp3_properties_kinship_blood.py | dih-sms2018-ughent/dih-sms2018-ughent.github.io | 9fa0a74d5e5b618c049cd696fb79ae40febeb868 | [
"MIT"
] | 22 | 2018-07-02T12:24:38.000Z | 2021-08-13T23:08:59.000Z |
##000000719 parent of
##000000551 sibling of
##000000307 relative of
##000000076 nephew of
##000000075 uncle of
kin = {
"parent of": "20",
"sibling of": "15",
"relative of": "10",
"nephew of": "5",
"uncle of": "1"
}
def reformatKinBlood(file):
with open(file, "r", encoding="utf8") as f1:
raw = f1.rea... | 21.621622 | 78 | 0.535 |
b30445bc80e22efbef40a33932c6d375230fd9bb | 3,561 | py | Python | tensortrade/stochastic/processes/gbm.py | bwcknr/tensortrade | 376f5e4cc4ad7df271774088884fbe88f8feb7d8 | [
"Apache-2.0"
] | 34 | 2020-06-05T22:39:53.000Z | 2022-01-09T03:09:12.000Z | tensortrade/stochastic/processes/gbm.py | bwcknr/tensortrade | 376f5e4cc4ad7df271774088884fbe88f8feb7d8 | [
"Apache-2.0"
] | 1 | 2022-01-17T06:38:27.000Z | 2022-01-17T06:38:27.000Z | tensortrade/stochastic/processes/gbm.py | bwcknr/tensortrade | 376f5e4cc4ad7df271774088884fbe88f8feb7d8 | [
"Apache-2.0"
] | 8 | 2020-06-01T12:09:53.000Z | 2022-01-18T14:45:29.000Z | # Copyright 2020 The TensorTrade 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 applicable law or agreed to... | 37.484211 | 102 | 0.738837 |
c00b7ccad2aa44d0f13b098a890cddac1b575153 | 1,065 | py | Python | Task1D.py | danielsanchezcata/Milestone-1- | e79bf245c43b7a354c815e5d58dd9975742d013c | [
"MIT"
] | null | null | null | Task1D.py | danielsanchezcata/Milestone-1- | e79bf245c43b7a354c815e5d58dd9975742d013c | [
"MIT"
] | null | null | null | Task1D.py | danielsanchezcata/Milestone-1- | e79bf245c43b7a354c815e5d58dd9975742d013c | [
"MIT"
] | null | null | null | from importlib_metadata import import_module
from haversine import haversine, Unit
from floodsystem.utils import sorted_by_key
from floodsystem.stationdata import build_station_list
from floodsystem.geo import rivers_with_station
from floodsystem.geo import stations_by_river
def run():
stations=build_station_list(... | 23.666667 | 63 | 0.674178 |
fed36e4b7f30d7f1bbedcf69f39970734c858285 | 202 | py | Python | icu_tokenizer/__init__.py | juncaofish/ICU-tokenizer | c37ba0a494b61f8e1545169738ffd7d7def49ebb | [
"MIT"
] | 16 | 2020-06-18T20:08:46.000Z | 2022-01-22T08:23:21.000Z | icu_tokenizer/__init__.py | juncaofish/ICU-tokenizer | c37ba0a494b61f8e1545169738ffd7d7def49ebb | [
"MIT"
] | 2 | 2021-11-19T14:04:36.000Z | 2022-01-19T07:37:03.000Z | icu_tokenizer/__init__.py | juncaofish/ICU-tokenizer | c37ba0a494b61f8e1545169738ffd7d7def49ebb | [
"MIT"
] | 1 | 2022-01-17T14:27:33.000Z | 2022-01-17T14:27:33.000Z | from icu_tokenizer.normalizer import Normalizer
from icu_tokenizer.sent_splitter import SentSplitter
from icu_tokenizer.tokenizer import Tokenizer
__all__ = ['Normalizer', 'SentSplitter', 'Tokenizer']
| 33.666667 | 53 | 0.841584 |
a6a7aeba0bc3c671b7420391d64e28f732330af3 | 1,290 | py | Python | mla/metrics/distance.py | Radiva/MLAlgorithms | effd8a77a8ac4eb0c614f5033a2d4ece79534e86 | [
"MIT"
] | null | null | null | mla/metrics/distance.py | Radiva/MLAlgorithms | effd8a77a8ac4eb0c614f5033a2d4ece79534e86 | [
"MIT"
] | null | null | null | mla/metrics/distance.py | Radiva/MLAlgorithms | effd8a77a8ac4eb0c614f5033a2d4ece79534e86 | [
"MIT"
] | null | null | null | # coding:utf-8
import numpy as np
import math
def __nint(val):
return (int) (val+0.5)
def euclidean_distance(a, b):
if isinstance(a, list) and isinstance(b, list):
a = np.array(a)
b = np.array(b)
return math.sqrt(sum((a - b) ** 2))
def l2_distance(X):
sum_X = np.sum(X * X, axis=1)
... | 23.454545 | 75 | 0.510853 |
66b748a77ad0d7c52ed167ef3f34b1c822cf722d | 6,119 | bzl | Python | infra_macros/fbcode_macros/build_defs/lib/thrift/java.bzl | philipjameson/buckit | 83b4ba7fc7a7a9d28b7a66117de6d6beccfdf7f8 | [
"BSD-3-Clause"
] | null | null | null | infra_macros/fbcode_macros/build_defs/lib/thrift/java.bzl | philipjameson/buckit | 83b4ba7fc7a7a9d28b7a66117de6d6beccfdf7f8 | [
"BSD-3-Clause"
] | null | null | null | infra_macros/fbcode_macros/build_defs/lib/thrift/java.bzl | philipjameson/buckit | 83b4ba7fc7a7a9d28b7a66117de6d6beccfdf7f8 | [
"BSD-3-Clause"
] | null | null | null | """
Specializer to support generating Java libraries from thrift sources
using plain fbthrift or Apache Thrift.
"""
load("@fbcode_macros//build_defs/lib/thrift:thrift_interface.bzl", "thrift_interface")
load("@fbcode_macros//build_defs:config.bzl", "config")
load("@fbcode_macros//build_defs:java_library.bzl", "java_li... | 31.379487 | 102 | 0.691453 |
774561f600496a971d18a675599e406e16c0085a | 8,312 | py | Python | python/GafferUI/RampPlugValueWidget.py | sebaDesmet/gaffer | 47b2d093c40452bd77947e3b5bd0722a366c8d59 | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/RampPlugValueWidget.py | sebaDesmet/gaffer | 47b2d093c40452bd77947e3b5bd0722a366c8d59 | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/RampPlugValueWidget.py | sebaDesmet/gaffer | 47b2d093c40452bd77947e3b5bd0722a366c8d59 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | 41.768844 | 148 | 0.722209 |
3163808f9c8858677e8717bf1eb58521dc1e7758 | 4,497 | py | Python | social/settings.py | vijayendra/Social | 35e2dfb7588eeeee3415f3eb6544759806279144 | [
"MIT"
] | 4 | 2016-04-06T08:06:20.000Z | 2016-05-20T13:43:10.000Z | social/settings.py | vijayendra/Social | 35e2dfb7588eeeee3415f3eb6544759806279144 | [
"MIT"
] | null | null | null | social/settings.py | vijayendra/Social | 35e2dfb7588eeeee3415f3eb6544759806279144 | [
"MIT"
] | null | null | null | """
Django settings for social project.
Generated by 'django-admin startproject' using Django 1.9.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
imp... | 26.767857 | 91 | 0.714921 |
8b1639466fb199e6cc41d48cf798be79e36d58eb | 5,690 | py | Python | script/extract_cc.py | RainOfPhone/ilf | 83c34c2147f05a26fde81f94acb58fe5719b05a2 | [
"Apache-2.0"
] | 2 | 2022-02-24T10:05:54.000Z | 2022-03-21T06:29:56.000Z | script/extract_cc.py | RainOfPhone/ilf | 83c34c2147f05a26fde81f94acb58fe5719b05a2 | [
"Apache-2.0"
] | null | null | null | script/extract_cc.py | RainOfPhone/ilf | 83c34c2147f05a26fde81f94acb58fe5719b05a2 | [
"Apache-2.0"
] | null | null | null | import imp
import os
import json
import shutil
import signal
import argparse
import subprocess
from tqdm import tqdm
from cc_utils import *
from script_template import DEPLOY_TEMP, TRUFFLE_CONFIG
accounts = [
"1c6dbb1fe61bbb7c256f0ffcbd34087e211173dbc8454220b8b166ed6ada5c00",
"b1cff43bf95333788b080b6cd5c5e2fc... | 36.012658 | 101 | 0.702988 |
fdeeebea32cb838ce2da808438f649cf4addbfdb | 21,525 | py | Python | kaggle/cli.py | JacAmoranto/Titanic-Challenge | aaac86674e7e57f44238a2c10cd0a52892a6203c | [
"Apache-2.0"
] | null | null | null | kaggle/cli.py | JacAmoranto/Titanic-Challenge | aaac86674e7e57f44238a2c10cd0a52892a6203c | [
"Apache-2.0"
] | null | null | null | kaggle/cli.py | JacAmoranto/Titanic-Challenge | aaac86674e7e57f44238a2c10cd0a52892a6203c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018 Kaggle 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 ag... | 40.384615 | 96 | 0.734959 |
283fdfba6569aced80fb18c459bde1918a0d22b9 | 8,650 | py | Python | data/joint_train_s_r_agent.py | zhiqiangdon/pose-adv-aug | 19a8d8d6443fe92f5377f50ad64c2e9d482f4908 | [
"Apache-2.0"
] | 93 | 2018-07-26T04:59:10.000Z | 2021-09-26T08:07:01.000Z | data/joint_train_s_r_agent.py | Hibiscuses/pose-adv-aug | 19a8d8d6443fe92f5377f50ad64c2e9d482f4908 | [
"Apache-2.0"
] | 5 | 2018-09-05T12:29:41.000Z | 2019-09-10T01:17:40.000Z | data/joint_train_s_r_agent.py | Hibiscuses/pose-adv-aug | 19a8d8d6443fe92f5377f50ad64c2e9d482f4908 | [
"Apache-2.0"
] | 18 | 2018-07-21T03:34:31.000Z | 2021-04-11T06:22:22.000Z | # Zhiqiang Tang, May 2017
import os, sys
import numpy as np
from PIL import Image
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
import json
from utils import imutils
from pylib import HumanPts, HumanAug
def sample_from_large_gaussian(x):
return max(-2*x, min(2*x, np.rando... | 41.990291 | 106 | 0.539769 |
ba49241df1fb26329695b8c581ee2a358c99537b | 3,878 | py | Python | apiman/bottle.py | strongbugman/stagger | 8ab92882f695cbcf70827c7f0009d01f7c1df2f7 | [
"BSD-3-Clause"
] | 38 | 2019-06-09T11:16:49.000Z | 2022-03-31T19:16:40.000Z | apiman/bottle.py | strongbugman/starchart | 8ab92882f695cbcf70827c7f0009d01f7c1df2f7 | [
"BSD-3-Clause"
] | 1 | 2020-05-02T08:28:33.000Z | 2022-02-19T08:33:03.000Z | apiman/bottle.py | strongbugman/starchart | 8ab92882f695cbcf70827c7f0009d01f7c1df2f7 | [
"BSD-3-Clause"
] | 2 | 2020-08-07T06:17:58.000Z | 2022-03-29T15:17:19.000Z | import typing
from bottle import Bottle, Request
from jinja2 import Template
from .base import Apiman as _Apiman
class Apiman(_Apiman):
"""Bottle extension
>>> app = Flask(__name__)
>>> apiman = Apiman(
... template="./examples/docs/dog_template.yml"
... )
>>> apiman.init_app(app)
>... | 32.588235 | 88 | 0.531975 |
bf34ce0c475b7688c3ce584ed6db8ff8c8b8114a | 2,779 | py | Python | cinder/quota_utils.py | rackerlabs/cinder | 4295ff0a64f781c3546f6c6e0816dbb8100133cb | [
"Apache-2.0"
] | null | null | null | cinder/quota_utils.py | rackerlabs/cinder | 4295ff0a64f781c3546f6c6e0816dbb8100133cb | [
"Apache-2.0"
] | null | null | null | cinder/quota_utils.py | rackerlabs/cinder | 4295ff0a64f781c3546f6c6e0816dbb8100133cb | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
# 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 requ... | 38.597222 | 78 | 0.585103 |
da9c5c89b0918ba0027e07075969c80aff0c327e | 668 | py | Python | backend/config.py | d4sein/Pastebin | ffe57809f5383696ea6055743755da01d7e6130c | [
"Unlicense"
] | 3 | 2020-01-02T23:43:35.000Z | 2020-11-11T10:40:42.000Z | backend/config.py | d4sein/Pastebin | ffe57809f5383696ea6055743755da01d7e6130c | [
"Unlicense"
] | 2 | 2021-10-06T09:03:47.000Z | 2022-02-18T17:10:26.000Z | backend/config.py | d4sein/Pastebin | ffe57809f5383696ea6055743755da01d7e6130c | [
"Unlicense"
] | 2 | 2020-01-07T15:54:49.000Z | 2020-01-09T00:57:19.000Z | import os
# Defines the application directory
DATABASE_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data')
if not os.path.exists(DATABASE_DIR):
os.mkdir(DATABASE_DIR)
THREADS_PER_PAGE = 2
# Enables protection against *Cross-site Request Forgery (CSRF)*
CSRF_ENABLED = True
# Secret key for si... | 24.740741 | 79 | 0.763473 |
55eb5ffac26170565f6e196e867820e6b024ea0d | 149 | py | Python | venv/Scripts/django-admin.py | aryanvohra/DataTransferCyberSecurity-AESStegnography | 1ecc367e0d283e476f70f453f846ed4a7a7f3f9c | [
"BSD-3-Clause"
] | null | null | null | venv/Scripts/django-admin.py | aryanvohra/DataTransferCyberSecurity-AESStegnography | 1ecc367e0d283e476f70f453f846ed4a7a7f3f9c | [
"BSD-3-Clause"
] | 1 | 2020-02-12T02:30:57.000Z | 2020-02-12T02:30:57.000Z | venv/Scripts/django-admin.py | aryanvohra/DataTransferCyberSecurity-AESStegnography | 1ecc367e0d283e476f70f453f846ed4a7a7f3f9c | [
"BSD-3-Clause"
] | null | null | null | #!D:\StegnoPython\venv\Scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 24.833333 | 42 | 0.778523 |
9aa6cc74a1e9e885205c95c01d9fd4f148f212a3 | 4,378 | py | Python | edid/coordinated_video_timings.py | rpavlik/cros-chameleon | 656801a04eea5fc7536015434f748e6efe44cfda | [
"BSD-3-Clause"
] | 17 | 2018-08-11T18:10:04.000Z | 2021-09-07T08:30:47.000Z | edid/coordinated_video_timings.py | rpavlik/cros-chameleon | 656801a04eea5fc7536015434f748e6efe44cfda | [
"BSD-3-Clause"
] | 4 | 2019-08-29T22:44:20.000Z | 2021-02-19T23:24:21.000Z | Source code/Embedded/vendor/cros-chameleon/edid/coordinated_video_timings.py | OSVR/OSVR-HDK-MCU-Firmware | d2ad48971b0d970e57a2106ca5b317032a3b9801 | [
"Apache-1.1"
] | 3 | 2019-05-26T12:50:38.000Z | 2020-01-21T18:28:05.000Z | # Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Provides the CoordinatedVideoTiming class with methods for parsing info.
CoordinatedVideoTiming info is stored in Video Timing Block extensions.
"""
... | 29.986301 | 80 | 0.645043 |
dc6b350c05300d1d786170876c1e1cc406af8319 | 2,137 | py | Python | lab2/nearest_11912309.py | kommunium/dip-lab | 2c8e08a994fb34b87da55da48a7b72b7c13d9c81 | [
"MIT"
] | null | null | null | lab2/nearest_11912309.py | kommunium/dip-lab | 2c8e08a994fb34b87da55da48a7b72b7c13d9c81 | [
"MIT"
] | null | null | null | lab2/nearest_11912309.py | kommunium/dip-lab | 2c8e08a994fb34b87da55da48a7b72b7c13d9c81 | [
"MIT"
] | null | null | null | # %%
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
def nearest_11912309(input_file: str, dim, output_file: str = 'test.tif') -> np.ndarray:
"""
Use nearest neighbor interpolation to interpolate a grey scale image.
The result is stored in a 8-bit grey .tif file
:param input_... | 36.220339 | 95 | 0.679457 |
60dda961a8159f1279f276423d0e11fe9f913bf7 | 3,959 | py | Python | tests/test_tree_handler.py | edeposit/storage | fb6bd326249847de04b17b64e856c878665cea92 | [
"MIT"
] | 1 | 2015-12-10T13:31:19.000Z | 2015-12-10T13:31:19.000Z | tests/test_tree_handler.py | edeposit/edeposit.amqp.storage | fb6bd326249847de04b17b64e856c878665cea92 | [
"MIT"
] | 47 | 2015-05-29T20:13:18.000Z | 2015-12-23T14:53:09.000Z | tests/test_tree_handler.py | edeposit/edeposit.amqp.storage | fb6bd326249847de04b17b64e856c878665cea92 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
import pytest
from storage.structures import Tree
from storage.tree_handler import TreeHandler
from structures.test_tree import sample_tree
# Variables... | 35.666667 | 79 | 0.73655 |
65610ccc27332650ca90b43fcad48f697fd37bab | 403 | py | Python | djangoProject/wsgi.py | devilsoul7777/YT_Downloader | 13c27a3ba60c0fbe37f5cb200b895836e4f7213d | [
"MIT"
] | 31 | 2020-11-07T03:23:55.000Z | 2022-03-16T18:21:45.000Z | djangoProject/wsgi.py | devilsoul7777/YT_Downloader | 13c27a3ba60c0fbe37f5cb200b895836e4f7213d | [
"MIT"
] | 124 | 2020-11-07T03:27:49.000Z | 2022-03-20T05:28:06.000Z | djangoProject/wsgi.py | devilsoul7777/YT_Downloader | 13c27a3ba60c0fbe37f5cb200b895836e4f7213d | [
"MIT"
] | 44 | 2020-11-09T04:39:39.000Z | 2022-03-12T09:48:19.000Z | """
WSGI config for djangoProject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO... | 23.705882 | 78 | 0.791563 |
dcca4dce6c1708341285012ab70098c05381907a | 10,169 | py | Python | scripts/reconstructGeneEvents.py | chrisruis/panaroo | e0ba5db1681134de7f9e483c97af7673e69d5498 | [
"MIT"
] | null | null | null | scripts/reconstructGeneEvents.py | chrisruis/panaroo | e0ba5db1681134de7f9e483c97af7673e69d5498 | [
"MIT"
] | null | null | null | scripts/reconstructGeneEvents.py | chrisruis/panaroo | e0ba5db1681134de7f9e483c97af7673e69d5498 | [
"MIT"
] | null | null | null | #Reconstructs gene changes identified by PastML onto a tree and joins gene gains and losses into an event if they occur along the same branch and are
#adjacent in the pangenome graph
#To run: python3 reconstructGeneEvents.py -g final_graph.gml -r combined_ancestral_states.tab -t tree -o outfilePrefix
import argparse
f... | 63.55625 | 180 | 0.629757 |
4e2f805bdcf554bbcaf5780d3ec74e891a972772 | 9,204 | py | Python | src/geo_bsd/hpgl_wrap.py | hpgl/hpgl | 72d8c4113c242295de740513093f5779c94ba84a | [
"BSD-3-Clause"
] | 70 | 2015-01-21T12:24:50.000Z | 2022-03-16T02:10:45.000Z | src/geo_bsd/hpgl_wrap.py | hpgl/hpgl | 72d8c4113c242295de740513093f5779c94ba84a | [
"BSD-3-Clause"
] | 8 | 2015-04-22T13:14:30.000Z | 2021-11-23T12:16:32.000Z | src/geo_bsd/hpgl_wrap.py | hpgl/hpgl | 72d8c4113c242295de740513093f5779c94ba84a | [
"BSD-3-Clause"
] | 18 | 2015-02-15T18:04:31.000Z | 2021-01-16T08:54:32.000Z | import os
import ctypes as C
import numpy.ctypeslib as NC
import numpy
hpgl_output_handler = C.CFUNCTYPE(C.c_int, C.c_char_p, C.py_object)
hpgl_progress_handler = C.CFUNCTYPE(C.c_int, C.c_char_p, C.c_int, C.py_object)
class _HPGL_MEAN_KIND:
stationary_auto = 0
stationary = 1
varying = 2
class _HPGL_K... | 29.5 | 83 | 0.696219 |
922044dab11ccfd06fc62e3199aeaf33cfe1f482 | 391 | py | Python | TwitterNumberAnalysis.py | 1029153958/TrumpTwitterAnalysis-1 | c77702e1389a18467b46bad98bffc721c9a8bd18 | [
"MIT"
] | 1 | 2020-04-18T17:24:31.000Z | 2020-04-18T17:24:31.000Z | TwitterNumberAnalysis.py | 1029153958/TrumpTwitterAnalysis-1 | c77702e1389a18467b46bad98bffc721c9a8bd18 | [
"MIT"
] | null | null | null | TwitterNumberAnalysis.py | 1029153958/TrumpTwitterAnalysis-1 | c77702e1389a18467b46bad98bffc721c9a8bd18 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#处理发推数量变化
T=pd.read_csv("./single/time.csv",header=None)
T=np.array(T).reshape([1,-1])[0]
SUM=0;INIT=T[0]
x=[];y=[]
for t in T:
SUM+=1
x.append((INIT-t)/(1000*3600))
y.append(SUM)
plt.plot(x,y)
plt.title("Trump's Twitter-Account Anal... | 17.772727 | 46 | 0.672634 |
cfe69fb012725c7e1e7754650ce07665f4500551 | 1,296 | py | Python | azure-mgmt-cdn/azure/mgmt/cdn/models/supported_optimization_types_list_result.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-cdn/azure/mgmt/cdn/models/supported_optimization_types_list_result.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-cdn/azure/mgmt/cdn/models/supported_optimization_types_list_result.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.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 ... | 34.105263 | 95 | 0.64429 |
2b3877a734def92079d118428ad20af91ecabb1d | 790 | py | Python | samples/tutorial-3.py | bopo/mooquant | 244a87d4cd8b4d918eec4f16905e0921c3b39f50 | [
"Apache-2.0"
] | 21 | 2017-09-07T16:08:21.000Z | 2020-10-15T13:42:21.000Z | samples/tutorial-3.py | bopo/MooQuant | 244a87d4cd8b4d918eec4f16905e0921c3b39f50 | [
"Apache-2.0"
] | 209 | 2018-10-09T11:57:39.000Z | 2021-03-25T21:40:30.000Z | samples/tutorial-3.py | bopo/MooQuant | 244a87d4cd8b4d918eec4f16905e0921c3b39f50 | [
"Apache-2.0"
] | 15 | 2018-11-17T20:14:37.000Z | 2022-02-04T23:55:29.000Z | from mooquant import strategy
from mooquant.technical import ma, rsi
from mooquant.tools import tushare
class MyStrategy(strategy.BacktestingStrategy):
def __init__(self, feed, instrument):
super(MyStrategy, self).__init__(feed)
self.__rsi = rsi.RSI(feed[instrument].getCloseDataSeries(), 14)
... | 30.384615 | 80 | 0.675949 |
ad8015a301b3117d7c2ddd1e28c41ca648b026b6 | 10,696 | py | Python | helpers.py | dcyoung23/balance | f9126f74e2d4af329f6e71c46fd671fa11f9cabc | [
"MIT"
] | null | null | null | helpers.py | dcyoung23/balance | f9126f74e2d4af329f6e71c46fd671fa11f9cabc | [
"MIT"
] | 1 | 2021-06-02T01:50:05.000Z | 2021-06-02T01:50:05.000Z | helpers.py | dcyoung23/balance | f9126f74e2d4af329f6e71c46fd671fa11f9cabc | [
"MIT"
] | null | null | null | import csv
import urllib.request
from datetime import datetime
from flask import redirect, render_template, request, session
from functools import wraps
def apology(message, code=400):
"""Renders message as an apology to user."""
def escape(s):
"""
Escape special characters.
https://... | 36.257627 | 121 | 0.529637 |
d073e780c1da75a770fcbae6382103e1c742c10a | 13,924 | py | Python | log_casp_inh/model_433.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_casp_inh/model_433.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_casp_inh/model_433.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('C6A', ['C8pro'])
Monomer('BaxA', ['BaxM', 'BaxA_1', 'BaxA_2', 'SmacM'])
Monomer('Ligand', ['Receptor'])
Monomer('C6pro', ['C3A'])
Monome... | 85.423313 | 598 | 0.808532 |
7eb7e468571e0922954d3bd916075555499e10eb | 1,595 | py | Python | test/1.2.0/doi-identifiers/D_/test_1_2_0_doi_identifiers_D__apalike_object.py | zmoon/cff-converter-python | ebf0b5e44d67f8beaa1cd13a0d0393ea04c6058d | [
"Apache-2.0"
] | 40 | 2018-06-13T21:38:35.000Z | 2022-03-19T18:34:37.000Z | test/1.2.0/doi-identifiers/D_/test_1_2_0_doi_identifiers_D__apalike_object.py | zmoon/cff-converter-python | ebf0b5e44d67f8beaa1cd13a0d0393ea04c6058d | [
"Apache-2.0"
] | 135 | 2018-03-20T09:35:39.000Z | 2022-03-16T14:57:08.000Z | test/1.2.0/doi-identifiers/D_/test_1_2_0_doi_identifiers_D__apalike_object.py | zmoon/cff-converter-python | ebf0b5e44d67f8beaa1cd13a0d0393ea04c6058d | [
"Apache-2.0"
] | 14 | 2018-06-12T20:17:25.000Z | 2022-02-02T13:58:58.000Z | import os
import pytest
from test.contracts.apalike_object import Contract
from cffconvert.behavior_1_2_x.apalike_object import ApalikeObject
from cffconvert import Citation
@pytest.fixture(scope="module")
def apalike_object():
fixture = os.path.join(os.path.dirname(__file__), "CITATION.cff")
with open(fixtur... | 33.93617 | 72 | 0.706583 |
1e7c536fc6c6d926c9f817c15205a2c8544c7176 | 163 | py | Python | tests/test_version.py | nismod/water_demand | e95670540c14f0d501b6d446e749b5640828bbec | [
"MIT"
] | 1 | 2021-03-31T03:00:08.000Z | 2021-03-31T03:00:08.000Z | tests/test_version.py | nismod/water_demand | e95670540c14f0d501b6d446e749b5640828bbec | [
"MIT"
] | 1 | 2019-06-12T15:12:45.000Z | 2019-06-12T15:12:45.000Z | tests/test_version.py | nismod/water_demand | e95670540c14f0d501b6d446e749b5640828bbec | [
"MIT"
] | null | null | null | import water_demand
def test_version():
assert water_demand.version() == (2, 1, 1)
assert(water_demand.version(formatted=True) == 'water_demand v2.1.1')
| 23.285714 | 73 | 0.705521 |
c8752ce802b0aaa4280c0a8dc94291ed370afc5a | 635 | py | Python | backend/manage.py | crowdbotics-apps/livestock-30349 | 62c6df2da38c98032cb617337a5d38bcae0dc8fb | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/livestock-30349 | 62c6df2da38c98032cb617337a5d38bcae0dc8fb | [
"FTL",
"AML",
"RSA-MD"
] | 6 | 2021-09-14T05:44:58.000Z | 2022-01-23T15:08:18.000Z | backend/manage.py | crowdbotics-apps/livestock-30349 | 62c6df2da38c98032cb617337a5d38bcae0dc8fb | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'livestock_30349.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
rais... | 28.863636 | 79 | 0.686614 |
aa4ed93ec081cb975273559c059b678e1a134c78 | 50,448 | py | Python | lightweight_gan/lightweight_gan.py | NielsRogge/lightweight-gan | 0262a9d455ebbd79967dec232f9112c95efb3818 | [
"MIT"
] | null | null | null | lightweight_gan/lightweight_gan.py | NielsRogge/lightweight-gan | 0262a9d455ebbd79967dec232f9112c95efb3818 | [
"MIT"
] | null | null | null | lightweight_gan/lightweight_gan.py | NielsRogge/lightweight-gan | 0262a9d455ebbd79967dec232f9112c95efb3818 | [
"MIT"
] | null | null | null | import os
import json
import multiprocessing
from random import random
import math
from math import log2, floor
from functools import partial
from contextlib import contextmanager, ExitStack
from pathlib import Path
from shutil import rmtree
import torch
from torch.cuda.amp import autocast, GradScaler
from torch.optim... | 33.948856 | 214 | 0.589221 |
489b938cc6548e53078710ea440419c9742b1d4e | 28,531 | py | Python | fmt_fmu/rtos/tools/building.py | CornerOfSkyline/FMT_Firmware | 7d36406e104d32a94a9c9046502b54b567c561eb | [
"Apache-2.0"
] | 1 | 2021-03-19T02:24:50.000Z | 2021-03-19T02:24:50.000Z | fmt_fmu/rtos/tools/building.py | CornerOfSkyline/FMT_Firmware | 7d36406e104d32a94a9c9046502b54b567c561eb | [
"Apache-2.0"
] | null | null | null | fmt_fmu/rtos/tools/building.py | CornerOfSkyline/FMT_Firmware | 7d36406e104d32a94a9c9046502b54b567c561eb | [
"Apache-2.0"
] | 3 | 2021-02-01T02:54:34.000Z | 2021-03-29T13:52:10.000Z | #
# File : building.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
#
# 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... | 33.724586 | 128 | 0.58291 |
b133268fdd1ecfb83c1653f64b8e3afc04a23e0a | 557 | py | Python | 2021/1b.py | linnall/advent-of-code | 66fa4922b71b57ef9d98423955a72ab7f95adc9a | [
"MIT"
] | 1 | 2021-12-17T05:50:49.000Z | 2021-12-17T05:50:49.000Z | 2021/1b.py | linnall/advent-of-code | 66fa4922b71b57ef9d98423955a72ab7f95adc9a | [
"MIT"
] | null | null | null | 2021/1b.py | linnall/advent-of-code | 66fa4922b71b57ef9d98423955a72ab7f95adc9a | [
"MIT"
] | null | null | null | import functools
def solution():
ret = 0
with open('1.in', 'r') as file:
count = 0
threeSum = []
for line in file:
if count < 3:
threeSum.append(int(line))
else:
print(threeSum)
fsum = threeSum[1] + threeSum[2] + i... | 22.28 | 60 | 0.421903 |
59119a79f1f61f50d5e8bf44e8e181cbca3e1cb9 | 16,051 | py | Python | enigmatoolbox/plotting/base.py | saratheriver/ENIGMA | c26483bfeb9e035b7ab5f56998d17155aece584f | [
"BSD-3-Clause"
] | null | null | null | enigmatoolbox/plotting/base.py | saratheriver/ENIGMA | c26483bfeb9e035b7ab5f56998d17155aece584f | [
"BSD-3-Clause"
] | null | null | null | enigmatoolbox/plotting/base.py | saratheriver/ENIGMA | c26483bfeb9e035b7ab5f56998d17155aece584f | [
"BSD-3-Clause"
] | 1 | 2020-12-14T18:34:40.000Z | 2020-12-14T18:34:40.000Z | """Plotting functionality based on VTK."""
# Author: Oualid Benkarim <oualid.benkarim@mcgill.ca>
# License: BSD 3 clause
import os
import warnings
from collections import defaultdict
import numpy as np
from numpy.lib.stride_tricks import as_strided
from vtk import vtkCommand
import vtk.qt as vtk_qt
from enigmatoo... | 32.230924 | 79 | 0.558096 |
b9c88fb8f921542399f926261defc0635fdc9b23 | 3,107 | py | Python | src/NZGBplugin/LINZ/gazetteer/gui/DatabaseConfiguration.py | strk/gazetteer | 7c1a46827aaef47ffebe10f7d9dde1bbf477e6fe | [
"MIT"
] | null | null | null | src/NZGBplugin/LINZ/gazetteer/gui/DatabaseConfiguration.py | strk/gazetteer | 7c1a46827aaef47ffebe10f7d9dde1bbf477e6fe | [
"MIT"
] | null | null | null | src/NZGBplugin/LINZ/gazetteer/gui/DatabaseConfiguration.py | strk/gazetteer | 7c1a46827aaef47ffebe10f7d9dde1bbf477e6fe | [
"MIT"
] | null | null | null | #!/usr/bin/python
################################################################################
#
# New Zealand Geographic Board gazetteer application,
# Crown copyright (c) 2020, Land Information New Zealand on behalf of
# the New Zealand Government.
#
# This file is released under the MIT licence. See the LICE... | 26.330508 | 80 | 0.574831 |
485509bdb67f1546c452124e18107f73271150b4 | 998 | py | Python | model_hub/setup.py | onlyrico/determined | c6f23186c3191bfe4b8caf8a091ad76a1e2298c2 | [
"Apache-2.0"
] | 1 | 2021-12-18T06:39:09.000Z | 2021-12-18T06:39:09.000Z | model_hub/setup.py | hkang1/determined | 0f45c4a7e1be7821ea4e148e57619cc687b89342 | [
"Apache-2.0"
] | 1 | 2021-05-04T18:30:28.000Z | 2021-05-04T18:30:28.000Z | model_hub/setup.py | liamcli/determined | c9d43f9c203ef8b7c6604306c2d757b96c646584 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
setup(
name="model-hub",
version="0.17.6-dev0",
author="Determined AI",
author_email="hello@determined.ai",
url="https://determined.ai/",
description="Model Hub for Determined Deep Learning Training Platform",
long_description="See https://docs.de... | 39.92 | 81 | 0.682365 |
096f299b086b0c9ab24829aea38892085bde6a3a | 4,435 | py | Python | tests/test_html__parse_url.py | radiac/django-powerwiki | 3df80384261bdef8d25b1df9459073f0ae928a86 | [
"BSD-3-Clause"
] | 4 | 2020-09-10T20:36:02.000Z | 2021-11-03T17:09:11.000Z | tests/test_html__parse_url.py | radiac/django-powerwiki | 3df80384261bdef8d25b1df9459073f0ae928a86 | [
"BSD-3-Clause"
] | null | null | null | tests/test_html__parse_url.py | radiac/django-powerwiki | 3df80384261bdef8d25b1df9459073f0ae928a86 | [
"BSD-3-Clause"
] | null | null | null | """
Test parse_url in html.py
"""
from django.core.exceptions import ValidationError
import pytest
from powerwiki.constants import SCHEME_ASSET, SCHEME_WIKI
from powerwiki.html import parse_url
def test_parse_url__absolute_url__unchanged(wiki, page):
url = "https://example.com"
parsed = parse_url(url, wiki,... | 31.906475 | 87 | 0.727621 |
b6fff61f97c86c91fed11776e1c94140a3343784 | 4,279 | py | Python | vftable_renamer.py | psxvoid/idapython-debugging-dynamic-enrichment | 1a853797190df8d0eddfdff5ab2fd196cce7c4e9 | [
"MIT"
] | 8 | 2019-10-06T11:42:33.000Z | 2021-09-17T15:22:57.000Z | vftable_renamer.py | psxvoid/idapython-debugging-dynamic-enrichment | 1a853797190df8d0eddfdff5ab2fd196cce7c4e9 | [
"MIT"
] | null | null | null | vftable_renamer.py | psxvoid/idapython-debugging-dynamic-enrichment | 1a853797190df8d0eddfdff5ab2fd196cce7c4e9 | [
"MIT"
] | 1 | 2020-05-12T17:17:03.000Z | 2020-05-12T17:17:03.000Z | import idaapi
import idautils
import idc
# needed for regexp [a3e1bcd6]
import re
# Ask for a prefix that will be added to subs in the specified range
func_prefix = idc.AskStr("MyClass::", "Enter a prefix that will be added to subs")
if (func_prefix == "MyClass::") or not func_prefix:
quit()
start_addr = idc.S... | 32.416667 | 108 | 0.590091 |
35eca12bb4f4ecfc1637422e781aa52490b54fd6 | 3,249 | py | Python | isi_sdk_8_2_0/isi_sdk_8_2_0/models/compatibilities_class_active.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_0/isi_sdk_8_2_0/models/compatibilities_class_active.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_0/isi_sdk_8_2_0/models/compatibilities_class_active.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 7
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_2_0.models.compati... | 28.252174 | 129 | 0.590643 |
51294186d841ac3cc253f9b606fba8397b5af211 | 2,082 | py | Python | skcurve/__init__.py | espdev/scikit-curve | 5fcb540ef3862adc01c95bb8629cd4b6de59581b | [
"BSD-3-Clause"
] | 3 | 2020-01-15T12:32:46.000Z | 2021-03-04T04:15:18.000Z | skcurve/__init__.py | espdev/scikit-curve | 5fcb540ef3862adc01c95bb8629cd4b6de59581b | [
"BSD-3-Clause"
] | null | null | null | skcurve/__init__.py | espdev/scikit-curve | 5fcb540ef3862adc01c95bb8629cd4b6de59581b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from ._version import __version__ # noqa
from skcurve._base import Axis, Point, Segment, CurvePoint, CurveSegment, Curve
from skcurve._distance import known_metrics, get_metric
from skcurve._diffgeom import DifferentialGeometryWarning
from skcurve._interpolate import (
InterpolationError,... | 22.387097 | 79 | 0.71806 |
1a3075bea55ac79dc5e8c5c5bceb0b7c00b64e21 | 1,781 | py | Python | subset_sum.py | hubbards/Algorithms-Python | 9d953acc9d30ca043ee1b0269917fc3d9326f79c | [
"MIT"
] | null | null | null | subset_sum.py | hubbards/Algorithms-Python | 9d953acc9d30ca043ee1b0269917fc3d9326f79c | [
"MIT"
] | null | null | null | subset_sum.py | hubbards/Algorithms-Python | 9d953acc9d30ca043ee1b0269917fc3d9326f79c | [
"MIT"
] | null | null | null | """
This module contains a dynamic programming algorithm for solving the subset sum
problem. See section 6.4 of Algorithm Design by Kleinberg and Tardos.
An instance of the subset sum problem is defined by a weight capacity and a
collection of items, where each item has a weight. A solution is any subset of
items for ... | 32.381818 | 79 | 0.596856 |
76158f8611f6523df1acd23ed885545f8c1b9590 | 12,734 | bzl | Python | toolchain/internal/llvm_distributions.bzl | fraudies/bazel-toolchain | 17915c26b370e942a64d9f0b4e6cc340e30f5386 | [
"Apache-2.0"
] | null | null | null | toolchain/internal/llvm_distributions.bzl | fraudies/bazel-toolchain | 17915c26b370e942a64d9f0b4e6cc340e30f5386 | [
"Apache-2.0"
] | null | null | null | toolchain/internal/llvm_distributions.bzl | fraudies/bazel-toolchain | 17915c26b370e942a64d9f0b4e6cc340e30f5386 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Bazel 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 applicable law or agreed to in wr... | 66.670157 | 132 | 0.761976 |
1074906fce124197d225bbca330ea2b22f034948 | 4,373 | py | Python | asciify.py | blat-blatnik/asciify | e7885f9f48d96937a1a572d24cbb0854193450ac | [
"Unlicense"
] | null | null | null | asciify.py | blat-blatnik/asciify | e7885f9f48d96937a1a572d24cbb0854193450ac | [
"Unlicense"
] | null | null | null | asciify.py | blat-blatnik/asciify | e7885f9f48d96937a1a572d24cbb0854193450ac | [
"Unlicense"
] | null | null | null | import sys
from os import path
from PIL import Image
# the "pallete" of ascii characters used - from lowest to highest intensity
ASCII_CHARS = [' ','.',',',':',';','+','*','?','%','S','#','@']
DEFAULT_WIDTH = 70
# resize an image while keeping the aspect ratio constant
def resize(image, new_width):
(ol... | 35.552846 | 129 | 0.626343 |
51acfbd53f8fbae2a2dfcaed897d7996f049f3cb | 13,711 | py | Python | tests/unit/diag_scripts/shared/test_iris_helpers.py | chrisdane/ESMValTool | 35e0c2b0dbaa0927a2d677f382b43520633a1a0f | [
"Apache-2.0"
] | null | null | null | tests/unit/diag_scripts/shared/test_iris_helpers.py | chrisdane/ESMValTool | 35e0c2b0dbaa0927a2d677f382b43520633a1a0f | [
"Apache-2.0"
] | null | null | null | tests/unit/diag_scripts/shared/test_iris_helpers.py | chrisdane/ESMValTool | 35e0c2b0dbaa0927a2d677f382b43520633a1a0f | [
"Apache-2.0"
] | null | null | null | """Tests for the module :mod:`esmvaltool.diag_scripts.shared.iris_helpers`."""
import iris
import mock
import numpy as np
import pytest
from esmvaltool.diag_scripts.shared import iris_helpers as ih
LONG_NAME = 'x'
DIM_COORD_1 = iris.coords.DimCoord(np.arange(3.0) - 1.0, long_name=LONG_NAME)
AUX_COORD_1 = iris.coords... | 35.15641 | 79 | 0.609875 |
270e420fa8c131d21e094b45e4091fbbbce0c035 | 90,757 | py | Python | tensorflow/python/eager/function_test.py | victormwenda/tensorflow | 62276ada3e5932af3f583401bba4378b9b5259ff | [
"Apache-2.0"
] | null | null | null | tensorflow/python/eager/function_test.py | victormwenda/tensorflow | 62276ada3e5932af3f583401bba4378b9b5259ff | [
"Apache-2.0"
] | null | null | null | tensorflow/python/eager/function_test.py | victormwenda/tensorflow | 62276ada3e5932af3f583401bba4378b9b5259ff | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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... | 32.847267 | 80 | 0.666637 |
9f7587a82c578d7fc3f6daa5471846f4ecc3e248 | 282 | py | Python | python/masonite/app/http/controllers/PageController.py | djones6/web-frameworks | 3ccdadccfba60b41fdb3753e161b15f6c862ff86 | [
"MIT"
] | null | null | null | python/masonite/app/http/controllers/PageController.py | djones6/web-frameworks | 3ccdadccfba60b41fdb3753e161b15f6c862ff86 | [
"MIT"
] | null | null | null | python/masonite/app/http/controllers/PageController.py | djones6/web-frameworks | 3ccdadccfba60b41fdb3753e161b15f6c862ff86 | [
"MIT"
] | null | null | null | from masonite.view import View
from masonite.request import Request
class PageController:
def index(self, request: Request):
return ''
def show_user(self, request: Request):
return request.param('id')
def create_user(self):
return ''
| 20.142857 | 42 | 0.648936 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.