hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a1993a7bb57d8770057e855f94ed217a2399335 | 612 | py | Python | exercises/high-scores/example.py | xarxziux/exercism-python | c98184d08cda663267681d18a321d99e68599079 | [
"MIT"
] | null | null | null | exercises/high-scores/example.py | xarxziux/exercism-python | c98184d08cda663267681d18a321d99e68599079 | [
"MIT"
] | null | null | null | exercises/high-scores/example.py | xarxziux/exercism-python | c98184d08cda663267681d18a321d99e68599079 | [
"MIT"
] | null | null | null | class HighScores(object):
def __init__(self, scores):
self.scores = scores
def latest(self):
return self.scores[-1]
def personal_best(self):
return max(self.scores)
def personal_top(self):
return sorted(self.scores, reverse=True)[:3]
def report(self):
diff... | 27.818182 | 79 | 0.593137 |
4a1993c5cdbb235b8723083ca6311d41876ade30 | 1,842 | py | Python | predict.py | emanuel1025/Elo-Ratings-Match-Forecasting | 75428675a29049294a449736ac0340d7e5cc37d1 | [
"Apache-2.0"
] | null | null | null | predict.py | emanuel1025/Elo-Ratings-Match-Forecasting | 75428675a29049294a449736ac0340d7e5cc37d1 | [
"Apache-2.0"
] | null | null | null | predict.py | emanuel1025/Elo-Ratings-Match-Forecasting | 75428675a29049294a449736ac0340d7e5cc37d1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import numpy as np
from tester import test
from sklearn.ensemble import RandomForestRegressor
validation_path = "validation/features/"
features_path = "training/features/"
labels_path = "training/labels/sum.lab"
results_path = "testing/"
features = []
#features.append( "checkmate_move_done")
#feat... | 25.943662 | 80 | 0.753529 |
4a1993fba4739b0289df86b6e07497a2593ae9b0 | 16,789 | py | Python | util/reggen/register.py | esshiu/opentitan | 72fc87331f4a5350d475d4ebf7556ac72495ab19 | [
"Apache-2.0"
] | null | null | null | util/reggen/register.py | esshiu/opentitan | 72fc87331f4a5350d475d4ebf7556ac72495ab19 | [
"Apache-2.0"
] | null | null | null | util/reggen/register.py | esshiu/opentitan | 72fc87331f4a5350d475d4ebf7556ac72495ab19 | [
"Apache-2.0"
] | null | null | null | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
from typing import Dict, List, Optional
from .access import SWAccess, HWAccess
from .field import Field
from .lib import (check_keys, check_str, check_name, check_bool,
... | 40.069212 | 80 | 0.506582 |
4a19948513f70ca7d7b09a40a4de7c8b141fdbd3 | 3,224 | py | Python | simpmods/user.py | IsmaelRLG/simpbot | 7d4288334f637e0a7774ef1acda933a668c60181 | [
"MIT"
] | 3 | 2017-05-08T14:53:40.000Z | 2021-12-18T22:15:14.000Z | simpmods/user.py | IsmaelRLG/simpbot | 7d4288334f637e0a7774ef1acda933a668c60181 | [
"MIT"
] | null | null | null | simpmods/user.py | IsmaelRLG/simpbot | 7d4288334f637e0a7774ef1acda933a668c60181 | [
"MIT"
] | 1 | 2017-05-15T23:28:56.000Z | 2017-05-15T23:28:56.000Z | # -*- coding: utf-8 -*-
# Simple Bot (SimpBot)
# Copyright 2016-2017, Ismael Lugo (kwargs)
import simpbot
module = simpbot.get_module(sys=True)
loader = module.loader()
@loader('register user', 'register user',
need=[
'requires nickserv',
'unregistered user'],
i18n={
'loader': simpbo... | 33.237113 | 77 | 0.600496 |
4a1994e530505dc71239893b304a96875bd23f38 | 19,659 | py | Python | main.py | D9veth/Tg_bot_parcer | 68cc18f5fb9b18093f63fc74936940a31e743d34 | [
"MIT"
] | null | null | null | main.py | D9veth/Tg_bot_parcer | 68cc18f5fb9b18093f63fc74936940a31e743d34 | [
"MIT"
] | null | null | null | main.py | D9veth/Tg_bot_parcer | 68cc18f5fb9b18093f63fc74936940a31e743d34 | [
"MIT"
] | null | null | null | import telebot
import config
from telebot import types
import time
from main_pars import pars_vv,pars_gor,pars_tts,pars_asna,pars_mag,pars_puma,pars_metro,pars_perek,pars_mvideo,pars_nike,pars_lamoda,pars_sokolov,pars_eladarado,pars_restore
bot = telebot.TeleBot(config.token)
@bot.message_handler(commands = ['start'... | 75.034351 | 259 | 0.603184 |
4a199639ef5e9424ccecca03d2d1fc479e11f182 | 2,437 | py | Python | Face-recognition/face_recognition.py | sanjar-techie/face-recognition | 9c9cff3113a54bf80fce60710181d4ae96e1f765 | [
"MIT"
] | null | null | null | Face-recognition/face_recognition.py | sanjar-techie/face-recognition | 9c9cff3113a54bf80fce60710181d4ae96e1f765 | [
"MIT"
] | null | null | null | Face-recognition/face_recognition.py | sanjar-techie/face-recognition | 9c9cff3113a54bf80fce60710181d4ae96e1f765 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import face_recognition
import os
from datetime import datetime
# from PIL import ImageGrab
path = 'Images'
images = []
classNames = []
myList = os.listdir(path)
print(myList)
for cl in myList:
curImg = cv2.imread(f'{path}/{cl}')
images.append(curImg)
classNames.append(os.pat... | 30.848101 | 101 | 0.630693 |
4a199696f911639c32f74ff74a5cf0a405af8ba9 | 2,056 | py | Python | typed_python/Codebase_test.py | APrioriInvestments/typed_python | a3191e5d30333eba156c2a910abc78f7813dcaa3 | [
"Apache-2.0"
] | 105 | 2019-12-02T01:44:46.000Z | 2022-03-28T20:27:38.000Z | typed_python/Codebase_test.py | APrioriInvestments/typed_python | a3191e5d30333eba156c2a910abc78f7813dcaa3 | [
"Apache-2.0"
] | 173 | 2019-10-08T19:37:06.000Z | 2022-01-24T18:43:42.000Z | typed_python/Codebase_test.py | APrioriInvestments/typed_python | a3191e5d30333eba156c2a910abc78f7813dcaa3 | [
"Apache-2.0"
] | 1 | 2020-01-23T00:06:42.000Z | 2020-01-23T00:06:42.000Z | # Copyright 2020 typed_python 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 a... | 38.792453 | 104 | 0.718385 |
4a1996ff67d3474da06f96b21126b60a6c0cf580 | 550 | py | Python | manage.py | robot-lab/main-web-service | 28b7aa5dc6a27a3819e12abb61a78626858279f8 | [
"Apache-2.0"
] | 1 | 2019-09-23T13:36:29.000Z | 2019-09-23T13:36:29.000Z | manage.py | robot-lab/main-web-service | 28b7aa5dc6a27a3819e12abb61a78626858279f8 | [
"Apache-2.0"
] | 137 | 2018-10-12T11:12:08.000Z | 2021-06-10T20:54:32.000Z | manage.py | robot-lab/judyst-main-web-service | 28b7aa5dc6a27a3819e12abb61a78626858279f8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'judyst_web_service.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import D... | 34.375 | 82 | 0.692727 |
4a19982f1420c333af1d481a36198e7c55a9bb28 | 9,974 | py | Python | check/validate/client.py | siddhya/gstwebrtc-demos | 9de598332ecc6b9e86cc3b77391b941c61a75879 | [
"BSD-2-Clause"
] | 451 | 2017-10-21T17:00:18.000Z | 2022-03-31T07:58:36.000Z | check/validate/client.py | siddhya/gstwebrtc-demos | 9de598332ecc6b9e86cc3b77391b941c61a75879 | [
"BSD-2-Clause"
] | 215 | 2018-02-04T12:58:50.000Z | 2021-04-28T09:39:29.000Z | check/validate/client.py | siddhya/gstwebrtc-demos | 9de598332ecc6b9e86cc3b77391b941c61a75879 | [
"BSD-2-Clause"
] | 208 | 2017-11-22T12:15:02.000Z | 2022-03-07T18:25:16.000Z | # Copyright (c) 2020, Matthew Waters <matthew@centricular.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version... | 39.896 | 108 | 0.700722 |
4a1998b1139b3238acce2a05b8a8764a35aaf075 | 8,234 | py | Python | code/main.py | Brian-ZhenLiu/Chatbot | 29080279b126e80f58fcee1de5243b9526791bbe | [
"MIT"
] | null | null | null | code/main.py | Brian-ZhenLiu/Chatbot | 29080279b126e80f58fcee1de5243b9526791bbe | [
"MIT"
] | null | null | null | code/main.py | Brian-ZhenLiu/Chatbot | 29080279b126e80f58fcee1de5243b9526791bbe | [
"MIT"
] | null | null | null | import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *
from data.twitter import data
from sklearn.utils import shuffle
import tensorflow as tf
import numpy as np
import time
replyNum = 5
def getReplying(y, w2idx, idx2w, decode_seqs2, encode_seqs2, start_id, end_id, sess, net_rnn, question):... | 45.491713 | 154 | 0.62752 |
4a1999558e2edc3ec3c1d7522f65c8bc8f19ecd9 | 576 | py | Python | apps/diary/migrations/0005_data_migration.py | deniskrumko/deniskrumko | 613c0c3eac953d2e8482a2e66fce7d3570770b2c | [
"MIT"
] | 2 | 2019-07-09T01:42:04.000Z | 2020-04-09T16:44:59.000Z | apps/diary/migrations/0005_data_migration.py | deniskrumko/deniskrumko | 613c0c3eac953d2e8482a2e66fce7d3570770b2c | [
"MIT"
] | 5 | 2019-12-30T22:16:38.000Z | 2020-09-11T18:13:14.000Z | apps/diary/migrations/0005_data_migration.py | deniskrumko/deniskrumko | 613c0c3eac953d2e8482a2e66fce7d3570770b2c | [
"MIT"
] | 1 | 2019-07-09T01:42:07.000Z | 2019-07-09T01:42:07.000Z | # -*- coding: utf-8 -*-
# Generated by Denis on 2046-08-15 10:15
from __future__ import unicode_literals
from django.db import migrations
from ..models import DiaryEntry
def add_tags(apps, schema_editor):
"""Add tags for all exisiting diary entries."""
for entry in DiaryEntry.objects.all():
entry.po... | 20.571429 | 51 | 0.647569 |
4a199a2cf1dd18120e86558af3f5925738c47fec | 1,893 | py | Python | codecarbon/core/units.py | nikolaskaris/codecarbon | d6b47bf29c1e216e43e708ec49981c3dad9142af | [
"MIT"
] | 1 | 2020-12-23T11:44:25.000Z | 2020-12-23T11:44:25.000Z | codecarbon/core/units.py | nikolaskaris/codecarbon | d6b47bf29c1e216e43e708ec49981c3dad9142af | [
"MIT"
] | null | null | null | codecarbon/core/units.py | nikolaskaris/codecarbon | d6b47bf29c1e216e43e708ec49981c3dad9142af | [
"MIT"
] | null | null | null | """
Provides functionality for unit conversions
"""
from dataclasses import dataclass
@dataclass
class EmissionsPerKwh:
"""
Measured in kg/kwh
"""
LBS_MWH_TO_KG_KWH = 0.00045359237
G_KWH_TO_KG_KWH = 0.001
kgs_per_kwh: float
@classmethod
def from_lbs_per_mwh(cls, lbs_per_mwh: float)... | 21.033333 | 82 | 0.651875 |
4a199ada9492d28139b4a33c3b6306863215c796 | 2,926 | py | Python | sender/Messages/ACK.py | schc-over-sigfox/schc-over-sigfox | d03e26cf5524ebd6bd64b4ca33a83149eec5e59f | [
"MIT"
] | null | null | null | sender/Messages/ACK.py | schc-over-sigfox/schc-over-sigfox | d03e26cf5524ebd6bd64b4ca33a83149eec5e59f | [
"MIT"
] | null | null | null | sender/Messages/ACK.py | schc-over-sigfox/schc-over-sigfox | d03e26cf5524ebd6bd64b4ca33a83149eec5e59f | [
"MIT"
] | 1 | 2022-03-19T12:36:30.000Z | 2022-03-19T12:36:30.000Z | from Messages.ACKHeader import ACKHeader
from schc_utils import bitstring_to_bytes, is_monochar, zfill
class ACK:
PROFILE = None
BITMAP = None
HEADER = None
PADDING = None
def __init__(self, profile, rule_id, dtag, w, c, bitmap, padding=''):
self.PROFILE = profile
self.BITMAP = bi... | 35.682927 | 99 | 0.612098 |
4a199b8a38f796fce6cdf4258cc16eb646034a98 | 252 | py | Python | tests/basics/try_continue.py | learnforpractice/micropython-cpp | 004bc8382f74899e7b876cc29bfa6a9cc976ba10 | [
"MIT"
] | 13,648 | 2015-01-01T01:34:51.000Z | 2022-03-31T16:19:53.000Z | tests/basics/try_continue.py | learnforpractice/micropython-cpp | 004bc8382f74899e7b876cc29bfa6a9cc976ba10 | [
"MIT"
] | 7,092 | 2015-01-01T07:59:11.000Z | 2022-03-31T23:52:18.000Z | tests/basics/try_continue.py | learnforpractice/micropython-cpp | 004bc8382f74899e7b876cc29bfa6a9cc976ba10 | [
"MIT"
] | 4,942 | 2015-01-02T11:48:50.000Z | 2022-03-31T19:57:10.000Z | # test continue within exception handler
def f():
lst = [1, 2, 3]
for x in lst:
print('a', x)
try:
if x == 2:
raise Exception
except Exception:
continue
print('b', x)
f()
| 18 | 40 | 0.444444 |
4a199cd517aff88ee1a844eef0b77faa326b851b | 4,535 | py | Python | examples/machine_translation/transformer/faster_transformer/encoder_decoding_predict.py | XieYunshen/PaddleNLP | c3d1df6e9e9b77df7af74b7f8a819182ee9c3a7f | [
"Apache-2.0"
] | 1 | 2021-07-22T08:33:53.000Z | 2021-07-22T08:33:53.000Z | examples/machine_translation/transformer/faster_transformer/encoder_decoding_predict.py | ZHUI/PaddleNLP | ddbae3d2baa7f6072d70e5e0dd90251c9149a36e | [
"Apache-2.0"
] | null | null | null | examples/machine_translation/transformer/faster_transformer/encoder_decoding_predict.py | ZHUI/PaddleNLP | ddbae3d2baa7f6072d70e5e0dd90251c9149a36e | [
"Apache-2.0"
] | null | null | null | import sys
import os
import numpy as np
from attrdict import AttrDict
import argparse
import time
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
import yaml
from pprint import pprint
from paddlenlp.transformers import TransformerModel
from paddlenlp.transformers import position_encoding_init
f... | 31.275862 | 122 | 0.626681 |
4a199ebd0ca5c9ce152e9987e8fbb25890c26714 | 703 | py | Python | thai_nner/utils/util.py | vistec-AI/Thai-NNER | 31c7112b194bb26f19296f32df7f3550fdfc4b88 | [
"MIT"
] | 16 | 2022-03-05T07:07:55.000Z | 2022-03-30T06:16:32.000Z | thai_nner/utils/util.py | vistec-AI/Thai-NNER | 31c7112b194bb26f19296f32df7f3550fdfc4b88 | [
"MIT"
] | 1 | 2022-03-12T04:10:27.000Z | 2022-03-24T09:09:17.000Z | thai_nner/utils/util.py | vistec-AI/Thai-NNER | 31c7112b194bb26f19296f32df7f3550fdfc4b88 | [
"MIT"
] | null | null | null | import json
import pandas as pd
from pathlib import Path
from itertools import repeat
from collections import OrderedDict
def ensure_dir(dirname):
dirname = Path(dirname)
if not dirname.is_dir():
dirname.mkdir(parents=True, exist_ok=False)
def read_json(fname):
fname = Path(fname)
with fname.... | 26.037037 | 61 | 0.705548 |
4a199eca2d99d41445e8eeddd7adefa07abbb85b | 3,409 | py | Python | membership-manager.py | buraktokman/Reddit-Jokes | 3945e2fd986d3ed81459ae813a9ee8eadb50de47 | [
"MIT"
] | 1 | 2021-08-09T07:10:36.000Z | 2021-08-09T07:10:36.000Z | membership-manager.py | buraktokman/Reddit-Jokes | 3945e2fd986d3ed81459ae813a9ee8eadb50de47 | [
"MIT"
] | null | null | null | membership-manager.py | buraktokman/Reddit-Jokes | 3945e2fd986d3ed81459ae813a9ee8eadb50de47 | [
"MIT"
] | null | null | null | #! usr/bin/env python3
# -*- coding: utf-8 -*-
'''
#-------------------------------------------------------------------------------
Project : Project JaaS
Module : membership_manager
Purpose : Add new users & check membership status of existing ones
Version : 0.1.1 beta
Status : Development
Modified : 2020 Mar... | 30.711712 | 137 | 0.50132 |
4a199edc19378961945f9c03f292c9261890e6df | 3,974 | py | Python | libs/backtest.py | illi4/Crypto_trading_robot | 14d3021909232765ebb8c4d16d3ba0064c6bd93d | [
"MIT"
] | 19 | 2017-12-08T01:36:29.000Z | 2021-12-06T06:59:54.000Z | libs/backtest.py | illi4/Crypto_trading_robot | 14d3021909232765ebb8c4d16d3ba0064c6bd93d | [
"MIT"
] | null | null | null | libs/backtest.py | illi4/Crypto_trading_robot | 14d3021909232765ebb8c4d16d3ba0064c6bd93d | [
"MIT"
] | 10 | 2017-12-02T08:14:40.000Z | 2021-11-04T16:29:19.000Z | ################################ Libraries ############################################
import exceptions
import time as t
from datetime import datetime
import config
from collections import deque
from sys import exit
## Backtest class
class backtesting(object):
def __init__(self):
self.backtesting, self.e... | 40.55102 | 111 | 0.599144 |
4a19a081d1274a69cad1ace66f25f9e6275f7284 | 3,086 | py | Python | benchmarks/postgres/zzzeek_asyncio_greenlet_part_11.py | moriyoshi/greenletio | 75fc944cefe58ee491e5b8ff951a64f13ae0104d | [
"MIT"
] | 131 | 2020-07-17T22:36:25.000Z | 2022-03-06T21:29:23.000Z | benchmarks/postgres/zzzeek_asyncio_greenlet_part_11.py | moriyoshi/greenletio | 75fc944cefe58ee491e5b8ff951a64f13ae0104d | [
"MIT"
] | 7 | 2020-07-18T07:36:13.000Z | 2021-07-16T08:28:47.000Z | benchmarks/postgres/zzzeek_asyncio_greenlet_part_11.py | moriyoshi/greenletio | 75fc944cefe58ee491e5b8ff951a64f13ae0104d | [
"MIT"
] | 5 | 2020-07-18T01:08:40.000Z | 2021-05-12T09:17:17.000Z | """
Source: https://gist.github.com/zzzeek/a63254eedac043b3c233a0de5352f9c5
This is a simpler version of the greenlet
example at https://gist.github.com/zzzeek/4e89ce6226826e7a8df13e1b573ad354
Instead of the "await" keyword, we use the "await_()" function to interact with
the greenlet context. the greenlet context its... | 24.688 | 88 | 0.568049 |
4a19a0a0411b965bd35eae068e8473b515e31a7e | 14,775 | py | Python | tensorflow_federated/python/core/impl/tensorflow_serialization.py | xueyuuu/federated | ad617401324c133eb838e4e0af7442a4dfa71d6e | [
"Apache-2.0"
] | 2 | 2019-07-09T10:04:39.000Z | 2019-10-02T05:10:16.000Z | tensorflow_federated/python/core/impl/tensorflow_serialization.py | xueyuuu/federated | ad617401324c133eb838e4e0af7442a4dfa71d6e | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/tensorflow_serialization.py | xueyuuu/federated | ad617401324c133eb838e4e0af7442a4dfa71d6e | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2018, The TensorFlow Federated 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 ... | 46.171875 | 80 | 0.733401 |
4a19a290ec506c74b55a09daec35b2e88ca3f96b | 2,078 | py | Python | integration/experiment/monitor/run_monitor_minife.py | asmaalrawi/geopm | e93548dfdd693a17c81163787ba467891937356d | [
"BSD-3-Clause"
] | null | null | null | integration/experiment/monitor/run_monitor_minife.py | asmaalrawi/geopm | e93548dfdd693a17c81163787ba467891937356d | [
"BSD-3-Clause"
] | null | null | null | integration/experiment/monitor/run_monitor_minife.py | asmaalrawi/geopm | e93548dfdd693a17c81163787ba467891937356d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyrig... | 40.745098 | 74 | 0.744466 |
4a19a482adc8aeb451c7eed504dd3e88036bea31 | 4,891 | py | Python | docs/conf.py | fastscape-lem/fastscape-litho | 0ce9c7c056b197a2f558343597af7c7375ff6f20 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | fastscape-lem/fastscape-litho | 0ce9c7c056b197a2f558343597af7c7375ff6f20 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | fastscape-lem/fastscape-litho | 0ce9c7c056b197a2f558343597af7c7375ff6f20 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# fastscape_litho documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | 30.006135 | 77 | 0.69127 |
4a19a4e77607c50196e4c29a1a054a73dcdc20a3 | 8,072 | py | Python | packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py | nathawes/swift-lldb | 3cbf7470e0f9191ec1fc1c69ce8048c1dc64ec77 | [
"Apache-2.0"
] | 2 | 2019-05-24T14:10:24.000Z | 2019-05-24T14:27:38.000Z | packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py | DalavanCloud/lldb | e913eaf2468290fb94c767d474d611b41a84dd69 | [
"Apache-2.0"
] | null | null | null | packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py | DalavanCloud/lldb | e913eaf2468290fb94c767d474d611b41a84dd69 | [
"Apache-2.0"
] | null | null | null | """
Test that the Python operating system plugin works correctly
"""
from __future__ import print_function
import os
import time
import re
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class PluginPythonOSPlugin(TestBase):
mydir = TestBase.compute_mydir(__file__)... | 40.767677 | 153 | 0.647547 |
4a19a50fcd79f4841e1f12a4054599180e3be67c | 11,621 | py | Python | src/robusta/runner/config_loader.py | kandahk/robusta | 61a2001cb1c4e90e8a74b810463ec99e6cb80787 | [
"MIT"
] | null | null | null | src/robusta/runner/config_loader.py | kandahk/robusta | 61a2001cb1c4e90e8a74b810463ec99e6cb80787 | [
"MIT"
] | null | null | null | src/robusta/runner/config_loader.py | kandahk/robusta | 61a2001cb1c4e90e8a74b810463ec99e6cb80787 | [
"MIT"
] | null | null | null | import importlib.util
import logging
import os
import pkgutil
import subprocess
import sys
import threading
import yaml
from typing import Optional, List, Dict
from inspect import getmembers
from ..cli.utils import get_package_name
from ..integrations.receiver import ActionRequestReceiver
from ..integrations.scheduled... | 41.063604 | 117 | 0.627313 |
4a19a674871ad1c4f7c20a5efda809c835f8157b | 2,581 | py | Python | events/worldcon75/migrations/0001_initial.py | Siikakala/kompassi | 14cdcd966ab689d762cc885e28b6d15465c216f0 | [
"CC-BY-3.0"
] | null | null | null | events/worldcon75/migrations/0001_initial.py | Siikakala/kompassi | 14cdcd966ab689d762cc885e28b6d15465c216f0 | [
"CC-BY-3.0"
] | null | null | null | events/worldcon75/migrations/0001_initial.py | Siikakala/kompassi | 14cdcd966ab689d762cc885e28b6d15465c216f0 | [
"CC-BY-3.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-17 19:59
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import labour.models.signup_extras
class Migration(migrations.Migration):
initial = True
dependencies = [
('core... | 64.525 | 347 | 0.707865 |
4a19a73d2fe70f6252960102e8b65f9c9d610e8a | 4,680 | py | Python | youtube_dl/extractor/cbs.py | hackarada/youtube-dl | 2ba46715a41fe074eab2221170b2ac78fab93fad | [
"Unlicense"
] | 3,001 | 2020-10-24T05:24:18.000Z | 2022-03-31T06:45:32.000Z | youtube_dl/extractor/cbs.py | hackarada/youtube-dl | 2ba46715a41fe074eab2221170b2ac78fab93fad | [
"Unlicense"
] | 274 | 2020-10-24T04:57:21.000Z | 2022-03-22T01:34:56.000Z | youtube_dl/extractor/cbs.py | hackarada/youtube-dl | 2ba46715a41fe074eab2221170b2ac78fab93fad | [
"Unlicense"
] | 541 | 2020-10-24T03:32:09.000Z | 2022-01-12T23:49:30.000Z | from __future__ import unicode_literals
from .theplatform import ThePlatformFeedIE
from ..utils import (
ExtractorError,
int_or_none,
find_xpath_attr,
xpath_element,
xpath_text,
update_url_query,
)
class CBSBaseIE(ThePlatformFeedIE):
def _parse_smil_subtitles(self, smil, namespace=None, s... | 41.415929 | 224 | 0.583761 |
4a19a784a00b3106bb124ae94b6f4f81605b9cc4 | 194 | py | Python | tests/processinst/test_module.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | tests/processinst/test_module.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | tests/processinst/test_module.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
def test_all_contains_only_valid_names():
import pycamunda.processinst
for name in pycamunda.processinst.__all__:
getattr(pycamunda.processinst, name)
| 21.555556 | 46 | 0.721649 |
4a19aa613744ba26d2c394f47c21ca765a63befa | 9,504 | py | Python | tissue_specific_analysis/SampleSpecificIsoforms.py | Xinglab/espresso | a68b29178079be320f74f62a5cda5bbfa1934edb | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tissue_specific_analysis/SampleSpecificIsoforms.py | Xinglab/espresso | a68b29178079be320f74f62a5cda5bbfa1934edb | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tissue_specific_analysis/SampleSpecificIsoforms.py | Xinglab/espresso | a68b29178079be320f74f62a5cda5bbfa1934edb | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | #!/usr/bin/env python3
'''
This is a script to identify sample-specific isoforms based on
an isoform read count matrix generated by ESPRESSO (rows are
detected isoforms and columns are samples)
'''
# Load required libraries
import argparse
import numpy as np
import pandas as pd
import concurrent.futures as cf
from s... | 45.042654 | 140 | 0.680029 |
4a19aac285fb925bdd3e2249d82f93c66d103c33 | 3,487 | py | Python | neural-network.py | benediktaugenstein/simple-neural-network | af58617e7f4fbbd222c60daf678981bf369dd838 | [
"Apache-2.0"
] | null | null | null | neural-network.py | benediktaugenstein/simple-neural-network | af58617e7f4fbbd222c60daf678981bf369dd838 | [
"Apache-2.0"
] | null | null | null | neural-network.py | benediktaugenstein/simple-neural-network | af58617e7f4fbbd222c60daf678981bf369dd838 | [
"Apache-2.0"
] | null | null | null | import numpy as np
# Can be set to make sure the random weights and biases generated are going to be the same for each time the code runs
np.random.seed(0)
# suppress scientific notation
np.set_printoptions(suppress=True)
# input data
input = np.array([[0.5, 0.3, 10.0, 0.2],
[0.7, 0.6, 0.25, 0.5],
... | 31.7 | 166 | 0.675939 |
4a19ab0c65051a972a96af4ff8c92e674c716057 | 2,915 | py | Python | research/slim/convert_tiff_to_jpeg.py | tathey1/models | 46a2289b224ec627c3c6dffe65ff3b268fdbba66 | [
"Apache-2.0"
] | null | null | null | research/slim/convert_tiff_to_jpeg.py | tathey1/models | 46a2289b224ec627c3c6dffe65ff3b268fdbba66 | [
"Apache-2.0"
] | null | null | null | research/slim/convert_tiff_to_jpeg.py | tathey1/models | 46a2289b224ec627c3c6dffe65ff3b268fdbba66 | [
"Apache-2.0"
] | 1 | 2018-09-07T18:29:48.000Z | 2018-09-07T18:29:48.000Z | """
author: Thomas Athey
date: 7/30/18
Significant code is borrowed from
tensorflow/models/research/slim/datasets/download_and_convert+flowers.py
Convert a particular directory of tiff files to jpegs.
The directory should have subdirectories corresponding to the different classes.
Jpegs will be found in a directory ... | 26.5 | 85 | 0.754717 |
4a19ab85b6b1e83c679f8a0d696e9185ed480b13 | 564 | py | Python | foundation.examples/single_demo/sim3d.py | PowerRocker/rpi_spark_examples | bc264cbc780ef1640f9caa59ad1e6e2a30c59ceb | [
"MIT"
] | 1 | 2018-11-18T03:07:50.000Z | 2018-11-18T03:07:50.000Z | foundation.examples/single_demo/sim3d.py | PowerRocker/rpi_spark_examples | bc264cbc780ef1640f9caa59ad1e6e2a30c59ceb | [
"MIT"
] | 1 | 2020-12-25T16:30:54.000Z | 2020-12-25T16:31:50.000Z | foundation.examples/single_demo/sim3d.py | mobinrg/rpi_spark_examples | bc264cbc780ef1640f9caa59ad1e6e2a30c59ceb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# RPi-Spark Single Demo
#
# Show mode: Button A
# Field of vision: Joy Up and Down
# Exit: Button A + Joy Up
#
# Author: Kunpeng Zhang
# 2018.6.07
#
# See LICENSE for details.
import sys
from JMRPiFoundations.Skeleton.RPiSparkProvider import initSpark
from JMRPiFoundations.Devices.rpi_spark_... | 22.56 | 86 | 0.72695 |
4a19abd56cfda186f1973f338d985881e4712ba6 | 1,407 | py | Python | t00_chocolate.py | 2019-fall-csc-226/a01-breaking-bad-concepta-abe | 287c25fe7ee9447694d84e26c867ae9677767982 | [
"MIT"
] | null | null | null | t00_chocolate.py | 2019-fall-csc-226/a01-breaking-bad-concepta-abe | 287c25fe7ee9447694d84e26c867ae9677767982 | [
"MIT"
] | null | null | null | t00_chocolate.py | 2019-fall-csc-226/a01-breaking-bad-concepta-abe | 287c25fe7ee9447694d84e26c867ae9677767982 | [
"MIT"
] | null | null | null | ######################################################################
# Author: Abraham Moreno
# username: TheOneAndOnlyAbe
#
# Purpose: Designed to compute the total chocolate desired by the user
#
######################################################################
# Acknowledgements:
#
# Modified from original co... | 31.977273 | 138 | 0.612651 |
4a19acba899d2170e1b5b99de44a471cca691ca9 | 602 | py | Python | testing/urls.py | bartels/satchless | 4d333014333dc4fd5815f9e0bbea565959919a30 | [
"BSD-4-Clause"
] | null | null | null | testing/urls.py | bartels/satchless | 4d333014333dc4fd5815f9e0bbea565959919a30 | [
"BSD-4-Clause"
] | null | null | null | testing/urls.py | bartels/satchless | 4d333014333dc4fd5815f9e0bbea565959919a30 | [
"BSD-4-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
from django.conf.urls.defaults import patterns, url, include
from satchless.cart.tests import cart_app
from satchless.category.tests import category_app
from satchless.product.tests import product_app
from satchless.order.tests import order_app
urlpatterns = patterns('',
url(r'^category/', ... | 37.625 | 60 | 0.722591 |
4a19ae7c2282236d231028483bd66345ada03f08 | 1,009 | py | Python | examples/add_vectors_image.py | MaksHess/napari | 64a144607342c02177fc62fa83a3442ace0a98e7 | [
"BSD-3-Clause"
] | 1,345 | 2019-03-03T21:14:14.000Z | 2022-03-31T19:46:39.000Z | examples/add_vectors_image.py | MaksHess/napari | 64a144607342c02177fc62fa83a3442ace0a98e7 | [
"BSD-3-Clause"
] | 3,904 | 2019-03-02T01:30:24.000Z | 2022-03-31T20:17:27.000Z | examples/add_vectors_image.py | MaksHess/napari | 64a144607342c02177fc62fa83a3442ace0a98e7 | [
"BSD-3-Clause"
] | 306 | 2019-03-29T17:09:10.000Z | 2022-03-30T09:54:11.000Z | """
This example generates an image of vectors
Vector data is an array of shape (N, M, 2)
Each vector position is defined by an (x-proj, y-proj) element
where x-proj and y-proj are the vector projections at each center
where each vector is centered on a pixel of the NxM grid
"""
import napari
import numpy as n... | 25.871795 | 74 | 0.684836 |
4a19aeba30fddfe04195e97f95db1be284ca8e18 | 33,187 | py | Python | python_modules/dagster/dagster/core/definitions/pipeline.py | chasleslr/dagster | 88907f9473fb8e7a9b1af9a0a8b349d42f4b8153 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/definitions/pipeline.py | chasleslr/dagster | 88907f9473fb8e7a9b1af9a0a8b349d42f4b8153 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/definitions/pipeline.py | chasleslr/dagster | 88907f9473fb8e7a9b1af9a0a8b349d42f4b8153 | [
"Apache-2.0"
] | null | null | null | import uuid
import warnings
from dagster import check
from dagster.core.definitions.solid import NodeDefinition
from dagster.core.errors import (
DagsterInvalidDefinitionError,
DagsterInvalidSubsetError,
DagsterInvariantViolationError,
)
from dagster.core.storage.output_manager import IOutputManagerDefinit... | 40.87069 | 105 | 0.614096 |
4a19af00c057406e55b8edd3ba462a812924fbdb | 101 | py | Python | python/ql/test/library-tests/stmts/with_stmt/test.py | vadi2/codeql | a806a4f08696d241ab295a286999251b56a6860c | [
"MIT"
] | 4,036 | 2020-04-29T00:09:57.000Z | 2022-03-31T14:16:38.000Z | python/ql/test/library-tests/stmts/with_stmt/test.py | vadi2/codeql | a806a4f08696d241ab295a286999251b56a6860c | [
"MIT"
] | 2,970 | 2020-04-28T17:24:18.000Z | 2022-03-31T22:40:46.000Z | python/ql/test/library-tests/stmts/with_stmt/test.py | ScriptBox99/github-codeql | 2ecf0d3264db8fb4904b2056964da469372a235c | [
"MIT"
] | 794 | 2020-04-29T00:28:25.000Z | 2022-03-30T08:21:46.000Z |
def f():
with a:
call()
def g():
with x:
with y:
call() | 11.222222 | 18 | 0.306931 |
4a19af1a871b983209cb106764f46e1e2eed5cb9 | 2,530 | py | Python | taggle/models/heads/saol.py | tattaka/Taggle | d78e7f76c65cd69336a0347299939eeb3a184d4e | [
"MIT"
] | 7 | 2020-08-06T08:53:26.000Z | 2021-04-17T12:03:28.000Z | taggle/models/heads/saol.py | tattaka/Taggle | d78e7f76c65cd69336a0347299939eeb3a184d4e | [
"MIT"
] | null | null | null | taggle/models/heads/saol.py | tattaka/Taggle | d78e7f76c65cd69336a0347299939eeb3a184d4e | [
"MIT"
] | null | null | null | from functools import partial
import torch
import torch.nn.functional as F
from torch import nn
class SpatiallyAttentiveOutputHead(nn.Module):
__name__ = 'SpatiallyAttentiveOutputHead'
def __init__(self, encoder_channels, mid_channel=512, p=0.2, last_activation=None, num_class=10):
super(SpatiallyAt... | 40.806452 | 101 | 0.617787 |
4a19afae5fc5290b1be0bfeb6269ec21c0ed595e | 2,624 | py | Python | src/bin/pilprint.py | alempedroso/mxnet-lambda | 05af0db5e2a6fcc6c8d8c8c3821ed989ef520085 | [
"Apache-2.0"
] | 145 | 2017-01-19T23:33:03.000Z | 2021-06-05T05:34:55.000Z | mxnet_lambda/src/bin/pilprint.py | Nuvoola/oreilly-ai-nyc | 22a683c63b7d0153cc2249a94d76b3c8969b1972 | [
"MIT"
] | 17 | 2017-02-03T20:51:39.000Z | 2020-05-21T11:33:52.000Z | mxnet_lambda/src/bin/pilprint.py | Nuvoola/oreilly-ai-nyc | 22a683c63b7d0153cc2249a94d76b3c8969b1972 | [
"MIT"
] | 44 | 2017-02-04T19:40:03.000Z | 2020-10-01T19:24:19.000Z | #!/home/ec2-user/mx-lambda-nocv/bin/python2.7
#
# The Python Imaging Library.
# $Id$
#
# print image files to postscript printer
#
# History:
# 0.1 1996-04-20 fl Created
# 0.2 1996-10-04 fl Use draft mode when converting.
# 0.3 2003-05-06 fl Fixed a typo or two.
#
from __future__ import print_function
impo... | 25.475728 | 68 | 0.568979 |
4a19afc0bfa75ab250f0d2fb7ba96945b595236a | 229 | py | Python | data/xor.py | wenyuzhao/Multilayer-Perceptron | fcecc761424f7fd0c54b36d325735d25e2e24f14 | [
"Apache-2.0"
] | 2 | 2017-05-13T15:18:33.000Z | 2017-11-09T02:33:27.000Z | data/xor.py | wenyuzhao/Multilayer-Perceptron | fcecc761424f7fd0c54b36d325735d25e2e24f14 | [
"Apache-2.0"
] | null | null | null | data/xor.py | wenyuzhao/Multilayer-Perceptron | fcecc761424f7fd0c54b36d325735d25e2e24f14 | [
"Apache-2.0"
] | 1 | 2018-10-29T12:07:27.000Z | 2018-10-29T12:07:27.000Z | import numpy as np
train_data = [
(np.array([0., 0.]), np.array([0.])),
(np.array([0., 1.]), np.array([1.])),
(np.array([1., 0.]), np.array([1.])),
(np.array([1., 1.]), np.array([0.])),
]
test_data = train_data
| 20.818182 | 41 | 0.489083 |
4a19b000acb146e25136d6f3e9ac58bffffef4ee | 4,855 | py | Python | tests/commit/math/test__extrapolation.py | oguzziya/PhiFlow | 55d9834051e8a52c19a0e6d62e1c7c2f0a42cc34 | [
"MIT"
] | null | null | null | tests/commit/math/test__extrapolation.py | oguzziya/PhiFlow | 55d9834051e8a52c19a0e6d62e1c7c2f0a42cc34 | [
"MIT"
] | null | null | null | tests/commit/math/test__extrapolation.py | oguzziya/PhiFlow | 55d9834051e8a52c19a0e6d62e1c7c2f0a42cc34 | [
"MIT"
] | null | null | null | from unittest import TestCase
from phi.math import NUMPY_BACKEND
from phi.math.extrapolation import *
from phi import math, tf
from phi.tf import TF_BACKEND
from phi.torch import TORCH_BACKEND
class TestExtrapolation(TestCase):
def test_pad(self):
test_in_func_out = [
(math.zeros(x=3, y=4, z... | 43.348214 | 112 | 0.536148 |
4a19b00ac0b8c2d8e450aa66fa2bcbbafcf0bafb | 25,852 | py | Python | build/fbcode_builder/getdeps.py | xiaosumay/fizz | 5fe89e57526a977bd420a8269c860654c8021c54 | [
"BSD-3-Clause"
] | null | null | null | build/fbcode_builder/getdeps.py | xiaosumay/fizz | 5fe89e57526a977bd420a8269c860654c8021c54 | [
"BSD-3-Clause"
] | null | null | null | build/fbcode_builder/getdeps.py | xiaosumay/fizz | 5fe89e57526a977bd420a8269c860654c8021c54 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
f... | 35.077341 | 88 | 0.585255 |
4a19b0273ac2746fa2cd253d05341f3532c5d127 | 10,400 | py | Python | src/ope/deepiv/learner.py | liyuan9988/IVOPEwithACME | d77fab09b2e1cb8d3dbd8b2ab88adcce6a853558 | [
"MIT"
] | 1 | 2020-09-05T01:25:39.000Z | 2020-09-05T01:25:39.000Z | src/ope/deepiv/learner.py | liyuan9988/IVOPEwithACME | d77fab09b2e1cb8d3dbd8b2ab88adcce6a853558 | [
"MIT"
] | null | null | null | src/ope/deepiv/learner.py | liyuan9988/IVOPEwithACME | d77fab09b2e1cb8d3dbd8b2ab88adcce6a853558 | [
"MIT"
] | null | null | null | # Lint as: python3
# pylint: disable=bad-indentation,line-too-long
"""DeepIV Learner implementation."""
import datetime
from typing import Dict, List
import acme
from acme.tf import savers as tf2_savers
from acme.tf import utils as tf2_utils
from acme.utils import counting
from acme.utils import loggers
import numpy ... | 40.466926 | 114 | 0.639904 |
4a19b0821db4161d2a0db44e203017b4fcb2b489 | 978 | py | Python | ibsng/handler/user/search_user.py | ParspooyeshFanavar/pyibsng | d48bcf4f25e3f23461528bf0ff8870cc3d537444 | [
"MIT"
] | 6 | 2018-03-06T10:16:36.000Z | 2021-12-05T12:43:10.000Z | ibsng/handler/user/search_user.py | ParspooyeshFanavar/pyibsng | d48bcf4f25e3f23461528bf0ff8870cc3d537444 | [
"MIT"
] | 3 | 2018-03-06T10:27:08.000Z | 2022-01-02T15:21:27.000Z | ibsng/handler/user/search_user.py | ParspooyeshFanavar/pyibsng | d48bcf4f25e3f23461528bf0ff8870cc3d537444 | [
"MIT"
] | 3 | 2018-01-06T16:28:31.000Z | 2018-09-17T19:47:19.000Z | """Search user API method."""
from ibsng.handler.handler import Handler
class searchUser(Handler):
"""Search user method class."""
def control(self):
"""Validate inputs after setup method.
:return: None
:rtype: None
"""
self.is_valid(self.conds, dict)
self.is_... | 26.432432 | 55 | 0.59407 |
4a19b16e606f47ee40cc8d1fec2eab0d16b2d91a | 708 | py | Python | setup.py | mihi-r/numba_timer | 997b6d305d26983ff51d2a592e356e4edf58b053 | [
"MIT"
] | 1 | 2020-10-01T02:08:30.000Z | 2020-10-01T02:08:30.000Z | setup.py | mihi-r/numba_timer | 997b6d305d26983ff51d2a592e356e4edf58b053 | [
"MIT"
] | null | null | null | setup.py | mihi-r/numba_timer | 997b6d305d26983ff51d2a592e356e4edf58b053 | [
"MIT"
] | null | null | null | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name="numba_timer",
version="0.1.2",
author="Mihir Patel",
author_email="abc55abc55@gmail.com",
description="A helper package to easily time Numba CUDA GPU events",
long_description=long_des... | 30.782609 | 72 | 0.666667 |
4a19b1a49d7c9479c630a458445de80d754a092b | 30,761 | py | Python | exchangelib/folders/base.py | kraglik/exchangelib | 3d4aad35f5e24bc282f02e5fa8d67ee683fda64e | [
"BSD-2-Clause"
] | null | null | null | exchangelib/folders/base.py | kraglik/exchangelib | 3d4aad35f5e24bc282f02e5fa8d67ee683fda64e | [
"BSD-2-Clause"
] | null | null | null | exchangelib/folders/base.py | kraglik/exchangelib | 3d4aad35f5e24bc282f02e5fa8d67ee683fda64e | [
"BSD-2-Clause"
] | null | null | null | # coding=utf-8
from __future__ import unicode_literals
from fnmatch import fnmatch
import logging
from operator import attrgetter
from future.utils import python_2_unicode_compatible, PY2
from six import string_types
from ..errors import ErrorAccessDenied, ErrorFolderNotFound, ErrorCannotEmptyFolder, ErrorCannotDele... | 44.775837 | 122 | 0.626898 |
4a19b246b756ba19492546aaef1e1dd3477de823 | 1,269 | py | Python | tests/test_switch.py | unlhcc/shipwright | ef2381758c12ad9fd1644d1095602e9abc33dc41 | [
"Apache-2.0"
] | 107 | 2015-01-01T03:40:58.000Z | 2022-01-13T21:15:57.000Z | tests/test_switch.py | unlhcc/shipwright | ef2381758c12ad9fd1644d1095602e9abc33dc41 | [
"Apache-2.0"
] | 62 | 2015-01-02T00:24:14.000Z | 2020-09-23T14:59:39.000Z | tests/test_switch.py | unlhcc/shipwright | ef2381758c12ad9fd1644d1095602e9abc33dc41 | [
"Apache-2.0"
] | 21 | 2015-01-22T20:51:01.000Z | 2018-04-04T17:46:20.000Z | from __future__ import absolute_import
from shipwright._lib import cli
def switch(event):
return cli.switch(event, True)
aux = {
u'aux': {
u'Digest': u'sha256:redacted',
u'Size': 1337,
u'Tag': u'redacted',
},
'event': 'push',
'image': u'redacted/redacted',
u'progress... | 19.227273 | 75 | 0.552403 |
4a19b2650909dca46e45fb9e5a9a0147b10845bc | 556 | py | Python | tests/components/smarttub/test_entity.py | AdmiralStipe/core | e9334347eb8354795cdb17f1401a80ef3abfb269 | [
"Apache-2.0"
] | 4 | 2016-06-22T12:00:41.000Z | 2018-06-11T20:31:25.000Z | tests/components/smarttub/test_entity.py | AdmiralStipe/core | e9334347eb8354795cdb17f1401a80ef3abfb269 | [
"Apache-2.0"
] | 54 | 2016-06-15T04:52:32.000Z | 2022-03-22T06:02:16.000Z | tests/components/smarttub/test_entity.py | AdmiralStipe/core | e9334347eb8354795cdb17f1401a80ef3abfb269 | [
"Apache-2.0"
] | 1 | 2016-04-17T09:39:48.000Z | 2016-04-17T09:39:48.000Z | """Test SmartTubEntity."""
from homeassistant.components.smarttub.entity import SmartTubEntity
async def test_entity(coordinator, spa):
"""Test SmartTubEntity."""
entity = SmartTubEntity(coordinator, spa, "entity1")
assert entity.device_info
assert entity.name
coordinator.data[spa.id] = {}
... | 29.263158 | 83 | 0.688849 |
4a19b290fe8bafc70f5d6212a728e05fcfeeec1d | 1,045 | py | Python | tests/common/test_debug.py | jonathanslenders/edgedb | 35ad66c4bd525cd9966f8029e5b385e888323f82 | [
"Apache-2.0"
] | 1 | 2021-12-15T09:34:48.000Z | 2021-12-15T09:34:48.000Z | tests/common/test_debug.py | jonathanslenders/edgedb | 35ad66c4bd525cd9966f8029e5b385e888323f82 | [
"Apache-2.0"
] | null | null | null | tests/common/test_debug.py | jonathanslenders/edgedb | 35ad66c4bd525cd9966f8029e5b385e888323f82 | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 20017-present MagicStack Inc. and the EdgeDB 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
#
# htt... | 32.65625 | 74 | 0.744498 |
4a19b2af7101bf70ed9721b336cc9585f1dac9a9 | 436 | py | Python | travel_recommand/travel/migrations/0017_hotel_booking_ending_date.py | nirvasangani/travoyager-travel-recommendation | bb0c041630929276a695343b9a25e4e7f5a9e321 | [
"MIT"
] | 2 | 2021-05-13T17:14:50.000Z | 2021-05-18T07:59:56.000Z | travel_recommand/travel/migrations/0017_hotel_booking_ending_date.py | nirvasangani/travoyager-travel-recommendation | bb0c041630929276a695343b9a25e4e7f5a9e321 | [
"MIT"
] | null | null | null | travel_recommand/travel/migrations/0017_hotel_booking_ending_date.py | nirvasangani/travoyager-travel-recommendation | bb0c041630929276a695343b9a25e4e7f5a9e321 | [
"MIT"
] | 3 | 2021-05-14T03:24:32.000Z | 2021-05-18T08:01:23.000Z | # Generated by Django 3.0.6 on 2021-04-07 09:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('travel', '0016_auto_20210407_1500'),
]
operations = [
migrations.AddField(
model_name='hotel_booking',
name='ending_... | 21.8 | 55 | 0.600917 |
4a19b2c605ef6ebdd4f3ecf498e24e36bbcac1e5 | 8,423 | py | Python | rotkehlchen/assets/spam_assets.py | rotkehlchenio/rotkehlchen | 98f49cd3ed26c641fec03b78eff9fe1872385fbf | [
"BSD-3-Clause"
] | 137 | 2018-03-05T11:53:29.000Z | 2019-11-03T16:38:42.000Z | rotkehlchen/assets/spam_assets.py | rotkehlchenio/rotkehlchen | 98f49cd3ed26c641fec03b78eff9fe1872385fbf | [
"BSD-3-Clause"
] | 385 | 2018-03-08T12:43:41.000Z | 2019-11-10T09:15:36.000Z | rotkehlchen/assets/spam_assets.py | rotkehlchenio/rotkehlchen | 98f49cd3ed26c641fec03b78eff9fe1872385fbf | [
"BSD-3-Clause"
] | 59 | 2018-03-08T10:08:27.000Z | 2019-10-26T11:30:44.000Z | import logging
from json.decoder import JSONDecodeError
from typing import TYPE_CHECKING, Any, Dict, Set
import requests
from eth_utils import to_checksum_address
from rotkehlchen.assets.asset import EthereumToken
from rotkehlchen.assets.utils import get_or_create_ethereum_token
from rotkehlchen.chain.ethereum.types ... | 38.461187 | 98 | 0.678381 |
4a19b2d7c424917fb52162cbd441483b6c60c269 | 3,985 | py | Python | page/views.py | guvenaltunsoyy/django-kaft-clone | be4bfee0b7e07113866f36d452b225580d177bb4 | [
"MIT"
] | null | null | null | page/views.py | guvenaltunsoyy/django-kaft-clone | be4bfee0b7e07113866f36d452b225580d177bb4 | [
"MIT"
] | null | null | null | page/views.py | guvenaltunsoyy/django-kaft-clone | be4bfee0b7e07113866f36d452b225580d177bb4 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.contrib import messages
from .models import (Carousel, Page)
from .forms import CarouselModelForm, PageModelForm
from django.utils.text import slugify
from django.contrib.admin.views.decorators import staff_member_required
from product.models import Category, Pr... | 31.377953 | 86 | 0.637139 |
4a19b364453ee2580495c4e1068f9a54102a8bcf | 8,700 | py | Python | cfgov/scripts/http_smoke_test.py | cfpb/cfgov-refresh | e948e1f589e44999e4744911a73d06e5ff5905cc | [
"CC0-1.0"
] | 156 | 2015-01-16T15:16:46.000Z | 2020-08-04T04:48:01.000Z | cfgov/scripts/http_smoke_test.py | cfpb/cfgov-refresh | e948e1f589e44999e4744911a73d06e5ff5905cc | [
"CC0-1.0"
] | 3,604 | 2015-01-05T22:09:12.000Z | 2020-08-14T17:09:19.000Z | cfgov/scripts/http_smoke_test.py | cfpb/cfgov-refresh | e948e1f589e44999e4744911a73d06e5ff5905cc | [
"CC0-1.0"
] | 102 | 2015-01-28T14:51:18.000Z | 2020-08-10T00:00:39.000Z | #!/usr/bin/env python
import argparse
import logging
import sys
import time
import requests
logger = logging.getLogger("http_smoke_tests")
logger.setLevel(logging.FATAL)
shell_log = logging.StreamHandler()
shell_log.setLevel(logging.INFO)
logger.addHandler(shell_log)
parser = argparse.ArgumentParser()
parser.add_ar... | 34.939759 | 133 | 0.65046 |
4a19b62b158214634ec63c7d321baf5a3f8b53ae | 3,790 | py | Python | race.py | TyPh00nCdr/agent-hallucination | 05532b57a05e9b73d7d3883e9ce67e5449ddf3a6 | [
"Apache-2.0"
] | null | null | null | race.py | TyPh00nCdr/agent-hallucination | 05532b57a05e9b73d7d3883e9ce67e5449ddf3a6 | [
"Apache-2.0"
] | null | null | null | race.py | TyPh00nCdr/agent-hallucination | 05532b57a05e9b73d7d3883e9ce67e5449ddf3a6 | [
"Apache-2.0"
] | null | null | null | from os import sched_getaffinity
from pathlib import Path
import gym
import numpy as np
from pyvirtualdisplay import Display
ENV = 'CarRacing-v0'
AVAILABLE_CORES = len(sched_getaffinity(0))
ROLLOUTS_PER_CORE = 100 // AVAILABLE_CORES
def key_press(k, mod):
from pyglet.window import key
if k == key.ENTER:
... | 32.956522 | 92 | 0.573087 |
4a19b70172058021780501843f914722c831e6e2 | 3,798 | py | Python | tests/test_validate.py | pachterlab/kb_python | 61eb657a1bb28a7cefd2fbafaaf6f1d0bd757b7d | [
"BSD-2-Clause"
] | 71 | 2019-11-05T21:37:21.000Z | 2022-03-28T14:33:54.000Z | tests/test_validate.py | pachterlab/kb_python | 61eb657a1bb28a7cefd2fbafaaf6f1d0bd757b7d | [
"BSD-2-Clause"
] | 111 | 2019-11-08T19:27:25.000Z | 2022-03-29T00:06:03.000Z | tests/test_validate.py | pachterlab/kb_python | 61eb657a1bb28a7cefd2fbafaaf6f1d0bd757b7d | [
"BSD-2-Clause"
] | 13 | 2019-11-04T22:06:46.000Z | 2021-12-01T20:34:32.000Z | from unittest import mock, TestCase
from unittest.mock import call
import kb_python.validate as validate
from tests.mixins import TestMixin
@validate.validate_files()
def dummy(*args, **kwargs):
return
@validate.validate_files()
def dummy_str(*args, **kwargs):
return 'test'
@validate.validate_files()
def... | 36.873786 | 79 | 0.628489 |
4a19b80aa863c01a72879b1a25276baffece16c8 | 1,856 | py | Python | change-liwc-scores-to-personality.py | sarajaksa/IS2020 | db6b7cdc804465dd4142f27a8c05c3a2e87c1076 | [
"MIT"
] | null | null | null | change-liwc-scores-to-personality.py | sarajaksa/IS2020 | db6b7cdc804465dd4142f27a8c05c3a2e87c1076 | [
"MIT"
] | null | null | null | change-liwc-scores-to-personality.py | sarajaksa/IS2020 | db6b7cdc804465dd4142f27a8c05c3a2e87c1076 | [
"MIT"
] | null | null | null | import pandas
import sqlite3
database_file_name = "data.db"
filename = "LIWC2015 Results (users (52235 files)).csv"
def number(n):
return float(n.replace(",", "."))
def put_personality_to_database(row, cursor):
sql_query = f'INSERT INTO personality (author, WC, C, A, O, E, N) values ("{row.Filename}", {row... | 25.777778 | 151 | 0.647629 |
4a19b94deb80c06c0e90d0bbd889ff6918d5f96a | 22,845 | py | Python | py/ztools/mtp/mtpxci_remote.py | HerrTrigger/NSC_BUILDER | e9083e83383281bdd9e167d3141163dcc56b6710 | [
"MIT"
] | 828 | 2018-11-05T02:43:40.000Z | 2022-03-27T08:49:56.000Z | py/ztools/mtp/mtpxci_remote.py | HerrTrigger/NSC_BUILDER | e9083e83383281bdd9e167d3141163dcc56b6710 | [
"MIT"
] | 141 | 2018-11-05T19:59:23.000Z | 2022-01-10T01:17:32.000Z | py/ztools/mtp/mtpxci_remote.py | HerrTrigger/NSC_BUILDER | e9083e83383281bdd9e167d3141163dcc56b6710 | [
"MIT"
] | 119 | 2018-11-05T06:57:37.000Z | 2022-03-25T18:10:33.000Z | import aes128
import Print
import os
import shutil
import json
import listmanager
from Fs import Nsp as squirrelNSP
from Fs import Xci as squirrelXCI
from Fs.Nca import NcaHeader
from Fs import Nca
from Fs.File import MemoryFile
import sq_tools
from Fs import Type as FsType
import Keys
from binascii imp... | 33.645066 | 160 | 0.660495 |
4a19b9af52382aa1f22954d36a80f6805f492a64 | 515 | py | Python | pagarmecoreapi/decorators.py | pagarme/pagarme-core-api-python | c7b11ca78ab3e7e896e5b75048e6f72b511db00e | [
"MIT"
] | 6 | 2021-09-02T19:55:04.000Z | 2022-03-16T14:06:15.000Z | pagarmecoreapi/decorators.py | pagarme/pagarme-core-api-python | c7b11ca78ab3e7e896e5b75048e6f72b511db00e | [
"MIT"
] | 2 | 2021-10-11T22:48:15.000Z | 2022-01-24T18:24:23.000Z | pagarmecoreapi/decorators.py | pagarme/pagarme-core-api-python | c7b11ca78ab3e7e896e5b75048e6f72b511db00e | [
"MIT"
] | 2 | 2021-09-12T21:43:32.000Z | 2022-03-07T16:58:54.000Z | # -*- coding: utf-8 -*-
"""
pagarmecoreapi
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class lazy_property(object):
"""A decorator class for lazy instantiation."""
def __init__(self, fget):
self.fget = fget
self.func_name = fget.... | 22.391304 | 84 | 0.574757 |
4a19b9be63a6369bd9006da2c6f4af951d23b4b2 | 7,482 | py | Python | youtube_dl/extractor/tv2.py | hackarada/youtube-dl | 2ba46715a41fe074eab2221170b2ac78fab93fad | [
"Unlicense"
] | 3,001 | 2020-10-24T05:24:18.000Z | 2022-03-31T06:45:32.000Z | youtube_dl/extractor/tv2.py | hackarada/youtube-dl | 2ba46715a41fe074eab2221170b2ac78fab93fad | [
"Unlicense"
] | 274 | 2020-10-24T04:57:21.000Z | 2022-03-22T01:34:56.000Z | youtube_dl/extractor/tv2.py | hackarada/youtube-dl | 2ba46715a41fe074eab2221170b2ac78fab93fad | [
"Unlicense"
] | 541 | 2020-10-24T03:32:09.000Z | 2022-01-12T23:49:30.000Z | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
float_or_none,
js_to_json,
parse_iso8601,
remove_end,
strip_or_none,
try_get,
... | 38.766839 | 148 | 0.528067 |
4a19bb0c6b615a904dfc5d37069be87d1ce91eeb | 1,102 | py | Python | examples/video_channel_create.py | Dawolee/jwplatform-py | 0a0c69e9c6a2eece9b0392f2e9ba5d8cc24675a4 | [
"MIT"
] | 2 | 2020-03-09T21:59:37.000Z | 2020-09-15T10:24:27.000Z | examples/video_channel_create.py | Dawolee/jwplatform-py | 0a0c69e9c6a2eece9b0392f2e9ba5d8cc24675a4 | [
"MIT"
] | null | null | null | examples/video_channel_create.py | Dawolee/jwplatform-py | 0a0c69e9c6a2eece9b0392f2e9ba5d8cc24675a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import sys
import jwplatform
def create_channel(api_key, api_secret, channel_type='manual', **kwargs):
"""
Function which creates a new channel. Channels serve as containers of video/media objects.
:param api_key: <string> JWPlatform api-key
... | 39.357143 | 145 | 0.727768 |
4a19bbbe580950f00b55f2ba0d3ad03df7b460c2 | 5,186 | py | Python | aalh_iit_industry_001/cleanup-subjects-column.py | johndewees/iitmigration | 4dadfbecda719d6e7d60af076a231aedec3c862f | [
"Unlicense"
] | null | null | null | aalh_iit_industry_001/cleanup-subjects-column.py | johndewees/iitmigration | 4dadfbecda719d6e7d60af076a231aedec3c862f | [
"Unlicense"
] | null | null | null | aalh_iit_industry_001/cleanup-subjects-column.py | johndewees/iitmigration | 4dadfbecda719d6e7d60af076a231aedec3c862f | [
"Unlicense"
] | null | null | null | from openpyxl import load_workbook
filename = 'aalh_iit_industry_001.xlsx'
wb = load_workbook(filename)
ws = wb['Metadata Template']
minimumcol = 8
maximumcol = 8
minimumrow = 7
maximumrow = 464
iterationrow = 7
targetcol = 9
placecol = 13
subjectholland = 'Images in time photographic collection. (To... | 64.024691 | 141 | 0.655226 |
4a19bc08629df13f806b1003649588b63064da13 | 566 | py | Python | plotly/validators/splom/marker/colorbar/_ticks.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/splom/marker/colorbar/_ticks.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/splom/marker/colorbar/_ticks.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class TicksValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name='ticks',
parent_name='splom.marker.colorbar',
**kwargs
):
super(TicksValidator, self).__init__(
plotly_name=plotly_na... | 28.3 | 71 | 0.597173 |
4a19bc0ff47921cf68440da12d17d09e2706a5d1 | 5,627 | py | Python | backtest/algos/algo_prometheus_v1.py | block1o1/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | 4 | 2021-10-14T21:22:25.000Z | 2022-03-12T19:58:48.000Z | backtest/algos/algo_prometheus_v1.py | inevolin/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | null | null | null | backtest/algos/algo_prometheus_v1.py | inevolin/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | 1 | 2022-03-15T22:52:53.000Z | 2022-03-15T22:52:53.000Z |
import json
import sys
sys.dont_write_bytecode = True
import numpy as np
import datetime
import random
import math
import core
def run(debug):
base = "BTC"
base = "ETH"
#base = "LTC"
quote = "USDT"
historymins = 60*24*30*1 #60*24*30*4
interval = 60
dtend = datetime.datetime.strptime('20... | 32.526012 | 90 | 0.435756 |
4a19bdd90d28bc297f4aa11e8f790a7f83d5dede | 1,478 | py | Python | docs/src/automobile.py | VictorOmondi1997/Automobile | 4ab74b5607ad275073d9c717748accff511f8670 | [
"Apache-2.0"
] | null | null | null | docs/src/automobile.py | VictorOmondi1997/Automobile | 4ab74b5607ad275073d9c717748accff511f8670 | [
"Apache-2.0"
] | null | null | null | docs/src/automobile.py | VictorOmondi1997/Automobile | 4ab74b5607ad275073d9c717748accff511f8670 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 5 13:10:41 2019
@author: Victor Omondi
"""
class Automobile:
def __init__(self, vehicle_id, make, model, color, year, mileage):
self.vehicle_id = vehicle_id
self.make = make
self.__model = model
self.__color = color
self.__yea... | 26.872727 | 181 | 0.562923 |
4a19bdfd97e1bb6313d9cb3b4360ca34a65cebf4 | 3,321 | py | Python | bounty-program/stellar-docs/python/claimable-balance.py | apaldiwal/stellar-quest | 14f12dd38d837008c4181e61295c19ab6d1bfd96 | [
"MIT"
] | 1 | 2021-07-19T17:55:41.000Z | 2021-07-19T17:55:41.000Z | bounty-program/stellar-docs/python/claimable-balance.py | apaldiwal/stellar-quest | 14f12dd38d837008c4181e61295c19ab6d1bfd96 | [
"MIT"
] | null | null | null | bounty-program/stellar-docs/python/claimable-balance.py | apaldiwal/stellar-quest | 14f12dd38d837008c4181e61295c19ab6d1bfd96 | [
"MIT"
] | null | null | null | import time
from stellar_sdk.xdr import TransactionResult, OperationType
from stellar_sdk.exceptions import NotFoundError, BadResponseError, BadRequestError
from stellar_sdk import (
Keypair,
Network,
Server,
TransactionBuilder,
Transaction,
Asset,
Operation,
Claimant,
ClaimPredicate... | 29.389381 | 87 | 0.733815 |
4a19be00bd5e873191ac7f07cdbae80bc9aa726f | 7,373 | py | Python | instagram/views.py | fkinyae/kins-stage | f924e5a0393d38ed2976ac4a1dec00b97380a559 | [
"MIT"
] | null | null | null | instagram/views.py | fkinyae/kins-stage | f924e5a0393d38ed2976ac4a1dec00b97380a559 | [
"MIT"
] | null | null | null | instagram/views.py | fkinyae/kins-stage | f924e5a0393d38ed2976ac4a1dec00b97380a559 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect, get_object_or_404
from .models import Image,Profile,Follow
from .forms import UploadForm,ProfileForm,UpdateUserForm,UpdateUserProfileForm,CommentForm,UserSignUpForm
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from ... | 36.5 | 114 | 0.667435 |
4a19be9bc4b5f52b616b53f96459d44e158b3ac7 | 534 | py | Python | hackerearth/Algorithms/Different queries/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerearth/Algorithms/Different queries/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerearth/Algorithms/Different queries/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | import io
import unittest
from contextlib import redirect_stdout
from unittest.mock import patch
class TestQ(unittest.TestCase):
@patch('builtins.input', side_effect=[
'5 3',
'1 2 3 4 5',
'1 3 4 2',
'2 1 2 3',
'1 4 5 -6',
])
def test_case_0(self, input_mock=None):
... | 22.25 | 62 | 0.597378 |
4a19bff2b554083729260726443698d084a607c4 | 16,306 | py | Python | code/Test/TextROI.py | tpsatish95/OCR-on-Indus-Seals | 3c66a1be11117297d75275c3b099b2f108860ecb | [
"Apache-2.0"
] | 2 | 2016-11-26T03:35:01.000Z | 2022-01-06T08:50:03.000Z | code/Test/TextROI.py | dataarch/OCR-on-Indus-Seals | 3c66a1be11117297d75275c3b099b2f108860ecb | [
"Apache-2.0"
] | null | null | null | code/Test/TextROI.py | dataarch/OCR-on-Indus-Seals | 3c66a1be11117297d75275c3b099b2f108860ecb | [
"Apache-2.0"
] | 1 | 2018-10-20T02:33:22.000Z | 2018-10-20T02:33:22.000Z | # -*- coding: utf-8 -*-
import skimage.io
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import selectivesearch
import numpy as np
import skimage.transform
import os
import shutil
import caffe
from PIL import Image
candidates = set()
merged_candidates = set()
refined = set()
final = set()
final_... | 33.075051 | 197 | 0.49307 |
4a19c099e02f6cd663defc5c5f18d6f9bbbd51b8 | 474 | py | Python | lib/aggregate.py | deepu-james/sast-scan | 3e6c6da5e981cf51c39312ed0665f3d6d49ee042 | [
"MIT"
] | 131 | 2020-01-08T21:09:32.000Z | 2022-02-24T21:30:25.000Z | lib/aggregate.py | deepu-james/sast-scan | 3e6c6da5e981cf51c39312ed0665f3d6d49ee042 | [
"MIT"
] | 27 | 2020-01-10T20:25:15.000Z | 2020-09-04T12:21:30.000Z | lib/aggregate.py | deepu-james/sast-scan | 3e6c6da5e981cf51c39312ed0665f3d6d49ee042 | [
"MIT"
] | 19 | 2020-01-10T08:00:40.000Z | 2021-08-06T01:41:35.000Z | # -*- coding: utf-8 -*-
import json
def jsonl_aggregate(run_data_list, out_file_name):
"""Produce aggregated report in jsonl format
:param run_data_list: List of run data after parsing the sarif files
:param out_file_name: Output filename
"""
if not run_data_list or not out_file_name:
ret... | 27.882353 | 72 | 0.664557 |
4a19c1b6e503e4d9f636cbc4208160a71157c42c | 3,199 | py | Python | awake_guardian/awake_guardian.py | kamil-cy/awake-guardian | a03d03d3980c6dcc4355ded3d9ed218dceeb5271 | [
"MIT"
] | null | null | null | awake_guardian/awake_guardian.py | kamil-cy/awake-guardian | a03d03d3980c6dcc4355ded3d9ed218dceeb5271 | [
"MIT"
] | null | null | null | awake_guardian/awake_guardian.py | kamil-cy/awake-guardian | a03d03d3980c6dcc4355ded3d9ed218dceeb5271 | [
"MIT"
] | null | null | null | from PySide6.QtCore import QTimer
from datetime import datetime
from .config import Config, Icon
from .hold_dialog import HoldDialog
from .lang import L
from .power_management import SYSTEM_COMMANDS
from .settings_dialog import SettingsDialog
from .sounds import Sound
from .system_tray_icon import SystemTrayIcon
from ... | 32.979381 | 82 | 0.632698 |
4a19c1ed48a6908fc3192e2bad9eccc4065b0c60 | 1,166 | py | Python | scripts/xor_6_6f/xor_6_6f_prepare_data.py | NRuf77/proset | 101d491e05c2423faddca31029232982f46d8831 | [
"MIT"
] | null | null | null | scripts/xor_6_6f/xor_6_6f_prepare_data.py | NRuf77/proset | 101d491e05c2423faddca31029232982f46d8831 | [
"MIT"
] | null | null | null | scripts/xor_6_6f/xor_6_6f_prepare_data.py | NRuf77/proset | 101d491e05c2423faddca31029232982f46d8831 | [
"MIT"
] | null | null | null | """Prepare 'continuous XOR' problem with 6 relevant and 6 irrelevant features as benchmark case.
Copyright by Nikolaus Ruf
Released under the MIT license - see LICENSE file for details
"""
import gzip
import os
import pickle
import numpy as np
from sklearn.model_selection import train_test_split
from p... | 28.439024 | 112 | 0.708405 |
4a19c1f194eb275f9469fcfcf85a74b889dbb3e7 | 9,651 | py | Python | nemo/collections/nlp/models/language_modeling/bert_lm_model.py | vinayphadnis/NeMo | 9dc7773c48e164b8a82051bb558a728c6eeb85ec | [
"Apache-2.0"
] | 2 | 2020-10-08T13:38:46.000Z | 2020-10-14T15:09:34.000Z | nemo/collections/nlp/models/language_modeling/bert_lm_model.py | vinayphadnis/NeMo | 9dc7773c48e164b8a82051bb558a728c6eeb85ec | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/models/language_modeling/bert_lm_model.py | vinayphadnis/NeMo | 9dc7773c48e164b8a82051bb558a728c6eeb85ec | [
"Apache-2.0"
] | 1 | 2020-12-18T14:23:37.000Z | 2020-12-18T14:23:37.000Z | # Copyright (c) 2020, 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 License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 38.915323 | 119 | 0.678064 |
4a19c23ad1ce091c440fad5ca485ed19e4f22627 | 639 | py | Python | Python/car.py | rgomeztinoco/poo_uber | c705268820408dc5ee60a8a23e2cd05967642988 | [
"MIT"
] | null | null | null | Python/car.py | rgomeztinoco/poo_uber | c705268820408dc5ee60a8a23e2cd05967642988 | [
"MIT"
] | null | null | null | Python/car.py | rgomeztinoco/poo_uber | c705268820408dc5ee60a8a23e2cd05967642988 | [
"MIT"
] | null | null | null | from account import Account
class Car:
id = int
license = str
driver = Account("","")
__passenger = int
def __init__(self, license, driver):
self.license = license
self.driver = driver
@property
def passenger(self):
return self.__passenger
@passenger.setter
def passenger(self, pass... | 22.821429 | 47 | 0.655712 |
4a19c249f6d780e8b77925d273e70375c0ff9254 | 60 | py | Python | flask_app/views/__init__.py | BlakeC97/gcloud-flask-app | 0f2b3c49cf4a771b2656639720b71c649ecef5d1 | [
"MIT"
] | null | null | null | flask_app/views/__init__.py | BlakeC97/gcloud-flask-app | 0f2b3c49cf4a771b2656639720b71c649ecef5d1 | [
"MIT"
] | null | null | null | flask_app/views/__init__.py | BlakeC97/gcloud-flask-app | 0f2b3c49cf4a771b2656639720b71c649ecef5d1 | [
"MIT"
] | null | null | null | from .homepage import homepage
from .pdf_ocr import pdf_ocr
| 20 | 30 | 0.833333 |
4a19c3ba5933afb087bc273e475acb8df51a9517 | 1,770 | py | Python | setup.py | a-ws-m/unlockGNN | 128b192770925220e24761173c9c373d90088868 | [
"MIT"
] | 6 | 2020-09-20T11:38:46.000Z | 2020-10-21T14:13:35.000Z | setup.py | a-ws-m/unlockGNN | 128b192770925220e24761173c9c373d90088868 | [
"MIT"
] | 18 | 2021-09-27T17:24:26.000Z | 2022-02-02T03:25:35.000Z | setup.py | a-ws-m/unlockGNN | 128b192770925220e24761173c9c373d90088868 | [
"MIT"
] | 1 | 2021-08-05T11:05:53.000Z | 2021-08-05T11:05:53.000Z | """Setup script for package."""
import pathlib
from setuptools import find_namespace_packages, setup
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
# This call to setup() does all the work
setup(
name="unlockNN",
... | 31.052632 | 92 | 0.619209 |
4a19c3d5507dcda3ee354d4a661b0e60ddcd42d5 | 6,307 | py | Python | test/programytest/clients/restful/flask/line/test_client.py | whackur/chatbot | bb4b4dace89f1f8aae2b6377bf7d2601e66af7a7 | [
"MIT"
] | 2 | 2018-06-16T09:32:22.000Z | 2019-07-21T13:16:00.000Z | test/programytest/clients/restful/flask/line/test_client.py | whackur/chatbot | bb4b4dace89f1f8aae2b6377bf7d2601e66af7a7 | [
"MIT"
] | 3 | 2020-07-16T04:00:42.000Z | 2021-03-31T18:52:22.000Z | test/programytest/clients/restful/flask/line/test_client.py | whackur/chatbot | bb4b4dace89f1f8aae2b6377bf7d2601e66af7a7 | [
"MIT"
] | 4 | 2018-06-29T23:50:44.000Z | 2020-11-05T08:13:47.000Z | import unittest.mock
from linebot.models import TextSendMessage
from linebot import LineBotApi, WebhookParser
from linebot.webhook import SignatureValidator
from programy.clients.restful.flask.line.client import LineBotClient
from programy.clients.restful.flask.line.config import LineConfiguration
from programytest.... | 37.319527 | 156 | 0.711432 |
4a19c66d88cdb8861482a7528b44619ad7525dc9 | 16,044 | py | Python | madminer/fisherinformation/geometry.py | siyuchen95/madminer | dfcbd7ee26c47dd294610c195fafce15f74c10eb | [
"MIT"
] | 2 | 2020-09-09T20:58:31.000Z | 2020-09-10T01:35:35.000Z | madminer/fisherinformation/geometry.py | siyuchen95/madminer | dfcbd7ee26c47dd294610c195fafce15f74c10eb | [
"MIT"
] | null | null | null | madminer/fisherinformation/geometry.py | siyuchen95/madminer | dfcbd7ee26c47dd294610c195fafce15f74c10eb | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import numpy as np
import random
from scipy.interpolate import griddata, LinearNDInterpolator, CloughTocher2DInterpolator
from scipy.stats import chi2
from ..utils.various import load_and_check
logger = logging.getLogge... | 39.614815 | 120 | 0.613064 |
4a19c6b3e7cf767e730ec41b37d772fb9ad3836c | 543 | py | Python | RabbitMqUdn/client/command_args.py | clearpal7/ChaosTestingCode | 5fc029372dc68064f99ac494618061211f51204d | [
"MIT"
] | 24 | 2018-03-23T02:50:52.000Z | 2021-08-17T18:50:58.000Z | RabbitMqUdn/client/command_args.py | clearpal7/ChaosTestingCode | 5fc029372dc68064f99ac494618061211f51204d | [
"MIT"
] | 3 | 2018-03-11T17:00:25.000Z | 2019-10-07T21:19:43.000Z | RabbitMqUdn/client/command_args.py | clearpal7/ChaosTestingCode | 5fc029372dc68064f99ac494618061211f51204d | [
"MIT"
] | 24 | 2017-10-03T09:45:37.000Z | 2022-03-28T12:55:18.000Z |
def get_args(args):
args_dict = dict()
index = 1
while index < len(args):
key = args[index]
value = args[index+1]
args_dict[key] = value
index += 2
return args_dict
def get_mandatory_arg(args_dict, key):
if key in args_dict:
return args_dict[key]
... | 21.72 | 52 | 0.598527 |
4a19c9414211c8c62b98f93060f744f5ef2c71ea | 2,099 | py | Python | cogs/_setup.py | GoldenJayz/sexybot | 77d5938240f5f3d8c6fbf4eab6ba3aada40fb6d7 | [
"MIT"
] | null | null | null | cogs/_setup.py | GoldenJayz/sexybot | 77d5938240f5f3d8c6fbf4eab6ba3aada40fb6d7 | [
"MIT"
] | null | null | null | cogs/_setup.py | GoldenJayz/sexybot | 77d5938240f5f3d8c6fbf4eab6ba3aada40fb6d7 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
import datetime
import json
from PIL import Image
from io import BytesIO
client = discord.Client()
class _setup(commands.Cog):
def __init__(self, client):
self.client = client
async def editimage(self, target):
IMAGE = Image.open("amoogus.jpg")
... | 35.576271 | 135 | 0.597904 |
4a19c97a25f7dd551c4f43594cdd2a626416ee63 | 8,338 | py | Python | independent_vector_analysis/tests/test_iva_g.py | SSTGroup/independent_vector_analysis | a5fa085bfb3bb8e9a4283bb90beaa8e0132596b6 | [
"MIT"
] | 1 | 2022-03-09T14:52:14.000Z | 2022-03-09T14:52:14.000Z | independent_vector_analysis/tests/test_iva_g.py | SSTGroup/independent_vector_analysis | a5fa085bfb3bb8e9a4283bb90beaa8e0132596b6 | [
"MIT"
] | null | null | null | independent_vector_analysis/tests/test_iva_g.py | SSTGroup/independent_vector_analysis | a5fa085bfb3bb8e9a4283bb90beaa8e0132596b6 | [
"MIT"
] | null | null | null | # Copyright (c) <2021> <University of Paderborn>
# Signal and System Theory Group, Univ. of Paderborn, https://sst-group.org/
# https://github.com/SSTGroup/independent_vector_analysis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated d... | 34.454545 | 99 | 0.578076 |
4a19c98350cd691b55b37a0d50c1fcbd6ab69303 | 8,411 | py | Python | docs/conf.py | Ramon5/dj-chartjs | eaa1d24a43f1d66637686c2620408a9890a1eb2b | [
"MIT"
] | null | null | null | docs/conf.py | Ramon5/dj-chartjs | eaa1d24a43f1d66637686c2620408a9890a1eb2b | [
"MIT"
] | null | null | null | docs/conf.py | Ramon5/dj-chartjs | eaa1d24a43f1d66637686c2620408a9890a1eb2b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | 32.474903 | 83 | 0.714065 |
4a19caed8fdcdaed886c69e559ae6ea2629df3e8 | 5,041 | py | Python | captum/attr/_utils/stat.py | ashkan-software/captum | b8b7d4b10a9646e4da827635d6947499fbde3326 | [
"BSD-3-Clause"
] | 1 | 2020-02-02T19:23:01.000Z | 2020-02-02T19:23:01.000Z | captum/attr/_utils/stat.py | ashkan-software/captum | b8b7d4b10a9646e4da827635d6947499fbde3326 | [
"BSD-3-Clause"
] | null | null | null | captum/attr/_utils/stat.py | ashkan-software/captum | b8b7d4b10a9646e4da827635d6947499fbde3326 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import torch
class Stat:
"""
The Stat class represents a statistic that can be updated and retrieved
at any point in time.
The basic functionality this class provides is:
1. A update/get method to actually compute the statistic
2. A statistic store/cache to retrieve dep... | 24.004762 | 75 | 0.565364 |
4a19cc20d0bf5bdd9463da2bb54d4435b9a315c4 | 6,898 | py | Python | sandbox/lib/jumpscale/JumpscaleLibs/clients/tarantool/TarantoolFactory.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | null | null | null | sandbox/lib/jumpscale/JumpscaleLibs/clients/tarantool/TarantoolFactory.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | null | null | null | sandbox/lib/jumpscale/JumpscaleLibs/clients/tarantool/TarantoolFactory.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | null | null | null | import os
from Jumpscale import j
try:
import tarantool
except:
j.builders.db.tarantool.install()
import tarantool
from .TarantoolClient import TarantoolClient
from .TarantoolDB import TarantoolDB
JSConfigBaseFactory = j.application.JSFactoryBaseClass
class TarantoolFactory(JSConfigBaseFactory):
""... | 34.148515 | 119 | 0.603653 |
4a19cc63ac71d6039dad92b42d72c80f8ea54408 | 10,978 | py | Python | neutron/notifiers/nova.py | mail2nsrajesh/neutron | 352afb37afcf4952f03436b25618d0066c51f3f1 | [
"Apache-2.0"
] | null | null | null | neutron/notifiers/nova.py | mail2nsrajesh/neutron | 352afb37afcf4952f03436b25618d0066c51f3f1 | [
"Apache-2.0"
] | null | null | null | neutron/notifiers/nova.py | mail2nsrajesh/neutron | 352afb37afcf4952f03436b25618d0066c51f3f1 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 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... | 40.065693 | 79 | 0.600656 |
4a19ce5e051b034d478e38ec2777c4a8778d5603 | 20,713 | py | Python | intersight/models/iam_role.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 21 | 2018-03-29T14:20:35.000Z | 2021-10-13T05:11:41.000Z | intersight/models/iam_role.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 14 | 2018-01-30T15:45:46.000Z | 2022-02-23T14:23:21.000Z | intersight/models/iam_role.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 18 | 2018-01-03T15:09:56.000Z | 2021-07-16T02:21:54.000Z | # coding: utf-8
"""
Cisco Intersight OpenAPI specification.
The Cisco Intersight OpenAPI specification.
OpenAPI spec version: 1.0.9-1461
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class IamRole(object):
... | 32.877778 | 738 | 0.629363 |
4a19cfbdf75336fa2492068e8926d75fa5aa954d | 6,880 | py | Python | tests/test_utilities/test_extended_tag_list.py | amih90/bacpypes | 27ab4f18aa252ceb6ffdc32d53af2995a2e92647 | [
"MIT"
] | 240 | 2015-07-17T16:27:54.000Z | 2022-03-29T13:53:06.000Z | tests/test_utilities/test_extended_tag_list.py | amih90/bacpypes | 27ab4f18aa252ceb6ffdc32d53af2995a2e92647 | [
"MIT"
] | 400 | 2015-07-23T05:37:52.000Z | 2022-03-29T12:32:30.000Z | tests/test_utilities/test_extended_tag_list.py | amih90/bacpypes | 27ab4f18aa252ceb6ffdc32d53af2995a2e92647 | [
"MIT"
] | 143 | 2015-07-17T18:22:27.000Z | 2022-03-22T01:21:24.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test Utilities Extended Tag List
--------------------------------
"""
import unittest
from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob
from bacpypes.primitivedata import Tag, OpeningTag, ClosingTag, \
Null, Boolean, Unsigned, Integer, Real, D... | 40.233918 | 122 | 0.699128 |
4a19d0477499bc406e852a8927cf5ea9063ee380 | 6,479 | py | Python | pex/resolve/lockfile/__init__.py | alexey-tereshenkov-oxb/pex | 2e2d1e50e604fdee48b0d51aea482ca255521ff0 | [
"Apache-2.0"
] | null | null | null | pex/resolve/lockfile/__init__.py | alexey-tereshenkov-oxb/pex | 2e2d1e50e604fdee48b0d51aea482ca255521ff0 | [
"Apache-2.0"
] | null | null | null | pex/resolve/lockfile/__init__.py | alexey-tereshenkov-oxb/pex | 2e2d1e50e604fdee48b0d51aea482ca255521ff0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
from pex import resolver
from pex.common import pluralize, safe_open
from pex.requirements import LocalProjectRequirement, VCSRequirement
from pex.r... | 39.03012 | 99 | 0.702886 |
4a19d07b2410b88ffe24afb557943f9d2d3d100e | 599 | py | Python | demo4.py | KINGMJ/python-demo | 1876ab9912353e40494892d72c5cd72dd322cad4 | [
"MIT"
] | null | null | null | demo4.py | KINGMJ/python-demo | 1876ab9912353e40494892d72c5cd72dd322cad4 | [
"MIT"
] | null | null | null | demo4.py | KINGMJ/python-demo | 1876ab9912353e40494892d72c5cd72dd322cad4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*
# 遍历的技巧
# items() 可以取出 key 和 value
knights = {'gallahad': 'the pure', 'robin': 'the brave'}
for k, v in knights.items():
print(k, v)
# enumerate() 可以取出 index 和 value
for i, v in enumerate(['tic', 'tac', 'toe']):
print(i, v)
# 同时循环多个序列时,zip() 函数可以将其内的元素一一匹配
questions = ['name', 'quest'... | 24.958333 | 65 | 0.60601 |
4a19d2726e1cb77c7f72a471110caa2d87f24fb8 | 5,730 | py | Python | kornia/losses/ssim.py | tdchaitanya/kornia | 6dd16563f66f979c7a95846ef86678894b7d54fd | [
"Apache-2.0"
] | 10 | 2021-01-26T05:25:01.000Z | 2022-02-08T06:10:41.000Z | kornia/losses/ssim.py | tdchaitanya/kornia | 6dd16563f66f979c7a95846ef86678894b7d54fd | [
"Apache-2.0"
] | 3 | 2021-05-03T10:34:15.000Z | 2022-02-17T04:25:26.000Z | kornia/losses/ssim.py | tdchaitanya/kornia | 6dd16563f66f979c7a95846ef86678894b7d54fd | [
"Apache-2.0"
] | 4 | 2021-04-30T01:51:38.000Z | 2022-01-27T05:06:04.000Z | from typing import Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from kornia.filters import get_gaussian_kernel2d
class SSIM(nn.Module):
r"""Creates a criterion that measures the Structural Similarity (SSIM)
index between each element in the input `x` and target `y`.
The inde... | 35.590062 | 80 | 0.564049 |
4a19d31d451a6813b730865f97f331e3c82514cd | 4,648 | py | Python | tests/jupyterlab_hubshare/test_handlers.py | lydian/jupyterlab_hubshre | 18e3f270569d9f0d7c377bb3e26678300c19d22b | [
"BSD-3-Clause"
] | 3 | 2021-03-29T07:21:27.000Z | 2021-03-29T15:48:02.000Z | tests/jupyterlab_hubshare/test_handlers.py | lydian/jupyterlab_hubshre | 18e3f270569d9f0d7c377bb3e26678300c19d22b | [
"BSD-3-Clause"
] | 5 | 2021-04-28T08:48:00.000Z | 2021-06-07T06:47:10.000Z | tests/jupyterlab_hubshare/test_handlers.py | lydian/jupyterlab_hubshre | 18e3f270569d9f0d7c377bb3e26678300c19d22b | [
"BSD-3-Clause"
] | 3 | 2021-05-06T00:43:59.000Z | 2021-06-06T06:08:36.000Z | import base64
import datetime
import urllib.parse
from unittest import mock
import tornado
import pytest
from jupyter_server.services.contents.filemanager import FileContentsManager
from jupyterlab_hubshare.handlers import create_manager
from jupyterlab_hubshare.handlers import BaseMixin
from jupyterlab_hubshare.hand... | 31.405405 | 84 | 0.66932 |
4a19d3be1d6e589062b189f612b316a4285300f4 | 3,932 | py | Python | dydx/perp_orders.py | petioptrv/dydx-python | 7f82bb6f73f7850152268e08ad1534789831d450 | [
"Apache-2.0"
] | 99 | 2019-07-30T01:37:06.000Z | 2022-03-15T05:09:05.000Z | dydx/perp_orders.py | GibraltarCapital/dydx-python | 7f82bb6f73f7850152268e08ad1534789831d450 | [
"Apache-2.0"
] | 25 | 2019-07-31T23:09:47.000Z | 2022-02-01T00:22:48.000Z | dydx/perp_orders.py | GibraltarCapital/dydx-python | 7f82bb6f73f7850152268e08ad1534789831d450 | [
"Apache-2.0"
] | 38 | 2019-09-15T09:17:01.000Z | 2022-03-24T10:26:20.000Z | from web3 import Web3
import dydx.constants as consts
import dydx.util as utils
EIP712_ORDER_STRUCT_STRING = \
'Order(' + \
'bytes32 flags,' + \
'uint256 amount,' + \
'uint256 limitPrice,' + \
'uint256 triggerPrice,' + \
'uint256 limitFee,' + \
'address maker,' + \
'address taker,' + \
'uint256 expir... | 27.117241 | 78 | 0.600203 |
4a19d5414c828db42e1973192e9de148723831ae | 505 | py | Python | disco.py | evanessa234/selenium-tasks | 369f48bcb9fbba856074088886b8f1551f795b1f | [
"MIT"
] | null | null | null | disco.py | evanessa234/selenium-tasks | 369f48bcb9fbba856074088886b8f1551f795b1f | [
"MIT"
] | null | null | null | disco.py | evanessa234/selenium-tasks | 369f48bcb9fbba856074088886b8f1551f795b1f | [
"MIT"
] | null | null | null | from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://discord.com/login')
user = driver.find_element_by_xpath('//input[@name=\'email\']').send_keys("your_email_here")
pwd = driver.find_element_by_xpath('//input[@name=\'password\']')
pwd.send_keys("your_password_here")
login = driver.find_ele... | 36.071429 | 191 | 0.774257 |
4a19d7c40f746d64de800d7bf78a387bb2ba7db2 | 1,651 | py | Python | ex39.py | JeffreyAsuncion/PythonTheHardWay | 97488d99c9feff8b7737fc6910d0db03ee406550 | [
"MIT"
] | null | null | null | ex39.py | JeffreyAsuncion/PythonTheHardWay | 97488d99c9feff8b7737fc6910d0db03ee406550 | [
"MIT"
] | null | null | null | ex39.py | JeffreyAsuncion/PythonTheHardWay | 97488d99c9feff8b7737fc6910d0db03ee406550 | [
"MIT"
] | null | null | null |
# Exercise 39 - Dictionaries, Oh Lovely Dictionaries
# Create a mapping of state to abbreviation
states = {
'Oregon': 'OR',
'Florida': 'FL',
'California': 'CA',
'New York': 'NY',
'Michigan': 'MI'
}
# create a basic set of states and some cities in them
cities = {
... | 24.641791 | 89 | 0.623864 |
4a19d7c4c2ea5d703c7051c86f9d7041808d44c5 | 20,586 | py | Python | pyfolio/utils.py | QuantInsti/pyfolio | 906d49e566d1af260aacec109943016cf8258919 | [
"Apache-2.0"
] | 3 | 2020-11-28T18:12:36.000Z | 2021-06-09T11:31:28.000Z | pyfolio/utils.py | QuantInsti/pyfolio | 906d49e566d1af260aacec109943016cf8258919 | [
"Apache-2.0"
] | null | null | null | pyfolio/utils.py | QuantInsti/pyfolio | 906d49e566d1af260aacec109943016cf8258919 | [
"Apache-2.0"
] | 3 | 2019-07-25T03:09:44.000Z | 2020-07-02T18:39:26.000Z | #
# Copyright 2017 Quantopian, 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 wr... | 29.965066 | 78 | 0.640581 |
4a19d8baff7b4aae42c41bc8a5cd421e99074c40 | 8,134 | py | Python | apps/personal/clock/main.py | hpagseddy/ZPUI | b82819e523987639c2dfab417f9895d7cd7ce049 | [
"Apache-2.0",
"MIT"
] | null | null | null | apps/personal/clock/main.py | hpagseddy/ZPUI | b82819e523987639c2dfab417f9895d7cd7ce049 | [
"Apache-2.0",
"MIT"
] | 2 | 2020-01-17T00:44:53.000Z | 2020-01-19T21:10:48.000Z | apps/personal/clock/main.py | hpagseddy/ZPUI | b82819e523987639c2dfab417f9895d7cd7ce049 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-01-14T22:44:27.000Z | 2020-01-14T22:44:27.000Z | from __future__ import division
import math
import os
import time
from datetime import datetime, timedelta
from dateutil.zoneinfo import getzoneinfofile_stream, ZoneInfoFile
from subprocess import check_output, CalledProcessError
from apps import ZeroApp
from actions import FirstBootAction
from ui import Menu, Refre... | 41.927835 | 193 | 0.615441 |
4a19d9171d127868a27361c52d0953ac4c0a3826 | 9,765 | py | Python | flex-templates/python/regional_dlp_de_identification/pubsub_dlp_bigquery.py | marklindsey11/Google-Cloud-DataWarehouse | 987aaf34ae899edde82b7854530519ea9231e519 | [
"Apache-2.0"
] | 16 | 2021-12-16T21:09:32.000Z | 2022-03-17T08:00:06.000Z | flex-templates/python/regional_dlp_de_identification/pubsub_dlp_bigquery.py | marklindsey11/Google-Cloud-DataWarehouse | 987aaf34ae899edde82b7854530519ea9231e519 | [
"Apache-2.0"
] | 25 | 2021-12-16T23:28:15.000Z | 2022-03-31T18:55:40.000Z | flex-templates/python/regional_dlp_de_identification/pubsub_dlp_bigquery.py | marklindsey11/Google-Cloud-DataWarehouse | 987aaf34ae899edde82b7854530519ea9231e519 | [
"Apache-2.0"
] | 16 | 2021-12-16T21:17:00.000Z | 2022-03-16T13:56:32.000Z | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.5 | 83 | 0.582796 |
4a19d91f68f448a1fb524c8bc4d3b3c304f8feab | 854 | py | Python | components/collector/collector/collectors/gitlab.py | WMeijbeek/quality-time | 325366a36b1f54f91b748e5e9a7bedee2d2a5ee7 | [
"Apache-2.0"
] | null | null | null | components/collector/collector/collectors/gitlab.py | WMeijbeek/quality-time | 325366a36b1f54f91b748e5e9a7bedee2d2a5ee7 | [
"Apache-2.0"
] | null | null | null | components/collector/collector/collectors/gitlab.py | WMeijbeek/quality-time | 325366a36b1f54f91b748e5e9a7bedee2d2a5ee7 | [
"Apache-2.0"
] | null | null | null | """Gitlab metric source."""
import requests
from collector.collector import Collector
from collector.type import Measurement, URL
class GitlabJobs(Collector):
"""Collector class to get job counts from Gitlab."""
def api_url(self, **parameters) -> URL:
return URL(f"{parameters.get('url')}/api/v4/pro... | 34.16 | 94 | 0.696721 |
4a19d9299eae16ed2a0f4bfadf0a639d309c16e7 | 8,255 | py | Python | update-query.py | suin/update-query | 51d1ceca8888bb516d145d741ac4a029071f175d | [
"MIT"
] | 3 | 2016-01-10T02:03:31.000Z | 2020-04-19T15:29:18.000Z | update-query.py | suin/update-query | 51d1ceca8888bb516d145d741ac4a029071f175d | [
"MIT"
] | null | null | null | update-query.py | suin/update-query | 51d1ceca8888bb516d145d741ac4a029071f175d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Update query management tool
#
import os
import argparse
import commands
import sys
import re
import time
import glob
class TokenCollection:
"""
Token collection object
"""
def __init__(self, tokens = []):
"""
Returns new TokenCollection object
"""
self.to... | 23.721264 | 126 | 0.67983 |
4a19d9e84d3e4cc3dace7c2dcfd9df6cacf5db38 | 174 | py | Python | dovesoft/__init__.py | srahul07/dovesoft | aabba703009af331f3d04c550693bd706400957b | [
"MIT"
] | null | null | null | dovesoft/__init__.py | srahul07/dovesoft | aabba703009af331f3d04c550693bd706400957b | [
"MIT"
] | 3 | 2021-03-20T00:43:11.000Z | 2022-01-06T22:33:23.000Z | dovesoft/__init__.py | srahul07/dovesoft | aabba703009af331f3d04c550693bd706400957b | [
"MIT"
] | null | null | null | from .version import __version__
from .dovesoft import DoveSoftClient
from .exceptions import DoveSoftError, DoveSoftClientError, DoveSoftServerError
from .message import Sms | 43.5 | 79 | 0.867816 |
4a19d9f233c6a2f5ab82b85f33c46904666111fd | 5,947 | py | Python | xinmei/tools/tensorflow_scripts/list_kernels/print_kernel_src_list.py | lh-ycx/tensorflow | fbb024db725f462de6a991541fed568ad4f75eb5 | [
"Apache-2.0"
] | null | null | null | xinmei/tools/tensorflow_scripts/list_kernels/print_kernel_src_list.py | lh-ycx/tensorflow | fbb024db725f462de6a991541fed568ad4f75eb5 | [
"Apache-2.0"
] | null | null | null | xinmei/tools/tensorflow_scripts/list_kernels/print_kernel_src_list.py | lh-ycx/tensorflow | fbb024db725f462de6a991541fed568ad4f75eb5 | [
"Apache-2.0"
] | null | null | null | import os
import re
import sys
import click
from tensorflow.python.tools.selective_registration_header_lib import get_header_from_ops_and_kernels, \
get_ops_and_kernels
class IncScanner:
inc_reg = re.compile(r'^\s*#\s*include\s*["<](tensorflow/core/kernels/)?(?P<name>[^/]+)[>"].*$')
special_cases = {
... | 34.982353 | 116 | 0.604843 |
4a19db7ccdd4c25d66ea1299e07f2c3d9c7e0e6b | 424 | py | Python | src/fast_solution_using_deque.py | karianjahi/advent_of_code | 16939cc7c475465c35d8750328b9b7aef60fc4d6 | [
"MIT"
] | null | null | null | src/fast_solution_using_deque.py | karianjahi/advent_of_code | 16939cc7c475465c35d8750328b9b7aef60fc4d6 | [
"MIT"
] | null | null | null | src/fast_solution_using_deque.py | karianjahi/advent_of_code | 16939cc7c475465c35d8750328b9b7aef60fc4d6 | [
"MIT"
] | null | null | null | from collections import deque
def count_number_of_fish_after_n_days(laternfish_list, no_of_days):
# init counts
basket = deque([0] * 9)
for laternfish in laternfish_list:
basket[laternfish] += 1
# run through days
for each_day in range(no_of_days):
basket[7] += basket[0]
b... | 24.941176 | 67 | 0.676887 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.