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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
213a52f9011384675eda1dd484d504bf3cb6d2fe | 393 | py | Python | rec_to_nwb/processing/nwb/components/position/time/valid/fl_pos_valid_time_builder.py | jihyunbak/rec_to_nwb | 6e65f8bf0a4faa4d986483ec2442ba19d70c92a9 | [
"Apache-2.0"
] | 8 | 2020-05-29T13:48:35.000Z | 2021-11-19T04:24:48.000Z | rec_to_nwb/processing/nwb/components/position/time/valid/fl_pos_valid_time_builder.py | jihyunbak/rec_to_nwb | 6e65f8bf0a4faa4d986483ec2442ba19d70c92a9 | [
"Apache-2.0"
] | 12 | 2020-11-13T01:36:32.000Z | 2022-01-23T20:35:55.000Z | rec_to_nwb/processing/nwb/components/position/time/valid/fl_pos_valid_time_builder.py | jihyunbak/rec_to_nwb | 6e65f8bf0a4faa4d986483ec2442ba19d70c92a9 | [
"Apache-2.0"
] | 3 | 2020-10-20T06:52:45.000Z | 2021-07-06T23:00:53.000Z | from rec_to_nwb.processing.nwb.components.position.time.valid.fl_pos_valid_time import FlPosValidTime
from rec_to_nwb.processing.tools.beartype.beartype import beartype
class FlPosValidTimeBuilder:
@staticmethod
@beartype
def build(start_time: float, stop_time: float):
return FlPosValidTime(
... | 28.071429 | 101 | 0.740458 |
55e3e1d3f07a656f38ec328964f8ee4819293bea | 11,169 | py | Python | TakeBlipPosTagger/model.py | guireis1/testpos | efe22724d4c3512dd5336dc9788704793793122d | [
"MIT"
] | null | null | null | TakeBlipPosTagger/model.py | guireis1/testpos | efe22724d4c3512dd5336dc9788704793793122d | [
"MIT"
] | null | null | null | TakeBlipPosTagger/model.py | guireis1/testpos | efe22724d4c3512dd5336dc9788704793793122d | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.autograd import Variable
def log_sum_exp(vec, dim=0):
max, idx = torch.max(vec, dim)
max_exp = max.unsqueeze(-1).expand_as(vec)
return max + torch.log(torch.sum(torch.exp(vec - max_exp), dim))
class CRF(nn.Module):
def __init__(self, vocab_size, pad_idx,... | 39.606383 | 116 | 0.640433 |
abcba4fb0ab3e1ec4f96b6afc582f966847db034 | 1,224 | py | Python | autotyper.py | Voided-Git/autotyper | 12610d96c1b4b1babf46eb18c8d526c0a234657f | [
"MIT"
] | null | null | null | autotyper.py | Voided-Git/autotyper | 12610d96c1b4b1babf46eb18c8d526c0a234657f | [
"MIT"
] | null | null | null | autotyper.py | Voided-Git/autotyper | 12610d96c1b4b1babf46eb18c8d526c0a234657f | [
"MIT"
] | null | null | null | # imports (keyboard writing, waiting, pressing with immediate releasing and system)
from keyboard import write, wait, press_and_release
from os import system
# set the window title
system("title AutoTyper")
# inputting integers (error checking)
def int_input(prompt: str):
while True:
try:
re... | 28.465116 | 84 | 0.669935 |
9c8fb340782173b8bb0c4816cafdd918de3a2275 | 3,183 | py | Python | aux_functions.py | rcolomina/simple_flask_app | 39bf21021f8669ba208d22b574468c9b1c147b63 | [
"MIT"
] | null | null | null | aux_functions.py | rcolomina/simple_flask_app | 39bf21021f8669ba208d22b574468c9b1c147b63 | [
"MIT"
] | 1 | 2022-03-18T18:31:58.000Z | 2022-03-18T18:31:58.000Z | aux_functions.py | rcolomina/simple_flask_app | 39bf21021f8669ba208d22b574468c9b1c147b63 | [
"MIT"
] | null | null | null | from config import Config
# Not Found message configured
def output_not_found(username):
print("debug: output_not_found")
message = Config.MSG_DATA_NOT_FOUND+" Username '"+username+ \
"' does not exist."
status = 404
data = {"status":status,"message":message}
return data,status
def o... | 33.861702 | 79 | 0.642476 |
99eeafca934aac326b7d6b8f1d2ed31c5d0e456d | 1,611 | py | Python | src/act/client/actproxy.py | bryngemark/aCT | be6d0fec0bd1313cb112c1901f21b3e39ccca305 | [
"Apache-2.0"
] | null | null | null | src/act/client/actproxy.py | bryngemark/aCT | be6d0fec0bd1313cb112c1901f21b3e39ccca305 | [
"Apache-2.0"
] | null | null | null | src/act/client/actproxy.py | bryngemark/aCT | be6d0fec0bd1313cb112c1901f21b3e39ccca305 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
Insert proxy certificate into aCT.
Returns:
8: Error inserting or updating proxy.
"""
import argparse
import os
import sys
import logging
import act.client.proxymgr as proxymgr
from act.client.errors import NoProxyFileError
def printProxyInfo(proxyInfo):
"""Print proxy info fro... | 26.409836 | 87 | 0.655493 |
4178ae97a31f925a5014aae944ec1ec68178bd26 | 1,983 | py | Python | getmodel.py | hmartelb/speech-denoising | 78424200d16215c100d9eb47e73dfc67845a0fbf | [
"MIT"
] | 4 | 2021-06-20T10:31:50.000Z | 2022-03-15T01:19:14.000Z | getmodel.py | hmartelb/speech-denoising | 78424200d16215c100d9eb47e73dfc67845a0fbf | [
"MIT"
] | null | null | null | getmodel.py | hmartelb/speech-denoising | 78424200d16215c100d9eb47e73dfc67845a0fbf | [
"MIT"
] | 4 | 2021-08-14T19:06:13.000Z | 2022-02-25T05:09:35.000Z | import torch.nn.functional as F
from torchaudio.models import ConvTasNet
from losses import ScaleInvariantSDRLoss
from models import UNet, UNetDNP, TransUNet
default_params = {
"UNet": {
"n_channels": 1,
"n_class": 2,
"unet_depth": 6,
"unet_scale_factor": 16,
},
"UNetDNP":... | 24.182927 | 48 | 0.544629 |
a86cf1a822ea9dba9ee77c15a29a38ba92e1fb43 | 17,931 | py | Python | tests/integration/shell/test_call.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2021-08-14T13:48:38.000Z | 2021-08-14T13:48:38.000Z | tests/integration/shell/test_call.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 3 | 2015-03-31T14:44:05.000Z | 2015-06-18T19:02:24.000Z | tests/integration/shell/test_call.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2020-01-02T09:03:24.000Z | 2020-01-02T09:03:24.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
tests.integration.shell.call
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
# Import python libs
from __future__ import absolute_import
import getpass
import os
import sys
import re
import shutil
from datetime import datetime
import l... | 35.790419 | 110 | 0.541799 |
4a3cf952f6d43a71b73f8438e110a062a1bcc724 | 5,269 | py | Python | train.py | DelphyAlan/AON | 7db113d20ee6b17f9fbc2f627e059fd46d134535 | [
"MIT"
] | null | null | null | train.py | DelphyAlan/AON | 7db113d20ee6b17f9fbc2f627e059fd46d134535 | [
"MIT"
] | null | null | null | train.py | DelphyAlan/AON | 7db113d20ee6b17f9fbc2f627e059fd46d134535 | [
"MIT"
] | null | null | null | import tensorflow.compat.v1 as tf
from model_aon import inference, get_train_op, get_init_op
from input_data import get_batch_data
import os
import numpy as np
tf.disable_v2_behavior()
flags = tf.app.flags
flags.DEFINE_string('exp_dir', 'exp_log', 'experiment model save directory')
flags.DEFINE_integer('batch_size', ... | 45.034188 | 140 | 0.683242 |
64c2c81aa04f3ca05115b16cc85f6e6ad79635f6 | 14,945 | py | Python | src/dcmstack/extract.py | jbpoline/dcmstack | f93e8ea8ee6aedc2aef041876687243ad99fad7e | [
"MIT"
] | 1 | 2018-09-05T11:33:24.000Z | 2018-09-05T11:33:24.000Z | src/dcmstack/extract.py | jbpoline/dcmstack | f93e8ea8ee6aedc2aef041876687243ad99fad7e | [
"MIT"
] | null | null | null | src/dcmstack/extract.py | jbpoline/dcmstack | f93e8ea8ee6aedc2aef041876687243ad99fad7e | [
"MIT"
] | null | null | null | """
Extract meta data from a DICOM data set.
"""
import struct, warnings
from collections import OrderedDict, namedtuple, Counter
import dicom
from dicom.datadict import keyword_for_tag
from nibabel.nicom import csareader
#This is needed to allow extraction on files with invalid values (e.g. too
#long of a decimal st... | 36.099034 | 81 | 0.542389 |
bce57df2eeb7b5aba8e62b7afb1ea5b9999221de | 8,837 | py | Python | IBA/test/test_tensorflow_v1.py | YaNgZhAnG-V5/covid-attribution | b3cb2efe6de9db79ab68f0d7c3d1264d2cfab030 | [
"MIT"
] | 57 | 2020-03-09T20:39:04.000Z | 2022-03-28T12:54:20.000Z | IBA/test/test_tensorflow_v1.py | YaNgZhAnG-V5/covid-attribution | b3cb2efe6de9db79ab68f0d7c3d1264d2cfab030 | [
"MIT"
] | 25 | 2020-03-09T23:20:47.000Z | 2022-03-12T00:17:53.000Z | IBA/test/test_tensorflow_v1.py | YaNgZhAnG-V5/covid-attribution | b3cb2efe6de9db79ab68f0d7c3d1264d2cfab030 | [
"MIT"
] | 7 | 2020-03-10T13:13:51.000Z | 2022-01-04T09:31:30.000Z | # Copyright (c) Karl Schulz, Leon Sixt
#
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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, includin... | 33.858238 | 92 | 0.677606 |
2c601292e948f53e48dfb96626fd4386acf57ee4 | 5,138 | py | Python | project/data_analysis/python/montecarlo/mc_analysis.py | simonsobs/ps_py | fd34612f6756f693df92e01912fd71b291f1774a | [
"BSD-3-Clause"
] | 12 | 2019-01-25T13:42:52.000Z | 2022-03-30T22:07:33.000Z | project/data_analysis/python/montecarlo/mc_analysis.py | simonsobs/ps_py | fd34612f6756f693df92e01912fd71b291f1774a | [
"BSD-3-Clause"
] | 20 | 2018-11-22T06:51:44.000Z | 2022-03-22T19:31:14.000Z | project/data_analysis/python/montecarlo/mc_analysis.py | sgiardie/PSpipe | 046c1d68c06fd3e8b7f0d9c068d0ff999bf95a0b | [
"BSD-3-Clause"
] | 10 | 2019-04-19T09:32:11.000Z | 2022-01-21T10:26:09.000Z | """
This script analyze the simulations generated by mc_get_spectra.py
it estimates the mean and numerical covariances from the simulations
"""
from pspy import pspy_utils, so_dict, so_spectra
import numpy as np
import sys
d = so_dict.so_dict()
d.read_from_file(sys.argv[1])
type = d["type"]
surveys = d["surveys"]
i... | 38.924242 | 140 | 0.526664 |
aaf919d53aab4bd4c9f8913967a2936a9a9def34 | 259 | py | Python | main/forms.py | Shanmuga-raj/TXT2HTML | 9d63afed3e9e0f1f198e6cc75dc3252ecb29e1ba | [
"MIT"
] | null | null | null | main/forms.py | Shanmuga-raj/TXT2HTML | 9d63afed3e9e0f1f198e6cc75dc3252ecb29e1ba | [
"MIT"
] | null | null | null | main/forms.py | Shanmuga-raj/TXT2HTML | 9d63afed3e9e0f1f198e6cc75dc3252ecb29e1ba | [
"MIT"
] | null | null | null | from django import forms
from .models import Post
from ckeditor.widgets import CKEditorWidget
class PostForm(forms.ModelForm):
body = forms.CharField(widget=CKEditorWidget(),label="Text Editor")
class Meta:
model=Post
fields=('body',) | 28.777778 | 71 | 0.725869 |
331e46f3591f3fdab61c3bd28053553d1f8598d8 | 4,759 | py | Python | Python/iris_plain_mlp.py | kingmbc/iris-python | 824a3dd9cf9fd9685ece05298423a4b8e78dccb7 | [
"MIT"
] | 39 | 2017-04-11T19:31:53.000Z | 2021-12-31T18:52:16.000Z | Python/iris_plain_mlp.py | kingmbc/iris-python | 824a3dd9cf9fd9685ece05298423a4b8e78dccb7 | [
"MIT"
] | null | null | null | Python/iris_plain_mlp.py | kingmbc/iris-python | 824a3dd9cf9fd9685ece05298423a4b8e78dccb7 | [
"MIT"
] | 57 | 2017-03-09T10:27:54.000Z | 2022-01-06T06:02:05.000Z | from __future__ import print_function
from builtins import range
"""
SECTION 1 : Load and setup data for training
"""
import csv
import random
import math
random.seed(113)
# Load dataset
with open('../Datasets/iris/iris.csv') as csvfile:
csvreader = csv.reader(csvfile)
next(csvreader, None) # skip header
... | 28.668675 | 90 | 0.578903 |
4dde16c1f3f9096478e4b1b49ae1a60cc7a678b7 | 8,656 | py | Python | SRC/lexer.py | Tim8Trudeau/T3001 | bdac8936e83906f1da1f9d60037f68755e770786 | [
"MIT"
] | null | null | null | SRC/lexer.py | Tim8Trudeau/T3001 | bdac8936e83906f1da1f9d60037f68755e770786 | [
"MIT"
] | null | null | null | SRC/lexer.py | Tim8Trudeau/T3001 | bdac8936e83906f1da1f9d60037f68755e770786 | [
"MIT"
] | null | null | null | """ Lexer module for CLIQ test robot interpreter"""
###############################################################################
# #
# LEXER #
# ... | 32.912548 | 122 | 0.490065 |
3d83a88ae4d4a8a25087b43e2c679023f098ce88 | 1,100 | py | Python | ComputerManagement/serializacion.py | hugobarzano/IV_hugobarzano | 4638750e1e7c16608e17e34744f38176144e1a15 | [
"Artistic-2.0"
] | null | null | null | ComputerManagement/serializacion.py | hugobarzano/IV_hugobarzano | 4638750e1e7c16608e17e34744f38176144e1a15 | [
"Artistic-2.0"
] | 14 | 2015-10-13T09:07:12.000Z | 2015-12-11T15:49:08.000Z | ComputerManagement/serializacion.py | hugobarzano/IV_hugobarzano | 4638750e1e7c16608e17e34744f38176144e1a15 | [
"Artistic-2.0"
] | 1 | 2016-01-03T19:32:09.000Z | 2016-01-03T19:32:09.000Z | from rest_framework import serializers
from ComputerManagement.models import Dispositivo
class DispositivoSerializado(serializers.Serializer):
id_dispositivo = serializers.IntegerField()
nombre_dispositivo = serializers.CharField(max_length=200)
fabricante = serializers.CharField(max_length=200)
caracteristicas = ... | 42.307692 | 101 | 0.784545 |
d4eaa39b9c8f57fac1085ae4adb14038bb544516 | 1,659 | py | Python | seqdesign/scripts/library_selection_birch.py | eembees/SeqDesign | 436b8ae55824957b444c312c2799f2bcbce4a103 | [
"MIT"
] | 38 | 2020-11-26T15:54:05.000Z | 2022-03-23T18:46:27.000Z | seqdesign/scripts/library_selection_birch.py | debbiemarkslab/SeqDesign | 436b8ae55824957b444c312c2799f2bcbce4a103 | [
"MIT"
] | 2 | 2021-04-02T20:58:44.000Z | 2021-08-24T03:19:06.000Z | seqdesign/scripts/library_selection_birch.py | eembees/SeqDesign | 436b8ae55824957b444c312c2799f2bcbce4a103 | [
"MIT"
] | 9 | 2021-04-27T19:28:30.000Z | 2022-03-23T18:46:31.000Z | #!/usr/bin/env python3
from seqdesign import birch
import argparse
import os
def main():
parser = argparse.ArgumentParser(description="Make a feature matrix for BIRCH clustering from a fasta file.")
parser.add_argument("--input", type=str, required=True,
help="Input feature matrix csv.... | 40.463415 | 113 | 0.694997 |
a0ed793813bca0beb98d07819c1edb767adcb45d | 1,019 | py | Python | hdd_pred/scripts/train_test.py | Reshirin/hdd_pred | f0065771fb2ca7ae1ff8492432a0c8bac21a4a19 | [
"MIT"
] | null | null | null | hdd_pred/scripts/train_test.py | Reshirin/hdd_pred | f0065771fb2ca7ae1ff8492432a0c8bac21a4a19 | [
"MIT"
] | null | null | null | hdd_pred/scripts/train_test.py | Reshirin/hdd_pred | f0065771fb2ca7ae1ff8492432a0c8bac21a4a19 | [
"MIT"
] | null | null | null | import pytest
import pathlib
from click.testing import CliRunner
from hdd_pred.scripts.train import main, _main
_HERE = pathlib.Path(__file__).resolve().parent
@pytest.mark.parametrize("config_file", [("configs/config.yml")])
def test_click_main(config_file):
"""Tests both _main() click runner and its call to ... | 29.970588 | 88 | 0.713445 |
8e220a7b28e3bedcea371a951493e1bb4623f684 | 6,779 | py | Python | bindings/python/ensmallen_graph/datasets/string/haemophilushaemolyticusm21639.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/haemophilushaemolyticusm21639.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/haemophilushaemolyticusm21639.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Haemophilus haemolyticus M21639.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datet... | 35.492147 | 223 | 0.706889 |
5e83d8cc2bb610155c2390094487e06f9213eb67 | 6,838 | py | Python | tests/python/pygmod/test_lua.py | javabird25/gpython | f58df9c0c626ccd3f1dbd8a2d762ae62b9f22caf | [
"MIT"
] | 26 | 2018-11-27T16:40:30.000Z | 2022-01-27T12:37:34.000Z | tests/python/pygmod/test_lua.py | javabird25/gpython | f58df9c0c626ccd3f1dbd8a2d762ae62b9f22caf | [
"MIT"
] | 9 | 2019-05-05T22:00:00.000Z | 2021-01-18T13:43:21.000Z | tests/python/pygmod/test_lua.py | javabird25/gpython | f58df9c0c626ccd3f1dbd8a2d762ae62b9f22caf | [
"MIT"
] | 4 | 2019-05-05T18:10:35.000Z | 2022-01-18T14:42:31.000Z | import logging
from collections import defaultdict
import pytest
import _luastack
from pygmod import lua
logging.basicConfig(level=logging.DEBUG)
@pytest.fixture(autouse=True)
def luastack():
yield
_luastack.stack = [_luastack.StackPad()]
def test_auto_pop_from_empty_stack():
@lua.auto_pop
def fu... | 27.134921 | 80 | 0.708541 |
565762297a6987f94b0c5c408a4fac3b5f071dea | 300 | py | Python | erpnext_connector/erpnext_connector/doctype/erpnext_price_list/erpnext_price_list.py | Athenolabs/erpnext_connector | ce52c298b5a3b370f1def8d4df00cda5541aeabd | [
"MIT"
] | 3 | 2017-09-21T13:50:26.000Z | 2020-12-31T11:48:36.000Z | erpnext_connector/erpnext_connector/doctype/erpnext_price_list/erpnext_price_list.py | Athenolabs/erpnext_connector | ce52c298b5a3b370f1def8d4df00cda5541aeabd | [
"MIT"
] | 1 | 2018-02-09T13:01:52.000Z | 2021-03-31T12:30:44.000Z | erpnext_connector/erpnext_connector/doctype/erpnext_price_list/erpnext_price_list.py | mntechnique/erpnext_connector | 5bb5d0bb418d57a5877b172546f0292420cfd678 | [
"MIT"
] | 4 | 2017-10-26T03:59:43.000Z | 2020-08-16T15:30:28.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017, MN Technique and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, requests
import erpnext_connector
from frappe.model.document import Document
class ERPNextPriceList(Document):
pass
| 25 | 51 | 0.796667 |
992e756f1db73fb34b103dadf61736a6e0515822 | 6,723 | py | Python | examples/pwr_run/checkpointing/nonpc_short/final3/job15.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/nonpc_short/final3/job15.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/nonpc_short/final3/job15.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 30.559091 | 118 | 0.70296 |
597e5e074a2ff04b268c7479be43c71d8a831512 | 419 | py | Python | jogadorAleatorio.py | kevenLeandro/simula-oBancoImobiliario | d79fd91b94eb6f05c9088223f8ba4e4dc1c58b90 | [
"Apache-2.0"
] | null | null | null | jogadorAleatorio.py | kevenLeandro/simula-oBancoImobiliario | d79fd91b94eb6f05c9088223f8ba4e4dc1c58b90 | [
"Apache-2.0"
] | null | null | null | jogadorAleatorio.py | kevenLeandro/simula-oBancoImobiliario | d79fd91b94eb6f05c9088223f8ba4e4dc1c58b90 | [
"Apache-2.0"
] | null | null | null | import jogador
import comportamento
class jogadorAleatorio(jogador.jogador):
def __init__(self, posicao, volta, saldo):
super().__init__(posicao, volta, saldo)
def comportamento(self, propriedade,jogador):
comportamento.aleatorio(propriedade, jogador)
def get_definition(self):
re... | 24.647059 | 105 | 0.73031 |
753ce1b686a74ec97686fe8ac1f6b167a3966b2e | 1,429 | py | Python | test_app_data/settings.py | ella/django-appdata | 2a1bbc2c4b4569ebcd1bee98b29431df206912c9 | [
"BSD-3-Clause"
] | 13 | 2015-03-13T11:40:43.000Z | 2020-07-19T04:33:59.000Z | test_app_data/settings.py | ella/django-appdata | 2a1bbc2c4b4569ebcd1bee98b29431df206912c9 | [
"BSD-3-Clause"
] | 20 | 2015-01-03T07:26:56.000Z | 2020-10-29T09:44:29.000Z | test_app_data/settings.py | ella/django-appdata | 2a1bbc2c4b4569ebcd1bee98b29431df206912c9 | [
"BSD-3-Clause"
] | 15 | 2015-01-03T07:27:09.000Z | 2020-05-14T07:15:27.000Z | DEBUG = True
ROOT_URLCONF = 'test_app_data.urls'
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
TEMPLATE_LOADERS = (
'django.template.loaders.app_directories.Loader',
)
TEMPLATE_OPTIONS = {
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.template.context_processo... | 24.637931 | 69 | 0.69909 |
0105a6595061636f079690bbd87d145909c155f7 | 7,297 | py | Python | hsv_dot_beer/config/common.py | it-avenger/hsv-beer | 039611bbcf260ad24c9a829fca0af96b4c7da014 | [
"Apache-2.0"
] | null | null | null | hsv_dot_beer/config/common.py | it-avenger/hsv-beer | 039611bbcf260ad24c9a829fca0af96b4c7da014 | [
"Apache-2.0"
] | 6 | 2020-08-03T09:50:01.000Z | 2021-06-10T18:17:28.000Z | hsv_dot_beer/config/common.py | cartacode/hsv_dot_beer | 039611bbcf260ad24c9a829fca0af96b4c7da014 | [
"Apache-2.0"
] | null | null | null | import os
from os.path import join
from distutils.util import strtobool
import dj_database_url
from configurations import Configuration
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
class Common(Configuration):
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.a... | 32.431111 | 113 | 0.570371 |
35ee0627b0d757fb74fbc6be0ef6c100781f2bfd | 2,052 | py | Python | test/vanilla/Expected/AcceptanceTests/BodyDate/bodydate/aio/_configuration.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/BodyDate/bodydate/aio/_configuration.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/BodyDate/bodydate/aio/_configuration.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | # 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 ... | 44.608696 | 108 | 0.680799 |
380c1507bc8ddf9fcb2c8a4ec0c0f2867645c02d | 9,449 | py | Python | src/triage/tracking.py | dssg/triage | 9f96a6be3df6bb04f654f33e127c53351a301d07 | [
"MIT"
] | 160 | 2017-06-13T09:59:59.000Z | 2022-03-21T22:00:35.000Z | src/triage/tracking.py | dssg/triage | 9f96a6be3df6bb04f654f33e127c53351a301d07 | [
"MIT"
] | 803 | 2016-10-21T19:44:02.000Z | 2022-03-29T00:02:33.000Z | src/triage/tracking.py | dssg/triage | 9f96a6be3df6bb04f654f33e127c53351a301d07 | [
"MIT"
] | 59 | 2017-01-31T22:10:22.000Z | 2022-03-19T12:35:03.000Z | import sys
import datetime
import platform
import getpass
import os
import requests
import subprocess
import verboselogs, logging
logger = verboselogs.VerboseLogger(__name__)
from functools import wraps
from triage.util.db import scoped_session, get_for_update
from triage.util.introspection import classpath
from triage... | 32.47079 | 96 | 0.696793 |
b9077fa89c8246f8b65314b84ac6a321505041c2 | 308 | py | Python | pyembroidery-convert.py | teosavv/pyembroidery | 00985f423e64ea1a454e5484012c19a64f26eb2c | [
"MIT"
] | 45 | 2018-07-08T09:49:30.000Z | 2022-03-23T07:01:15.000Z | pyembroidery-convert.py | teosavv/pyembroidery | 00985f423e64ea1a454e5484012c19a64f26eb2c | [
"MIT"
] | 59 | 2018-07-05T22:05:58.000Z | 2022-02-20T01:01:20.000Z | pyembroidery-convert.py | teosavv/pyembroidery | 00985f423e64ea1a454e5484012c19a64f26eb2c | [
"MIT"
] | 23 | 2018-08-10T17:58:04.000Z | 2022-03-29T03:41:46.000Z | from __future__ import print_function
import sys
from pyembroidery import *
if len(sys.argv) <= 1:
print("No command arguments")
exit(1)
input = sys.argv[1]
if len(sys.argv) >= 3:
output = sys.argv[2]
else:
output = sys.argv[1] + ".csv"
pattern = read(input)
write = write(pattern,output)
| 18.117647 | 37 | 0.668831 |
c51ebb956084607c3f7a3b2793698b665b55fd6a | 926 | py | Python | museosMadrid/migrations/0002_auto_20180517_1948.py | AlbertoCoding/X-Serv-Practica-Museos | 5d3e3c99b8750ece9973f4e04ae3c3bfe77f3946 | [
"Apache-2.0"
] | null | null | null | museosMadrid/migrations/0002_auto_20180517_1948.py | AlbertoCoding/X-Serv-Practica-Museos | 5d3e3c99b8750ece9973f4e04ae3c3bfe77f3946 | [
"Apache-2.0"
] | null | null | null | museosMadrid/migrations/0002_auto_20180517_1948.py | AlbertoCoding/X-Serv-Practica-Museos | 5d3e3c99b8750ece9973f4e04ae3c3bfe77f3946 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('museosMadrid', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='museo',
name='most... | 26.457143 | 73 | 0.565875 |
59a55c99b76c84dd0197728ea8fdf8f86a6b45b4 | 33,585 | py | Python | Lib/os.py | lazylife7157/RustPython | 84f08c85d9f0295d2a1905b5065498181eb442c7 | [
"MIT"
] | null | null | null | Lib/os.py | lazylife7157/RustPython | 84f08c85d9f0295d2a1905b5065498181eb442c7 | [
"MIT"
] | null | null | null | Lib/os.py | lazylife7157/RustPython | 84f08c85d9f0295d2a1905b5065498181eb442c7 | [
"MIT"
] | null | null | null | r"""OS routines for NT or Posix depending on what system we're on.
This exports:
- all functions from posix or nt, e.g. unlink, stat, etc.
- os.path is either posixpath or ntpath
- os.name is either 'posix' or 'nt'
- os.curdir is a string representing the current directory (always '.')
- os.pardir is a strin... | 35.427215 | 95 | 0.624833 |
fa6b60c245da8136f6d940c68e7d2ea60515cc22 | 657 | py | Python | pilot/pilot.py | pointerboy/atspilot | a70bf67c5dd6360cd5e1fe7dce50c18266560e5f | [
"MIT"
] | null | null | null | pilot/pilot.py | pointerboy/atspilot | a70bf67c5dd6360cd5e1fe7dce50c18266560e5f | [
"MIT"
] | null | null | null | pilot/pilot.py | pointerboy/atspilot | a70bf67c5dd6360cd5e1fe7dce50c18266560e5f | [
"MIT"
] | null | null | null | import numpy as np
from PIL import ImageGrab
import cv2
import time
from pilot.input.d3_directkeys import ReleaseKey, PressKey, Keys
last_time = time.time()
def process_img(original):
new_img = cv2.cvtColor(original, cv2.COLOR_BGR2GRAY)
new_img = cv2.Canny(new_img, threshold1=200, threshold2=300)
return ... | 27.375 | 64 | 0.695586 |
a5d26bb656b38b9af4e3be7d0a397eb732c98fcb | 98,142 | py | Python | droidlet/perception/semantic_parsing/nsp_transformer_model/modeling_utils.py | colesbury/fairo | 9e50a3aa7369c68c80e84d80abd5fcdee8a9277a | [
"MIT"
] | 73 | 2021-09-14T19:24:45.000Z | 2022-03-27T06:43:26.000Z | droidlet/perception/semantic_parsing/nsp_transformer_model/modeling_utils.py | colesbury/fairo | 9e50a3aa7369c68c80e84d80abd5fcdee8a9277a | [
"MIT"
] | 268 | 2021-09-14T22:40:23.000Z | 2022-03-31T23:01:54.000Z | droidlet/perception/semantic_parsing/nsp_transformer_model/modeling_utils.py | colesbury/fairo | 9e50a3aa7369c68c80e84d80abd5fcdee8a9277a | [
"MIT"
] | 20 | 2021-09-14T19:24:47.000Z | 2022-03-30T19:03:44.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors, Facebook AI Research authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | 46.076056 | 197 | 0.621385 |
5cd22db48003f7443b23858a0621a32de463ca88 | 4,364 | py | Python | deprecated/gen_soap_kmat_deprecated.py | BingqingCheng/ASAP | a92dd34eaa092dcbe46163e000ebd2ccee22f8ae | [
"MIT"
] | 74 | 2020-01-09T10:38:39.000Z | 2022-03-04T15:09:05.000Z | deprecated/gen_soap_kmat_deprecated.py | FelixWodaczek/ASAP | d34a064cd7e409ad8b5ae0dec4f1c0a621717773 | [
"MIT"
] | 31 | 2020-01-30T13:15:42.000Z | 2022-03-03T05:42:51.000Z | deprecated/gen_soap_kmat_deprecated.py | FelixWodaczek/ASAP | d34a064cd7e409ad8b5ae0dec4f1c0a621717773 | [
"MIT"
] | 14 | 2020-02-23T15:03:31.000Z | 2022-03-04T15:04:04.000Z | #!/usr/bin/python3
"""
python3 gen_soap_kmat.py --fxyz *.xyz --dict *.xyz --prefix $prefix
--rcut $rcut --n $nmax --l $lmax --g $g --periodic True/False --plot True/False
"""
import argparse
import matplotlib.pyplot as plt
import numpy as np
from ase.io import read
from dscribe.descriptors import SOAP
from dscribe.ke... | 39.672727 | 119 | 0.64253 |
effccdfece600e5beffda080862898774b76c397 | 13,489 | py | Python | pytorch_sound/trainer.py | lunarbridge/pytorch_sound | 61270221d85fefd5aee4f015caf9a0375575019e | [
"BSD-2-Clause"
] | null | null | null | pytorch_sound/trainer.py | lunarbridge/pytorch_sound | 61270221d85fefd5aee4f015caf9a0375575019e | [
"BSD-2-Clause"
] | null | null | null | pytorch_sound/trainer.py | lunarbridge/pytorch_sound | 61270221d85fefd5aee4f015caf9a0375575019e | [
"BSD-2-Clause"
] | null | null | null | import abc
import glob
import os
import torch.nn as nn
import matplotlib.pyplot as plt
import numpy as np
import torch
import enum
from pathlib import Path
from typing import Tuple, Dict, Any
from tensorboardX import SummaryWriter
from collections import defaultdict
from pytorch_sound.settings import SAMPLE_RATE
from ... | 35.311518 | 123 | 0.581956 |
090cf28077c12f4fe796d3972039330f125d63d6 | 12,490 | py | Python | filebeat/tests/system/test_modules.py | ByteInternet/beats | fe23344906fbd4f0db3142738071225ae7c64644 | [
"Apache-2.0"
] | 4 | 2018-05-28T00:45:15.000Z | 2022-01-10T16:36:40.000Z | filebeat/tests/system/test_modules.py | ByteInternet/beats | fe23344906fbd4f0db3142738071225ae7c64644 | [
"Apache-2.0"
] | null | null | null | filebeat/tests/system/test_modules.py | ByteInternet/beats | fe23344906fbd4f0db3142738071225ae7c64644 | [
"Apache-2.0"
] | 3 | 2019-10-29T11:33:17.000Z | 2020-10-16T09:11:00.000Z | from filebeat import BaseTest
from beat.beat import INTEGRATION_TESTS
import os
import unittest
import glob
import shutil
import subprocess
from elasticsearch import Elasticsearch
import json
import logging
from parameterized import parameterized
def load_fileset_test_cases():
"""
Creates a list of all module... | 38.549383 | 133 | 0.53787 |
fc4b13778f3cf2b1da5356b54a3909eb06b975ef | 4,318 | py | Python | src/LossFunction.py | askarum/CS547project | 73e8da0d4113f9ec3be374958da9dc165212d722 | [
"MIT"
] | null | null | null | src/LossFunction.py | askarum/CS547project | 73e8da0d4113f9ec3be374958da9dc165212d722 | [
"MIT"
] | 3 | 2021-05-15T03:15:45.000Z | 2021-05-15T03:16:36.000Z | src/LossFunction.py | askarum/CS547project | 73e8da0d4113f9ec3be374958da9dc165212d722 | [
"MIT"
] | null | null | null | import torch
import torch.nn
import torch.nn.functional as _F
#Thanks to Askar for finding this.
#TODO: Make sure to cite the underlying paper in our writeup.
#https://pytorch.org/docs/stable/generated/torch.nn.TripletMarginLoss.html
LossFunction = torch.nn.TripletMarginLoss
class SphereNormLoss(torch.nn.modules.l... | 42.333333 | 150 | 0.649375 |
0dda0edfa26992ab1b5a69e34dd4e8c2dd0e4cd2 | 517 | py | Python | src/Pyro4/constants.py | wronglink/Pyro4 | 3f78dcb6dc163913b385f22b318b94c9806df839 | [
"MIT"
] | null | null | null | src/Pyro4/constants.py | wronglink/Pyro4 | 3f78dcb6dc163913b385f22b318b94c9806df839 | [
"MIT"
] | null | null | null | src/Pyro4/constants.py | wronglink/Pyro4 | 3f78dcb6dc163913b385f22b318b94c9806df839 | [
"MIT"
] | null | null | null | """
Definitions of various hard coded constants.
Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
"""
# Pyro version
VERSION = "4.35"
# standard object name for the Daemon object
DAEMON_NAME = "Pyro.Daemon"
# standard name for the Name server itself
NAMESERVER_NAME = "Py... | 24.619048 | 92 | 0.727273 |
d13fd45d5c3c776e634ffd61d4e813dd5bf10b0a | 260 | py | Python | nexus/meta_api/query_extensionner/grammar/__init__.py | RobbiNespu/hyperboria | 7db858386f1a20e8d49bc16f53bfd7f1e4d03f7e | [
"Unlicense"
] | 54 | 2021-01-07T03:02:36.000Z | 2022-03-28T17:19:29.000Z | nexus/meta_api/query_extensionner/grammar/__init__.py | the-superpirate/hyperboria | 74776166158d07b199677f9738862e5f1fa54367 | [
"Unlicense"
] | 10 | 2021-01-08T17:38:59.000Z | 2022-02-28T14:34:45.000Z | nexus/meta_api/query_extensionner/grammar/__init__.py | the-superpirate/hyperboria | 74776166158d07b199677f9738862e5f1fa54367 | [
"Unlicense"
] | 16 | 2020-12-28T18:31:44.000Z | 2022-02-22T15:00:53.000Z | from .parser import parser
from .tree import OrOperation
from .tree_transformer import (
FieldResolver,
MorphyResolver,
UnknownOperationResolver,
)
__all__ = ['parser', 'FieldResolver', 'MorphyResolver', 'OrOperation', 'UnknownOperationResolver']
| 26 | 98 | 0.765385 |
3227d0139adc9bbb2497a66ac09b994ea1bde168 | 272 | py | Python | unique_word_occurences.py | krishnakanth-G/python-works | 1186c40da20ca94be3b84089ffcf8130be3448de | [
"MIT"
] | null | null | null | unique_word_occurences.py | krishnakanth-G/python-works | 1186c40da20ca94be3b84089ffcf8130be3448de | [
"MIT"
] | null | null | null | unique_word_occurences.py | krishnakanth-G/python-works | 1186c40da20ca94be3b84089ffcf8130be3448de | [
"MIT"
] | null | null | null | string = "one two three one one two three"
words = string.split()
unique = []
for word in words:
if word not in unique:
unique.append(word)
for i in range(0,len(unique)):
counts = string.count(unique[i])
print("('",unique[i],"',",counts,")",end =" ")
| 24.727273 | 50 | 0.610294 |
9ef21cc156b03201198a75956c6a75111fb9e90f | 2,446 | py | Python | gcloud/apigw/views/get_task_detail.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | 881 | 2019-03-25T02:45:42.000Z | 2022-03-30T09:10:49.000Z | gcloud/apigw/views/get_task_detail.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | 3,303 | 2019-03-25T04:18:03.000Z | 2022-03-31T11:52:03.000Z | gcloud/apigw/views/get_task_detail.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | 395 | 2019-03-25T02:53:36.000Z | 2022-03-31T08:37:28.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 42.172414 | 115 | 0.763696 |
d7b4c2dd4fe5034b95d4435cc084f46dc264e1a7 | 1,749 | py | Python | test/viz/test_heatmap.py | khourhin/sequana | c56d4490b7c8edc8a0f63fd60578eb72ed64f1b5 | [
"BSD-3-Clause"
] | 138 | 2016-07-13T06:24:45.000Z | 2022-03-28T13:12:03.000Z | test/viz/test_heatmap.py | khourhin/sequana | c56d4490b7c8edc8a0f63fd60578eb72ed64f1b5 | [
"BSD-3-Clause"
] | 655 | 2016-03-10T17:33:40.000Z | 2022-03-30T16:10:45.000Z | test/viz/test_heatmap.py | khourhin/sequana | c56d4490b7c8edc8a0f63fd60578eb72ed64f1b5 | [
"BSD-3-Clause"
] | 39 | 2016-11-04T11:40:58.000Z | 2022-03-15T08:12:29.000Z | from sequana.viz import Heatmap
from sequana import sequana_data
def test_heatmap():
filename = sequana_data("test_heatmap.csv")
import pandas as pd
data = pd.read_csv(filename, skiprows=2, index_col=0)
h = Heatmap(data)
h.plot(cmap='hot')
h.row_method= 'single'
h.col_method= 'single'
... | 25.720588 | 71 | 0.643796 |
a89fd375a2fe3143c53fd46cf21acd16ca5ecd55 | 3,874 | py | Python | src/gui/icon.py | Epihaius/panda3dstudio | f5c62ca49617cae1aa5aa5b695200027da99e242 | [
"BSD-3-Clause"
] | 63 | 2016-01-02T16:28:47.000Z | 2022-01-19T11:29:51.000Z | src/gui/icon.py | Epihaius/panda3dstudio | f5c62ca49617cae1aa5aa5b695200027da99e242 | [
"BSD-3-Clause"
] | 12 | 2016-06-12T14:14:15.000Z | 2020-12-18T16:11:45.000Z | src/gui/icon.py | Epihaius/panda3dstudio | f5c62ca49617cae1aa5aa5b695200027da99e242 | [
"BSD-3-Clause"
] | 17 | 2016-05-23T00:02:27.000Z | 2021-04-25T17:48:27.000Z | from .base import *
class Icon(Widget):
def __init__(self, parent, icon_id):
self.type = "widget"
self.widget_type = "icon"
self._parent = parent
self._id = icon_id
self.node = parent.node.attach_new_node("icon_widget")
self.image_offset = (0, 0)
self.oute... | 24.36478 | 76 | 0.581569 |
702f54af93e4b35cb7420af24a69635f81f0b010 | 10,453 | py | Python | src/image_builder.py | Lokiiiiii/deep-learning-containers | f54b733567fd741b12362dc71cf93a72b5da1c82 | [
"Apache-2.0"
] | 1 | 2021-07-10T14:01:23.000Z | 2021-07-10T14:01:23.000Z | src/image_builder.py | Lokiiiiii/deep-learning-containers | f54b733567fd741b12362dc71cf93a72b5da1c82 | [
"Apache-2.0"
] | null | null | null | src/image_builder.py | Lokiiiiii/deep-learning-containers | f54b733567fd741b12362dc71cf93a72b5da1c82 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2019-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompany... | 36.936396 | 158 | 0.623553 |
34075f0c35d1358a80efd22671b1553e0b415a15 | 650 | py | Python | interaction/migrations/0004_auto_20220225_1650.py | protwis/Protwis | fdcad0a2790721b02c0d12d8de754313714c575e | [
"Apache-2.0"
] | null | null | null | interaction/migrations/0004_auto_20220225_1650.py | protwis/Protwis | fdcad0a2790721b02c0d12d8de754313714c575e | [
"Apache-2.0"
] | null | null | null | interaction/migrations/0004_auto_20220225_1650.py | protwis/Protwis | fdcad0a2790721b02c0d12d8de754313714c575e | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.1 on 2022-02-25 15:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('interaction', '0003_auto_20180117_1457'),
]
operations = [
migrations.RemoveField(
model_name='residuefragmentatom',
name='i... | 23.214286 | 51 | 0.587692 |
dc6e0cfac3804c44d3f12e1f88d1982300419fdb | 17,110 | py | Python | tb_rest_client/models/models_pe/__init__.py | fargiolas/thingsboard-python-rest-client | 8c439e27218226b356e8203c2a7f1239278669c0 | [
"Apache-2.0"
] | null | null | null | tb_rest_client/models/models_pe/__init__.py | fargiolas/thingsboard-python-rest-client | 8c439e27218226b356e8203c2a7f1239278669c0 | [
"Apache-2.0"
] | null | null | null | tb_rest_client/models/models_pe/__init__.py | fargiolas/thingsboard-python-rest-client | 8c439e27218226b356e8203c2a7f1239278669c0 | [
"Apache-2.0"
] | null | null | null | from .default_device_profile_transport_configuration import DefaultDeviceProfileTransportConfiguration
from .json_node import JsonNode
from .merged_user_permissions import MergedUserPermissions
from .page_data_edge import PageDataEdge
from .tenant_solution_template_info import TenantSolutionTemplateInfo
from .tenant_in... | 54.14557 | 113 | 0.907832 |
5ac64234df577f2d75b9f1c40f5e0556db76caca | 5,135 | py | Python | testfixtures/tdatetime.py | cjw296/testfixtures | 1bf1e6fe1e111210d6d7fbcd00feb564095ffd02 | [
"MIT"
] | null | null | null | testfixtures/tdatetime.py | cjw296/testfixtures | 1bf1e6fe1e111210d6d7fbcd00feb564095ffd02 | [
"MIT"
] | null | null | null | testfixtures/tdatetime.py | cjw296/testfixtures | 1bf1e6fe1e111210d6d7fbcd00feb564095ffd02 | [
"MIT"
] | null | null | null | # Copyright (c) 2008-2013 Simplistix Ltd
# See license.txt for license details.
from calendar import timegm
from datetime import datetime, timedelta, date
from testfixtures.compat import new_class
@classmethod
def add(cls,*args,**kw):
if 'tzinfo' in kw or len(args)>7:
raise TypeError('Cannot add tzinfo to... | 24.6875 | 73 | 0.559299 |
09413fe43ff8fd03255899ddd2ff3133ad56eb7f | 3,637 | py | Python | scripts/analog_io_rampup.py | maymohan/baxter_examples | 37dbb35ccb02356de76ea64fda61b5389b0a8f8c | [
"BSD-3-Clause"
] | null | null | null | scripts/analog_io_rampup.py | maymohan/baxter_examples | 37dbb35ccb02356de76ea64fda61b5389b0a8f8c | [
"BSD-3-Clause"
] | null | null | null | scripts/analog_io_rampup.py | maymohan/baxter_examples | 37dbb35ccb02356de76ea64fda61b5389b0a8f8c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2013-2015, Rethink Robotics
# 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,
# ... | 35.656863 | 77 | 0.708826 |
829b61452447b60eace17e4106202fc37202d7e7 | 73 | py | Python | klickbrick/script.py | jms/klickbrick | af2ae2c6692f91639dd6f9cf67fac8acaa48e115 | [
"MIT"
] | 1 | 2021-07-16T03:59:22.000Z | 2021-07-16T03:59:22.000Z | klickbrick/script.py | jms/klickbrick | af2ae2c6692f91639dd6f9cf67fac8acaa48e115 | [
"MIT"
] | null | null | null | klickbrick/script.py | jms/klickbrick | af2ae2c6692f91639dd6f9cf67fac8acaa48e115 | [
"MIT"
] | null | null | null | def greeting(name):
return f"Hello {name}"
def onboard():
pass
| 10.428571 | 26 | 0.616438 |
e65ee5885917b60296b659bacf7a0cf5d6ab344b | 32,158 | py | Python | test/functional/fundrawtransaction.py | Pakcoin-project/pakcoinold | 02cb74e55daecaaf2c590753cdc6be245b448dd0 | [
"MIT"
] | 3 | 2019-02-08T10:36:22.000Z | 2021-02-17T22:05:25.000Z | test/functional/fundrawtransaction.py | Pakcoin-project/pakcoinold | 02cb74e55daecaaf2c590753cdc6be245b448dd0 | [
"MIT"
] | null | null | null | test/functional/fundrawtransaction.py | Pakcoin-project/pakcoinold | 02cb74e55daecaaf2c590753cdc6be245b448dd0 | [
"MIT"
] | 3 | 2019-02-08T10:36:26.000Z | 2020-04-10T09:35:16.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the fundrawtransaction RPC."""
from test_framework.test_framework import BitcoinTestFramework
fro... | 44.601942 | 223 | 0.569812 |
6da27a5bbeffb8372223cf31f66f93b9ab4a8c44 | 753 | py | Python | python/20200714/ex03.py | kogepanh/class-numeric | 4fd4cb56818339c6348f9f691c64fb33a09e1b69 | [
"MIT"
] | null | null | null | python/20200714/ex03.py | kogepanh/class-numeric | 4fd4cb56818339c6348f9f691c64fb33a09e1b69 | [
"MIT"
] | null | null | null | python/20200714/ex03.py | kogepanh/class-numeric | 4fd4cb56818339c6348f9f691c64fb33a09e1b69 | [
"MIT"
] | null | null | null | #ex03
def rev(lst):
if lst == []:
return []
else:
return rev(lst[1:]) + [lst[0]]
def deeprev(lst):
if lst == []:
return []
if isinstance(lst[0], list):
lst[0] = deeprev(lst[0])
return deeprev(lst[1:]) + [lst[0]]
def count_items(itemlist):
if len(itemlist) == 0:
... | 22.147059 | 55 | 0.5166 |
f20d93afee69f62e6c751a48f7934766e7db26bb | 2,314 | py | Python | anthos/replace_ws_vars.py | datapipertech/google-anthos | 48148457e884ba818a3d57bb4a8420907087e588 | [
"Apache-2.0"
] | 6 | 2021-05-12T08:08:55.000Z | 2021-12-13T08:09:48.000Z | anthos/replace_ws_vars.py | datapipertech/google-anthos | 48148457e884ba818a3d57bb4a8420907087e588 | [
"Apache-2.0"
] | 15 | 2021-03-29T22:45:48.000Z | 2021-07-28T20:36:00.000Z | anthos/replace_ws_vars.py | datapipertech/google-anthos | 48148457e884ba818a3d57bb4a8420907087e588 | [
"Apache-2.0"
] | 7 | 2021-04-19T19:48:08.000Z | 2022-02-22T05:21:42.000Z | import json
import ipaddress
import os
from subprocess import Popen
private_subnets = '${private_subnets}'
vsphere_network = '${vsphere_network}'
domain_name = '${domain_name}'
hostname = 'admin-workstation'
subnets = json.loads(private_subnets)
for subnet in subnets:
if subnet['name'] == vsphere_network:
... | 36.730159 | 102 | 0.725583 |
c432aa6709b8d6d28387ede6e024a95f95c80988 | 1,459 | py | Python | tests/integration/goldens/logging/samples/generated_samples/logging_generated_logging_v2_config_service_v2_delete_sink_sync.py | znowdev/gapic-generator-python | 18ba7a0933461dfa3ecfccf48f2233d65824144a | [
"Apache-2.0"
] | null | null | null | tests/integration/goldens/logging/samples/generated_samples/logging_generated_logging_v2_config_service_v2_delete_sink_sync.py | znowdev/gapic-generator-python | 18ba7a0933461dfa3ecfccf48f2233d65824144a | [
"Apache-2.0"
] | null | null | null | tests/integration/goldens/logging/samples/generated_samples/logging_generated_logging_v2_config_service_v2_delete_sink_sync.py | znowdev/gapic-generator-python | 18ba7a0933461dfa3ecfccf48f2233d65824144a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 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... | 31.717391 | 85 | 0.757368 |
3c86e794250c54a081f2f417cd8ed72cd3d76bc8 | 28,227 | py | Python | filer/models/filemodels.py | pbs/django-filer | c862a84d4e1d86c14eeb509e341f6a7d39a421bf | [
"BSD-3-Clause"
] | 1 | 2015-03-03T15:49:14.000Z | 2015-03-03T15:49:14.000Z | filer/models/filemodels.py | pbs/django-filer | c862a84d4e1d86c14eeb509e341f6a7d39a421bf | [
"BSD-3-Clause"
] | 10 | 2015-04-08T14:16:52.000Z | 2021-12-15T16:17:57.000Z | filer/models/filemodels.py | pbs/django-filer | c862a84d4e1d86c14eeb509e341f6a7d39a421bf | [
"BSD-3-Clause"
] | null | null | null | #-*- coding: utf-8 -*-
import polymorphic
import hashlib
import os
import filer
import logging
import operator
from django.contrib.auth import models as auth_models
from django.urls import reverse
from django.core.files.base import ContentFile
from django.core.exceptions import ValidationError
from django.db import (m... | 37.837802 | 108 | 0.609735 |
856e0fc41f3da9e4faff817456e02f16eaf84e02 | 90 | py | Python | katas/kyu_7/how_many_are_smaller_than_me.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | katas/kyu_7/how_many_are_smaller_than_me.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | katas/kyu_7/how_many_are_smaller_than_me.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | def smaller(arr):
return [sum(b < a for b in arr[i + 1:]) for i, a in enumerate(arr)]
| 30 | 71 | 0.6 |
dcf9b52ce4e3f3b709da9963eebaeb4cbcf2020b | 1,805 | py | Python | allauth/socialaccount/providers/openstreetmap/views.py | christopherpoland/django-allauth | df78274669a87f5c1a9147843b353353230d1940 | [
"MIT"
] | 2 | 2022-01-24T23:30:18.000Z | 2022-01-26T00:21:22.000Z | allauth/socialaccount/providers/openstreetmap/views.py | christopherpoland/django-allauth | df78274669a87f5c1a9147843b353353230d1940 | [
"MIT"
] | 8 | 2021-04-08T21:58:27.000Z | 2022-03-12T00:44:58.000Z | allauth/socialaccount/providers/openstreetmap/views.py | safwanrahman/django-allauth | dac31fdac2c13a97829e6879e09431c735abab4e | [
"MIT"
] | 3 | 2020-06-21T20:52:12.000Z | 2021-07-31T11:07:21.000Z | from xml.etree import ElementTree
from xml.parsers.expat import ExpatError
from allauth.compat import six
from allauth.socialaccount.providers.oauth.client import OAuth
from allauth.socialaccount.providers.oauth.views import (
OAuthAdapter,
OAuthCallbackView,
OAuthLoginView,
)
from .provider import OpenSt... | 36.1 | 76 | 0.685873 |
a20cecf843606dcb3aab541a89a20c8dcf81ca9e | 935 | py | Python | Graphs/KruskalAlog.py | Saicharan67/Interview-Coding-Questions | b28cccd41e380f15b833039d687931570908adfb | [
"MIT"
] | 12 | 2021-06-18T16:24:27.000Z | 2021-11-04T03:30:00.000Z | Graphs/KruskalAlog.py | Saicharan67/Interview-Coding-Questions | b28cccd41e380f15b833039d687931570908adfb | [
"MIT"
] | 32 | 2021-10-01T07:15:00.000Z | 2021-11-05T15:35:53.000Z | Graphs/KruskalAlog.py | Saicharan67/Interview-Coding-Questions | b28cccd41e380f15b833039d687931570908adfb | [
"MIT"
] | 21 | 2021-09-29T09:16:31.000Z | 2021-10-30T10:06:21.000Z |
def GetParent(node, parent):
if node == parent[node]:
return node
parent[node] = GetParent(parent[node], parent)
return parent[node]
def union(u, v, parent, rank):
u = GetParent(u, parent)
v = GetParent(v, parent)
if rank[u] < rank[v]:
parent[u] = v
elif rank[u] > rank[... | 18.7 | 57 | 0.48877 |
92858c527c1a133eed23663de4dbb5004052fbbd | 1,240 | py | Python | base/configs/custom.py | titorenko/compartmental-model | fe022ef754a2b07351db8f48e5b0fdfdbbcebdea | [
"MIT"
] | null | null | null | base/configs/custom.py | titorenko/compartmental-model | fe022ef754a2b07351db8f48e5b0fdfdbbcebdea | [
"MIT"
] | null | null | null | base/configs/custom.py | titorenko/compartmental-model | fe022ef754a2b07351db8f48e5b0fdfdbbcebdea | [
"MIT"
] | null | null | null | from base.initialise_parameters import preparePopulationFrame, params
# camp
camp = 'Moria'
population_frame, population = preparePopulationFrame(camp)
# from github issue
# if not used, set timings to e.g. [0,0] or any other interval of 0 length or outside caluclated window
control_dict = dict( # contains our 6 dif... | 35.428571 | 150 | 0.637903 |
cf7b1209097cecdc280f18cbfdf6fd6fd5b0eaac | 981 | py | Python | services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/dependencies.py | elisabettai/osparc-simcore | ad7b6e05111b50fe95e49306a992170490a7247f | [
"MIT"
] | null | null | null | services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/dependencies.py | elisabettai/osparc-simcore | ad7b6e05111b50fe95e49306a992170490a7247f | [
"MIT"
] | 55 | 2018-05-15T09:47:00.000Z | 2022-03-31T06:56:50.000Z | services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/dependencies.py | odeimaiz/osparc-simcore | 71c2fc58dcfe067487dcd75cb70298a4d6237e97 | [
"MIT"
] | 1 | 2020-04-22T15:06:58.000Z | 2020-04-22T15:06:58.000Z | from fastapi import Depends, FastAPI, Request
from fastapi.datastructures import State
from ..models.domains.shared_store import SharedStore
from ..models.schemas.application_health import ApplicationHealth
from .rabbitmq import RabbitMQ
from .settings import DynamicSidecarSettings
def get_application(request: Reque... | 28.852941 | 86 | 0.783894 |
36c672f6786c4de09170b8a5229faf7a70b3d09e | 6,293 | py | Python | hlso/web/callbacks.py | holtgrewe/clsify | ad5efecd1d0114898e10498434bded32840d9a4b | [
"MIT"
] | null | null | null | hlso/web/callbacks.py | holtgrewe/clsify | ad5efecd1d0114898e10498434bded32840d9a4b | [
"MIT"
] | 4 | 2019-12-26T22:28:06.000Z | 2020-01-16T21:37:58.000Z | hlso/web/callbacks.py | holtgrewe/clsify | ad5efecd1d0114898e10498434bded32840d9a4b | [
"MIT"
] | null | null | null | """Callback code."""
import base64
import json
import os
import tempfile
from dash.dependencies import Input, Output, State
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from logzero import logger
import pandas as pd
from ..conversion import convert_se... | 40.6 | 100 | 0.505959 |
c0a9e8cca691fd9a9993816af7e07d8c83bbd71a | 829 | py | Python | settings/local_template.py | evertrol/det | 5d397010bc9a608dcb38c176bb3f89e4f17ab272 | [
"MIT"
] | null | null | null | settings/local_template.py | evertrol/det | 5d397010bc9a608dcb38c176bb3f89e4f17ab272 | [
"MIT"
] | null | null | null | settings/local_template.py | evertrol/det | 5d397010bc9a608dcb38c176bb3f89e4f17ab272 | [
"MIT"
] | null | null | null | from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
# SECURITY WARNING: keep the secret key used in production secret!
# Use for example the command line command below to generatea a secret key
# $ python -c 'from django.core.management import utils; print(utils.get_random_secret_key())'
SECRET... | 30.703704 | 95 | 0.691194 |
3fcffddc8ab8002248a2e6632d9865088a173714 | 2,278 | py | Python | checker.py | nwtnni/java-autograder | acad5135fb668eaa218a314c02274be76a1911e8 | [
"MIT"
] | 2 | 2017-09-27T12:05:56.000Z | 2017-09-27T18:36:19.000Z | checker.py | nwtnni/submission-checker | acad5135fb668eaa218a314c02274be76a1911e8 | [
"MIT"
] | null | null | null | checker.py | nwtnni/submission-checker | acad5135fb668eaa218a314c02274be76a1911e8 | [
"MIT"
] | null | null | null | from util import *
from functools import reduce
ALLOWED_BY_DEFAULT = ["txt", "java", "pdf", "classpath", "jpg", "png", "DS_Store", "ctr"]
class Checker:
_REQUIRE_DIR = path("whitelists")
def __init__(self, assignment):
with open(join(Checker._REQUIRE_DIR, add_ext(assignment, ".txt")), "r") as f:
... | 37.966667 | 101 | 0.565847 |
d3c5b2007a1146b84250fb0fd62ee9ab462a8de6 | 2,405 | py | Python | source/modules/synt/variable_algorithms.py | SyntLang/SyntPy | fdbfe4c4083193d430cbdf5a0968556ba9f72f0f | [
"MIT"
] | null | null | null | source/modules/synt/variable_algorithms.py | SyntLang/SyntPy | fdbfe4c4083193d430cbdf5a0968556ba9f72f0f | [
"MIT"
] | null | null | null | source/modules/synt/variable_algorithms.py | SyntLang/SyntPy | fdbfe4c4083193d430cbdf5a0968556ba9f72f0f | [
"MIT"
] | null | null | null | # Variable Algorithms
# meta
def meta(self, *args):
# check if run_status is run
if self.run_status == "run":
pass
else:
return
# get input data
meta_name = args[0] if len(args) > 0 else None
meta_value = args[1] if len(args) > 1 else None
# validate input data
if meta_name is None:
se... | 24.05 | 132 | 0.669023 |
a154f3539c34b3b8e540c5840fec5ff9441ad356 | 10,169 | py | Python | mps_database/tools/mps_checkout.py | slaclab/mps_database | 023ed9bb3b333e382cc612f816c3f4b295b66a4c | [
"BSD-3-Clause-LBNL"
] | null | null | null | mps_database/tools/mps_checkout.py | slaclab/mps_database | 023ed9bb3b333e382cc612f816c3f4b295b66a4c | [
"BSD-3-Clause-LBNL"
] | 1 | 2017-07-07T21:31:59.000Z | 2017-07-07T21:31:59.000Z | mps_database/tools/mps_checkout.py | slaclab/mps_database | 023ed9bb3b333e382cc612f816c3f4b295b66a4c | [
"BSD-3-Clause-LBNL"
] | 4 | 2017-07-07T20:10:54.000Z | 2020-12-13T00:03:37.000Z | #This script will check that all thresholds for an app id are corectly functioning
#The user will then check that the screen shows the expected ouput
#
import sys
import os
from datetime import datetime, date
import time
import argparse
import epics as e
import json
def process_args(argv):
parser=argparse.Argume... | 45.195556 | 181 | 0.567411 |
25212cc10caaa3248f7fa287ddf913dccd307ef0 | 5,274 | py | Python | tests/providers/apache/hive/__init__.py | takuti/airflow | 0ac3b8c3dd749c59e60cf0169580b9e7c5049d9e | [
"Apache-2.0"
] | 8,092 | 2016-04-27T20:32:29.000Z | 2019-01-05T07:39:33.000Z | tests/providers/apache/hive/__init__.py | takuti/airflow | 0ac3b8c3dd749c59e60cf0169580b9e7c5049d9e | [
"Apache-2.0"
] | 2,961 | 2016-05-05T07:16:16.000Z | 2019-01-05T08:47:59.000Z | tests/providers/apache/hive/__init__.py | takuti/airflow | 0ac3b8c3dd749c59e60cf0169580b9e7c5049d9e | [
"Apache-2.0"
] | 3,546 | 2016-05-04T20:33:16.000Z | 2019-01-05T05:14:26.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... | 31.023529 | 100 | 0.668373 |
157e6dc70fd6712a2308dc620c14ea32d40d8156 | 147 | py | Python | p4_5.py | yujie24/Fishc_Python | aef4bd5dbf40e01de56d3eb81c7dfb0c1a1f68d6 | [
"MIT"
] | 1 | 2020-02-16T16:24:40.000Z | 2020-02-16T16:24:40.000Z | p4_5.py | yujie24/Fishc_Python | aef4bd5dbf40e01de56d3eb81c7dfb0c1a1f68d6 | [
"MIT"
] | null | null | null | p4_5.py | yujie24/Fishc_Python | aef4bd5dbf40e01de56d3eb81c7dfb0c1a1f68d6 | [
"MIT"
] | null | null | null | # continue语句:终止本轮循环,并开始下一轮循环
# 注意:在开始下一循环前,会先测试循环条件
for i in range(10):
if i % 2 != 0:
print(i)
continue
i += 2
print(i)
| 13.363636 | 28 | 0.557823 |
a1f6d2b64b732cce94d9a48e9a53b24b588d4ca1 | 9,177 | py | Python | worker.py | jet-black/ppo-lstm-parallel | 4ab5c92602cc9f4c83a24a15717357c56c4a4372 | [
"MIT"
] | 38 | 2018-08-15T19:38:47.000Z | 2022-03-17T10:57:49.000Z | worker.py | JohnSun23/ppo-lstm-parallel | 4ab5c92602cc9f4c83a24a15717357c56c4a4372 | [
"MIT"
] | 1 | 2019-11-14T07:45:58.000Z | 2019-11-14T09:44:45.000Z | worker.py | JohnSun23/ppo-lstm-parallel | 4ab5c92602cc9f4c83a24a15717357c56c4a4372 | [
"MIT"
] | 15 | 2018-08-17T10:00:47.000Z | 2022-03-02T14:00:05.000Z | from multiprocessing import Queue, Process
import numpy as np
from threading import Thread
from agent import PPOAgent
from gather import GatheringWorker
from policy import get_policy
import utils
import environments
class Worker:
def __init__(self, env_producer, idx, master_weights_in_queue, master_weights_out_q... | 44.765854 | 116 | 0.581345 |
c79295f8d4ef8159414bad8b45c61d20ed81ee06 | 145 | py | Python | 2675/2675.py3.py | isac322/BOJ | 35959dd1a63d75ebca9ed606051f7a649d5c0c7b | [
"MIT"
] | 14 | 2017-05-02T02:00:42.000Z | 2021-11-16T07:25:29.000Z | 2675/2675.py3.py | isac322/BOJ | 35959dd1a63d75ebca9ed606051f7a649d5c0c7b | [
"MIT"
] | 1 | 2017-12-25T14:18:14.000Z | 2018-02-07T06:49:44.000Z | 2675/2675.py3.py | isac322/BOJ | 35959dd1a63d75ebca9ed606051f7a649d5c0c7b | [
"MIT"
] | 9 | 2016-03-03T22:06:52.000Z | 2020-04-30T22:06:24.000Z | len = int(input())
while len:
n, st = input().split()
n = int(n)
for i in st:
print(i*n, end = "")
print("")
len -= 1 | 18.125 | 28 | 0.441379 |
4ffb125d73879b0af9fd76d37e830ba53dd240e0 | 1,440 | py | Python | resources/legacy/helper_old.py | andy897221/Proof-of-Play-Flow-Demo | 018ec382801f1363711b7680e728535a2ac94d26 | [
"MIT"
] | null | null | null | resources/legacy/helper_old.py | andy897221/Proof-of-Play-Flow-Demo | 018ec382801f1363711b7680e728535a2ac94d26 | [
"MIT"
] | null | null | null | resources/legacy/helper_old.py | andy897221/Proof-of-Play-Flow-Demo | 018ec382801f1363711b7680e728535a2ac94d26 | [
"MIT"
] | null | null | null | import numpy as np
def getMVP(self):
# use highest parameter based total parameter values of all players
enum = ["gold_per_min", "xp_per_min", "kills_per_min", "last_hits_per_min", "hero_damage_per_min",
"hero_healing_per_min", "tower_damage", "stuns_per_min"]
plyrRating, ratingBase = {"param":... | 46.451613 | 103 | 0.646528 |
5c69c1fd1a48cd5c04cf2fbf4b070bcc5553a510 | 2,620 | py | Python | submodules/datasets/tests/test_open_images_v5.py | khy0809/WeightNet | cd5ea53b42c6169ffd5a0d7d883788fdc871cd1e | [
"MIT"
] | null | null | null | submodules/datasets/tests/test_open_images_v5.py | khy0809/WeightNet | cd5ea53b42c6169ffd5a0d7d883788fdc871cd1e | [
"MIT"
] | null | null | null | submodules/datasets/tests/test_open_images_v5.py | khy0809/WeightNet | cd5ea53b42c6169ffd5a0d7d883788fdc871cd1e | [
"MIT"
] | null | null | null | import os
import sys
import time
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(base_dir)
import datasets
def check_target_value(ds, dst):
idx = 0
image1, (positive_ids, negative_ids) = ds[idx]
_mid_to_idx = {mid: idx for idx, mid in enumerate(ds.classes)}
ind... | 33.164557 | 99 | 0.709542 |
d26a1d21b9a8fe4b753974b37d93a8b45bcf4ef7 | 10,569 | py | Python | cyclegan/train.py | jesa7955/CycleGAN-PyTorch | 521a937b23f258d54ee2a5d7a7f9d925e7e3e63c | [
"BSD-2-Clause"
] | 6 | 2019-11-22T12:26:40.000Z | 2021-07-21T01:48:39.000Z | cyclegan/train.py | jesa7955/CycleGAN-PyTorch | 521a937b23f258d54ee2a5d7a7f9d925e7e3e63c | [
"BSD-2-Clause"
] | null | null | null | cyclegan/train.py | jesa7955/CycleGAN-PyTorch | 521a937b23f258d54ee2a5d7a7f9d925e7e3e63c | [
"BSD-2-Clause"
] | 1 | 2019-12-20T05:03:14.000Z | 2019-12-20T05:03:14.000Z | import argparse
import os
import sys
import itertools
import math
import datetime
import time
import torchvision.transforms as transforms
from torchvision.utils import save_image
from torchvision import datasets
from torch.utils.data import DataLoader
from torch.autograd import Variable
import torch
import torch.nn a... | 43.493827 | 298 | 0.633172 |
68e091b2fef8050c355269c5e4679fea9d7169d7 | 3,100 | py | Python | bandit/plugins/general_bad_file_permissions.py | bittner/bandit | 87ecc4079ea50d77be13ed72bbf5ad2eb0673c64 | [
"Apache-2.0"
] | 1 | 2020-10-05T05:38:26.000Z | 2020-10-05T05:38:26.000Z | bandit/plugins/general_bad_file_permissions.py | bittner/bandit | 87ecc4079ea50d77be13ed72bbf5ad2eb0673c64 | [
"Apache-2.0"
] | null | null | null | bandit/plugins/general_bad_file_permissions.py | bittner/bandit | 87ecc4079ea50d77be13ed72bbf5ad2eb0673c64 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# SPDX-License-Identifier: Apache-2.0
r"""
==================================================
B103: Test for setting permissive file permissions
==================================================
POSIX based operating systems utilize a permissions model to... | 35.227273 | 87 | 0.624194 |
599c4c8df9722c0f7cb01f59953ce67c59b8c6d9 | 1,745 | py | Python | catlas/load_bulk_structures.py | ulissigroup/catlas | 1796bf562f21f4afaee8999bbdf0ed76e63f8501 | [
"MIT"
] | null | null | null | catlas/load_bulk_structures.py | ulissigroup/catlas | 1796bf562f21f4afaee8999bbdf0ed76e63f8501 | [
"MIT"
] | 34 | 2021-12-02T16:55:34.000Z | 2022-03-30T17:58:35.000Z | catlas/load_bulk_structures.py | ulissigroup/catlas | 1796bf562f21f4afaee8999bbdf0ed76e63f8501 | [
"MIT"
] | 1 | 2021-12-14T17:22:19.000Z | 2021-12-14T17:22:19.000Z | """Function to load bulks from an ase.db."""
from ase.db import connect
import os.path
import numpy as np
import pandas as pd
from .dask_utils import SizeDict
import catlas
required_fields = (
"atoms",
"mpid",
"natoms",
"xc",
"nelements",
"elements",
) # These fields are expected to exist in e... | 28.606557 | 109 | 0.507163 |
b61d1629fbda944e517ef38687d8e8b4275a489f | 2,636 | py | Python | fairseq/optim/dynamic_loss_scaler.py | ictnlp/MoE-Waitk | 6f8ca9834c2ab77785ebd93fd569f73c3819340b | [
"MIT"
] | 2 | 2022-03-21T04:35:46.000Z | 2022-03-21T04:36:14.000Z | fairseq/optim/dynamic_loss_scaler.py | ictnlp/MoE-Waitk | 6f8ca9834c2ab77785ebd93fd569f73c3819340b | [
"MIT"
] | null | null | null | fairseq/optim/dynamic_loss_scaler.py | ictnlp/MoE-Waitk | 6f8ca9834c2ab77785ebd93fd569f73c3819340b | [
"MIT"
] | 2 | 2022-03-21T14:22:27.000Z | 2022-03-27T02:31:27.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class DynamicLossScaler(object):
def __init__(
self,
init_scale=2.0**15,
scale_factor=2.0,
scale_window=2... | 37.126761 | 92 | 0.605083 |
f4fceb972b8681c0f2ab2e9ade35cf1d73b49b6e | 1,426 | py | Python | alignment/find_bug/get_max_triples.py | LaudateCorpus1/code-align-evals-data | 97446d992c3785d6605f1500b2c9b95d042e7b9c | [
"MIT"
] | 3 | 2021-07-29T23:40:15.000Z | 2021-08-12T10:18:09.000Z | alignment/find_bug/get_max_triples.py | openai/code-align-evals-data | 97446d992c3785d6605f1500b2c9b95d042e7b9c | [
"MIT"
] | 1 | 2021-09-19T06:44:15.000Z | 2021-09-19T06:44:15.000Z | alignment/find_bug/get_max_triples.py | LaudateCorpus1/code-align-evals-data | 97446d992c3785d6605f1500b2c9b95d042e7b9c | [
"MIT"
] | 1 | 2021-09-19T06:44:03.000Z | 2021-09-19T06:44:03.000Z | def get_max_triples(n):
"""
You are given a positive integer n. You have to create an integer array a of length n.
For each i (1 ≤ i ≤ n), the value of a[i] = i * i - i + 1.
Return the number of triples (a[i], a[j], a[k]) of a where i < j < k,
and a[i] + a[j] + a[k] is a multiple of 3.
... | 25.464286 | 115 | 0.490884 |
2fddbbc4bf88ee87f7e9ea321d31283e576a346a | 6,401 | py | Python | dm_control/scripts/dataset.py | mhauskn/dm_control | b7944e0ed4392924f40a3e5c65b1a93c027b9718 | [
"Apache-2.0"
] | null | null | null | dm_control/scripts/dataset.py | mhauskn/dm_control | b7944e0ed4392924f40a3e5c65b1a93c027b9718 | [
"Apache-2.0"
] | null | null | null | dm_control/scripts/dataset.py | mhauskn/dm_control | b7944e0ed4392924f40a3e5c65b1a93c027b9718 | [
"Apache-2.0"
] | null | null | null | import torch
import h5py
import numpy as np
import bisect
import random
from absl import logging
from torch.utils.data import Dataset
OBS_KEYS = [
'walker/actuator_activation',
'walker/appendages_pos',
'walker/body_height',
'walker/end_effectors_pos',
'walker/joints_pos',
'walker/joints_vel',
... | 37.215116 | 112 | 0.62584 |
eb87a19c45df09ce5f4c0c306bd2c68fc6742d76 | 4,521 | py | Python | benchmark/startQiskit_noisy1633.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy1633.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy1633.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=58
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... | 32.292857 | 82 | 0.61712 |
d71cedee5f4690a5e597744a3615d0446aa5c254 | 6,976 | py | Python | sample-input/benchmarks/LRA/geometry.py | GiudGiud/OpenMOC | 83623ebe64b558d45fa021132f812d425774673f | [
"MIT"
] | null | null | null | sample-input/benchmarks/LRA/geometry.py | GiudGiud/OpenMOC | 83623ebe64b558d45fa021132f812d425774673f | [
"MIT"
] | 1 | 2018-06-26T19:51:58.000Z | 2018-06-26T19:51:58.000Z | sample-input/benchmarks/LRA/geometry.py | GiudGiud/OpenMOC | 83623ebe64b558d45fa021132f812d425774673f | [
"MIT"
] | null | null | null | import openmoc
###############################################################################
# Main Simulation Parameters
###############################################################################
options = openmoc.options.Options()
num_threads = options.getNumThreads()
track_spacing ... | 34.88 | 79 | 0.609375 |
efedaa67534f0eea2de2b39c899b2d47ab60b189 | 11,569 | py | Python | queenbee/repository/package.py | AntoineDao/queenbee | 800d5b26a69cffbce85864ea9430304b7fb8d11a | [
"MIT"
] | null | null | null | queenbee/repository/package.py | AntoineDao/queenbee | 800d5b26a69cffbce85864ea9430304b7fb8d11a | [
"MIT"
] | null | null | null | queenbee/repository/package.py | AntoineDao/queenbee | 800d5b26a69cffbce85864ea9430304b7fb8d11a | [
"MIT"
] | null | null | null | import os
import re
import hashlib
from io import BytesIO
from datetime import datetime
from tarfile import TarInfo, TarFile
from typing import Union, Tuple
from pydantic import Field, constr
from ..plugin import Plugin
from ..recipe import Recipe, BakedRecipe
from ..base.request import make_request, urljoin
from ..... | 30.049351 | 91 | 0.579825 |
86ca9dadf359b2fe4f7d075b2721f428668a7b2f | 16,029 | py | Python | autotest/utilities/test_gdal_contour.py | chambbj/gdal | 3d56aecb5b8e9890dae8f560acd099992e707d12 | [
"MIT"
] | 1 | 2015-02-16T16:51:38.000Z | 2015-02-16T16:51:38.000Z | autotest/utilities/test_gdal_contour.py | theduckylittle/gdal | 61be261cae524582ba28bceebb027cc1e967e0ab | [
"MIT"
] | null | null | null | autotest/utilities/test_gdal_contour.py | theduckylittle/gdal | 61be261cae524582ba28bceebb027cc1e967e0ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: gdal_contour testing
# Author: Even Rouault <even dot rouault @ mines-paris dot org>
#
###################################################... | 36.346939 | 298 | 0.560671 |
098863f81a077da1881631e071b5bb3bf0695592 | 7,300 | py | Python | mastodon/streaming.py | TheoLeCalvar/Mastodon.py | f352142dfd39cf00fbf8a0b0257f1169daad5947 | [
"MIT"
] | 1 | 2019-09-07T17:39:08.000Z | 2019-09-07T17:39:08.000Z | mastodon/streaming.py | TheoLeCalvar/Mastodon.py | f352142dfd39cf00fbf8a0b0257f1169daad5947 | [
"MIT"
] | 1 | 2019-09-24T21:14:32.000Z | 2019-09-24T21:14:32.000Z | mastodon/streaming.py | TheoLeCalvar/Mastodon.py | f352142dfd39cf00fbf8a0b0257f1169daad5947 | [
"MIT"
] | null | null | null | """
Handlers for the Streaming API:
https://github.com/tootsuite/mastodon/blob/master/docs/Using-the-API/Streaming-API.md
"""
import json
import six
from mastodon import Mastodon
from mastodon.Mastodon import MastodonMalformedEventError, MastodonNetworkError, MastodonReadTimeout
from requests.exceptions import Chunked... | 38.421053 | 156 | 0.570685 |
fb4c7c13695cf33b5d774127eb3d8f79c315d094 | 3,825 | py | Python | ceda_cc/unitTestsS2.py | markelg/ceda-cc | 47fa271c04c6fe4dcb10c04bdb389b19a56083f5 | [
"BSD-3-Clause-Clear"
] | null | null | null | ceda_cc/unitTestsS2.py | markelg/ceda-cc | 47fa271c04c6fe4dcb10c04bdb389b19a56083f5 | [
"BSD-3-Clause-Clear"
] | 1 | 2019-07-26T14:45:05.000Z | 2019-07-26T14:45:05.000Z | ceda_cc/unitTestsS2.py | agstephens/ceda-cc | c364d57562fd47a1a1fae8931bcce970975bc3cb | [
"BSD-3-Clause-Clear"
] | null | null | null | import logging, time, os, sys
import utils_c4
import ceda_cc_config.config_c4 as config
from c4_run import fileMetadata, dummy, main
from xceptions import *
from file_utils import installedSupportedNetcdf
#### set up log file ####
tstring2 = '%4.4i%2.2i%2.2i' % time.gmtime()[0:3]
testLogFile = '%s__qclog_%s.txt' % ('... | 34.772727 | 120 | 0.654379 |
74853668e78a54577f2e42f18f05a1e22326e1df | 583 | py | Python | scieio/spectrometry/migrations/0009_auto_20200419_0359.py | arnelimperial/scieio | 279a25766f20d074a3df824c0fbc8b2d8e35f272 | [
"MIT"
] | null | null | null | scieio/spectrometry/migrations/0009_auto_20200419_0359.py | arnelimperial/scieio | 279a25766f20d074a3df824c0fbc8b2d8e35f272 | [
"MIT"
] | 8 | 2021-03-19T01:56:44.000Z | 2022-03-12T00:24:21.000Z | scieio/spectrometry/migrations/0009_auto_20200419_0359.py | arnelimperial/scieio | 279a25766f20d074a3df824c0fbc8b2d8e35f272 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-04-19 00:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spectrometry', '0008_auto_20200419_0304'),
]
operations = [
migrations.AlterField(
model_name='gasms',
name='product... | 24.291667 | 63 | 0.595197 |
783f13e0173ab1561809d43cbe35bf1fdf6966e4 | 4,315 | py | Python | edgelm/examples/textless_nlp/gslm/tools/resynthesize_speech.py | guotao0628/DeepNet | 1ae74d8b44d715bf67c7d64a8efafff4b7c7937a | [
"MIT"
] | 1 | 2021-11-07T00:30:05.000Z | 2021-11-07T00:30:05.000Z | edgelm/examples/textless_nlp/gslm/tools/resynthesize_speech.py | guotao0628/DeepNet | 1ae74d8b44d715bf67c7d64a8efafff4b7c7937a | [
"MIT"
] | null | null | null | edgelm/examples/textless_nlp/gslm/tools/resynthesize_speech.py | guotao0628/DeepNet | 1ae74d8b44d715bf67c7d64a8efafff4b7c7937a | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import gc
import logging
import os
import joblib
import soundfile as sf
import torch
from examples.textless_nlp.... | 32.443609 | 87 | 0.638239 |
e412a783a8f40fa0db336b1df7cd0787e70b688a | 2,448 | py | Python | src/python/src/proteus/websocket.py | Xilinx/inference-server | 7477b7dc420ce4cd0d7e1d9914b71898e97d6814 | [
"Apache-2.0"
] | 4 | 2021-11-03T21:32:55.000Z | 2022-02-17T17:13:16.000Z | src/python/src/proteus/websocket.py | Xilinx/inference-server | 7477b7dc420ce4cd0d7e1d9914b71898e97d6814 | [
"Apache-2.0"
] | null | null | null | src/python/src/proteus/websocket.py | Xilinx/inference-server | 7477b7dc420ce4cd0d7e1d9914b71898e97d6814 | [
"Apache-2.0"
] | 2 | 2022-03-05T20:01:33.000Z | 2022-03-25T06:00:35.000Z | # Copyright 2021 Xilinx 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 agreed to in writing,... | 30.987342 | 117 | 0.64134 |
0a20363a0ef22f982f1e97f54f02099ab9e4b94a | 516 | py | Python | virtual/lib/python3.6/site-packages/demo/demoapp/models.py | igihozo-stella/smart-parking | 92c5dcd3eb08b8fccfddd34bb3291a240c563ec8 | [
"MIT"
] | null | null | null | virtual/lib/python3.6/site-packages/demo/demoapp/models.py | igihozo-stella/smart-parking | 92c5dcd3eb08b8fccfddd34bb3291a240c563ec8 | [
"MIT"
] | null | null | null | virtual/lib/python3.6/site-packages/demo/demoapp/models.py | igihozo-stella/smart-parking | 92c5dcd3eb08b8fccfddd34bb3291a240c563ec8 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils.translation import ugettext_lazy as _
class MyObject(models.Model):
CHOICES = (
('0', _('Meters')),
('1', _('Milimeters')),
('2', _('Centimeters')),
('3', _('Liters')),
('4', _('Mililiters')),
('5', _('Unit'))
)
... | 25.8 | 70 | 0.585271 |
d40ac2adf19626e508078dee5e40f0af1c3fcb1f | 26,689 | py | Python | sensortoolkit/plotting/_performance_metrics.py | USEPA/sensortoolkit | a9da32fd4df492154c6e4cc570011d14e933ee83 | [
"MIT"
] | 2 | 2022-02-25T21:59:04.000Z | 2022-03-01T19:37:38.000Z | sensortoolkit/plotting/_performance_metrics.py | USEPA/sensortoolkit | a9da32fd4df492154c6e4cc570011d14e933ee83 | [
"MIT"
] | null | null | null | sensortoolkit/plotting/_performance_metrics.py | USEPA/sensortoolkit | a9da32fd4df492154c6e4cc570011d14e933ee83 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""This module contains a method for displaying air sensor performance using
metrics and target values recommended by U.S. EPA for the evaluation of sensors
measuring either PM2.5 or O3.
================================================================================
@Author:
| Samuel Freder... | 45.857388 | 125 | 0.563303 |
b38a5a44f4869eab63cf93c20f50a34b85c06b21 | 2,323 | py | Python | saas/backend/biz/org_sync/department_member.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | 7 | 2021-08-13T03:48:16.000Z | 2021-12-20T15:31:38.000Z | saas/backend/biz/org_sync/department_member.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | 456 | 2021-08-16T02:13:57.000Z | 2022-03-30T10:02:49.000Z | saas/backend/biz/org_sync/department_member.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | 17 | 2021-08-10T04:08:46.000Z | 2022-03-14T14:24:36.000Z | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with th... | 40.051724 | 118 | 0.708567 |
3b647797b6e2cd12a478d45b7b2e61bb9ddb0646 | 4,234 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/availability_set_py3.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-07-23T08:59:24.000Z | 2018-07-23T08:59:24.000Z | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/availability_set_py3.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-11-29T14:46:42.000Z | 2018-11-29T14:46:42.000Z | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/availability_set_py3.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.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 ... | 47.044444 | 202 | 0.671233 |
e7e14ac6f01dc9c75ba48972fb685b075d120cd8 | 2,883 | py | Python | examples/GeoSchelling/model.py | xyudha/mesa-geo | a4e446f1f115055095829d1239c45eb31242eeff | [
"Apache-2.0"
] | 74 | 2017-09-20T14:12:01.000Z | 2022-03-23T10:13:17.000Z | examples/GeoSchelling/model.py | xyudha/mesa-geo | a4e446f1f115055095829d1239c45eb31242eeff | [
"Apache-2.0"
] | 33 | 2017-09-21T17:57:09.000Z | 2022-03-28T10:30:50.000Z | examples/GeoSchelling/model.py | xyudha/mesa-geo | a4e446f1f115055095829d1239c45eb31242eeff | [
"Apache-2.0"
] | 32 | 2018-04-16T23:39:02.000Z | 2022-02-09T20:10:35.000Z | from mesa.datacollection import DataCollector
from mesa import Model
from mesa.time import RandomActivation
from mesa_geo.geoagent import GeoAgent, AgentCreator
from mesa_geo import GeoSpace
import random
class SchellingAgent(GeoAgent):
"""Schelling segregation agent."""
def __init__(self, unique_id, model, ... | 31 | 79 | 0.584807 |
9201de17284cb37602664c6b2af1db9a82dd94ba | 550 | py | Python | backend/home/migrations/0001_load_initial_data.py | crowdbotics-dev/testappauto207-dev-23520 | e9d91aa3b146f3fccc5b2b705c39dc0c02756774 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-dev/testappauto207-dev-23520 | e9d91aa3b146f3fccc5b2b705c39dc0c02756774 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-dev/testappauto207-dev-23520 | e9d91aa3b146f3fccc5b2b705c39dc0c02756774 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "testappauto207-dev-23520.botics.co"
site_params = {
"name": "TestAppAuto207",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.... | 21.153846 | 61 | 0.663636 |
0823f368fcc63bcbf42f97cfe47442a7c4c400e0 | 4,437 | py | Python | scitbx/rigid_body/proto/tst_free_motion.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | scitbx/rigid_body/proto/tst_free_motion.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | scitbx/rigid_body/proto/tst_free_motion.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
from scitbx.rigid_body.proto import free_motion_reference_impl as fmri
from scitbx.rigid_body.proto import featherstone
import scitbx.math
from scitbx.array_family import flex
from scitbx import matrix
from libtbx.test_utils import approx_equal
from libtb... | 35.214286 | 92 | 0.686049 |
a60b51e09c8c41aaf87510cb6180a3b199799efb | 104 | py | Python | config.py | duyng404/burogu | 3752189dfe655ff003fda1437da358992d74ddbb | [
"MIT"
] | null | null | null | config.py | duyng404/burogu | 3752189dfe655ff003fda1437da358992d74ddbb | [
"MIT"
] | null | null | null | config.py | duyng404/burogu | 3752189dfe655ff003fda1437da358992d74ddbb | [
"MIT"
] | null | null | null | WTF_CSRF_ENABLED=True
SECRET_KEY='1a2s3d4f5g6'
CONTENT_DIR='content'
INTRO_LENGTH=50 #words
PER_PAGE=10
| 17.333333 | 24 | 0.846154 |
d79ad00d003b2c28bafb7f3fc06652c46fbdc62e | 14,195 | py | Python | flask/ctx.py | Aaron1992/flask | 84efebd6be3809388160e8654d0fccc9ce0b2395 | [
"BSD-3-Clause"
] | 1 | 2015-11-05T19:46:16.000Z | 2015-11-05T19:46:16.000Z | flask/ctx.py | Aaron1992/flask | 84efebd6be3809388160e8654d0fccc9ce0b2395 | [
"BSD-3-Clause"
] | null | null | null | flask/ctx.py | Aaron1992/flask | 84efebd6be3809388160e8654d0fccc9ce0b2395 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
flask.ctx
~~~~~~~~~
Implements the objects required to keep the context.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
from functools import update_wrapper
from werkzeug.excep... | 35.84596 | 80 | 0.643607 |
e0eb9878780e1e20b1bc4759f18a4effd6dc6e2b | 880 | py | Python | projects/700c/web/views/status.py | erik/sketches | 0a454ada58dee6db576e93cb2216dd750290329e | [
"MIT"
] | 1 | 2020-02-11T06:00:11.000Z | 2020-02-11T06:00:11.000Z | projects/700c/web/views/status.py | erik/sketches | 0a454ada58dee6db576e93cb2216dd750290329e | [
"MIT"
] | 1 | 2017-09-23T19:41:29.000Z | 2017-09-25T05:12:38.000Z | projects/700c/web/views/status.py | erik/sketches | 0a454ada58dee6db576e93cb2216dd750290329e | [
"MIT"
] | null | null | null | import json
import flask
from flask import request
from web.models import Location, Status, Trip
from web.views.util import requires_login, lookup_request_user
mod = flask.Blueprint('status', __name__)
mod.before_request(lookup_request_user)
@mod.route('/create', methods=['POST'])
@requires_login
def create():
... | 22.564103 | 62 | 0.676136 |
b9ee7fabe0713a1a890f8cee29fb55987e4e1efd | 3,775 | py | Python | datalad_osf/osfclient/osfclient/tests/test_utils.py | adswa/datalad-osf-2 | 25988f898ffc6f489c0855933136f39f79cf8c65 | [
"BSD-3-Clause"
] | 80 | 2017-10-24T05:06:00.000Z | 2022-02-20T18:44:17.000Z | datalad_osf/osfclient/osfclient/tests/test_utils.py | adswa/datalad-osf-2 | 25988f898ffc6f489c0855933136f39f79cf8c65 | [
"BSD-3-Clause"
] | 133 | 2017-03-07T22:36:54.000Z | 2017-10-24T04:43:57.000Z | datalad_osf/osfclient/osfclient/tests/test_utils.py | adswa/datalad-osf-2 | 25988f898ffc6f489c0855933136f39f79cf8c65 | [
"BSD-3-Clause"
] | 37 | 2017-10-26T03:34:17.000Z | 2021-11-17T05:24:10.000Z | from mock import call, patch, Mock
from osfclient.utils import file_empty
from osfclient.utils import norm_remote_path
from osfclient.utils import makedirs
from osfclient.utils import split_storage
def test_default_storage():
store, path = split_storage('foo/bar/baz')
assert store == 'osfstorage'
assert ... | 30.2 | 74 | 0.691656 |
ca0dd48246ac2eddb4b2761232e42480a4158573 | 11,243 | py | Python | benepar/base_parser.py | icewing1996/self-attentive-parser | 35ba70951eddefa63a294186077373fbe3e74185 | [
"MIT"
] | null | null | null | benepar/base_parser.py | icewing1996/self-attentive-parser | 35ba70951eddefa63a294186077373fbe3e74185 | [
"MIT"
] | null | null | null | benepar/base_parser.py | icewing1996/self-attentive-parser | 35ba70951eddefa63a294186077373fbe3e74185 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import os
import sys
import json
import codecs
from . import chart_decoder
from .downloader import load_model
from .bert_tokenization import BertTokenizer
#%%
IS_PY2 = sys.version_info < (3,0)
if IS_PY2:
STRING_TYPES = (str, unicode)
else:
STRING_TYPES = (str,)
EL... | 31.849858 | 130 | 0.536067 |
a76788e65d728d4a39881ba7fdd1173f91cecb4f | 130,625 | py | Python | netbox/dcim/tests/test_filters.py | letic/netbox | 0930745e16330edf00da081150b079d5ed6ecc02 | [
"Apache-2.0"
] | 2 | 2021-07-08T03:58:12.000Z | 2022-02-11T21:50:46.000Z | netbox/dcim/tests/test_filters.py | letic/netbox | 0930745e16330edf00da081150b079d5ed6ecc02 | [
"Apache-2.0"
] | 25 | 2019-09-17T19:40:50.000Z | 2022-03-11T04:01:55.000Z | netbox/dcim/tests/test_filters.py | letic/netbox | 0930745e16330edf00da081150b079d5ed6ecc02 | [
"Apache-2.0"
] | 1 | 2022-02-11T21:50:58.000Z | 2022-02-11T21:50:58.000Z | from django.contrib.auth.models import User
from django.test import TestCase
from dcim.choices import *
from dcim.filters import *
from dcim.models import (
Cable, ConsolePort, ConsolePortTemplate, ConsoleServerPort, ConsoleServerPortTemplate, Device, DeviceBay,
DeviceBayTemplate, DeviceRole, DeviceType, Front... | 47.242315 | 389 | 0.644685 |
ba5c05eb5d92898744a457c38f4d57748d954efa | 1,870 | py | Python | nebulae/astrobase/hangar/ImgGen/resgan.py | SeriaZheng/Nebulae | 27a0b78560e66f6ad6540ee7e04c29e03e632bbd | [
"MIT"
] | 2 | 2021-12-24T08:28:44.000Z | 2022-01-05T09:03:32.000Z | nebulae/astrobase/hangar/ImgGen/resgan.py | SeriaZheng/Nebulae | 27a0b78560e66f6ad6540ee7e04c29e03e632bbd | [
"MIT"
] | null | null | null | nebulae/astrobase/hangar/ImgGen/resgan.py | SeriaZheng/Nebulae | 27a0b78560e66f6ad6540ee7e04c29e03e632bbd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
garage
Created by Seria at 03/01/2019 8:32 PM
Email: zzqsummerai@yeah.net
_ooOoo_
o888888888o
o88`_ . _`88o
(| 0 0 |)
O \ 。 / O
_____/`-----‘\_____
.’ \|| _ _ ||/ `... | 32.241379 | 95 | 0.481283 |
ccec35b07ac355abec681a1cdb6c77b7f6e47ca1 | 2,982 | py | Python | tests/profile/simple_program_fork.py | zhammer/dd-trace-py | 4c30f6e36bfa34a63cd9b6884677c977f76d2a01 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/profile/simple_program_fork.py | zhammer/dd-trace-py | 4c30f6e36bfa34a63cd9b6884677c977f76d2a01 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/profile/simple_program_fork.py | zhammer/dd-trace-py | 4c30f6e36bfa34a63cd9b6884677c977f76d2a01 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | import os
import sys
import threading
import ddtrace.profile.auto
import ddtrace.profile.bootstrap
import ddtrace.profile.profiler
from ddtrace.profile.collector import memory
from ddtrace.profile.collector import stack
from ddtrace.profile.collector import threading as cthreading
def _allocate_mem():
# Do some ... | 38.230769 | 111 | 0.765594 |
4eb47770005be9f00c1695b77beab2803dd1dfbf | 1,396 | py | Python | mysite/urls.py | gnidoc327/django_web_dev_bookmark | 128003c4d94ebb896138c0878ecc8c0270481bc4 | [
"MIT"
] | null | null | null | mysite/urls.py | gnidoc327/django_web_dev_bookmark | 128003c4d94ebb896138c0878ecc8c0270481bc4 | [
"MIT"
] | null | null | null | mysite/urls.py | gnidoc327/django_web_dev_bookmark | 128003c4d94ebb896138c0878ecc8c0270481bc4 | [
"MIT"
] | null | null | null | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | 37.72973 | 79 | 0.682665 |
a2c78b923c9ca7f55160d2da0b04b38fe207b849 | 1,853 | py | Python | setup.py | kanutsanun-b/pressure2qnh | 8283d25b1bf697a6f85ae4948fc609de1ea214c4 | [
"MIT"
] | null | null | null | setup.py | kanutsanun-b/pressure2qnh | 8283d25b1bf697a6f85ae4948fc609de1ea214c4 | [
"MIT"
] | null | null | null | setup.py | kanutsanun-b/pressure2qnh | 8283d25b1bf697a6f85ae4948fc609de1ea214c4 | [
"MIT"
] | null | null | null | from distutils.core import setup
import os.path
setup(
name = 'pressure2qnh', # How you named your package folder (MyLib)
packages = ['pressure2qnh'], # Chose the same as "name"
version = '1.0.0', # Start with a small number and increase it with every change you make
license='MIT', ... | 57.90625 | 147 | 0.658931 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.