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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cf1040d3a857baba790a3640b927af6098194633 | 1,435 | py | Python | hacker_earth/data_structures/tuple_sort.py | Faraaz54/python_training_problems | 24c7b42daaf54366759e1d7c4b42f9936316e94b | [
"MIT"
] | null | null | null | hacker_earth/data_structures/tuple_sort.py | Faraaz54/python_training_problems | 24c7b42daaf54366759e1d7c4b42f9936316e94b | [
"MIT"
] | null | null | null | hacker_earth/data_structures/tuple_sort.py | Faraaz54/python_training_problems | 24c7b42daaf54366759e1d7c4b42f9936316e94b | [
"MIT"
] | null | null | null | import bisect
class queue():
def __init__(self):
self.q = []
self.front = len(self.q)
self.end = 0
def __len__(self):
return len(self.q)
def __str__(self):
return ' '.join(str(i) for i in self.q)
def push(self, student):
pos = -1
... | 20.211268 | 60 | 0.436934 |
9bf267426e7fa0e28a0b1f038267c6798182769e | 39,109 | py | Python | tensor2tensor/data_generators/problem.py | JosvanderWesthuizen/tensor2tensor | 342e214dea360a7f472fc82f3dd0775d7e224c52 | [
"Apache-2.0"
] | 1 | 2018-07-03T08:07:43.000Z | 2018-07-03T08:07:43.000Z | tensor2tensor/data_generators/problem.py | zhaopufeng/tensor2tensor | 7bb67a18e1e4a0cddd1d61c65c937f14c1c124e3 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/data_generators/problem.py | zhaopufeng/tensor2tensor | 7bb67a18e1e4a0cddd1d61c65c937f14c1c124e3 | [
"Apache-2.0"
] | 1 | 2019-04-12T10:53:17.000Z | 2019-04-12T10:53:17.000Z | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | 35.075336 | 80 | 0.682324 |
061c984b681097b6b6c96a506f039d87a27887df | 10,321 | py | Python | tests/test_queue.py | jeanphix/rq | 9633d36e85bbdc8202f2bacc2b34499e86b91715 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2018-09-14T10:36:58.000Z | 2018-09-14T10:36:58.000Z | tests/test_queue.py | jeanphix/rq | 9633d36e85bbdc8202f2bacc2b34499e86b91715 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tests/test_queue.py | jeanphix/rq | 9633d36e85bbdc8202f2bacc2b34499e86b91715 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | from tests import RQTestCase
from tests.fixtures import Calculator, div_by_zero, say_hello, some_calculation
from rq import Queue, get_failed_queue
from rq.job import Job, Status
from rq.exceptions import InvalidJobOperationError
class TestQueue(RQTestCase):
def test_create_queue(self):
"""Creating queues... | 33.186495 | 83 | 0.614572 |
b003c80171f1b9490128481e34f62cadb2bef075 | 4,194 | py | Python | bentoml/utils/open_api.py | niits/BentoML | 3954f36762e10f5df15af7e0ae6dd71f5f214261 | [
"Apache-2.0"
] | 3,451 | 2019-04-02T01:47:42.000Z | 2022-03-31T16:20:49.000Z | bentoml/utils/open_api.py | niits/BentoML | 3954f36762e10f5df15af7e0ae6dd71f5f214261 | [
"Apache-2.0"
] | 1,925 | 2019-04-03T00:19:05.000Z | 2022-03-31T22:41:54.000Z | bentoml/utils/open_api.py | niits/BentoML | 3954f36762e10f5df15af7e0ae6dd71f5f214261 | [
"Apache-2.0"
] | 451 | 2019-04-02T01:53:41.000Z | 2022-03-29T08:49:06.000Z | # Copyright 2019 Atalaya Tech, 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, ... | 35.243697 | 88 | 0.555079 |
becceb54b0d51b9406ead092b92125e63428d0d5 | 290 | py | Python | tests/unit/test_pbXmlWrite.py | paulross/xmlwriter | 6e33cd2cef0338416367aea5042fbf535a9381f1 | [
"MIT"
] | 1 | 2019-02-19T23:05:33.000Z | 2019-02-19T23:05:33.000Z | tests/unit/test_pbXmlWrite.py | paulross/xmlwriter | 6e33cd2cef0338416367aea5042fbf535a9381f1 | [
"MIT"
] | null | null | null | tests/unit/test_pbXmlWrite.py | paulross/xmlwriter | 6e33cd2cef0338416367aea5042fbf535a9381f1 | [
"MIT"
] | 1 | 2019-02-19T23:05:34.000Z | 2019-02-19T23:05:34.000Z | #!/usr/bin/env python
"""Tests pbXmlWrite."""
import os
import pytest
import pbXmlWrite as XmlWrite
with open(os.path.join(os.path.dirname(__file__), '_test_XmlWrite.py')) as f:
code = compile(f.read(), __file__, 'exec')
exec(code)
if __name__ == "__main__":
pytest.main()
| 18.125 | 77 | 0.682759 |
d2449c8e576dd6a2785d4f700e7041a26cd8cd30 | 12,226 | py | Python | salt/modules/pkgin.py | moniker-dns/salt | 0e1cd880dc7831b9f937a213dd90cc32e2a09884 | [
"Apache-2.0"
] | 1 | 2016-03-13T09:05:15.000Z | 2016-03-13T09:05:15.000Z | salt/modules/pkgin.py | moniker-dns/salt | 0e1cd880dc7831b9f937a213dd90cc32e2a09884 | [
"Apache-2.0"
] | null | null | null | salt/modules/pkgin.py | moniker-dns/salt | 0e1cd880dc7831b9f937a213dd90cc32e2a09884 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Package support for pkgin based systems, inspired from freebsdpkg module
'''
# Import python libs
import os
import re
import logging
# Import salt libs
import salt.utils
import salt.utils.decorators as decorators
VERSION_MATCH = re.compile(r'pkgin(?:[\s]+)([\d.]+)(?:[\s]+)(?:.*)')
log = l... | 24.209901 | 96 | 0.56797 |
b9b7a52be87244e95d2ebc6428993c08fa3eb9e8 | 16,947 | py | Python | jp.ac.u-aizu.onlinejudge/ALDS1_12_A/4938265.py | kagemeka/aoj-submissions | 42b1cd2ce421165b3a08cd57df136a5cc372b307 | [
"MIT"
] | 1 | 2022-02-15T20:18:30.000Z | 2022-02-15T20:18:30.000Z | jp.ac.u-aizu.onlinejudge/ALDS1_12_A/4938265.py | kagemeka/aoj-submissions | 42b1cd2ce421165b3a08cd57df136a5cc372b307 | [
"MIT"
] | null | null | null | jp.ac.u-aizu.onlinejudge/ALDS1_12_A/4938265.py | kagemeka/aoj-submissions | 42b1cd2ce421165b3a08cd57df136a5cc372b307 | [
"MIT"
] | null | null | null | import sys
from heapq import heappush, heappop, heapify
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# from collections import deque, Counter, defaultdict
# import itertools
# import string
# import math
# from operator import xor, or_
from functools import lru_cache, reduce
# sys.setrecursionlimit(10... | 27.873355 | 110 | 0.547058 |
1aa5bbe57a1e9be2770da5b3156b7b0e4b48caaa | 796 | py | Python | sopel/modules/uptime.py | CrushAndRun/sopel-Bodhi | 98d9661663a59f91880df21749c4861d163020fe | [
"EFL-2.0"
] | null | null | null | sopel/modules/uptime.py | CrushAndRun/sopel-Bodhi | 98d9661663a59f91880df21749c4861d163020fe | [
"EFL-2.0"
] | null | null | null | sopel/modules/uptime.py | CrushAndRun/sopel-Bodhi | 98d9661663a59f91880df21749c4861d163020fe | [
"EFL-2.0"
] | null | null | null | # coding=utf-8
"""
uptime.py - Uptime module
Copyright 2014, Fabian Neundorf
Licensed under the Eiffel Forum License 2.
http://sopel.chat
"""
from __future__ import unicode_literals, absolute_import, print_function, division
from sopel.module import commands
import datetime
def setup(bot):
if "uptime" not in bo... | 28.428571 | 82 | 0.625628 |
27d44fa051795f5f0542cb30c973a2461a39e736 | 19,923 | py | Python | training/coach_restyle_e4e.py | jtodo/restyle-encoder | 65941e42c5150346c32f1892345c0af1dae3b62e | [
"MIT"
] | 844 | 2021-04-06T15:47:12.000Z | 2022-03-31T08:13:54.000Z | training/coach_restyle_e4e.py | musikisomorphie/restyle-encoder | 3dacd706c79f42fc828afc0d3b05f29dd0406454 | [
"MIT"
] | 64 | 2021-04-07T12:08:59.000Z | 2022-03-30T09:35:00.000Z | training/coach_restyle_e4e.py | musikisomorphie/restyle-encoder | 3dacd706c79f42fc828afc0d3b05f29dd0406454 | [
"MIT"
] | 135 | 2021-04-06T20:10:15.000Z | 2022-03-27T13:06:15.000Z | import os
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('Agg')
import torch
from torch import nn, autograd
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import torch.nn.functional as F
from utils import common, train_utils
from criteria import id_loss, mo... | 38.610465 | 117 | 0.725945 |
467529698ebb54146b7657cb803d3594adea480f | 8,634 | py | Python | jwql/website/apps/jwql/monitor_pages/monitor_dark_bokeh.py | cracraft/jwql | 030c1663bc433465e01ad803e1578a2bc53035f4 | [
"BSD-3-Clause"
] | 42 | 2018-10-03T13:38:18.000Z | 2022-03-11T12:19:32.000Z | jwql/website/apps/jwql/monitor_pages/monitor_dark_bokeh.py | cracraft/jwql | 030c1663bc433465e01ad803e1578a2bc53035f4 | [
"BSD-3-Clause"
] | 723 | 2018-08-29T18:29:49.000Z | 2022-03-31T21:09:20.000Z | jwql/website/apps/jwql/monitor_pages/monitor_dark_bokeh.py | cracraft/jwql | 030c1663bc433465e01ad803e1578a2bc53035f4 | [
"BSD-3-Clause"
] | 30 | 2018-08-29T18:17:32.000Z | 2022-03-10T19:43:39.000Z | """This module contains code for the dark current monitor Bokeh plots.
Author
------
- Bryan Hilbert
- Gray Kanarek
- Lauren Chambers
Use
---
This module can be used from the command line as such:
::
from jwql.website.apps.jwql import monitor_pages
monitor_template = monitor_pa... | 41.509615 | 115 | 0.676859 |
f100ebd8aeca68b580476fdae8a786d5c693f09d | 2,012 | py | Python | examples/loss_monitor.py | jm-begon/pt_inspector | 3852d28418755fa8ec21e1abf1feb60dd85ef256 | [
"BSD-3-Clause"
] | null | null | null | examples/loss_monitor.py | jm-begon/pt_inspector | 3852d28418755fa8ec21e1abf1feb60dd85ef256 | [
"BSD-3-Clause"
] | 2 | 2018-12-03T12:50:27.000Z | 2018-12-03T12:58:49.000Z | examples/loss_monitor.py | montefiore-ai/pt-inspector | 3852d28418755fa8ec21e1abf1feb60dd85ef256 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
The example below is taken from http://pytorch.org/tutorials/beginner/pytorch_with_examples.html#pytorch-custom-nn-modules
where you can find in-depth comment about the standard PyTorch code.
We will focus here on the monitoring instead to illustrate the `StatMonitor`
class. Note however tha... | 27.944444 | 122 | 0.653082 |
27b645e2f1c20df9150afc5881fbc64791800e26 | 1,131 | py | Python | pyjac/pywrap/__main__.py | chx12002/pyJac | 5f54b2d6c04e1ee62d9db8bbf7553ad785f58c33 | [
"MIT"
] | 24 | 2017-03-14T05:14:18.000Z | 2022-03-30T06:35:47.000Z | pyjac/pywrap/__main__.py | chx12002/pyJac | 5f54b2d6c04e1ee62d9db8bbf7553ad785f58c33 | [
"MIT"
] | 34 | 2017-01-18T18:56:11.000Z | 2022-02-08T15:46:13.000Z | pyjac/pywrap/__main__.py | chx12002/pyJac | 5f54b2d6c04e1ee62d9db8bbf7553ad785f58c33 | [
"MIT"
] | 21 | 2017-02-04T11:25:56.000Z | 2022-02-14T13:57:13.000Z | """Main module for pywrap module.
"""
from argparse import ArgumentParser
from .pywrap_gen import generate_wrapper
from .. import utils
if __name__ == '__main__':
parser = ArgumentParser(
description='Generates a python wrapper for pyJac via Cython'
)
parser.add_argument('-l', '--lang',
... | 35.34375 | 76 | 0.498674 |
6d759b0fbf5b5373ebbefa045963c1249f0ff087 | 2,015 | py | Python | beast/plotting/plot_chi2_hist.py | marthaboyer/beast | 1ca71fb64ab60827e4e4e1937b64f319a98166c3 | [
"BSD-3-Clause"
] | null | null | null | beast/plotting/plot_chi2_hist.py | marthaboyer/beast | 1ca71fb64ab60827e4e4e1937b64f319a98166c3 | [
"BSD-3-Clause"
] | null | null | null | beast/plotting/plot_chi2_hist.py | marthaboyer/beast | 1ca71fb64ab60827e4e4e1937b64f319a98166c3 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, division
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
def plot(beast_stats_file, n_bins=50):
"""
Make a histogram of the chi2 values
Parameters
----------
beast_stats_file : str
path+file for the BEAST fitting re... | 28.785714 | 105 | 0.582134 |
70d60a80f3915e13fa099e43ff2373bf476e873e | 8,506 | py | Python | test/utils/test_low_rank.py | pytorch/botorch | 98ffb605af4b571dc1390a5fd220c2d2cee876fe | [
"MIT"
] | 2,344 | 2019-05-01T04:57:26.000Z | 2022-03-29T17:00:41.000Z | test/utils/test_low_rank.py | pytorch/botorch | 98ffb605af4b571dc1390a5fd220c2d2cee876fe | [
"MIT"
] | 942 | 2019-05-01T05:11:30.000Z | 2022-03-31T21:58:24.000Z | test/utils/test_low_rank.py | pytorch/botorch | 98ffb605af4b571dc1390a5fd220c2d2cee876fe | [
"MIT"
] | 280 | 2019-05-01T05:14:53.000Z | 2022-03-29T16:00:33.000Z | #!/usr/bin/env python3
# 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 torch
from botorch.exceptions.errors import BotorchError
from botorch.models.gp_regression import SingleTaskGP
f... | 49.74269 | 87 | 0.402187 |
2d823a460094f58c2eed6be6a8c3078a7d36ab33 | 36,719 | py | Python | venv/lib/python3.7/site-packages/sqlalchemy/orm/strategy_options.py | Ryan0v0/SoftwareEngineering_Project | 14486717095b33805fb1ea0f25a03152de25b7f4 | [
"MIT"
] | 13 | 2020-03-27T04:37:45.000Z | 2022-03-27T12:50:30.000Z | venv/lib/python3.7/site-packages/sqlalchemy/orm/strategy_options.py | linqiunan/SoftwareEngineering_Project | 14486717095b33805fb1ea0f25a03152de25b7f4 | [
"MIT"
] | 2 | 2020-04-06T17:44:37.000Z | 2021-12-09T03:32:17.000Z | venv/lib/python3.7/site-packages/sqlalchemy/orm/strategy_options.py | linqiunan/SoftwareEngineering_Project | 14486717095b33805fb1ea0f25a03152de25b7f4 | [
"MIT"
] | 3 | 2020-03-27T20:46:01.000Z | 2022-03-05T08:57:40.000Z | # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
"""
from .interfaces import MapperOption, PropComparator
from .. import util
from ..sql.base imp... | 33.169828 | 84 | 0.615322 |
381d59b9d18955b8b9c792300fcfd5aabad7ed33 | 1,777 | py | Python | mensatud.py | rookies/mensatud | 40f1bc06434ffced11867cfeddfe25385d129e2f | [
"MIT"
] | null | null | null | mensatud.py | rookies/mensatud | 40f1bc06434ffced11867cfeddfe25385d129e2f | [
"MIT"
] | null | null | null | mensatud.py | rookies/mensatud | 40f1bc06434ffced11867cfeddfe25385d129e2f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import urllib.request, json
import MensaHtmlParser
import MensaMealIngredient
def send_request(url):
req = urllib.request.Request(
url,
headers={
"User-Agent": "Mozilla/5.0 (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11"
})
sock = urllib.request.urlopen(req)
return sock
if __name__... | 32.309091 | 140 | 0.65166 |
39c52f8f9152e8961ce2e3d379f9b3018af9c9a7 | 17,078 | py | Python | functions.py | rushLuCy/Wump | 05e875220c30a0cf645765409b08b1468b918dfd | [
"MIT"
] | 1 | 2019-06-24T01:25:51.000Z | 2019-06-24T01:25:51.000Z | functions.py | rushLuCy/HackWeekBot | 05e875220c30a0cf645765409b08b1468b918dfd | [
"MIT"
] | null | null | null | functions.py | rushLuCy/HackWeekBot | 05e875220c30a0cf645765409b08b1468b918dfd | [
"MIT"
] | null | null | null | import os, sys, random
import numpy as np
import cv2
from scipy import ndimage
from matplotlib import pyplot as plt
from keras.initializers import RandomNormal
from keras.layers import Input, Dense, Activation, Dropout, Flatten, Reshape, LeakyReLU
from keras.layers.convolutional import Conv2D, Conv2DTranspose
from ker... | 36.182203 | 118 | 0.589999 |
dd4101a03a6b6d044382525a5f425778b5872f39 | 4,417 | py | Python | application.py | NileshRaut-code/Buisness_manegment_Flasks | 41fff980290b99bf2d180c5c78bfd7f1f8db7961 | [
"MIT"
] | null | null | null | application.py | NileshRaut-code/Buisness_manegment_Flasks | 41fff980290b99bf2d180c5c78bfd7f1f8db7961 | [
"MIT"
] | null | null | null | application.py | NileshRaut-code/Buisness_manegment_Flasks | 41fff980290b99bf2d180c5c78bfd7f1f8db7961 | [
"MIT"
] | null | null | null | #import os
from flask import *
import sqlite3
from datetime import date
#import xlwt
#from xlwt import Workbook
import pandas as pd
#import stat
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
@app.route("/add")
def add_student():
return render_template("add_student.ht... | 28.869281 | 177 | 0.636858 |
d0f533a8d765c3f035747fb26d2b87343fcfdb8f | 8,722 | py | Python | pyannote/audio/augmentation/noise.py | nhamilakis/pyannote-audio | 858aca4a5b950aef484892c93321c065e64237f0 | [
"MIT"
] | null | null | null | pyannote/audio/augmentation/noise.py | nhamilakis/pyannote-audio | 858aca4a5b950aef484892c93321c065e64237f0 | [
"MIT"
] | null | null | null | pyannote/audio/augmentation/noise.py | nhamilakis/pyannote-audio | 858aca4a5b950aef484892c93321c065e64237f0 | [
"MIT"
] | 1 | 2020-02-06T16:22:54.000Z | 2020-02-06T16:22:54.000Z | #!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2018 CNRS
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | 34.203922 | 108 | 0.629901 |
6fb3efd9ae13877c00fc7427a796674e1d6be455 | 2,351 | py | Python | tests/test_attributes.py | djeromov/confu | d84bb470aae367d00bf4453901fac349434687d9 | [
"Apache-2.0"
] | null | null | null | tests/test_attributes.py | djeromov/confu | d84bb470aae367d00bf4453901fac349434687d9 | [
"Apache-2.0"
] | 57 | 2018-09-17T08:01:52.000Z | 2022-03-10T14:09:13.000Z | tests/test_attributes.py | djeromov/confu | d84bb470aae367d00bf4453901fac349434687d9 | [
"Apache-2.0"
] | 2 | 2020-07-03T20:04:29.000Z | 2021-07-08T19:36:57.000Z | import pytest
from confu.schema import Bool, Directory, Float, Int, List, Schema, Str
@pytest.mark.parametrize("Class", [Str, Int, Float, Bool, Directory])
def test_init(Class):
"""
test attribute initiation
"""
attribute = Class("test", help="test attribute")
assert attribute.name == "test"
... | 27.022989 | 71 | 0.566993 |
801bc4beb2acb1d1278df48582dd18be2a7dfaf3 | 2,083 | py | Python | app/auth.py | initfve/notify-server | d69271937556389f5a9afc9500438b884564c61f | [
"BSD-2-Clause"
] | null | null | null | app/auth.py | initfve/notify-server | d69271937556389f5a9afc9500438b884564c61f | [
"BSD-2-Clause"
] | null | null | null | app/auth.py | initfve/notify-server | d69271937556389f5a9afc9500438b884564c61f | [
"BSD-2-Clause"
] | null | null | null | import httpx
import ldap3
from fastapi.logger import logger
from .settings import (
AUTHENTICATION_METHOD,
AUTHENTICATION_URL,
LDAP_HOST,
LDAP_PORT,
LDAP_USE_SSL,
LDAP_USER_RDN_ATTR,
LDAP_BASE_DN,
LDAP_USER_DN,
)
def authenticate_user(username: str, password: str) -> bool:
"""Retur... | 31.089552 | 79 | 0.693711 |
8b9ba48d887030083425935de0e5a52c9584ca40 | 3,643 | py | Python | tfx/dsl/compiler/compiler_utils.py | fanszoro/tfx | b1acab7bf89ec1364c96b9b4e2cc41594407b86c | [
"Apache-2.0"
] | null | null | null | tfx/dsl/compiler/compiler_utils.py | fanszoro/tfx | b1acab7bf89ec1364c96b9b4e2cc41594407b86c | [
"Apache-2.0"
] | 1 | 2020-11-10T02:21:30.000Z | 2020-11-10T02:21:30.000Z | tfx/dsl/compiler/compiler_utils.py | fanszoro/tfx | b1acab7bf89ec1364c96b9b4e2cc41594407b86c | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2020 Google LLC. 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 ... | 32.81982 | 80 | 0.742245 |
f4ca97c18119583353a7a8a1ee990fe15de4c304 | 29,132 | py | Python | Prototype_2/.venv/lib/python3.8/site-packages/engineio/server.py | amal66/Kawm | 3bf442ea1f4b572f4ec840e0ee6ec7d96ae23133 | [
"MIT"
] | 4 | 2019-05-10T22:50:09.000Z | 2022-01-05T08:34:36.000Z | Prototype_2/.venv/lib/python3.8/site-packages/engineio/server.py | amal66/Kawm | 3bf442ea1f4b572f4ec840e0ee6ec7d96ae23133 | [
"MIT"
] | 1 | 2019-01-25T12:01:06.000Z | 2019-01-25T15:59:24.000Z | Prototype_2/.venv/lib/python3.8/site-packages/engineio/server.py | amal66/Kawm | 3bf442ea1f4b572f4ec840e0ee6ec7d96ae23133 | [
"MIT"
] | 2 | 2021-03-29T07:36:48.000Z | 2021-12-29T17:14:26.000Z | import gzip
import importlib
import logging
import uuid
import zlib
import six
from six.moves import urllib
from . import exceptions
from . import packet
from . import payload
from . import socket
default_logger = logging.getLogger('engineio.server')
class Server(object):
"""An Engine.IO server.
This clas... | 43.031019 | 79 | 0.561891 |
c310f01664ee7d3ce41312e57b88cec67b6ab2ea | 1,777 | py | Python | appointment-conflicts/appointment_conflicts.py | saneravi/ML_Stuff | 74e1ed7ba9f4dccb555792315a14ba6071150304 | [
"MIT"
] | 209 | 2015-01-02T03:47:12.000Z | 2022-03-06T16:54:47.000Z | appointment-conflicts/appointment_conflicts.py | Kerwin-Xie/algorithms | 4347a9b7bf54ef378d16d26ef9e357ddc710664b | [
"MIT"
] | 3 | 2015-12-06T14:40:34.000Z | 2021-03-22T17:40:24.000Z | appointment-conflicts/appointment_conflicts.py | Kerwin-Xie/algorithms | 4347a9b7bf54ef378d16d26ef9e357ddc710664b | [
"MIT"
] | 114 | 2015-01-31T08:37:10.000Z | 2022-02-23T04:42:28.000Z | #!/usr/bin/env python
"""Coding challenge to find all conflicts of a list of appointments."""
class Appointment:
"""
An appointment.
Parameters
----------
name : str
Describe what the appointment is about.
start : int
end : int
"""
def __init__(self, name, start, end):
... | 21.154762 | 71 | 0.562746 |
4c6568a5c8f17c254716eee311e8941564768f10 | 1,648 | py | Python | tests/terraform/checks/resource/aws/test_PasswordPolicyUppercaseLetter.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 4,013 | 2019-12-09T13:16:54.000Z | 2022-03-31T14:31:01.000Z | tests/terraform/checks/resource/aws/test_PasswordPolicyUppercaseLetter.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 1,258 | 2019-12-17T09:55:51.000Z | 2022-03-31T19:17:17.000Z | tests/terraform/checks/resource/aws/test_PasswordPolicyUppercaseLetter.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 638 | 2019-12-19T08:57:38.000Z | 2022-03-30T21:38:37.000Z | import unittest
from checkov.terraform.checks.resource.aws.PasswordPolicyUppercaseLetter import check
from checkov.common.models.enums import CheckResult
class TestPasswordPolicyUpperCaseLetter(unittest.TestCase):
def test_success(self):
resource_conf = {
"minimum_password_length": [15],
... | 35.06383 | 85 | 0.649272 |
218969d46aa086d2370d6e202c84d6c41f9ec73e | 2,564 | py | Python | tests/handlers/v2/test_user_profile.py | homebysix/consoleme | ff800dd154c4a2be30ff7350f58d92ea4c8446d0 | [
"Apache-2.0"
] | null | null | null | tests/handlers/v2/test_user_profile.py | homebysix/consoleme | ff800dd154c4a2be30ff7350f58d92ea4c8446d0 | [
"Apache-2.0"
] | 3 | 2021-09-08T03:07:37.000Z | 2022-03-12T00:57:18.000Z | tests/handlers/v2/test_user_profile.py | homebysix/consoleme | ff800dd154c4a2be30ff7350f58d92ea4c8446d0 | [
"Apache-2.0"
] | null | null | null | """Docstring in public module."""
import os
import sys
import ujson as json
from tornado.testing import AsyncHTTPTestCase
APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.append(os.path.join(APP_ROOT, ".."))
class TestUserProfile(AsyncHTTPTestCase):
def get_app(self):
f... | 37.705882 | 110 | 0.519501 |
da60e1162ac6af5d1110add2874dbcbf1ac9003f | 563 | py | Python | digitalBooksPDF/migrations/0033_auto_20200604_2056.py | amado-developer/ReadHub-RestfulAPI | 8d8b445c4a84810d52bbf78a2593e0b48351590c | [
"MIT"
] | null | null | null | digitalBooksPDF/migrations/0033_auto_20200604_2056.py | amado-developer/ReadHub-RestfulAPI | 8d8b445c4a84810d52bbf78a2593e0b48351590c | [
"MIT"
] | 7 | 2021-03-19T03:09:53.000Z | 2022-01-13T02:48:44.000Z | digitalBooksPDF/migrations/0033_auto_20200604_2056.py | amado-developer/ReadHub-RestfulAPI | 8d8b445c4a84810d52bbf78a2593e0b48351590c | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-06-04 20:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('digital_books', '0008_digital_book_rating'),
('digitalBooksPDF', '0032_auto_20200604_1951'),
]
operations =... | 26.809524 | 125 | 0.660746 |
3fd660e6783ab9f6fe8265e71cecf62b49607a3f | 3,409 | py | Python | networks/unet.py | puilp0502/pytorch-hair-segmentation | 08b07acc401dbdbcd440b142bd33d67b412f91d0 | [
"MIT"
] | null | null | null | networks/unet.py | puilp0502/pytorch-hair-segmentation | 08b07acc401dbdbcd440b142bd33d67b412f91d0 | [
"MIT"
] | null | null | null | networks/unet.py | puilp0502/pytorch-hair-segmentation | 08b07acc401dbdbcd440b142bd33d67b412f91d0 | [
"MIT"
] | null | null | null | """
U-Net Model
Original source from: https://github.com/milesial/Pytorch-UNet
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
class DoubleConv(nn.Module):
"""(convolution => [BN] => ReLU) * 2"""
def __init__(self, in_channels, out_channels):
super().__init__()
self.dou... | 31.275229 | 122 | 0.599883 |
02f86bfdf4778e5c202f34c278f8ee90b44d078c | 5,354 | py | Python | code/research.py | kevinpeterson/github-process-research | e75c7c47cadb95fae74188fbbe5c53b234ae23c4 | [
"MIT"
] | 2 | 2015-05-05T18:07:24.000Z | 2018-09-01T19:34:18.000Z | code/research.py | kevinpeterson/github-process-research | e75c7c47cadb95fae74188fbbe5c53b234ae23c4 | [
"MIT"
] | null | null | null | code/research.py | kevinpeterson/github-process-research | e75c7c47cadb95fae74188fbbe5c53b234ae23c4 | [
"MIT"
] | null | null | null | ##############################################################
# research.py
#
# Gathers and stores data using the GitHub REST API (https://developer.github.com/v3/).
#
# License: MIT 2014 Kevin Peterson
##############################################################
import requests
import json
import time
import os
imp... | 33.254658 | 125 | 0.628129 |
1c5b16199aedc4233cd0330a3d6f23816235122f | 4,681 | py | Python | xonsh/replay.py | stefb965/gitsome | a6a396411470f4a35420357c9f88e2ea62efff5c | [
"Apache-2.0"
] | 3 | 2016-11-08T08:56:02.000Z | 2021-04-11T14:23:14.000Z | xonsh/replay.py | batermj/gitsome | 77f599ef8b84336afc0a3d6525365da18cd510d8 | [
"Apache-2.0"
] | null | null | null | xonsh/replay.py | batermj/gitsome | 77f599ef8b84336afc0a3d6525365da18cd510d8 | [
"Apache-2.0"
] | 1 | 2020-02-15T14:02:07.000Z | 2020-02-15T14:02:07.000Z | """Tools to replay xonsh history files."""
import time
import builtins
from collections.abc import Mapping
from xonsh.tools import swap
from xonsh import lazyjson
from xonsh.environ import Env
from xonsh.history import History
from xonsh.history import _info as history_info
DEFAULT_MERGE_ENVS = ('replay', 'native')
... | 39.008333 | 89 | 0.592395 |
22a24634cdae0d6b718f66040093d3f3f2d16aa3 | 731 | py | Python | webservice/utils/convert.py | Jiangxinz/Paddle-bot | 87a1c381f2ca6a31d5bf665945625f6710f5292e | [
"Apache-2.0"
] | 14 | 2020-05-15T01:24:22.000Z | 2022-02-23T09:03:50.000Z | webservice/utils/convert.py | Jiangxinz/Paddle-bot | 87a1c381f2ca6a31d5bf665945625f6710f5292e | [
"Apache-2.0"
] | 18 | 2020-05-06T09:45:31.000Z | 2021-12-29T13:00:51.000Z | webservice/utils/convert.py | Jiangxinz/Paddle-bot | 87a1c381f2ca6a31d5bf665945625f6710f5292e | [
"Apache-2.0"
] | 11 | 2020-04-28T11:17:00.000Z | 2022-02-14T01:43:27.000Z | import time
import datetime
def javaTimeTotimeStamp(commitTime):
commitTime = commitTime.replace('T', ' ').replace('Z',
'') #java time To string
commitTime = time.strptime(commitTime, '%Y-%m-%d %H:%M:%S')
dt = datetime.datetime.fromtimestamp(time.mkti... | 34.809524 | 79 | 0.619699 |
bb5f296a450d94ad3375486789b073b53b8e2210 | 52,309 | py | Python | py_insightvm_sdk/models/license_policy_scanning.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 2 | 2019-03-15T16:05:54.000Z | 2020-07-19T18:37:50.000Z | py_insightvm_sdk/models/license_policy_scanning.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 1 | 2021-03-26T04:46:12.000Z | 2021-03-26T04:51:23.000Z | py_insightvm_sdk/models/license_policy_scanning.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
InsightVM API
# Overview This guide documents the InsightVM Application Programming Interface (API) Version 3. This API supports the Representation State Transfer (REST) design pattern. Unless noted otherwise this API accepts and produces the `application/json` media type. This API uses ... | 353.439189 | 48,045 | 0.495402 |
3b70353577c5797174a27e73e613a64d725c6f12 | 24,286 | py | Python | Tests/test_PandasBokeh.py | vroger11/Pandas-Bokeh | 3b9356eb047736bda3db80b88960a30b6bba83a1 | [
"MIT"
] | 781 | 2018-11-27T17:42:29.000Z | 2022-03-30T19:38:35.000Z | Tests/test_PandasBokeh.py | vroger11/Pandas-Bokeh | 3b9356eb047736bda3db80b88960a30b6bba83a1 | [
"MIT"
] | 109 | 2018-11-23T22:52:06.000Z | 2022-03-26T09:36:30.000Z | Tests/test_PandasBokeh.py | vroger11/Pandas-Bokeh | 3b9356eb047736bda3db80b88960a30b6bba83a1 | [
"MIT"
] | 103 | 2018-11-28T11:51:25.000Z | 2022-03-02T04:35:53.000Z | import json
import os
import numpy as np
import pandas as pd
import pytest
import pandas_bokeh
DIRECTORY = os.path.dirname(__file__)
TEST_SETS_DIRECTORY = os.path.join(os.path.dirname(DIRECTORY), "docs", "Testdata")
os.makedirs(os.path.join(DIRECTORY, "Plots"), exist_ok=True)
# Set pandas plotting backend:
pd.set_... | 28.33839 | 139 | 0.606275 |
e2e0b0dcce71e938623774a8955c47789fea7be5 | 399 | py | Python | poetry/puzzle/exceptions.py | lowitea/poetry | 04833bc42afc7ace61a471045cfface68141a7b6 | [
"MIT"
] | 1 | 2020-08-19T19:51:22.000Z | 2020-08-19T19:51:22.000Z | poetry/puzzle/exceptions.py | lowitea/poetry | 04833bc42afc7ace61a471045cfface68141a7b6 | [
"MIT"
] | 2 | 2020-09-12T22:53:08.000Z | 2021-02-10T14:36:05.000Z | poetry/puzzle/exceptions.py | lowitea/poetry | 04833bc42afc7ace61a471045cfface68141a7b6 | [
"MIT"
] | 1 | 2020-09-12T19:34:33.000Z | 2020-09-12T19:34:33.000Z | class SolverProblemError(Exception):
def __init__(self, error):
self._error = error
super(SolverProblemError, self).__init__(str(error))
@property
def error(self):
return self._error
class OverrideNeeded(Exception):
def __init__(self, *overrides):
self._overrides = ov... | 21 | 60 | 0.66416 |
adc7d5a1fc114157f3f06dc5d41d6bf52016320d | 197 | py | Python | bin/gdtest.py | Greg102/polyaxon | 1c0f89f95ddcf91302737a004b2740f9b235e7d0 | [
"MIT"
] | null | null | null | bin/gdtest.py | Greg102/polyaxon | 1c0f89f95ddcf91302737a004b2740f9b235e7d0 | [
"MIT"
] | null | null | null | bin/gdtest.py | Greg102/polyaxon | 1c0f89f95ddcf91302737a004b2740f9b235e7d0 | [
"MIT"
] | null | null | null | import os
output_root = os.environ['POLYAXON_RUN_OUTPUTS_PATH']
outpath = os.path.join(output_root, 'demofile3.txt')
f = open(outpath, "w")
f.write("Woops! I have deleted the content!")
f.close() | 24.625 | 53 | 0.736041 |
e787a6206c7a5be02646572c0e4b6aa3e5f016ae | 3,749 | py | Python | instagram/migrations/0001_initial.py | Ingabineza12/instagram | d04088b4ff2535e9008c8e1a8a738e6d6bdbf4ef | [
"Unlicense"
] | 1 | 2021-08-02T01:29:40.000Z | 2021-08-02T01:29:40.000Z | instagram/migrations/0001_initial.py | Ingabineza12/instagram | d04088b4ff2535e9008c8e1a8a738e6d6bdbf4ef | [
"Unlicense"
] | null | null | null | instagram/migrations/0001_initial.py | Ingabineza12/instagram | d04088b4ff2535e9008c8e1a8a738e6d6bdbf4ef | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-01-07 17:48
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import tinymce.models
class Migration(migrations.Migration):
initial = True
dependenci... | 43.593023 | 157 | 0.592158 |
5527b65e16fc19a4c9551d770759f88259970f21 | 4,674 | py | Python | ucscsdk/mometa/bios/BiosVfProcessorPrefetchConfig.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 9 | 2016-12-22T08:39:25.000Z | 2019-09-10T15:36:19.000Z | ucscsdk/mometa/bios/BiosVfProcessorPrefetchConfig.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 10 | 2017-01-31T06:59:56.000Z | 2021-11-09T09:14:37.000Z | ucscsdk/mometa/bios/BiosVfProcessorPrefetchConfig.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 13 | 2016-11-14T07:42:58.000Z | 2022-02-10T17:32:05.000Z | """This module contains the general information for BiosVfProcessorPrefetchConfig ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class BiosVfProcessorPrefetchConfigConsts():
SUPPORTED_BY_DEFAULT_NO = "no"
... | 64.027397 | 290 | 0.7362 |
ff93b7b31bd55d805ac127532d554969989ad62b | 145 | py | Python | tests/settings/redis_cache.py | alexforks/django-cache-lock | 0b0fc6f9ae260cfe2afd1f579822fd2147678284 | [
"MIT"
] | 12 | 2019-04-23T12:01:54.000Z | 2021-11-24T10:55:41.000Z | tests/settings/redis_cache.py | alexforks/django-cache-lock | 0b0fc6f9ae260cfe2afd1f579822fd2147678284 | [
"MIT"
] | 6 | 2020-02-28T18:19:09.000Z | 2021-08-24T09:33:24.000Z | tests/settings/redis_cache.py | alexforks/django-cache-lock | 0b0fc6f9ae260cfe2afd1f579822fd2147678284 | [
"MIT"
] | 4 | 2019-06-08T06:16:57.000Z | 2022-02-11T14:51:38.000Z | from .locmem import *
CACHES = {
"default": {
"BACKEND": "redis_cache.RedisCache",
"LOCATION": ["127.0.0.1:6379"],
}
}
| 14.5 | 44 | 0.517241 |
826da95b71a7d4d3c786eae14658367222bbfdd1 | 12,358 | py | Python | tests/storage_adapter_tests/test_sqlalchemy_adapter.py | napyang/ChatterBot_Nap | 04b064e608c694e41a467b36f72e36ec60ef349c | [
"BSD-3-Clause"
] | null | null | null | tests/storage_adapter_tests/test_sqlalchemy_adapter.py | napyang/ChatterBot_Nap | 04b064e608c694e41a467b36f72e36ec60ef349c | [
"BSD-3-Clause"
] | null | null | null | tests/storage_adapter_tests/test_sqlalchemy_adapter.py | napyang/ChatterBot_Nap | 04b064e608c694e41a467b36f72e36ec60ef349c | [
"BSD-3-Clause"
] | 1 | 2021-04-10T13:17:04.000Z | 2021-04-10T13:17:04.000Z | from unittest import TestCase
from chatterbot.conversation import Statement, Response
from chatterbot.storage.sql_storage import SQLStorageAdapter
class SQLAlchemyAdapterTestCase(TestCase):
@classmethod
def setUpClass(cls):
"""
Instantiate the adapter before any tests in the test case run.
... | 31.687179 | 80 | 0.629228 |
25b80f2fadd824958166dbe047c9dd7c14413bd3 | 613 | py | Python | trails/feeds/360locky.py | gallypette/maltrail | 1a863c287ce94ba128ef023bab0d5166fe8a4519 | [
"MIT"
] | null | null | null | trails/feeds/360locky.py | gallypette/maltrail | 1a863c287ce94ba128ef023bab0d5166fe8a4519 | [
"MIT"
] | null | null | null | trails/feeds/360locky.py | gallypette/maltrail | 1a863c287ce94ba128ef023bab0d5166fe8a4519 | [
"MIT"
] | 1 | 2019-12-06T08:37:05.000Z | 2019-12-06T08:37:05.000Z | #!/usr/bin/env python
"""
Copyright (c) 2014-2019 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
import re
from core.common import retrieve_content
__url__ = "https://data.netlab.360.com/feeds/dga/locky.txt"
__check__ = "netlab 360"
__info__ = "locky dg... | 23.576923 | 83 | 0.675367 |
73b4c5d786a519060c7a8b259795a37a85824d3c | 3,307 | py | Python | venv/Lib/site-packages/pyrogram/methods/bots/get_inline_bot_results.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/methods/bots/get_inline_bot_results.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/methods/bots/get_inline_bot_results.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram 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... | 36.340659 | 97 | 0.590263 |
cf88c922b85d252bcacbe2579e108e0c303f275c | 197 | py | Python | python3-tutorial/01 Basic/0805 ForBreak.py | CoderDream/python-best-practice | 40e6b5315daefb37c59daa1a1990ac1ae10f8cca | [
"MIT"
] | null | null | null | python3-tutorial/01 Basic/0805 ForBreak.py | CoderDream/python-best-practice | 40e6b5315daefb37c59daa1a1990ac1ae10f8cca | [
"MIT"
] | null | null | null | python3-tutorial/01 Basic/0805 ForBreak.py | CoderDream/python-best-practice | 40e6b5315daefb37c59daa1a1990ac1ae10f8cca | [
"MIT"
] | null | null | null | sites = ["Baidu", "Google", "Runoob", "Taobao"]
for site in sites:
if site == "Runoob":
print("菜鸟教程!")
break
print("循环数据 " + site)
else:
print("没有循环数据!")
print("完成循环!")
| 19.7 | 47 | 0.532995 |
8576d8a51cb0625e1cd7644550bb9a7f1241804f | 1,985 | py | Python | .serverless/requirements/telegram/files/chatphoto.py | kwokyto/anonymous-telegram-bot | f643073c01f11bf811d4027b3a63313f72289214 | [
"MIT"
] | 1 | 2022-03-17T16:30:47.000Z | 2022-03-17T16:30:47.000Z | .serverless/requirements/telegram/files/chatphoto.py | kwokyto/anonymous-telegram-bot | f643073c01f11bf811d4027b3a63313f72289214 | [
"MIT"
] | null | null | null | .serverless/requirements/telegram/files/chatphoto.py | kwokyto/anonymous-telegram-bot | f643073c01f11bf811d4027b3a63313f72289214 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | 37.45283 | 98 | 0.704282 |
59fe1010b43d3b847e0afaa022a6c3a5116019f3 | 1,711 | py | Python | taffrail/taffrail_client.py | taffrailmetrics/taffrail | 274023855dff0e20053105b7562c73324203f3b3 | [
"MIT"
] | 2 | 2018-01-30T02:44:50.000Z | 2018-02-16T13:02:44.000Z | taffrail/taffrail_client.py | taffrailmetrics/taffrail | 274023855dff0e20053105b7562c73324203f3b3 | [
"MIT"
] | null | null | null | taffrail/taffrail_client.py | taffrailmetrics/taffrail | 274023855dff0e20053105b7562c73324203f3b3 | [
"MIT"
] | null | null | null | from prometheus_client.parser import text_string_to_metric_families
from .metrics_server_source import MetricsServerSource
from .kube_state_metrics_source import KubeStateMetricsSource
from .prometheus_metrics_source import PrometheusMetricsSource
from .heapster_api_source import HeapsterApiSource
import json
class Me... | 34.918367 | 121 | 0.652835 |
8678a9b68927f9198aa1ec6cb79668358672a363 | 3,147 | py | Python | ListenAndWrite/SIX_LV.py | Anthlay/FUN_TOOLS | 8706ac48d432e7752bea654857725542dc1a4897 | [
"Apache-2.0"
] | 1 | 2020-12-21T04:12:44.000Z | 2020-12-21T04:12:44.000Z | ListenAndWrite/SIX_LV.py | Anthlay/FUN_TOOLS | 8706ac48d432e7752bea654857725542dc1a4897 | [
"Apache-2.0"
] | 2 | 2021-03-31T19:32:43.000Z | 2021-12-13T20:32:30.000Z | ListenAndWrite/SIX_LV.py | Anthlay/FUN_TOOLS | 8706ac48d432e7752bea654857725542dc1a4897 | [
"Apache-2.0"
] | null | null | null | import random
list_prefix = [
('smug' , '光 光滑 滑溜 ','smuggle 走私 v'),
('init' ,'开始','initiate 开始 创始 启蒙'),
('germ','seed 种子',' germ 细菌 幼芽 病原菌'),
('infra' ,'下 低','inferior 下级 晚辈 次品'),
('val' ,'价值','value 重视 尊重 评价'),
('con' ,'强调 一起 强化',' 前缀'),
('cept' ,'抓住','concept 观念 con 强调'),
('rue' ,'后悔的 悲伤的','ruthless 无情的 冷酷的'),
('slit... | 26.445378 | 78 | 0.282809 |
36e3acc8700e9a03e92b7ec4c6cdc6b631c1ad5a | 1,185 | py | Python | google/cloud/pubsublite/v1/pubsublite-v1-py/google/cloud/pubsublite_v1/services/cursor_service/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/pubsublite/v1/pubsublite-v1-py/google/cloud/pubsublite_v1/services/cursor_service/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/pubsublite/v1/pubsublite-v1-py/google/cloud/pubsublite_v1/services/cursor_service/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- 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... | 34.852941 | 84 | 0.785654 |
1c02f300272a1d993964149e7cc28511ae56135c | 299 | py | Python | utils/json_mappers/stage_json_mapper.py | kuyu12/pygame_fight_game | 3bbc286b9f33c6d6d9db9bea21f9b7af15247df5 | [
"MIT"
] | 1 | 2020-08-03T07:54:59.000Z | 2020-08-03T07:54:59.000Z | utils/json_mappers/stage_json_mapper.py | kuyu12/pygame_fight_game | 3bbc286b9f33c6d6d9db9bea21f9b7af15247df5 | [
"MIT"
] | null | null | null | utils/json_mappers/stage_json_mapper.py | kuyu12/pygame_fight_game | 3bbc286b9f33c6d6d9db9bea21f9b7af15247df5 | [
"MIT"
] | null | null | null | class StageMapper:
STAGE_NAME = "stage_name"
STAGE_IMAGE = "stage_image"
ROOD_MAP = "road_map"
USER_START_POSITION = "user_start_position"
class SignalMapper:
COLLISION_UPDATE = "collision_update"
SCREEN_TYPE_CHANGE = "screen_type_change"
COMBO_ATTACK = "combo_attack"
| 24.916667 | 47 | 0.73913 |
a19d5fec481b99e79ce54fa137a9ef289b26d640 | 2,576 | py | Python | backend/data_export/pipeline/catalog.py | Leryud/doccano-lilo | b67c17431bedd76624346a0dbc41dd226cb1a0b5 | [
"MIT"
] | null | null | null | backend/data_export/pipeline/catalog.py | Leryud/doccano-lilo | b67c17431bedd76624346a0dbc41dd226cb1a0b5 | [
"MIT"
] | null | null | null | backend/data_export/pipeline/catalog.py | Leryud/doccano-lilo | b67c17431bedd76624346a0dbc41dd226cb1a0b5 | [
"MIT"
] | null | null | null | from collections import defaultdict
from typing import Dict, List, Type
from pydantic import BaseModel
from typing_extensions import Literal
from projects.models import DOCUMENT_CLASSIFICATION, SEQUENCE_LABELING, SEQ2SEQ, SPEECH2TEXT, IMAGE_CLASSIFICATION, \
INTENT_DETECTION_AND_SLOT_FILLING
from . import example... | 25.76 | 117 | 0.69837 |
3fd379c7208d6408a28380b5badafe7f6b3c8938 | 4,877 | py | Python | python/cudf/reshape/general.py | revans2/cudf | 59bbb17ec4a2d040e999c3f86c56158e89d9dd0b | [
"Apache-2.0"
] | null | null | null | python/cudf/reshape/general.py | revans2/cudf | 59bbb17ec4a2d040e999c3f86c56158e89d9dd0b | [
"Apache-2.0"
] | null | null | null | python/cudf/reshape/general.py | revans2/cudf | 59bbb17ec4a2d040e999c3f86c56158e89d9dd0b | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018, NVIDIA CORPORATION.
import numpy as np
import pandas as pd
from cudf.dataframe import Series
from cudf.dataframe import Buffer
from cudf.dataframe import DataFrame
from cudf.utils import cudautils
from cudf.dataframe.categorical import CategoricalColumn
def melt(frame, id_vars=None, value_vars... | 32.513333 | 79 | 0.581915 |
b8cd38f11c59b344633bbd725a34fef04c21f925 | 2,056 | py | Python | examples/fillet.py | zignig/Boneless-CPU | 10bb571b4efab015e1bf147c78f0b8b3c93443e4 | [
"Apache-2.0",
"0BSD"
] | null | null | null | examples/fillet.py | zignig/Boneless-CPU | 10bb571b4efab015e1bf147c78f0b8b3c93443e4 | [
"Apache-2.0",
"0BSD"
] | null | null | null | examples/fillet.py | zignig/Boneless-CPU | 10bb571b4efab015e1bf147c78f0b8b3c93443e4 | [
"Apache-2.0",
"0BSD"
] | null | null | null | #!/usr/bin/python3
import sys
from boneless.simulator import *
from boneless.arch.instr import *
from boneless.assembler.asm import Assembler
from boneless.arch.disasm import disassemble
end = False
exit = False
strin = ""
debug = True
def io(addr, data=None):
global strin, exit
if data == None:
if ... | 22.844444 | 80 | 0.529669 |
785c3fcd8343e33f5882e78cf1f91e61bb8ef05c | 7,400 | py | Python | sagemaker/generate_resources.py | Intrical-AI/aws-sagemaker-deploy | 69b5928a23f63864b02366eb76cd57111339cffe | [
"Apache-2.0"
] | 6 | 2021-06-21T05:57:59.000Z | 2022-03-06T05:27:31.000Z | sagemaker/generate_resources.py | Intrical-AI/aws-sagemaker-deploy | 69b5928a23f63864b02366eb76cd57111339cffe | [
"Apache-2.0"
] | 20 | 2021-06-14T15:15:06.000Z | 2022-01-04T18:01:11.000Z | sagemaker/generate_resources.py | Intrical-AI/aws-sagemaker-deploy | 69b5928a23f63864b02366eb76cd57111339cffe | [
"Apache-2.0"
] | 9 | 2021-06-21T06:50:35.000Z | 2022-03-02T07:42:25.000Z | from bentoml.saved_bundle import load_bento_service_metadata
from sagemaker.lambda_function import LAMBDA_FUNCION_CODE
def gen_model(model_name, image_tag, timeout, num_of_workers):
"""
Generates the Sagemaker model that will be loaded to the endpoint instances.
"""
model = {
"SagemakerModel"... | 35.238095 | 127 | 0.467297 |
30e96285af0d98306ed1ed93dc5128a58e21d899 | 1,146 | py | Python | matrioska/argparser.py | joaompinto/matriosca | 98a8f2b65e3e0a3b9b9b7e7a536d9326ff6f2bee | [
"MIT"
] | null | null | null | matrioska/argparser.py | joaompinto/matriosca | 98a8f2b65e3e0a3b9b9b7e7a536d9326ff6f2bee | [
"MIT"
] | null | null | null | matrioska/argparser.py | joaompinto/matriosca | 98a8f2b65e3e0a3b9b9b7e7a536d9326ff6f2bee | [
"MIT"
] | null | null | null | from optparse import OptionParser
from .version import version
def arg_parser():
parser = OptionParser(version=version)
parser.add_option(
"-d",
"--decrypt",
action="store_true",
dest="decrypt",
default=False,
help="decrypt file",
)
parser.add_option(
... | 23.387755 | 71 | 0.54014 |
2e8445c33c6971de1138a7c6c9daa447eaf48e19 | 1,126 | py | Python | masters/python-jk-simpleipcb/src/jk_simpleipcb/WriteBuffer.py | jkpubsrc/simpleipcb | 97263edb0f3b1670d5edc18beceb9eeb33f18f9d | [
"Apache-2.0"
] | null | null | null | masters/python-jk-simpleipcb/src/jk_simpleipcb/WriteBuffer.py | jkpubsrc/simpleipcb | 97263edb0f3b1670d5edc18beceb9eeb33f18f9d | [
"Apache-2.0"
] | null | null | null | masters/python-jk-simpleipcb/src/jk_simpleipcb/WriteBuffer.py | jkpubsrc/simpleipcb | 97263edb0f3b1670d5edc18beceb9eeb33f18f9d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import struct
import ctypes
class WriteBuffer(object):
def __init__(self):
self.__buffer = bytearray()
#
def writeInt32(self, value):
assert isinstance(value, int)
self.__buffer.extend(struct.pack("<i", value))
#
def writeInt64(self, value):... | 17.873016 | 69 | 0.701599 |
59a40c0b145f6a69d2172be5d588881613c9b4a5 | 2,168 | py | Python | teamcat_service/docker_build/target/one_step_build/teamcat/doraemon/api/ci/views/ci_task_view.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 6 | 2018-11-26T08:42:52.000Z | 2020-06-01T08:33:48.000Z | teamcat_service/doraemon/doraemon/api/ci/views/ci_task_view.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | null | null | null | teamcat_service/doraemon/doraemon/api/ci/views/ci_task_view.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 1 | 2019-01-22T06:45:36.000Z | 2019-01-22T06:45:36.000Z | # coding=utf-8
'''
Created on 2014-1-5
@author: ETHAN
'''
from django.http import HttpResponse
from doraemon.api.ci.json_factory.ci_factory import CIFactory
from business.ci.ci_task_queue_service import CITQService
from business.ci.ci_task_service import CITaskService
from doraemon.api.response.response_models import ... | 34.412698 | 79 | 0.739852 |
1169e38fc8bbc5da739b277f9c9b4758465a71c4 | 27,609 | py | Python | sdk/python/pulumi_azure_native/devices/v20200901preview/_inputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/devices/v20200901preview/_inputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/devices/v20200901preview/_inputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 41.084821 | 199 | 0.677207 |
41182844139ea2d2aa4b285b342abc1ef7f054d1 | 21,065 | py | Python | cterasdk/edge/shares.py | CTERA-Networks/ctera-python-sdk | 35d9cb6949590e664fd237d29f54ce054fe80a9e | [
"Apache-2.0"
] | 5 | 2020-02-25T22:34:48.000Z | 2020-02-29T22:56:39.000Z | cterasdk/edge/shares.py | ctera/ctera-python-sdk | a86cb575d538620a12f326fe5e92f5abb5cc1f6b | [
"Apache-2.0"
] | 16 | 2020-03-25T19:12:03.000Z | 2021-06-02T14:45:34.000Z | cterasdk/edge/shares.py | ctera/ctera-python-sdk | a86cb575d538620a12f326fe5e92f5abb5cc1f6b | [
"Apache-2.0"
] | 3 | 2020-10-22T18:22:06.000Z | 2021-10-03T18:38:41.000Z | import logging
from . import enum
from .files import path
from ..common import Object
from ..exception import CTERAException, InputError
from .base_command import BaseCommand
from .types import NFSv3AccessControlEntry, RemoveNFSv3AccessControlEntry, ShareAccessControlEntry, RemoveShareAccessControlEntry
class Shares... | 43.522727 | 138 | 0.645526 |
66a6c47e087371db17d97ad40386553e24d8add4 | 13,105 | py | Python | src/cltkv1/prosody/latin/metrical_validator.py | todd-cook/cltkv1 | 90c3daaafda242a1982b38c2b11c52aedab7ddf8 | [
"MIT"
] | null | null | null | src/cltkv1/prosody/latin/metrical_validator.py | todd-cook/cltkv1 | 90c3daaafda242a1982b38c2b11c52aedab7ddf8 | [
"MIT"
] | null | null | null | src/cltkv1/prosody/latin/metrical_validator.py | todd-cook/cltkv1 | 90c3daaafda242a1982b38c2b11c52aedab7ddf8 | [
"MIT"
] | null | null | null | """Utility class for validating scansion patterns: hexameter, hendecasyllables, pentameter.
Allows users to configure the scansion symbols internally via a constructor argument;
a suitable default is provided."""
import logging
from typing import List
from Levenshtein import distance
from cltkv1.prosody.latin.scansi... | 42.003205 | 100 | 0.574666 |
5c359bd8a4d439823c3f1bb70b1832ae7e103907 | 831 | py | Python | src/test/scala/lms/transformation/test_distributed_tensor/split3D.py | Shangyint/lms-clean | 46dcf45b297bb537ce90d9c787dbf3700b47d54c | [
"BSD-3-Clause"
] | 50 | 2017-04-19T17:19:00.000Z | 2022-03-24T04:14:18.000Z | src/test/scala/lms/transformation/test_distributed_tensor/split3D.py | Shangyint/lms-clean | 46dcf45b297bb537ce90d9c787dbf3700b47d54c | [
"BSD-3-Clause"
] | 30 | 2019-09-10T01:17:19.000Z | 2022-01-14T21:22:03.000Z | src/test/scala/lms/transformation/test_distributed_tensor/split3D.py | Shangyint/lms-clean | 46dcf45b297bb537ce90d9c787dbf3700b47d54c | [
"BSD-3-Clause"
] | 20 | 2016-10-20T12:16:10.000Z | 2022-02-03T04:45:52.000Z | import os
import torch
import sys
from utils import extend, get_printer
def generate_data(lms_clean_root: str):
torch.manual_seed(0)
# model
input = torch.randn(32,32,32)
input.requires_grad = True
weight = torch.randn(32,32,16)
weight.requires_grad = True
splits = torch.split(input, 16, ... | 27.7 | 63 | 0.672684 |
9bc01e03edfa610fad835ebe0728f15729208d06 | 6,918 | py | Python | my_Calculator.py | DrakeParker257980-Developer/Python_Calculator-Using-TKinter- | 32a6d3d63f26e3e8211b2ab16f533abf287ef16a | [
"MIT"
] | null | null | null | my_Calculator.py | DrakeParker257980-Developer/Python_Calculator-Using-TKinter- | 32a6d3d63f26e3e8211b2ab16f533abf287ef16a | [
"MIT"
] | null | null | null | my_Calculator.py | DrakeParker257980-Developer/Python_Calculator-Using-TKinter- | 32a6d3d63f26e3e8211b2ab16f533abf287ef16a | [
"MIT"
] | null | null | null | from tkinter import *
import tkinter.messagebox as tmsg
import os
import time
from math import *
def getvals(event):
value = event.widget.cget('text')
if value=='Clr':
sc_variable.set('')
elif value=='=':
try:
sc_variable.set(eval(screen.get()))
screen.update()
... | 34.078818 | 237 | 0.685025 |
b546b6fe0c725d60a36f43dfbab0fef486df4cea | 749 | py | Python | mocha/skel/create-view/view.py | mardix/Mocha | bce481cb31a0972061dd99bc548701411dcb9de3 | [
"MIT"
] | 7 | 2017-05-14T02:21:48.000Z | 2020-11-07T20:12:01.000Z | mocha/skel/create-view/view.py | mardix/Mocha | bce481cb31a0972061dd99bc548701411dcb9de3 | [
"MIT"
] | 6 | 2019-11-04T02:52:17.000Z | 2021-05-06T19:00:33.000Z | mocha/skel/create-view/view.py | mardix/Mocha | bce481cb31a0972061dd99bc548701411dcb9de3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Mocha
Views
"""
from mocha import (Mocha,
page_attr,
config,
flash_success,
flash_error,
abort,
request,
url_for,
redirect,
... | 20.805556 | 80 | 0.351135 |
ef356a37889776728c253dcfe9127f5ec1d85f4e | 1,959 | py | Python | src/robotican_demos_upgrade/pygazebo/pygazebo/msg/model_v_pb2.py | aosbgu/ROSPlan-ExperimentPDDL | 09de0ba980362606dd1269c6689cb59d6f8776c6 | [
"MIT"
] | 82 | 2015-02-22T10:02:50.000Z | 2021-11-16T13:03:35.000Z | src/robotican_demos_upgrade/pygazebo/pygazebo/msg/model_v_pb2.py | aosbgu/ROSPlan-ExperimentPDDL | 09de0ba980362606dd1269c6689cb59d6f8776c6 | [
"MIT"
] | 24 | 2015-01-02T06:21:32.000Z | 2020-11-09T15:38:29.000Z | src/robotican_demos_upgrade/pygazebo/pygazebo/msg/model_v_pb2.py | aosbgu/ROSPlan-ExperimentPDDL | 09de0ba980362606dd1269c6689cb59d6f8776c6 | [
"MIT"
] | 26 | 2015-04-07T20:24:40.000Z | 2022-03-01T08:12:32.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: model_v.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _refle... | 27.591549 | 155 | 0.755487 |
f705f4a2e63a2fa8ac258a2512c5917660abddae | 8,792 | py | Python | f2_testbench/analyzers_mixin.py | TheSDK-blocks/f2_testbench | 6a263dbab6de1da980619c0ecf6d181342c7592b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | f2_testbench/analyzers_mixin.py | TheSDK-blocks/f2_testbench | 6a263dbab6de1da980619c0ecf6d181342c7592b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | f2_testbench/analyzers_mixin.py | TheSDK-blocks/f2_testbench | 6a263dbab6de1da980619c0ecf6d181342c7592b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | #This is a mixin class for signal analyzers to be used by f2_system class
#Todo: Analyzers should be a independent class
#Last modification by Marko Kosunen, marko.kosunen@aalto.fi, 30.07.2018 18:09
import numpy as np
import scipy.signal as sig
import matplotlib as mpl
mpl.use('Agg') #To enble plotting without X
impor... | 40.330275 | 135 | 0.59702 |
c48cf028762b4fdfc40d981b37dd36716578cfc2 | 6,673 | py | Python | aioscpy/crawler.py | ihandmine/aioscpy | 201ea4471cabfeb85de39b2127fc37ab3969ed48 | [
"MIT"
] | null | null | null | aioscpy/crawler.py | ihandmine/aioscpy | 201ea4471cabfeb85de39b2127fc37ab3969ed48 | [
"MIT"
] | null | null | null | aioscpy/crawler.py | ihandmine/aioscpy | 201ea4471cabfeb85de39b2127fc37ab3969ed48 | [
"MIT"
] | null | null | null | import pprint
import asyncio
import signal
from aioscpy.settings import overridden_settings
from aioscpy.settings import Settings
from aioscpy.signalmanager import SignalManager
from aioscpy.utils.ossignal import install_shutdown_handlers, signal_names
from aioscpy.inject import DependencyInjection
from aioscpy import... | 37.072222 | 113 | 0.643938 |
62adacae0581f7fa242361428052872f78021c6b | 10,318 | py | Python | Week 2/pisano.py | baptu123/Algorithmic-toolbox-Coursera-Assignments | 4e89a8b7dfcef6d360daa7bf33517409cf47c30a | [
"MIT"
] | 2 | 2020-09-02T14:55:14.000Z | 2020-09-02T15:16:54.000Z | Week 2/pisano.py | baptu123/Algorithmic-toolbox-Coursera-Assignments | 4e89a8b7dfcef6d360daa7bf33517409cf47c30a | [
"MIT"
] | null | null | null | Week 2/pisano.py | baptu123/Algorithmic-toolbox-Coursera-Assignments | 4e89a8b7dfcef6d360daa7bf33517409cf47c30a | [
"MIT"
] | 1 | 2020-09-02T15:19:40.000Z | 2020-09-02T15:19:40.000Z | n, m = [int(i) for i in input().split()]
# if period length of fibo modulo m is l. we need to compute n mod l
if n<=1:
print(n)
quit()
pisano = {2: 3, 3: 8, 4: 6, 5: 20, 6: 24, 7: 16, 8: 12, 9: 24, 10: 60, 11: 10, 12: 24, 13: 28, 14: 48, 15: 40, 16: 24, 17: 36, 18: 24, 19: 18, 20: 60, 21: 16, 22: 30... | 245.666667 | 2,024 | 0.587129 |
5e02d95662bd515efc193c8bb81b50bd950acf86 | 6,233 | py | Python | src/commands/messages.py | NaulaN/Escarbot-py | 21a4742956d1c80c575db43613324a348d930983 | [
"MIT"
] | 1 | 2021-08-22T11:20:21.000Z | 2021-08-22T11:20:21.000Z | src/commands/messages.py | NaulaN/Escarbot | 21a4742956d1c80c575db43613324a348d930983 | [
"MIT"
] | null | null | null | src/commands/messages.py | NaulaN/Escarbot | 21a4742956d1c80c575db43613324a348d930983 | [
"MIT"
] | 1 | 2021-08-13T21:32:14.000Z | 2021-08-13T21:32:14.000Z | import os
from discord import Colour,Embed,utils
from discord.ext import commands
from discord_slash import ButtonStyle,SlashContext,cog_ext
from discord_slash.utils.manage_components import create_actionrow,create_button,create_select,create_select_option
class Messages(object):
def __init__(self,obj,bot):
... | 51.090164 | 218 | 0.646398 |
bcb81f84a39f557ed2e0dc6f501b526c61fcd105 | 772 | py | Python | src/trade/migrations/0026_apowner.py | zeroleo12345/restful_server | adbc0567b3a83ebffe0dbf0ef051a70d38134a44 | [
"MIT"
] | 5 | 2018-08-21T06:48:46.000Z | 2021-01-05T06:55:02.000Z | src/trade/migrations/0026_apowner.py | zeroleo12345/restful_server | adbc0567b3a83ebffe0dbf0ef051a70d38134a44 | [
"MIT"
] | 8 | 2020-08-03T02:00:40.000Z | 2022-01-14T13:52:52.000Z | src/trade/migrations/0026_apowner.py | zeroleo12345/restful_server | adbc0567b3a83ebffe0dbf0ef051a70d38134a44 | [
"MIT"
] | 1 | 2021-04-29T10:20:54.000Z | 2021-04-29T10:20:54.000Z | # Generated by Django 2.1.13 on 2021-03-28 10:26
from django.db import migrations, models
import framework.database
class Migration(migrations.Migration):
dependencies = [
('trade', '0025_statap_statuser'),
]
operations = [
migrations.CreateModel(
name='ApOwner',
... | 27.571429 | 76 | 0.555699 |
0dc7d83bbfdcf3c892c73db3c8e97365414ee7f7 | 1,476 | py | Python | owmeta_core/git_repo.py | mwatts15/owmeta-core | b072178f8e7b83cc8665a29f4d038554d18adc35 | [
"MIT"
] | 2 | 2021-03-06T16:25:35.000Z | 2022-03-24T15:00:03.000Z | owmeta_core/git_repo.py | mwatts15/owmeta-core | b072178f8e7b83cc8665a29f4d038554d18adc35 | [
"MIT"
] | 39 | 2020-02-08T21:58:33.000Z | 2022-01-03T15:28:18.000Z | owmeta_core/git_repo.py | openworm/owmeta-core | b072178f8e7b83cc8665a29f4d038554d18adc35 | [
"MIT"
] | null | null | null | from git import Repo
class GitRepoProvider(object):
def __init__(self):
self._repo = None
self.base = None
def init(self, base=None):
base = self.base if not base else base
self._repo = Repo.init(base)
def add(self, files):
self.repo().index.add(files)
def r... | 25.016949 | 71 | 0.598238 |
039de64121e6a7c36561c9cf5c5a6c762bfc231e | 16,344 | py | Python | tests/test.py | guoshuai2016/clickhouse-operator | dea686b9d4fa0ed1fe875f35738aaac6aade175c | [
"Apache-2.0"
] | null | null | null | tests/test.py | guoshuai2016/clickhouse-operator | dea686b9d4fa0ed1fe875f35738aaac6aade175c | [
"Apache-2.0"
] | null | null | null | tests/test.py | guoshuai2016/clickhouse-operator | dea686b9d4fa0ed1fe875f35738aaac6aade175c | [
"Apache-2.0"
] | null | null | null | import json
import json
import os
import time
from testflows.core import TestScenario, Name, When, Then, Given, And, main, run, Module, TE
from testflows.asserts import error
from testflows.connect import Shell
from kubectl import *
from clickhouse import *
from test_examples import *
@TestScenario
@Name("test_001.... | 46.830946 | 172 | 0.604381 |
eb041c37116eec15e1a2698887203f186e2bf013 | 5,561 | py | Python | numba/tests/test_range.py | auderson/numba | 3d67c9850ab56457f418cf40af6245fd9c337705 | [
"BSD-2-Clause"
] | 13 | 2017-03-08T21:47:01.000Z | 2021-11-01T03:23:52.000Z | numba/tests/test_range.py | auderson/numba | 3d67c9850ab56457f418cf40af6245fd9c337705 | [
"BSD-2-Clause"
] | 45 | 2017-03-20T01:22:04.000Z | 2019-04-26T17:03:28.000Z | numba/tests/test_range.py | auderson/numba | 3d67c9850ab56457f418cf40af6245fd9c337705 | [
"BSD-2-Clause"
] | 2 | 2017-01-27T19:14:32.000Z | 2020-02-11T07:33:48.000Z | import unittest
import sys
import numpy
from numba.core.compiler import compile_isolated
from numba import jit, njit
from numba.core import types, utils
from numba.tests.support import tag
from numba.cpython.rangeobj import length_of_iterator
def loop1(n):
s = 0
for i in range(n):
s += i
return ... | 28.228426 | 74 | 0.524366 |
6bac6cc2cdc6c32e70b882f1b61816758ad5d5cf | 3,200 | py | Python | tests/util/test_struct_stream.py | ZeDon-SP/ssdcoin-blockchain | 310b461fa43e26305771322438206d9a5fc00f7a | [
"Apache-2.0"
] | 7 | 2021-07-20T16:54:56.000Z | 2021-11-05T10:05:07.000Z | tests/util/test_struct_stream.py | ZeDon-SP/ssdcoin-blockchain | 310b461fa43e26305771322438206d9a5fc00f7a | [
"Apache-2.0"
] | 2 | 2021-07-23T15:26:36.000Z | 2021-08-18T17:37:50.000Z | tests/util/test_struct_stream.py | ZeDon-SP/ssdcoin-blockchain | 310b461fa43e26305771322438206d9a5fc00f7a | [
"Apache-2.0"
] | null | null | null | import pytest
import io
from ssdcoin.util.ints import int8, uint8, int16, uint16, int32, uint32, int64, uint64, uint128, int512
class TestStructStream:
def _test_impl(self, cls, upper_boundary, lower_boundary):
with pytest.raises(ValueError):
t = cls(upper_boundary + 1)
with pytest.... | 29.357798 | 161 | 0.64875 |
4f0afaeda88677c578c8d1b4bb0354ce9e5f7a41 | 33,805 | py | Python | wavepytools/diag/coherence/singleGratingCoherence_z_scan_multithread.py | APS-XSD-OPT-Group/wavepytools | 25397c099e86a8939cc4ee3a2d266e4f809a1d18 | [
"MIT"
] | 3 | 2019-04-12T18:28:00.000Z | 2020-11-17T18:33:01.000Z | wavepytools/diag/coherence/singleGratingCoherence_z_scan_multithread.py | APS-XSD-OPT-Group/wavepytools | 25397c099e86a8939cc4ee3a2d266e4f809a1d18 | [
"MIT"
] | null | null | null | wavepytools/diag/coherence/singleGratingCoherence_z_scan_multithread.py | APS-XSD-OPT-Group/wavepytools | 25397c099e86a8939cc4ee3a2d266e4f809a1d18 | [
"MIT"
] | 3 | 2019-04-19T16:46:54.000Z | 2021-02-10T18:49:06.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
# #########################################################################
# Copyright (c) 2015, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2015. UChicago Argonne, LLC. Th... | 40.148456 | 175 | 0.462949 |
7123661ac9249dafe9d6aa9c3d9996162ea6890a | 932 | py | Python | kinoml/analysis/plots.py | t-kimber/kinoml | dc28fdbd416d1a53bb33131d6c6fcc05914b15cc | [
"MIT"
] | 36 | 2019-08-26T03:44:50.000Z | 2022-03-17T12:58:11.000Z | kinoml/analysis/plots.py | t-kimber/kinoml | dc28fdbd416d1a53bb33131d6c6fcc05914b15cc | [
"MIT"
] | 92 | 2019-08-28T11:53:28.000Z | 2022-03-30T10:15:44.000Z | kinoml/analysis/plots.py | t-kimber/kinoml | dc28fdbd416d1a53bb33131d6c6fcc05914b15cc | [
"MIT"
] | 18 | 2019-08-24T03:22:28.000Z | 2021-08-12T12:37:47.000Z | """
Common plots for ML model performance analysis
"""
import numpy as np
from matplotlib import pyplot as plt
from .metrics import performance
def predicted_vs_observed(predicted, observed, measurement_type, with_metrics=True, **kwargs):
plt.ioff()
fig, ax = plt.subplots()
ax.scatter(predicted, observed... | 28.242424 | 94 | 0.675966 |
4c6cffc3a9271d700f3d99d96fb8d912679d3c3a | 660 | py | Python | eventsourcing/tests/test_infrastructure_factory.py | h11r/eventsourcing | e53ef697bfef8b78a468dc52d342b0e39b7cb889 | [
"BSD-3-Clause"
] | null | null | null | eventsourcing/tests/test_infrastructure_factory.py | h11r/eventsourcing | e53ef697bfef8b78a468dc52d342b0e39b7cb889 | [
"BSD-3-Clause"
] | null | null | null | eventsourcing/tests/test_infrastructure_factory.py | h11r/eventsourcing | e53ef697bfef8b78a468dc52d342b0e39b7cb889 | [
"BSD-3-Clause"
] | null | null | null | import os
from unittest.case import TestCase
from eventsourcing.persistence import InfrastructureFactory
from eventsourcing.utils import get_topic
class TestInfrastructureFactoryErrors(TestCase):
def tearDown(self) -> None:
del os.environ[InfrastructureFactory.TOPIC]
def test_construct_raises_except... | 33 | 67 | 0.751515 |
874cce40c13f6d667b12a1aa51e8d2ecdcd31913 | 8,347 | py | Python | radio.py | solinium/r-a-d.io-cli | 616a90a90d2bd8b616ed0339c5dcb1a223e87b91 | [
"Unlicense"
] | 1 | 2020-07-17T17:14:41.000Z | 2020-07-17T17:14:41.000Z | radio.py | solinium/r-a-d.io-cli | 616a90a90d2bd8b616ed0339c5dcb1a223e87b91 | [
"Unlicense"
] | null | null | null | radio.py | solinium/r-a-d.io-cli | 616a90a90d2bd8b616ed0339c5dcb1a223e87b91 | [
"Unlicense"
] | 1 | 2020-04-03T21:09:25.000Z | 2020-04-03T21:09:25.000Z | #!/usr/bin/env python3
from datetime import timedelta
from os import environ, remove, system
from shutil import which
from sys import exit, platform, stdout
from time import sleep
from requests import ConnectionError
from requests import get as rget
def audio():
audiourl = 'https://relay0.r-a-d.io/main.mp3'
... | 33.123016 | 174 | 0.584282 |
fb756d787c5c03b08b60cf84c0c890f9b4dab33c | 14,897 | py | Python | ceilometer/tests/objectstore/test_swift_middleware.py | vmturbo/ceilometer | f856d3c915b738a64bce14967ba8114fe923c1af | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/objectstore/test_swift_middleware.py | vmturbo/ceilometer | f856d3c915b738a64bce14967ba8114fe923c1af | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/objectstore/test_swift_middleware.py | vmturbo/ceilometer | f856d3c915b738a64bce14967ba8114fe923c1af | [
"Apache-2.0"
] | 1 | 2019-09-16T02:11:41.000Z | 2019-09-16T02:11:41.000Z | #!/usr/bin/env python
#
# Copyright 2012 eNovance <licensing@enovance.com>
#
# Author: Julien Danjou <julien@danjou.info>
#
# 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.a... | 43.55848 | 79 | 0.63637 |
aa33c2c38bcd01424e3f390a93391e0b98aa6c24 | 2,536 | py | Python | train_classifier.py | msunardi/MotionClassifier | b8af0734ec8163ae2ef9ff5a1278b65d98fc422b | [
"MIT"
] | null | null | null | train_classifier.py | msunardi/MotionClassifier | b8af0734ec8163ae2ef9ff5a1278b65d98fc422b | [
"MIT"
] | null | null | null | train_classifier.py | msunardi/MotionClassifier | b8af0734ec8163ae2ef9ff5a1278b65d98fc422b | [
"MIT"
] | null | null | null | from __future__ import print_function
from classifier import *
from util import elapsed
import os
# gru_id = '015'
# lstm_id = '09'
#
# rnnkind = 'LSTM'
@elapsed
def run():
"""
:return:
"""
base_path = '/home/mathias/PycharmProjects/MotionClassifier/'
if os.name == 'nt':
base_path = '/Use... | 33.368421 | 110 | 0.652208 |
c3cba1348e6c282fe664800c1532f7a7edd6508c | 511 | py | Python | pyleecan/Methods/Machine/LamHole/comp_angle_d_axis.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | pyleecan/Methods/Machine/LamHole/comp_angle_d_axis.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | pyleecan/Methods/Machine/LamHole/comp_angle_d_axis.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | from numpy import pi
def comp_angle_d_axis(self):
"""Compute the angle between the X axis and the first d+ axis
By convention a "Tooth" is centered on the X axis
By convention the first magnet is +
Parameters
----------
self : LamHole
A LamHole object
Returns
-------
d_an... | 20.44 | 65 | 0.596869 |
a10e96ebf6d7c0fd4d56a3b139edde5f3f6fb264 | 7,677 | py | Python | ci/albert/parse_and_submit.py | haohanchen-yagao/deep-learning-models | 92bc19c9f71600d8005bcc34a7227b66ec0653f0 | [
"Apache-2.0"
] | null | null | null | ci/albert/parse_and_submit.py | haohanchen-yagao/deep-learning-models | 92bc19c9f71600d8005bcc34a7227b66ec0653f0 | [
"Apache-2.0"
] | null | null | null | ci/albert/parse_and_submit.py | haohanchen-yagao/deep-learning-models | 92bc19c9f71600d8005bcc34a7227b66ec0653f0 | [
"Apache-2.0"
] | null | null | null | import os, sys
import boto3
import re
import argparse
from datetime import datetime
folder = "Models_NLP"
def regex_extract(text, pattern):
m = re.search(pattern, text)
print(text)
if m:
found = m.group(1)
return found
def extract_result(log_abspath):
result = {}
loss = 100
mlm = ... | 30.343874 | 130 | 0.421779 |
653e9bb8abd49d143c5f9e9d351e784e00613d2f | 198 | py | Python | paz/datasets/__init__.py | ManuelMeder/paz | 6de73c0a99e0f9c7233c2797eebba2bb01631e6c | [
"MIT"
] | 300 | 2020-10-29T08:02:05.000Z | 2022-03-30T21:47:32.000Z | paz/datasets/__init__.py | albertofernandezvillan/paz | 9fbd50b993f37e1e807297a29c6044c09967c9cc | [
"MIT"
] | 30 | 2020-10-29T12:40:32.000Z | 2022-03-31T14:06:35.000Z | paz/datasets/__init__.py | albertofernandezvillan/paz | 9fbd50b993f37e1e807297a29c6044c09967c9cc | [
"MIT"
] | 62 | 2020-10-29T12:34:13.000Z | 2022-03-29T05:21:45.000Z | from .utils import get_class_names
from .voc import VOC
from .fat import FAT
from .open_images import OpenImages
from .ferplus import FERPlus
from .fer import FER
from .cityscapes import CityScapes
| 24.75 | 35 | 0.823232 |
a143ad634a0c7c6fd59800315ab9646611cd177a | 1,084 | py | Python | skp_edu_docker/code/cluster/preprocess/pre_node_feed_img2renet.py | TensorMSA/hoyai_docker | 12f0041e6306d8a6421585a4b51666bad30be442 | [
"MIT"
] | 8 | 2017-06-16T00:19:12.000Z | 2020-08-13T03:15:57.000Z | skp_edu_docker/code/cluster/preprocess/pre_node_feed_img2renet.py | TensorMSA/tensormsa_docker | 12f0041e6306d8a6421585a4b51666bad30be442 | [
"MIT"
] | 21 | 2017-06-09T10:15:14.000Z | 2018-03-29T07:51:02.000Z | skp_edu_docker/code/cluster/preprocess/pre_node_feed_img2renet.py | TensorMSA/hoyai_docker | 12f0041e6306d8a6421585a4b51666bad30be442 | [
"MIT"
] | 4 | 2017-10-25T09:59:53.000Z | 2020-05-07T09:51:11.000Z | from cluster.preprocess.pre_node_feed import PreNodeFeed
import h5py
class PreNodeFeedImg2Renet(PreNodeFeed):
"""
"""
def run(self, conf_data):
"""
override init class
"""
super(PreNodeFeedImg2Renet, self).run(conf_data)
self._init_node_parm(conf_data['node_id'])
... | 29.297297 | 117 | 0.585793 |
659c8fc19974082d2bc4f9e107d9a252c871ee8d | 15,903 | py | Python | spyder/plugins/editor/lsp/__init__.py | aglotero/spyder | 075d32fa359b728416de36cb0e744715fa5e3943 | [
"MIT"
] | 1 | 2019-02-10T10:39:03.000Z | 2019-02-10T10:39:03.000Z | spyder/plugins/editor/lsp/__init__.py | aglotero/spyder | 075d32fa359b728416de36cb0e744715fa5e3943 | [
"MIT"
] | null | null | null | spyder/plugins/editor/lsp/__init__.py | aglotero/spyder | 075d32fa359b728416de36cb0e744715fa5e3943 | [
"MIT"
] | 1 | 2019-02-18T01:28:51.000Z | 2019-02-18T01:28:51.000Z | # -*- coding: utf-8 -*-
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
LSP client, code introspection and linting utillites.
"""
from spyder.config.base import DEV
# Language server communication verbosity at server logs.
TRACE =... | 32.257606 | 79 | 0.696095 |
76d418ef8ac4d89bbfa11fda343e9b5ab74f0da4 | 4,748 | py | Python | BackTesting/INSTITUTIONAL_INVESTORS_FOLLOWER.py | Jacarlianda/FinMind | 181e478727c7cda498da2b42495e2a6fea9688e3 | [
"Apache-2.0"
] | null | null | null | BackTesting/INSTITUTIONAL_INVESTORS_FOLLOWER.py | Jacarlianda/FinMind | 181e478727c7cda498da2b42495e2a6fea9688e3 | [
"Apache-2.0"
] | null | null | null | BackTesting/INSTITUTIONAL_INVESTORS_FOLLOWER.py | Jacarlianda/FinMind | 181e478727c7cda498da2b42495e2a6fea9688e3 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
import requests
# class name,必須跟檔案名一致,例如 class INSTITUTIONAL_INVESTORS_FOLLOWER,檔名也是 INSTITUTIONAL_INVESTORS_FOLLOWER.py
class INSTITUTIONAL_INVESTORS_FOLLOWER:
def __init__(self,
stock_price,
**kwargs, ):
# -------------------------... | 39.566667 | 134 | 0.528644 |
ada8446b6224dfd64d026aef3dc0bc795eeff102 | 11,820 | py | Python | Tom_tools_v1.py | jtomfarrar/SPURS1_SST_map | 1a3d0cd32e50a4fc970e8401e18462e825d88bcd | [
"MIT"
] | null | null | null | Tom_tools_v1.py | jtomfarrar/SPURS1_SST_map | 1a3d0cd32e50a4fc970e8401e18462e825d88bcd | [
"MIT"
] | null | null | null | Tom_tools_v1.py | jtomfarrar/SPURS1_SST_map | 1a3d0cd32e50a4fc970e8401e18462e825d88bcd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
First attempt at (re)creating some of the basic "Tom tools" I have made in matlab.
Created on Fri Jun 12 17:03:58 2020
@author: jtomf
jfarrar@whoi.edu
"""
import numpy as np
import matplotlib.pyplot as plt
import datetime as datetime
from scipy import fft
from scipy import stats
from scip... | 31.187335 | 114 | 0.607699 |
12255586aeda67e04f99a1a54662e2ca50cecd85 | 1,415 | py | Python | src/nasty_analysis/__init__.py | lschmelzeisen/nasty-analysis | 50e2f2d5f6b8b9649a8c8adba1d94b59f01a8dca | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-05-23T19:18:42.000Z | 2020-05-26T12:33:44.000Z | src/nasty_analysis/__init__.py | lschmelzeisen/nasty-analysis | 50e2f2d5f6b8b9649a8c8adba1d94b59f01a8dca | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/nasty_analysis/__init__.py | lschmelzeisen/nasty-analysis | 50e2f2d5f6b8b9649a8c8adba1d94b59f01a8dca | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #
# Copyright 2019-2020 Lukas Schmelzeisen
#
# 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 t... | 34.512195 | 87 | 0.767491 |
4caf62ab4ebf8f4a0d3624e745e7931d036f1d65 | 2,549 | py | Python | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/ModifyVRouterAttributeRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/ModifyVRouterAttributeRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2020-05-31T14:51:47.000Z | 2020-05-31T14:51:47.000Z | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/ModifyVRouterAttributeRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.917808 | 80 | 0.773637 |
d8b753d0893df2b632eaf783008250d61746f287 | 3,859 | py | Python | marketplace/deployer_util/print_config_test.py | trironkk/marketplace-k8s-app-tools | 0611f74cd0723b06fc46ec065e2ac3f0be7b7114 | [
"Apache-2.0"
] | null | null | null | marketplace/deployer_util/print_config_test.py | trironkk/marketplace-k8s-app-tools | 0611f74cd0723b06fc46ec065e2ac3f0be7b7114 | [
"Apache-2.0"
] | null | null | null | marketplace/deployer_util/print_config_test.py | trironkk/marketplace-k8s-app-tools | 0611f74cd0723b06fc46ec065e2ac3f0be7b7114 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.631148 | 78 | 0.574242 |
4c9a838ddad3e52093e41a3c5dc001233eb75395 | 77 | py | Python | codigo.py | Riby4/HCAP2021 | b6b70e79c4458aa780dc64dc18675abe967780f5 | [
"MIT"
] | null | null | null | codigo.py | Riby4/HCAP2021 | b6b70e79c4458aa780dc64dc18675abe967780f5 | [
"MIT"
] | null | null | null | codigo.py | Riby4/HCAP2021 | b6b70e79c4458aa780dc64dc18675abe967780f5 | [
"MIT"
] | null | null | null | import math
print(math.pi)
print(3+8)
print("Hola, esta es una nueva línea")
| 15.4 | 38 | 0.727273 |
7a4b2de2911fe3a03a07c3260e4c3cc91bdff4bb | 941 | py | Python | tests/test_identity.py | Irme/MONAI | dc4bf661831b14f4231cb325cc1b15d38c1e406c | [
"Apache-2.0"
] | 3 | 2020-10-12T02:13:27.000Z | 2021-04-14T11:46:21.000Z | tests/test_identity.py | Scitator/MONAI | a42b563acf0c7504cee18ee84c8af2eff6e948a7 | [
"Apache-2.0"
] | 1 | 2020-09-17T12:41:51.000Z | 2020-09-29T15:20:37.000Z | tests/test_identity.py | Scitator/MONAI | a42b563acf0c7504cee18ee84c8af2eff6e948a7 | [
"Apache-2.0"
] | 1 | 2020-09-14T13:16:01.000Z | 2020-09-14T13:16:01.000Z | # Copyright 2020 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | 32.448276 | 74 | 0.753454 |
90f8e8c7b2ca1be7cbc0fced532340ac36d5bc97 | 3,716 | py | Python | config.py | 007vedant/elekto | d094bc1fa3d9fa28f89e0551fa82c4bd443d69f0 | [
"Apache-2.0"
] | 17 | 2021-01-19T03:32:58.000Z | 2022-02-15T07:11:05.000Z | config.py | 007vedant/elekto | d094bc1fa3d9fa28f89e0551fa82c4bd443d69f0 | [
"Apache-2.0"
] | 20 | 2021-01-07T00:16:40.000Z | 2022-03-30T04:29:12.000Z | config.py | 007vedant/elekto | d094bc1fa3d9fa28f89e0551fa82c4bd443d69f0 | [
"Apache-2.0"
] | 7 | 2021-01-06T03:51:37.000Z | 2022-03-05T04:32:43.000Z | # Copyright 2020 Manish Sahani
#
# 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... | 34.728972 | 82 | 0.690527 |
6a73fea3ab5a249c05a1a6152d5896985ad2c8b7 | 11,227 | py | Python | openapi_client/model/token_refresh.py | osuka/dognews-scraper | 12373064061157083a48ced8e2cabf9d1ace30a5 | [
"MIT"
] | 1 | 2019-11-15T13:19:36.000Z | 2019-11-15T13:19:36.000Z | openapi_client/model/token_refresh.py | osuka/news-extractor | 12373064061157083a48ced8e2cabf9d1ace30a5 | [
"MIT"
] | null | null | null | openapi_client/model/token_refresh.py | osuka/news-extractor | 12373064061157083a48ced8e2cabf9d1ace30a5 | [
"MIT"
] | null | null | null | """
Dognews Server API
Dognews Server client API # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from openapi_client.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
... | 42.206767 | 121 | 0.566491 |
117cae3ff73f2635a9e29571c47e44077cde8853 | 10,651 | py | Python | jiminy/gym/envs/classic_control/rendering.py | sibeshkar/jiminy | 7754f86fb0f246e7d039ea0cbfd9950fcae4adfb | [
"MIT"
] | 3 | 2020-03-16T13:50:40.000Z | 2021-06-09T05:26:13.000Z | jiminy/gym/envs/classic_control/rendering.py | sibeshkar/jiminy | 7754f86fb0f246e7d039ea0cbfd9950fcae4adfb | [
"MIT"
] | null | null | null | jiminy/gym/envs/classic_control/rendering.py | sibeshkar/jiminy | 7754f86fb0f246e7d039ea0cbfd9950fcae4adfb | [
"MIT"
] | null | null | null | """
2D rendering framework
"""
from __future__ import division
import os
import six
import sys
if "Apple" in sys.version:
if 'DYLD_FALLBACK_LIBRARY_PATH' in os.environ:
os.environ['DYLD_FALLBACK_LIBRARY_PATH'] += ':/usr/lib'
# (JDS 2016/04/15): avoid bug on Anaconda 2.3.0 / Yosemite
from jiminy.gy... | 31.984985 | 346 | 0.612994 |
9790ba136117de95d3184f2912ba3a01fabe271b | 3,097 | py | Python | Session_02/List1.py | CristiPV/kea-pyton | 988e56cd5794711b59af104de4dc6f87ffc014f0 | [
"MIT"
] | null | null | null | Session_02/List1.py | CristiPV/kea-pyton | 988e56cd5794711b59af104de4dc6f87ffc014f0 | [
"MIT"
] | null | null | null | Session_02/List1.py | CristiPV/kea-pyton | 988e56cd5794711b59af104de4dc6f87ffc014f0 | [
"MIT"
] | null | null | null | # Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Basic list & tuples exercises
# Fill in the code for the functions below. main() is already set up
# to call the functions with a few different inputs,
# printing 'OK' when each function is corr... | 30.97 | 79 | 0.594123 |
9b85317269e9284262fd525cdaa5f56dd353ee77 | 21,887 | py | Python | archive/do_bkg_estimation_wPSs_archive.py | g3-raman/NITRATES | b636e22d49d5d656d651b4972193f4bf9ccfa902 | [
"MIT"
] | 11 | 2021-11-01T23:52:06.000Z | 2022-01-22T09:18:44.000Z | archive/do_bkg_estimation_wPSs_archive.py | g3-raman/NITRATES | b636e22d49d5d656d651b4972193f4bf9ccfa902 | [
"MIT"
] | 4 | 2021-11-03T17:25:10.000Z | 2022-03-10T18:44:27.000Z | archive/do_bkg_estimation_wPSs_archive.py | g3-raman/NITRATES | b636e22d49d5d656d651b4972193f4bf9ccfa902 | [
"MIT"
] | 2 | 2021-11-17T00:40:33.000Z | 2021-12-22T13:59:34.000Z | import numpy as np
from astropy.io import fits
from astropy.table import Table, vstack
from astropy.wcs import WCS
import os
import argparse
import logging, traceback
import pandas as pd
from copy import copy, deepcopy
import multiprocessing as mp
from bkg_rate_estimation import get_avg_lin_cub_rate_quad_obs
from conf... | 31.72029 | 107 | 0.56842 |
fdee5059794d829ac1407c66d3fdcf91d241d35f | 22,670 | py | Python | esrally/mechanic/team.py | gavinfowler/rally | 4eb64adba80ae25e8a7d4d16bbe54b624bef4331 | [
"Apache-2.0"
] | null | null | null | esrally/mechanic/team.py | gavinfowler/rally | 4eb64adba80ae25e8a7d4d16bbe54b624bef4331 | [
"Apache-2.0"
] | null | null | null | esrally/mechanic/team.py | gavinfowler/rally | 4eb64adba80ae25e8a7d4d16bbe54b624bef4331 | [
"Apache-2.0"
] | null | null | null | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | 43.934109 | 140 | 0.634098 |
a16d32be9721cae9f4d9ce1dea359c600aef3726 | 99,632 | py | Python | third_party/CppHeaderParser/CppHeaderParser/CppHeaderParser.py | alberthrocks/emscripten | f7bd758bc344e0602df108eae91ead9d31737f3a | [
"MIT"
] | 8 | 2015-04-15T16:23:11.000Z | 2020-04-07T13:38:25.000Z | third_party/CppHeaderParser/CppHeaderParser/CppHeaderParser.py | comforx/emscripten | f842201acec3c1edafb2916a76a8eb8d75474c2b | [
"MIT"
] | null | null | null | third_party/CppHeaderParser/CppHeaderParser/CppHeaderParser.py | comforx/emscripten | f842201acec3c1edafb2916a76a8eb8d75474c2b | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Author: Jashua R. Cloutier (contact via sourceforge username:senexcanis)
#
# Copyright (C) 2010, Jashua R. Cloutier
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Re... | 42.432709 | 210 | 0.509294 |
9758bd19f0ba2496945e0b742fc0a4c34c29e3e4 | 7,303 | py | Python | Alfred/Alfred.alfredpreferences/workflows/user.workflow.6EF09E93-493A-4D08-B7DA-33AC86660AE2/libs/faker/providers/job/hy_AM/__init__.py | rouxbuciu/prefs | 7367cb9ce57cc038dc1dc73fb7f4e996a153bbfe | [
"MIT"
] | 258 | 2015-03-01T21:26:16.000Z | 2022-03-21T04:41:27.000Z | Alfred/Alfred.alfredpreferences/workflows/user.workflow.6EF09E93-493A-4D08-B7DA-33AC86660AE2/libs/faker/providers/job/hy_AM/__init__.py | rouxbuciu/prefs | 7367cb9ce57cc038dc1dc73fb7f4e996a153bbfe | [
"MIT"
] | 90 | 2015-03-02T02:44:05.000Z | 2021-07-29T06:22:19.000Z | Alfred/Alfred.alfredpreferences/workflows/user.workflow.6EF09E93-493A-4D08-B7DA-33AC86660AE2/libs/faker/providers/job/hy_AM/__init__.py | rouxbuciu/prefs | 7367cb9ce57cc038dc1dc73fb7f4e996a153bbfe | [
"MIT"
] | 22 | 2015-02-08T20:48:47.000Z | 2022-03-22T14:06:08.000Z | # coding=utf-8
from __future__ import unicode_literals
from .. import Provider as BaseProvider
class Provider(BaseProvider):
jobs = (
"Ակադեմիական գրադարանավար",
"Հաշվապահ",
"Դերասան",
"Ասեղնաբույժ",
"Ադմինիստրատոր",
"Ավիացիոն ինժեներ",
"Գյուղատնտեսական խոր... | 28.751969 | 58 | 0.564836 |
9e9ab4e8650cd295e216e1c49454071cb7910196 | 607 | py | Python | scanner/unitConverters.py | brucewxh/IntraArchiveDeduplicator | 7b0c07cc9fffa75e1b7be285f42b0a8fad42dcfb | [
"BSD-3-Clause"
] | 86 | 2015-01-13T15:02:08.000Z | 2021-12-24T02:13:03.000Z | scanner/unitConverters.py | brucewxh/IntraArchiveDeduplicator | 7b0c07cc9fffa75e1b7be285f42b0a8fad42dcfb | [
"BSD-3-Clause"
] | 4 | 2016-11-18T20:08:50.000Z | 2018-03-08T23:05:37.000Z | scanner/unitConverters.py | brucewxh/IntraArchiveDeduplicator | 7b0c07cc9fffa75e1b7be285f42b0a8fad42dcfb | [
"BSD-3-Clause"
] | 12 | 2015-05-03T07:56:50.000Z | 2021-03-11T12:38:56.000Z |
def binStrToInt(inStr):
if len(inStr) != 64:
raise ValueError("Input strings must be 64 chars long!")
ret = 0
mask = 1 << len(inStr) - 1
for char in inStr: # Specify memory order, so we're (theoretically) platform agnostic
if char == '1':
ret |= mask
mask >>= 1
# Convert to signed representation
VA... | 17.342857 | 87 | 0.61944 |
f3fe2a6be06dedc5621034dc942340a9f53293b4 | 10,877 | py | Python | xblock/data/dataset.py | ImperialNLP/X-Block | b5a5ce9088d0f3435011615f5029c2e3d79c8da2 | [
"BSD-3-Clause"
] | null | null | null | xblock/data/dataset.py | ImperialNLP/X-Block | b5a5ce9088d0f3435011615f5029c2e3d79c8da2 | [
"BSD-3-Clause"
] | null | null | null | xblock/data/dataset.py | ImperialNLP/X-Block | b5a5ce9088d0f3435011615f5029c2e3d79c8da2 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : dataset.py
# Author : Pranava Madhyastha <pranava@imperial.ac.uk>
# Date : 01.11.2020
# Last Modified Date: 09.11.2021
# Last Modified By : Pranava Madhyastha <pranava@imperial.ac.uk>
#
# Copyright (c) 2020, Imperial College, ... | 43.334661 | 105 | 0.58472 |
65bb9ac21b27c1598b2375c817aa94c4b7d4c90e | 9,073 | py | Python | npmodel.py | tkosht/neural_processes | 655d6bc2454699fdadce353ef9ebd2e2443dc8e2 | [
"MIT"
] | null | null | null | npmodel.py | tkosht/neural_processes | 655d6bc2454699fdadce353ef9ebd2e2443dc8e2 | [
"MIT"
] | 1 | 2019-03-10T08:37:31.000Z | 2019-03-15T04:26:34.000Z | npmodel.py | tkosht/neural_processes | 655d6bc2454699fdadce353ef9ebd2e2443dc8e2 | [
"MIT"
] | null | null | null | import torch
import torch.utils.data
from torch import nn
from torch.nn import functional as F
def weight_initialize(w):
return torch.nn.init.xavier_uniform_(w)
# return torch.nn.init.kaiming_uniform_(w)
# return torch.nn.init.xavier_normal_(w)
class NPMlp(nn.Module):
def __init__(self, layers=[2, 4... | 33.479705 | 98 | 0.576105 |
a7b2a455f71e190bf380b49203f49c3a11d63f5a | 890 | py | Python | var/spack/repos/builtin/packages/idba/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2018-11-27T03:39:44.000Z | 2021-09-06T15:50:35.000Z | var/spack/repos/builtin/packages/idba/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-01-11T20:11:52.000Z | 2019-01-11T20:11:52.000Z | var/spack/repos/builtin/packages/idba/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Idba(AutotoolsPackage):
"""IDBA is a practical iterative De Bruijn Graph De Novo Assembler... | 29.666667 | 74 | 0.676404 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.