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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7366fb79cc98cc8da4a20593adf754830266e3b | 6,539 | py | Python | bibpy/lexers/base_lexer.py | MisanthropicBit/bibpy | 3195790105544672f622ed893213a627b5280f2b | [
"BSD-3-Clause"
] | 1 | 2021-08-18T13:17:10.000Z | 2021-08-18T13:17:10.000Z | bibpy/lexers/base_lexer.py | MisanthropicBit/bibpy | 3195790105544672f622ed893213a627b5280f2b | [
"BSD-3-Clause"
] | 7 | 2018-02-18T12:29:20.000Z | 2020-05-14T18:08:48.000Z | bibpy/lexers/base_lexer.py | MisanthropicBit/bibpy | 3195790105544672f622ed893213a627b5280f2b | [
"BSD-3-Clause"
] | 3 | 2018-02-17T18:27:43.000Z | 2022-01-20T02:28:58.000Z | # -*- coding: utf-8 -*-
"""Base class for all lexers."""
import re
from funcparserlib.lexer import Token
class LexerError(Exception):
"""General lexer error."""
def __init__(self, msg, pos, char, lnum, brace_level, line):
"""Initialise with information on where the error occurred."""
self.m... | 29.32287 | 79 | 0.562777 |
6ed35db4d38694e7c783de4b97956c88c47c1f2f | 791 | py | Python | profiles_api/migrations/0002_profilefeeditem.py | MichaelPGudz/Profiles_REST_API | 021521658fe6482aa3759e81c6ebb6246955194f | [
"MIT"
] | 1 | 2020-03-28T22:09:15.000Z | 2020-03-28T22:09:15.000Z | profiles_api/migrations/0002_profilefeeditem.py | MichaelPGudz/Profiles_REST_API | 021521658fe6482aa3759e81c6ebb6246955194f | [
"MIT"
] | 7 | 2020-03-29T20:14:47.000Z | 2022-02-10T14:44:44.000Z | profiles_api/migrations/0002_profilefeeditem.py | MichaelPGudz/Profiles_REST_API | 021521658fe6482aa3759e81c6ebb6246955194f | [
"MIT"
] | null | null | null | # Generated by Django 2.2.10 on 2020-04-01 19:15
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('profiles_api', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 31.64 | 126 | 0.633375 |
eed4809b8bdc97940cdb1788bdbe46e15f108964 | 2,604 | py | Python | code/get_meteo_estaciones_cat.py | cesisar/TFM_UOC_2020 | a8bdcc3eb9c36c623d8396dbfa4b1eb567eaea97 | [
"MIT"
] | null | null | null | code/get_meteo_estaciones_cat.py | cesisar/TFM_UOC_2020 | a8bdcc3eb9c36c623d8396dbfa4b1eb567eaea97 | [
"MIT"
] | null | null | null | code/get_meteo_estaciones_cat.py | cesisar/TFM_UOC_2020 | a8bdcc3eb9c36c623d8396dbfa4b1eb567eaea97 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, argparse, os, logging
import pandas as pd
from datetime import datetime, timedelta
from sodapy import Socrata
def createLogger (logName = os.path.splitext(os.path.basename(__file__))[0], logLevel = logging.INFO):
FORMAT = '[%(asctime)-15s][%(levelname)s]: %... | 39.454545 | 148 | 0.652458 |
c07f0355bbc57fd188633a98190f5a878b737c92 | 460 | py | Python | chapter02/path_converter_demo/article/urls.py | Tomtao626/django | fe945063593b4bfe82d74842f728b854b501a294 | [
"Apache-2.0"
] | null | null | null | chapter02/path_converter_demo/article/urls.py | Tomtao626/django | fe945063593b4bfe82d74842f728b854b501a294 | [
"Apache-2.0"
] | null | null | null | chapter02/path_converter_demo/article/urls.py | Tomtao626/django | fe945063593b4bfe82d74842f728b854b501a294 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/5/26 23:21
# @Author : Tom_tao
# @Site :
# @File : urls.py
# @Software: PyCharm
from . import views
from django.urls import re_path,path
urlpatterns = [
path('',views.article),
# re_path(r'list/(?P<categories>\w+|(\w+\+\w+)+)/',views.article_list)
... | 27.058824 | 74 | 0.645652 |
220af7170a4cd352d0a0cfd12382a58ba1d892f0 | 577 | py | Python | tests/oldtests/old/dbmaptest.py | ctb/pygr | a3a3e68073834c20ddbdb27ed746baf8c73fef0a | [
"BSD-3-Clause"
] | 2 | 2015-03-07T13:20:50.000Z | 2015-11-04T12:01:21.000Z | tests/oldtests/old/dbmaptest.py | ctb/pygr | a3a3e68073834c20ddbdb27ed746baf8c73fef0a | [
"BSD-3-Clause"
] | null | null | null | tests/oldtests/old/dbmaptest.py | ctb/pygr | a3a3e68073834c20ddbdb27ed746baf8c73fef0a | [
"BSD-3-Clause"
] | null | null | null |
import MySQLdb
from pygr.seqdb import *
sp=BlastDB('sp') # OPEN SWISSPROT BLAST DB
s=Sequence(str(sp['CYGB_HUMAN'][40:-40]),'boo')
db=MySQLdb.Connection(db='test',read_default_file=os.environ['HOME']+'/.my.cnf')
cursor=db.cursor()
t=SQLTableMultiNoCache('test.mytable',cursor)
t._distinct_key='src_id'
m=StoredPathMa... | 28.85 | 80 | 0.719237 |
1c91d733f6dda667ac2491e6020cefbc2d2c094a | 165 | py | Python | onep/commands/__init__.py | apognu/1p | 4e3840d166e43d96300045363ad5f59e0a22c52c | [
"MIT"
] | null | null | null | onep/commands/__init__.py | apognu/1p | 4e3840d166e43d96300045363ad5f59e0a22c52c | [
"MIT"
] | null | null | null | onep/commands/__init__.py | apognu/1p | 4e3840d166e43d96300045363ad5f59e0a22c52c | [
"MIT"
] | null | null | null | from . import delete
from . import document
from . import edit
from . import search
from . import share
from . import signin
from . import show
from . import vaults
| 18.333333 | 22 | 0.757576 |
54eb74c3fc7feb26604ae7c639e0e3d29af7c7bb | 7,555 | py | Python | mistral/cmd/launch.py | lijianying10/mistral | c08cbf241cecb9ffb58adbc60b3fe43727e9d5e0 | [
"Apache-2.0"
] | null | null | null | mistral/cmd/launch.py | lijianying10/mistral | c08cbf241cecb9ffb58adbc60b3fe43727e9d5e0 | [
"Apache-2.0"
] | null | null | null | mistral/cmd/launch.py | lijianying10/mistral | c08cbf241cecb9ffb58adbc60b3fe43727e9d5e0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2016 - Brocade Communications Systems, Inc.
# Copyright 2018 - Extreme Networks, 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
#
# htt... | 31.219008 | 78 | 0.663534 |
81bdbd9a044873dc59a68f6048c24a75afafbc30 | 3,078 | py | Python | main.py | abadala/EnglishToIsiNdebele | fd69ea4e24710c5d28ad4c111e9b6b0611c083e1 | [
"MIT"
] | null | null | null | main.py | abadala/EnglishToIsiNdebele | fd69ea4e24710c5d28ad4c111e9b6b0611c083e1 | [
"MIT"
] | null | null | null | main.py | abadala/EnglishToIsiNdebele | fd69ea4e24710c5d28ad4c111e9b6b0611c083e1 | [
"MIT"
] | null | null | null | import sys
import json
import datetime
# increases a users elder score with each contribution. Think through tiers.
def yongeza_ubudala():
return
# open a path for a user to provide an english word::and its translation
def translation_couresel():
# iterate over all words in word list
wordfile = open('wo... | 30.475248 | 102 | 0.5705 |
f3e2630d508e0b45487402ec7d4836ca439be24a | 12,096 | py | Python | pypxe/tftp.py | vbyrd/PyPXE | 9d36ecf985d4436000ec266c5b8ed2e7cffa19bf | [
"MIT"
] | null | null | null | pypxe/tftp.py | vbyrd/PyPXE | 9d36ecf985d4436000ec266c5b8ed2e7cffa19bf | [
"MIT"
] | null | null | null | pypxe/tftp.py | vbyrd/PyPXE | 9d36ecf985d4436000ec266c5b8ed2e7cffa19bf | [
"MIT"
] | null | null | null | '''
This file contains classes and functions that implement the PyPXE TFTP service
'''
import socket
import struct
import os
import select
import time
import logging
import math
from pypxe import helpers
class ParentSocket(socket.socket):
'''Subclassed socket.socket to enable a link-back to the client object.''... | 40.32 | 125 | 0.579613 |
d71fbde751e280a87b527f2eb57356cd1ad49813 | 28,491 | py | Python | pyglet/gl/agl.py | SwineProject/pyglet | f0203870bef94d4349ad16f060c941d45270a0b5 | [
"BSD-3-Clause"
] | null | null | null | pyglet/gl/agl.py | SwineProject/pyglet | f0203870bef94d4349ad16f060c941d45270a0b5 | [
"BSD-3-Clause"
] | null | null | null | pyglet/gl/agl.py | SwineProject/pyglet | f0203870bef94d4349ad16f060c941d45270a0b5 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2018 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | 63.172949 | 170 | 0.790214 |
f07f5770146f1dc6e16f4f09f8f57d7ec0a27079 | 3,267 | py | Python | qa/rpc-tests/zmq_test.py | fujicoin/fujicoin-bitcore | bd4219c284e716c2326ba450cc3288ca691cd8b3 | [
"MIT"
] | null | null | null | qa/rpc-tests/zmq_test.py | fujicoin/fujicoin-bitcore | bd4219c284e716c2326ba450cc3288ca691cd8b3 | [
"MIT"
] | null | null | null | qa/rpc-tests/zmq_test.py | fujicoin/fujicoin-bitcore | bd4219c284e716c2326ba450cc3288ca691cd8b3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Fujicoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test ZMQ interface
#
from test_framework.test_framework import FujicoinTestFramework
from test_fram... | 32.346535 | 121 | 0.609428 |
8cc85cae55ac2729cb7c637c4cd110cd9932b049 | 9,038 | py | Python | src/arclus/preprocessing/dataset_reader.py | fromm-m/ecir2021-am-search | 58ed5fb86b8b3184fbbc4777c9e038768b728d13 | [
"MIT"
] | 3 | 2021-02-15T19:38:41.000Z | 2021-02-16T13:51:04.000Z | src/arclus/preprocessing/dataset_reader.py | fromm-m/ecir2021-am-search | 58ed5fb86b8b3184fbbc4777c9e038768b728d13 | [
"MIT"
] | null | null | null | src/arclus/preprocessing/dataset_reader.py | fromm-m/ecir2021-am-search | 58ed5fb86b8b3184fbbc4777c9e038768b728d13 | [
"MIT"
] | 1 | 2021-02-16T13:52:08.000Z | 2021-02-16T13:52:08.000Z | import json
import logging
import pathlib
from typing import Union, Optional
import pandas
from arclus.utils import is_blank
class DatasetReader:
"""General class for reading datasets."""
#: The root directory.
root: pathlib.Path
def __init__(
self,
root: Union[pathlib.Path, str],
... | 35.865079 | 111 | 0.594822 |
fd01d76c124c6b98976a2bf8e2bafd7ff83a384d | 114 | py | Python | testsmainnet/loantoken/test_LoanTokenLogicStandardEvents.py | DryptoBZX/contractsV2 | 3ee0b7669902ff6b9422440289ddc52f679e636b | [
"Apache-2.0"
] | 177 | 2020-06-13T01:41:04.000Z | 2022-03-28T06:26:53.000Z | testsmainnet/loantoken/test_LoanTokenLogicStandardEvents.py | DryptoBZX/contractsV2 | 3ee0b7669902ff6b9422440289ddc52f679e636b | [
"Apache-2.0"
] | 31 | 2020-08-14T14:30:37.000Z | 2022-03-15T15:36:25.000Z | testsmainnet/loantoken/test_LoanTokenLogicStandardEvents.py | DryptoBZX/contractsV2 | 3ee0b7669902ff6b9422440289ddc52f679e636b | [
"Apache-2.0"
] | 38 | 2020-06-24T22:24:40.000Z | 2022-03-26T00:27:14.000Z | #!/usr/bin/python3
import pytest
from brownie import *
from fixedint import *
#from helpers import setupLoanPool
| 16.285714 | 34 | 0.789474 |
e13c1aa6efa29f621cc4ecddcfaacae59df4ef11 | 3,393 | py | Python | examples/tutorials/contour_map.py | shahid-0/pygmt | fc8a30a99b81c4aa092e38669e5e4a39411ca78d | [
"BSD-3-Clause"
] | null | null | null | examples/tutorials/contour_map.py | shahid-0/pygmt | fc8a30a99b81c4aa092e38669e5e4a39411ca78d | [
"BSD-3-Clause"
] | 24 | 2021-02-12T08:12:30.000Z | 2022-02-08T13:04:23.000Z | examples/tutorials/contour_map.py | shahid-0/pygmt | fc8a30a99b81c4aa092e38669e5e4a39411ca78d | [
"BSD-3-Clause"
] | null | null | null | """
Creating a map with contour lines
=================================
Plotting a contour map is handled by :meth:`pygmt.Figure.grdcontour`.
.. note::
This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
To see the figures while using a Python script instead, use
``fi... | 29.763158 | 92 | 0.59328 |
57874dc49e6fa803f1060da59c3c2474d42fb081 | 481 | py | Python | gh/utils.py | voidabhi/GrowthHackersAPI | cf0b99dab24a2bb0bb0dc6ae09b2460ae950fedd | [
"MIT"
] | 6 | 2015-03-10T18:14:45.000Z | 2019-04-24T05:56:56.000Z | gh/utils.py | voidabhi/GrowthHackersAPI | cf0b99dab24a2bb0bb0dc6ae09b2460ae950fedd | [
"MIT"
] | 10 | 2015-01-01T14:18:05.000Z | 2016-05-11T18:04:45.000Z | gh/utils.py | voidabhi/GrowthHackersAPI | cf0b99dab24a2bb0bb0dc6ae09b2460ae950fedd | [
"MIT"
] | 3 | 2016-05-03T13:24:54.000Z | 2019-04-24T05:57:07.000Z |
import requests
from bs4 import BeautifulSoup
from constants import BASE_URL
def get_soup(page=''):
content = ''
try:
content = requests.get('%s/%s/' % (BASE_URL,page)).text
except requests.exceptions.ConnectionError as e:
content = requests.get('%s/%s' % (BASE_URL,page)).text
finally:
return BeautifulSou... | 21.863636 | 57 | 0.704782 |
5bc3660e6bb718e5455b5a2e094cdab088374c52 | 9,944 | py | Python | pims/spe_stack.py | nkeim/pims | 3c8f7832113517a37ddd65a2803a6b17f9c33e4c | [
"BSD-3-Clause"
] | 2 | 2021-01-31T23:58:44.000Z | 2021-09-15T06:10:06.000Z | pims/spe_stack.py | nkeim/pims | 3c8f7832113517a37ddd65a2803a6b17f9c33e4c | [
"BSD-3-Clause"
] | null | null | null | pims/spe_stack.py | nkeim/pims | 3c8f7832113517a37ddd65a2803a6b17f9c33e4c | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import warnings
import numpy as np
from .frame import Frame
from .base_frames import FramesSequence
class Spec(object):
"""SPE file specification data
Tuples of (offset, datatype, count), where offset is the offset in the SPE
file... | 36.558824 | 79 | 0.536806 |
3e98d847c563aff1a6db1d21a85858dfb8b15f58 | 10,051 | py | Python | depthai_sdk/src/depthai_sdk/utils.py | B-AROL-O/depthai | ad238dc652cafff1d5c02e89b5ba2f31ab483143 | [
"MIT"
] | null | null | null | depthai_sdk/src/depthai_sdk/utils.py | B-AROL-O/depthai | ad238dc652cafff1d5c02e89b5ba2f31ab483143 | [
"MIT"
] | null | null | null | depthai_sdk/src/depthai_sdk/utils.py | B-AROL-O/depthai | ad238dc652cafff1d5c02e89b5ba2f31ab483143 | [
"MIT"
] | null | null | null | import importlib
import sys
from pathlib import Path
import urllib.request
import cv2
import numpy as np
import depthai as dai
import datetime as dt
from heapq import heappop, heappush
import threading
def cosDist(a, b):
"""
Calculates cosine distance - https://en.wikipedia.org/wiki/Cosine_similarity
"""... | 33.615385 | 150 | 0.63327 |
5fdb3b356d97c24ea2ca7d6c38f8c9ba57c76f4c | 1,604 | py | Python | xlsxwriter/test/comparison/test_chart_combined07.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-01-09T19:43:43.000Z | 2019-01-09T19:43:43.000Z | xlsxwriter/test/comparison/test_chart_combined07.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_chart_combined07.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2018, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 25.460317 | 79 | 0.548628 |
39989510aaa2d1640e0855dc25c3c2d2ef3af6f6 | 7,818 | py | Python | Vault7/Lost-in-Translation/windows/ReplayWizard.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | 46 | 2017-05-15T11:15:08.000Z | 2018-07-02T03:32:52.000Z | Vault7/Lost-in-Translation/windows/ReplayWizard.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | null | null | null | Vault7/Lost-in-Translation/windows/ReplayWizard.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | 24 | 2017-05-17T03:26:17.000Z | 2018-07-09T07:00:50.000Z |
from __future__ import print_function
import glob
import math
import os
import subprocess
import sys
import time
import traceback
SLEEP = 5
LETTERS = 'BCDEFGHIJKLMNOPQRSTUVWXYZ'
REFRESH_LIST = 'REFRESH LIST'
REPLAY_DRIVE = 'D:\\'
MAIN_HEADER = "\nReplayWizard 2013-05-09\n\nLEAVE THIS WINDOW OPEN WHILE YOU... | 43.19337 | 448 | 0.609363 |
98bc06f63fd720e8b3aa8b9a3f5e58017cd9332c | 8,104 | py | Python | onnx_tf/handlers/backend/scan_mixin.py | MemoryChain-CN/onnx-tensorflow | e048c0a69b870d661143f561511329dae4acfcfa | [
"Apache-2.0"
] | 1 | 2020-06-04T14:16:39.000Z | 2020-06-04T14:16:39.000Z | onnx_tf/handlers/backend/scan_mixin.py | MemoryChain-CN/onnx-tensorflow | e048c0a69b870d661143f561511329dae4acfcfa | [
"Apache-2.0"
] | 1 | 2020-06-10T06:53:21.000Z | 2020-06-12T08:19:23.000Z | onnx_tf/handlers/backend/scan_mixin.py | yangchengtest/onnx-tf-atlas | 7c6772399256cd14b37a1ac4d7bad948583b0034 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from onnx.helper import make_opsetid
import onnx_tf
from onnx_tf.common import data_type
class ScanMixin(object):
@classmethod
def scan(cls, node, input_dict, strict):
current_opset = [make_opsetid(cls.DOMAIN, cls.VERSION)]
body = node.attrs["body"]
# in vers... | 42.878307 | 79 | 0.537019 |
7cd897a5bccab010f9653fcabb55d40999b4327e | 2,465 | py | Python | scripts/deprecated/story_predictor_percentiles_annotator.py | dwlmt/Story-Untangling | c56354e305f06a508b63b913989ff8856e4db5b6 | [
"Unlicense"
] | 7 | 2020-09-12T22:32:33.000Z | 2022-02-07T08:37:04.000Z | scripts/deprecated/story_predictor_percentiles_annotator.py | dwlmt/Story-Untangling | c56354e305f06a508b63b913989ff8856e4db5b6 | [
"Unlicense"
] | 2 | 2021-08-31T15:46:16.000Z | 2021-09-01T15:19:52.000Z | scripts/deprecated/story_predictor_percentiles_annotator.py | dwlmt/Story-Untangling | c56354e305f06a508b63b913989ff8856e4db5b6 | [
"Unlicense"
] | 1 | 2021-06-02T09:33:27.000Z | 2021-06-02T09:33:27.000Z | import argparse
from collections import defaultdict
import jsonlines
import numpy as np
from scipy.stats import stats
def main(args):
print(f"Arguments: {args}")
attribute_values_to_rank = defaultdict(lambda: list())
attribute_percentiles = defaultdict(lambda: list())
with jsonlines.open(args["sour... | 43.245614 | 112 | 0.689249 |
570441f03bf5b5b90a0006a92aa560f58c64f9ea | 1,042 | py | Python | app/core/migrations/0004_recipe.py | RafyAmgadBenjamin/recipe-app-api | 7b14ec9b422704205819fca20ae7ab1e713e4625 | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | RafyAmgadBenjamin/recipe-app-api | 7b14ec9b422704205819fca20ae7ab1e713e4625 | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | RafyAmgadBenjamin/recipe-app-api | 7b14ec9b422704205819fca20ae7ab1e713e4625 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2021-10-19 11:20
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredient'),
]
operations = [
migrations.CreateModel(
... | 35.931034 | 118 | 0.603647 |
3564c293a5ef2d5a57463dd8a46e0e654f5c9409 | 888 | py | Python | data.py | songer1993/L42-Practical-2 | 24416ea5b029c448f7ffea861ab914340eb26fa7 | [
"MIT"
] | null | null | null | data.py | songer1993/L42-Practical-2 | 24416ea5b029c448f7ffea861ab914340eb26fa7 | [
"MIT"
] | null | null | null | data.py | songer1993/L42-Practical-2 | 24416ea5b029c448f7ffea861ab914340eb26fa7 | [
"MIT"
] | null | null | null | from keras.utils import np_utils
import scipy.io
import numpy as np
np.random.seed(0)
def load_data():
rows, cols = 28, 28
nb_classes = 10
DATA_DIR = 'notMNIST_small.mat'
mat = scipy.io.loadmat(DATA_DIR)
X = mat['images']
Y = mat['labels']
# Move last column to front
X = np.rollax... | 18.122449 | 46 | 0.620495 |
46b5d9a865f4ad817d09556f18f9722f72d4a75e | 1,618 | py | Python | setup.py | samedamci/basedbinpy | 19352e5ce5c410ca9eeac9d3cb190488c5745258 | [
"0BSD"
] | null | null | null | setup.py | samedamci/basedbinpy | 19352e5ce5c410ca9eeac9d3cb190488c5745258 | [
"0BSD"
] | null | null | null | setup.py | samedamci/basedbinpy | 19352e5ce5c410ca9eeac9d3cb190488c5745258 | [
"0BSD"
] | null | null | null | from setuptools import find_packages, setup
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), "r", encoding="utf-8") as f:
long_description = f.read()
source_url = "https://github.com/samedamci/basedbinpy"
setup(
name="basedbinpy",
... | 35.173913 | 78 | 0.639679 |
e8e2c33469a46d8c678722572d4b94f70d687bcc | 12,391 | py | Python | save_the_change/mixins.py | juancferrer/django-save-the-change | fc16a74d20dc040725b16849aec93399cbea7672 | [
"Apache-2.0"
] | null | null | null | save_the_change/mixins.py | juancferrer/django-save-the-change | fc16a74d20dc040725b16849aec93399cbea7672 | [
"Apache-2.0"
] | null | null | null | save_the_change/mixins.py | juancferrer/django-save-the-change | fc16a74d20dc040725b16849aec93399cbea7672 | [
"Apache-2.0"
] | 1 | 2019-08-16T18:21:57.000Z | 2019-08-16T18:21:57.000Z | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function, unicode_literals
from collections import Mapping
from copy import copy, deepcopy
from datetime import date, time, datetime, timedelta, tzinfo
from decimal import Decimal
from uuid import UUID
from django.conf import settings
fr... | 30.519704 | 163 | 0.708014 |
ec615257f773d92f9143b8760b084827f0900a52 | 6,548 | py | Python | protocol/Channel.py | Anarchid/uberserver | 312b69e379e8999c440f1dd6e5c0b00a9932e7b1 | [
"MIT"
] | null | null | null | protocol/Channel.py | Anarchid/uberserver | 312b69e379e8999c440f1dd6e5c0b00a9932e7b1 | [
"MIT"
] | null | null | null | protocol/Channel.py | Anarchid/uberserver | 312b69e379e8999c440f1dd6e5c0b00a9932e7b1 | [
"MIT"
] | null | null | null | from AutoDict import AutoDict
import time
class Channel(AutoDict):
def __init__(self, root, name, id = 0, users=[], admins=[],
ban={}, allow=[], autokick='ban', chanserv=False,
owner='', mutelist={}, antispam=False,
censor=False, antishock=False, topic=None,
key=None, history=False, **kwargs):... | 35.586957 | 146 | 0.693952 |
87c129a97517ecccbd58feaf1a902c8e697f12de | 349 | py | Python | src/service/main_service.py | JoeIOU/metedata_fusion_tools | 3cf45338c4ae28e043142bf728ee6c91749ff72e | [
"Apache-2.0"
] | null | null | null | src/service/main_service.py | JoeIOU/metedata_fusion_tools | 3cf45338c4ae28e043142bf728ee6c91749ff72e | [
"Apache-2.0"
] | null | null | null | src/service/main_service.py | JoeIOU/metedata_fusion_tools | 3cf45338c4ae28e043142bf728ee6c91749ff72e | [
"Apache-2.0"
] | null | null | null | from service.metadata_service import app
from service.view_service import app_view
from httpserver import httpserver
app1 = httpserver.getApp()
app1.register_blueprint(app)
app1.register_blueprint(app_view)
# @app1.route("/")
# def hello():
# return "Hello World!"
if __name__ == "__main__":
# app1.run()
... | 20.529412 | 41 | 0.744986 |
36536a29c1c1f2eb140cdad90e60305cf624cd2b | 1,496 | py | Python | aftool/log.py | Asdil/aftool | cff4fd91dd7d0b7339b02a90824ffba40e7bdc63 | [
"MIT"
] | null | null | null | aftool/log.py | Asdil/aftool | cff4fd91dd7d0b7339b02a90824ffba40e7bdc63 | [
"MIT"
] | null | null | null | aftool/log.py | Asdil/aftool | cff4fd91dd7d0b7339b02a90824ffba40e7bdc63 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: log
Description :
Author : 艾登科技 Asdil
date: 2020/7/9
-------------------------------------------------
Change Activity:
2020/7/9:
------------------------------------------------... | 23.375 | 121 | 0.520722 |
87abc207fc5cdb172553d7ead1a6ca75b00d6e75 | 430 | py | Python | plotly/validators/heatmap/_xsrc.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/heatmap/_xsrc.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/heatmap/_xsrc.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class XsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name='xsrc', parent_name='heatmap', **kwargs):
super(XsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type... | 30.714286 | 76 | 0.64186 |
a58abe5065b4fa03fae006edd45fd53130667fc6 | 4,454 | py | Python | datamart/unit_tests/test_utils.py | ShadoWander/datamart | 35341f8fdb6c6b8232a1a84fa19ba1c765926ead | [
"MIT"
] | null | null | null | datamart/unit_tests/test_utils.py | ShadoWander/datamart | 35341f8fdb6c6b8232a1a84fa19ba1c765926ead | [
"MIT"
] | null | null | null | datamart/unit_tests/test_utils.py | ShadoWander/datamart | 35341f8fdb6c6b8232a1a84fa19ba1c765926ead | [
"MIT"
] | null | null | null | from datamart.utilities.utils import Utils
import unittest, os, json
from datamart.materializers.materializer_base import MaterializerBase
from datamart.materializers.noaa_materializer import NoaaMaterializer
import pandas as pd
from pandas.util.testing import assert_frame_equal
class TestUtils(unittest.TestCase):
... | 41.626168 | 103 | 0.566233 |
08e6e26ad989febc95727eeee229a743f27b70df | 1,562 | py | Python | api/tests/python/tests/substructure/tau_enumeration.py | 00Green27/Indigo | dc09f838b8b05d4bba2f79d0af5617d637f0b70e | [
"Apache-2.0"
] | null | null | null | api/tests/python/tests/substructure/tau_enumeration.py | 00Green27/Indigo | dc09f838b8b05d4bba2f79d0af5617d637f0b70e | [
"Apache-2.0"
] | null | null | null | api/tests/python/tests/substructure/tau_enumeration.py | 00Green27/Indigo | dc09f838b8b05d4bba2f79d0af5617d637f0b70e | [
"Apache-2.0"
] | null | null | null | import os
import sys
sys.path.append(os.path.normpath(os.path.join(os.path.abspath(__file__), '..', '..', '..', "common")))
from env_indigo import *
indigo = Indigo()
#indigo_inchi = IndigoInchi(indigo);
def testEnumTautomersForMolecule (molecule):
iter = indigo.iterateTautomers(molecule, 'INCHI')
lst = l... | 35.5 | 125 | 0.710627 |
d86d0ea3bdc31f38a00e5291d9b33d0201249757 | 5,687 | py | Python | poold/utils/history.py | geflaspohler/poold | 4ddd085597b85e8c737b2f904f504437f728513b | [
"MIT"
] | 7 | 2021-08-02T15:31:01.000Z | 2022-02-11T14:36:46.000Z | poold/utils/history.py | geflaspohler/poold | 4ddd085597b85e8c737b2f904f504437f728513b | [
"MIT"
] | null | null | null | poold/utils/history.py | geflaspohler/poold | 4ddd085597b85e8c737b2f904f504437f728513b | [
"MIT"
] | 1 | 2021-07-15T23:05:02.000Z | 2021-07-15T23:05:02.000Z |
""" History object for book-keeping online learning progress.
For example:
import poold
models = ["model1", "model2"]
duration = 20
learner, history = poold.create("adahedged", model_list=models, T=duration)
"""
import copy
import numpy as np
import pdb
class History(object):
def __init__(self... | 31.949438 | 106 | 0.578161 |
4d7281e2fec545accf1aed0bae1ed701dc2bb1d6 | 2,687 | py | Python | webEntregas/public_html/modelos/ADI_Bin/utilitarios/FCKeditor/editor/filemanager/connectors/py/fckconnector.py | kalebecalixto/webEntregas | e207f20e4b8b388bf4220018f20c78c7d8980094 | [
"Apache-2.0"
] | 3 | 2016-05-09T15:41:29.000Z | 2017-04-28T18:03:12.000Z | public/javascripts/fckeditor/editor/filemanager/connectors/py/fckconnector.py | suratpyari/tog_vault | d8a5c9c1daa8a43b88365fc7d2cdc354cb4676ab | [
"MIT"
] | 1 | 2019-09-29T02:13:43.000Z | 2019-09-29T02:13:43.000Z | public/javascripts/fckeditor/editor/filemanager/connectors/py/fckconnector.py | lee/typo_old | 20d9bfd2aaf38eee4a34dc527ced082313c75c79 | [
"MIT"
] | 1 | 2021-07-13T07:20:18.000Z | 2021-07-13T07:20:18.000Z | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2007 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | 29.527473 | 93 | 0.689989 |
43e2682c19140bdcb0b17073d47e0057b4176b2c | 1,043 | py | Python | app/core/migrations/0004_recipe.py | Jordon-Chen/recipe-app-api | 8112102a8c0fc1e4e36267e273d6816db2f5e628 | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | Jordon-Chen/recipe-app-api | 8112102a8c0fc1e4e36267e273d6816db2f5e628 | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | Jordon-Chen/recipe-app-api | 8112102a8c0fc1e4e36267e273d6816db2f5e628 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2021-04-27 01:42
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredient'),
]
operations = [
migrations.CreateModel(
... | 35.965517 | 118 | 0.604027 |
4c6ec2bbbdd316b1fddba5923343ea90c9f27559 | 1,429 | py | Python | gesund_projekt/pomodoros/migrations/0004_remove_pomodoro_pomodoro_pomodoro_author_and_more.py | asis2016/gesund-projekt | cb3828b69cd6a86deeab16943e38b6ebffd86abb | [
"MIT"
] | null | null | null | gesund_projekt/pomodoros/migrations/0004_remove_pomodoro_pomodoro_pomodoro_author_and_more.py | asis2016/gesund-projekt | cb3828b69cd6a86deeab16943e38b6ebffd86abb | [
"MIT"
] | null | null | null | gesund_projekt/pomodoros/migrations/0004_remove_pomodoro_pomodoro_pomodoro_author_and_more.py | asis2016/gesund-projekt | cb3828b69cd6a86deeab16943e38b6ebffd86abb | [
"MIT"
] | null | null | null | # Generated by Django 4.0.1 on 2022-03-31 06:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('pomodoros', '0003_remove... | 30.404255 | 121 | 0.596921 |
aabe7606851b6d03e4aa25a532528f40ee60780e | 1,042 | py | Python | docs_src/custom_request_and_route/tutorial003.py | Aryabhata-Rootspring/fastapi | f6237ad05a8468ac19c591181adad38d75372c46 | [
"MIT"
] | 53,007 | 2018-12-08T10:05:29.000Z | 2022-03-31T23:30:02.000Z | docs_src/custom_request_and_route/tutorial003.py | Aryabhata-Rootspring/fastapi | f6237ad05a8468ac19c591181adad38d75372c46 | [
"MIT"
] | 4,155 | 2019-01-05T05:07:49.000Z | 2022-03-31T21:25:38.000Z | docs_src/custom_request_and_route/tutorial003.py | Aryabhata-Rootspring/fastapi | f6237ad05a8468ac19c591181adad38d75372c46 | [
"MIT"
] | 4,092 | 2018-12-09T16:21:00.000Z | 2022-03-31T07:59:45.000Z | import time
from typing import Callable
from fastapi import APIRouter, FastAPI, Request, Response
from fastapi.routing import APIRoute
class TimedRoute(APIRoute):
def get_route_handler(self) -> Callable:
original_route_handler = super().get_route_handler()
async def custom_route_handler(request:... | 26.05 | 70 | 0.666027 |
05af0c7e7016d3751a19a770c29a79212a1e37dd | 1,526 | py | Python | tests/test_websocket_notifications.py | systemallica/django-websocket-notifications | eae304b021eb14d818d3a1fa5dd18bf791eb4197 | [
"MIT"
] | null | null | null | tests/test_websocket_notifications.py | systemallica/django-websocket-notifications | eae304b021eb14d818d3a1fa5dd18bf791eb4197 | [
"MIT"
] | null | null | null | tests/test_websocket_notifications.py | systemallica/django-websocket-notifications | eae304b021eb14d818d3a1fa5dd18bf791eb4197 | [
"MIT"
] | null | null | null | from test_plus import APITestCase
from test_plus.test import TestCase, APITestCase
from tests.factories import UserFactory
from websocket_notifications.models import NotificationGroup
class NotificationGroupAPITest(APITestCase):
user_factory = UserFactory
def setUp(self):
self.user = self.make_user... | 33.173913 | 85 | 0.707077 |
17b07ca5fd01dc55a95b198e0fc0257ecd4e00fb | 5,374 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20191201/get_service_endpoint_policy_definition.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20191201/get_service_endpoint_policy_definition.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20191201/get_service_endpoint_policy_definition.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"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
from ... import _utilities, _tables
__a... | 40.406015 | 178 | 0.681243 |
68ec182b91750adda3830ffbfbe77aac76a0636b | 2,987 | py | Python | app/models.py | DuncanArani/TALANTA | acad80af95bff9c3531816185d24ce9c7a7ae827 | [
"MIT"
] | 1 | 2018-09-18T09:09:02.000Z | 2018-09-18T09:09:02.000Z | app/models.py | DuncanArani/TALANTA | acad80af95bff9c3531816185d24ce9c7a7ae827 | [
"MIT"
] | 3 | 2018-09-19T09:41:07.000Z | 2018-09-19T15:10:45.000Z | app/models.py | koyoo-maxwel/TALANTA | 8d6d3f47fbde3f6589382ce4be830345c51ac8cd | [
"MIT"
] | null | null | null | from . import db
from datetime import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin
from . import login_manager
class User(UserMixin, db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
username = db.Column... | 27.40367 | 107 | 0.68229 |
f6866631aa2e81323777661e7ad9afd898eadda6 | 1,781 | py | Python | pyoanda/tests/_test_integration/integration_test_case.py | toloco/pyoanda | 26b3f28a89d07c5c20d2a645884505387f1daae8 | [
"MIT"
] | 81 | 2015-03-18T23:02:33.000Z | 2021-07-13T15:00:14.000Z | pyoanda/tests/_test_integration/integration_test_case.py | toloco/pyoanda | 26b3f28a89d07c5c20d2a645884505387f1daae8 | [
"MIT"
] | 32 | 2015-04-18T22:04:00.000Z | 2019-02-28T00:58:39.000Z | pyoanda/tests/_test_integration/integration_test_case.py | toloco/pyoanda | 26b3f28a89d07c5c20d2a645884505387f1daae8 | [
"MIT"
] | 32 | 2015-04-06T16:42:07.000Z | 2018-02-13T19:06:19.000Z | from datetime import datetime, timedelta
try:
import unittest2 as unittest
except ImportError:
import unittest
from pyoanda import SANDBOX
from pyoanda.client import Client
from pyoanda.order import Order
class IntegrationTestCase(unittest.TestCase):
# Keep this as it will be share between all tests cas... | 30.706897 | 77 | 0.58731 |
9aa57af1c2bfdc06aee79c16628b45201552bcea | 661 | py | Python | tests/integrations/subprocess/test_json_parser.py | danyeaw/briefcase | fd9744e5b8dfc8a4c7606dc63cddfcda2dd00d78 | [
"BSD-3-Clause"
] | null | null | null | tests/integrations/subprocess/test_json_parser.py | danyeaw/briefcase | fd9744e5b8dfc8a4c7606dc63cddfcda2dd00d78 | [
"BSD-3-Clause"
] | null | null | null | tests/integrations/subprocess/test_json_parser.py | danyeaw/briefcase | fd9744e5b8dfc8a4c7606dc63cddfcda2dd00d78 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from briefcase.integrations.subprocess import ParseError, json_parser
@pytest.mark.parametrize(
"data, output",
[
('{"key": "value"}', {"key": "value"}),
(b'{"key": "value"}', {"key": "value"}),
]
)
def test_json_parser_success(data, output):
assert json_parser(data) == ... | 24.481481 | 76 | 0.612708 |
f7e9b92aacf79ad90f89cb9a8d6aed1a830d2540 | 291 | py | Python | oils/urls.py | ChristianJStarr/sbs-website | db891f0a67f46cc9cdadc95714304b2ea91a162a | [
"MIT"
] | 1 | 2022-01-09T18:54:32.000Z | 2022-01-09T18:54:32.000Z | oils/urls.py | ChristianJStarr/sbs-website | db891f0a67f46cc9cdadc95714304b2ea91a162a | [
"MIT"
] | null | null | null | oils/urls.py | ChristianJStarr/sbs-website | db891f0a67f46cc9cdadc95714304b2ea91a162a | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'oils'
urlpatterns = [
path('', views.all_patterns_views, name='patterns'),
path('<int:amount>/<int:offset>/', views.all_patterns_views, name='patterns'),
path('view/<id>/', views.single_pattern_views, name='view')
]
| 26.454545 | 82 | 0.690722 |
63e5026f952f8ea6be222fcca98eda84e91b67b2 | 2,683 | py | Python | src/urllib3/__init__.py | cjerdonek/urllib3 | 728d9244665ef5b03103cb74d7b409ebe4f23b43 | [
"MIT"
] | 553 | 2019-03-26T09:31:13.000Z | 2022-03-31T05:25:22.000Z | src/urllib3/__init__.py | cjerdonek/urllib3 | 728d9244665ef5b03103cb74d7b409ebe4f23b43 | [
"MIT"
] | 54 | 2015-12-14T12:51:51.000Z | 2019-03-08T07:40:11.000Z | src/urllib3/__init__.py | cjerdonek/urllib3 | 728d9244665ef5b03103cb74d7b409ebe4f23b43 | [
"MIT"
] | 56 | 2019-04-07T13:28:07.000Z | 2022-03-25T15:59:07.000Z | """
urllib3 - Thread-safe connection pooling and re-using.
"""
from __future__ import absolute_import
import warnings
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
from . import exceptions
from .filepost import encode_multipart_formdata
from .poolmanager import PoolManager, ... | 30.83908 | 88 | 0.758852 |
cc8dae771e621db4e71f760ad0deb4be7dd378b5 | 747 | py | Python | script/get_kernel_descriptor.py | SJTU-IPADS/reef-artifacts | 8750974f2d6655525a2cc317bf2471914fe68dab | [
"Apache-2.0"
] | 7 | 2022-03-23T07:04:20.000Z | 2022-03-30T02:44:42.000Z | script/get_kernel_descriptor.py | SJTU-IPADS/reef-artifacts | 8750974f2d6655525a2cc317bf2471914fe68dab | [
"Apache-2.0"
] | null | null | null | script/get_kernel_descriptor.py | SJTU-IPADS/reef-artifacts | 8750974f2d6655525a2cc317bf2471914fe68dab | [
"Apache-2.0"
] | null | null | null | import sys
import json
f = open(sys.argv[1], "r")
lines = f.readlines()
descriptors = {}
is_descriptor = False
for line in lines:
if line.find(".amdhsa_kernel ") != -1:
is_descriptor = True
continue
if line.find(".end_amdhsa_kernel") != -1:
is_descriptor = False
continue
... | 19.657895 | 56 | 0.582329 |
f9e70e4315b0a7169fe091ed0c5cca33f3a289cb | 1,758 | py | Python | python/nrzs_encode.py | artemies/gr-kiss | 2e0d74ac91976ce0bfdc9ffff2d84146f333ede9 | [
"Unlicense"
] | null | null | null | python/nrzs_encode.py | artemies/gr-kiss | 2e0d74ac91976ce0bfdc9ffff2d84146f333ede9 | [
"Unlicense"
] | null | null | null | python/nrzs_encode.py | artemies/gr-kiss | 2e0d74ac91976ce0bfdc9ffff2d84146f333ede9 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016 Daniel Estevez <daniel@destevez.net>.
#
# 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 witho... | 35.16 | 80 | 0.692264 |
18d42d30af43a68fb2d60dce41b80e66e85310a5 | 4,960 | py | Python | juniper_official/Solutions/CGNAT/cgnat_multirow.py | vvikramb/healthbot-rules | 72bdad144bebb512e9ac32d607b5924d96225334 | [
"Apache-2.0",
"BSD-3-Clause"
] | 43 | 2018-11-27T00:42:45.000Z | 2022-02-24T01:19:39.000Z | juniper_official/Solutions/CGNAT/cgnat_multirow.py | vvikramb/healthbot-rules | 72bdad144bebb512e9ac32d607b5924d96225334 | [
"Apache-2.0",
"BSD-3-Clause"
] | 266 | 2018-10-26T10:19:04.000Z | 2022-03-16T04:38:29.000Z | juniper_official/Solutions/CGNAT/cgnat_multirow.py | vvikramb/healthbot-rules | 72bdad144bebb512e9ac32d607b5924d96225334 | [
"Apache-2.0",
"BSD-3-Clause"
] | 99 | 2018-10-25T09:53:55.000Z | 2021-12-07T09:51:59.000Z | #!/usr/bin/env python3
from __future__ import print_function, division
import requests, sys
from pprint import pprint as pp
from tand_udf import MultiRows
def get_ifl_stats(**kwargs):
print(kwargs, file=sys.stderr)
# Define and query influxdb
dg = (kwargs['device_group'])
did = (kwargs['device_id'])
... | 34.929577 | 102 | 0.656048 |
c5e53fe2b14ab8febb26cacc3873e784a6c16fd6 | 166 | py | Python | parser/fase2/team19/Analisis_Ascendente/Instrucciones/PLPGSQL/SelectCount.py | Yosoyfr/tytus | 0df7e656835a93458462e476f7ab858a33baa2e0 | [
"MIT"
] | null | null | null | parser/fase2/team19/Analisis_Ascendente/Instrucciones/PLPGSQL/SelectCount.py | Yosoyfr/tytus | 0df7e656835a93458462e476f7ab858a33baa2e0 | [
"MIT"
] | null | null | null | parser/fase2/team19/Analisis_Ascendente/Instrucciones/PLPGSQL/SelectCount.py | Yosoyfr/tytus | 0df7e656835a93458462e476f7ab858a33baa2e0 | [
"MIT"
] | 4 | 2020-12-19T17:12:13.000Z | 2021-01-07T20:29:53.000Z | from Analisis_Ascendente.Instrucciones.instruccion import Instruccion
class SelectCount(Instruccion):
def __init__(self,idtabla):
self.idtabla = idtabla
| 27.666667 | 69 | 0.789157 |
57d9d5a7a27aa2cd1e078083bab5f906bc4d365f | 2,111 | py | Python | solidity/python/PerformanceUniTestCrossConnector.py | frankwei98/contracts | 18fa00ec598058459d96950523c3fc23d2c00bd6 | [
"Apache-2.0"
] | 13 | 2018-09-18T09:55:27.000Z | 2021-01-07T02:35:08.000Z | solidity/python/PerformanceUniTestCrossConnector.py | frankwei98/contracts | 18fa00ec598058459d96950523c3fc23d2c00bd6 | [
"Apache-2.0"
] | 47 | 2019-02-13T06:25:37.000Z | 2021-07-30T05:23:44.000Z | solidity/python/PerformanceUniTestCrossConnector.py | frankwei98/contracts | 18fa00ec598058459d96950523c3fc23d2c00bd6 | [
"Apache-2.0"
] | 12 | 2018-09-05T07:13:33.000Z | 2019-05-28T09:53:06.000Z | import Web3Wrapper
import InputGenerator
MINIMUM_VALUE_BALANCE = 100
MAXIMUM_VALUE_BALANCE = 10 ** 34
SAMPLES_COUNT_BALANCE = 50
MINIMUM_VALUE_WEIGHT = 100000
MAXIMUM_VALUE_WEIGHT = 900000
SAMPLES_COUNT_WEIGHT = 10
MINIMUM_VALUE_AMOUNT = 1
MAXIMUM_VALUE_AMOUNT = 10 ** 34
SAMPLES_COUNT_AMOUNT = 50
def Main():
... | 39.830189 | 181 | 0.63856 |
19b8162782b34a8c06d00967e7b59d5f0c456294 | 5,195 | py | Python | sdk/python/pulumi_azure_nextgen/peering/v20190801preview/get_peering_service_prefix.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/peering/v20190801preview/get_peering_service_prefix.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/peering/v20190801preview/get_peering_service_prefix.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # 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
from ... import _utilities, _tables
__a... | 35.340136 | 163 | 0.653705 |
0a80d3e297967a547ec821610e2656df1758d14b | 3,155 | py | Python | recordwhat/records/sub.py | mrakitin/recordwhat | c68b8fca69836bdba0075726e829325f2c8918a8 | [
"BSD-3-Clause"
] | 1 | 2016-06-08T15:14:15.000Z | 2016-06-08T15:14:15.000Z | recordwhat/records/sub.py | mrakitin/recordwhat | c68b8fca69836bdba0075726e829325f2c8918a8 | [
"BSD-3-Clause"
] | 12 | 2016-02-11T15:01:05.000Z | 2019-09-23T17:28:32.000Z | recordwhat/records/sub.py | mrakitin/recordwhat | c68b8fca69836bdba0075726e829325f2c8918a8 | [
"BSD-3-Clause"
] | 4 | 2016-06-08T15:03:07.000Z | 2019-09-23T17:05:38.000Z | from ophyd import (EpicsSignal, EpicsSignalRO)
from .. import (RecordBase, _register_record_type,
FieldComponent as Cpt)
@_register_record_type('sub')
class SubRecord(RecordBase):
alarm_status = Cpt(EpicsSignalRO, '.STAT')
last_value_alarmed = Cpt(EpicsSignalRO, '.LALM')
last_value_archiv... | 42.066667 | 65 | 0.67607 |
5ab2bf6d834de300b12416a1835f6f0ef63b57e2 | 2,808 | py | Python | ftl/python/builder_test.py | JonathanRRogers/runtimes-common | 6b69050bed4389763ddff8e1b9ec48f12ac32fc5 | [
"Apache-2.0"
] | 95 | 2016-09-09T23:36:36.000Z | 2022-03-05T20:06:00.000Z | ftl/python/builder_test.py | JonathanRRogers/runtimes-common | 6b69050bed4389763ddff8e1b9ec48f12ac32fc5 | [
"Apache-2.0"
] | 392 | 2016-09-13T15:15:57.000Z | 2022-02-22T01:18:23.000Z | ftl/python/builder_test.py | JonathanRRogers/runtimes-common | 6b69050bed4389763ddff8e1b9ec48f12ac32fc5 | [
"Apache-2.0"
] | 73 | 2016-09-08T19:27:03.000Z | 2021-07-08T13:28:18.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 33.428571 | 79 | 0.707621 |
f019dbcb74131fa21f7a2b53431b0d9dfb5d2a80 | 7,163 | py | Python | kratos/python_scripts/KratosUnittest.py | lcirrott/Kratos | 8406e73e0ad214c4f89df4e75e9b29d0eb4a47ea | [
"BSD-4-Clause"
] | null | null | null | kratos/python_scripts/KratosUnittest.py | lcirrott/Kratos | 8406e73e0ad214c4f89df4e75e9b29d0eb4a47ea | [
"BSD-4-Clause"
] | null | null | null | kratos/python_scripts/KratosUnittest.py | lcirrott/Kratos | 8406e73e0ad214c4f89df4e75e9b29d0eb4a47ea | [
"BSD-4-Clause"
] | null | null | null | from __future__ import print_function, absolute_import, division
from KratosMultiphysics import Logger
from unittest import * # needed to make all functions available to the tests using this file
from unittest.util import safe_repr
from contextlib import contextmanager
import getopt
import sys
import os
class TestL... | 30.480851 | 132 | 0.577132 |
9a77b743492a5b0462b6a672622e363175742ea5 | 3,070 | py | Python | projects/Deploying-a-Sentiment-Analysis-Model/serve/predict.py | gmendozah/deep-learning-with-pytorch | c46d68854722e029569654b1a3ef550871e7cfa3 | [
"MIT"
] | null | null | null | projects/Deploying-a-Sentiment-Analysis-Model/serve/predict.py | gmendozah/deep-learning-with-pytorch | c46d68854722e029569654b1a3ef550871e7cfa3 | [
"MIT"
] | null | null | null | projects/Deploying-a-Sentiment-Analysis-Model/serve/predict.py | gmendozah/deep-learning-with-pytorch | c46d68854722e029569654b1a3ef550871e7cfa3 | [
"MIT"
] | null | null | null | import argparse
import json
import os
import pickle
import sys
import sagemaker_containers
import pandas as pd
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data
from model import LSTMClassifier
from utils import review_to_words, convert_and_pad
def model_fn(mod... | 33.369565 | 107 | 0.702606 |
d7611a8db2284db3579879cecef39692063829a8 | 3,224 | py | Python | script/polldb.py | sensfre/CabinetApproval | 209b6ba9d34cbc47b4468be272d51956988dce30 | [
"MIT"
] | null | null | null | script/polldb.py | sensfre/CabinetApproval | 209b6ba9d34cbc47b4468be272d51956988dce30 | [
"MIT"
] | 6 | 2020-02-24T07:01:38.000Z | 2020-06-13T23:30:07.000Z | script/polldb.py | sensfre/CabinetApproval | 209b6ba9d34cbc47b4468be272d51956988dce30 | [
"MIT"
] | null | null | null | """polldb.py
"""
import os
from datetime import datetime, timedelta
import numpy as np
from scipy.interpolate import interp1d
import fileio
def interp(xx, yy):
# 範囲外で返す fill_value を有効にするには、
# bounds_error を設定する必要がある。
return interp1d(xx, yy, fill_value=(yy[0], yy[-1]), bounds_error=False)
def t_max(pp)... | 26 | 89 | 0.531638 |
edb57071abf99966e94c8656b25342e67f2f5f6c | 4,201 | py | Python | src/make_windows.py | HLasse/wav2vec_finetune | 084ab432ba4acbf5ce81267e2791fb36a0b70daa | [
"MIT"
] | 6 | 2021-09-10T08:18:07.000Z | 2022-01-11T16:34:48.000Z | src/make_windows.py | HLasse/wav2vec_finetune | 084ab432ba4acbf5ce81267e2791fb36a0b70daa | [
"MIT"
] | null | null | null | src/make_windows.py | HLasse/wav2vec_finetune | 084ab432ba4acbf5ce81267e2791fb36a0b70daa | [
"MIT"
] | 3 | 2021-09-10T09:46:17.000Z | 2021-10-31T08:40:37.000Z | import numpy as np
import math
sig = np.arange(0, 20)
sampling_rate = 1
frame_length = 5
frame_stride = 2
zero_padding = True
def stack_frames(
sig,
sampling_rate,
frame_length,
frame_stride,
filter=lambda x: np.ones(
(x,
)),
zero_padding=True,
... | 37.846847 | 180 | 0.615092 |
d5483f6c3b8735de73e2cf7a51c8f3b3f2da50c9 | 611 | py | Python | Binary Search/878. Nth Magical Number.py | Into-Y0u/Github-Baby | 5e4e6b02f49c2c99533289be9d49911006cad919 | [
"MIT"
] | 2 | 2022-01-25T04:30:26.000Z | 2022-01-25T10:36:15.000Z | Binary Search/878. Nth Magical Number.py | Into-Y0u/Leetcode-Baby | 681ad4df01ee908f76d888aa4ccc10f04c03c56f | [
"MIT"
] | null | null | null | Binary Search/878. Nth Magical Number.py | Into-Y0u/Leetcode-Baby | 681ad4df01ee908f76d888aa4ccc10f04c03c56f | [
"MIT"
] | null | null | null | class Solution:
def nthMagicalNumber(self, n: int, a: int, b: int) -> int:
def gcd(a,b):
if a==0 :
return b
return gcd(b%a,a)
def lcm(a,b):
return (a*b) // gcd(a,b)
left,right = 1 , n*min(a,b)
ans = 0
while... | 26.565217 | 62 | 0.361702 |
bdf0f4975d721f61ae1228fddb8413d6f6161698 | 1,200 | py | Python | airflow/operators/python_operator.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 5 | 2020-07-17T07:33:58.000Z | 2022-03-02T06:23:47.000Z | airflow/operators/python_operator.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 7 | 2020-06-03T14:55:17.000Z | 2021-12-30T00:01:50.000Z | airflow/operators/python_operator.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 12 | 2020-01-09T14:02:39.000Z | 2022-01-24T07:18:51.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 37.5 | 89 | 0.764167 |
f26a6115ab5ab6f17c27cc58d388d45f1bcd86b6 | 4,507 | py | Python | src/python/zensols/deeplearn/batch/meta.py | plandes/deeplearn | 925f02200c62a7dc798e474ed94a86e009fd1ebf | [
"MIT"
] | 2 | 2021-04-30T17:19:14.000Z | 2021-05-04T03:48:59.000Z | src/python/zensols/deeplearn/batch/meta.py | plandes/deeplearn | 925f02200c62a7dc798e474ed94a86e009fd1ebf | [
"MIT"
] | null | null | null | src/python/zensols/deeplearn/batch/meta.py | plandes/deeplearn | 925f02200c62a7dc798e474ed94a86e009fd1ebf | [
"MIT"
] | null | null | null | """Contains container classes for batch data.
"""
__author__ = 'Paul Landes'
from typing import Dict, Type
from dataclasses import dataclass
from dataclasses import field as dc_field
import sys
from io import TextIOBase
from zensols.config import Dictable
from zensols.persist import persisted, PersistableContainer
fr... | 33.887218 | 83 | 0.6785 |
4e4b4b3ec7cc6743f7806a3acaea16d10889c635 | 1,211 | py | Python | localflavor/generic/countries/sepa.py | torakses/django-localflavor | 17ca87095d6f8c3f3888016085a2edb5951889f4 | [
"BSD-3-Clause"
] | 1 | 2022-01-31T11:12:03.000Z | 2022-01-31T11:12:03.000Z | localflavor/generic/countries/sepa.py | torakses/django-localflavor | 17ca87095d6f8c3f3888016085a2edb5951889f4 | [
"BSD-3-Clause"
] | 2 | 2021-04-22T09:02:20.000Z | 2021-09-20T09:23:45.000Z | localflavor/generic/countries/sepa.py | torakses/django-localflavor | 17ca87095d6f8c3f3888016085a2edb5951889f4 | [
"BSD-3-Clause"
] | 1 | 2021-02-05T09:42:52.000Z | 2021-02-05T09:42:52.000Z | # -*- coding: utf-8 -*-
#: European Payments Council list of SEPA scheme countries as of 2 Sep 2015.
#: http://www.europeanpaymentscouncil.eu/index.cfm/knowledge-bank/epc-documents/epc-list-of-sepa-scheme-countries/
IBAN_SEPA_COUNTRIES = (
'AT', # Austria
'BE', # Belgium
'BG', # Bulgaria
'CH', # Sw... | 28.162791 | 114 | 0.548307 |
f0cf4d5700f5caf57b03dc914312e74354a176bf | 34,744 | py | Python | netharn/util/util_slider.py | angiemsu/netharn | 728cb40aad299baf62c689430d07b29c67d8cf21 | [
"Apache-2.0"
] | null | null | null | netharn/util/util_slider.py | angiemsu/netharn | 728cb40aad299baf62c689430d07b29c67d8cf21 | [
"Apache-2.0"
] | null | null | null | netharn/util/util_slider.py | angiemsu/netharn | 728cb40aad299baf62c689430d07b29c67d8cf21 | [
"Apache-2.0"
] | null | null | null | import ubelt as ub # NOQA
import cv2
import numpy as np
import netharn as nh
import torch
import torch.utils.data as torch_data
import itertools as it
class SlidingWindow(ub.NiceRepr):
"""
Generates basis for "sliding window" slices to break a large image into
smaller pieces. Use it.product to slide acro... | 40.636257 | 92 | 0.557391 |
f219e590daf56ae1b1dd62ba2b91aa2f47e9d461 | 51,255 | py | Python | tensorflow/python/keras/engine/functional.py | Mithilesh1609/tensorflow | 63f70b5611d7f50512ea26295d26016c2704901b | [
"Apache-2.0"
] | 2 | 2020-06-16T22:01:14.000Z | 2020-06-20T10:10:26.000Z | tensorflow/python/keras/engine/functional.py | 3ecurityy/tensorflow | f8c0e68a8aa5d575a19129ec67c9ed6262652082 | [
"Apache-2.0"
] | 203 | 2019-06-14T23:53:10.000Z | 2022-02-10T02:27:23.000Z | tensorflow/python/keras/engine/functional.py | 3ecurityy/tensorflow | f8c0e68a8aa5d575a19129ec67c9ed6262652082 | [
"Apache-2.0"
] | 1 | 2020-05-19T23:48:24.000Z | 2020-05-19T23:48:24.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.01171 | 120 | 0.700478 |
0d2e4d029636577adc74784d9a8b3494b94dc67d | 7,565 | py | Python | tensorflow/compiler/tests/adam_test.py | awan-10/tensorflow | 9d8b58a8074a5bdc152cd5a2a9260ccb72eaef90 | [
"Apache-2.0"
] | 5 | 2018-10-20T03:54:49.000Z | 2021-01-02T07:19:53.000Z | tensorflow/compiler/tests/adam_test.py | liufengdb/tensorflow | 51100a8de57ef53e36a8a9f5a9829cbd33fbed04 | [
"Apache-2.0"
] | null | null | null | tensorflow/compiler/tests/adam_test.py | liufengdb/tensorflow | 51100a8de57ef53e36a8a9f5a9829cbd33fbed04 | [
"Apache-2.0"
] | 2 | 2019-02-07T15:33:54.000Z | 2019-03-29T17:44:31.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.672043 | 80 | 0.648249 |
588b7750ae37357dc41aff94901a13379845a549 | 267 | py | Python | exercises/11_Matrix_games/.ipynb_checkpoints/problem_instances-checkpoint.py | kiwomuc/optimization-for-DS-lecture | 43ea50ef85f73b5bbc7659e8c457218ae136bb94 | [
"CC0-1.0"
] | 5 | 2021-10-03T14:40:28.000Z | 2022-01-20T15:34:36.000Z | exercises/11_Matrix_games/.ipynb_checkpoints/problem_instances-checkpoint.py | kiwomuc/optimization-for-DS-lecture | 43ea50ef85f73b5bbc7659e8c457218ae136bb94 | [
"CC0-1.0"
] | 10 | 2021-10-21T13:02:40.000Z | 2022-02-06T19:50:32.000Z | exercises/11_Matrix_games/.ipynb_checkpoints/problem_instances-checkpoint.py | kiwomuc/optimization-for-DS-lecture | 43ea50ef85f73b5bbc7659e8c457218ae136bb94 | [
"CC0-1.0"
] | 12 | 2021-10-05T21:47:52.000Z | 2022-02-04T15:38:30.000Z | import numpy as np
def policeman_and_burglar_matrix(n, th=0.8):
w = np.abs(np.random.randn(n))
th = 0.8
C = np.empty((n, n))
for i in range(n):
for j in range(n):
C[i,j] = np.abs(i-j)
A = w * (1 - np.exp(-th * C))
return A | 24.272727 | 44 | 0.513109 |
b8c4806999d77e838f7310c6b9cf61d1e19590dc | 734 | py | Python | Artificial Intelligence/Bot Building/BotClean/Solution.py | RaulButuc/SolvedProblemsArchive | df8695127f2204c4924e6ca0f14bcf362376bfa7 | [
"MIT"
] | 14 | 2017-02-09T12:54:37.000Z | 2020-07-08T00:23:13.000Z | Artificial Intelligence/Bot Building/BotClean/Solution.py | RaulButuc/SolvedProblemsArchive | df8695127f2204c4924e6ca0f14bcf362376bfa7 | [
"MIT"
] | null | null | null | Artificial Intelligence/Bot Building/BotClean/Solution.py | RaulButuc/SolvedProblemsArchive | df8695127f2204c4924e6ca0f14bcf362376bfa7 | [
"MIT"
] | 5 | 2020-02-22T20:55:21.000Z | 2020-07-08T00:19:51.000Z | #!/usr/bin/python
def manhattan_dist(x1, y1, x2, y2):
return (abs(x1 - x2) + abs(y1 - y2), x2, y2)
def next_move(x, y, board, dirty):
dist = [manhattan_dist(x, y, d[0], d[1]) for d in dirty]
dist.sort()
dx = dist[0][1]
dy = dist[0][2]
if x == dx and y == dy:
print "CLEAN"
elif x < ... | 27.185185 | 78 | 0.523161 |
c67413f7d39f02fa8d7fcca67ff0e8cdd94cf247 | 31,329 | py | Python | cloudshell/snmp/mibs/SNMPv2-MIB.py | QualiSystems/cloudshell-snmp | 9f8c4a927997d69cf85cac2a9bb1c36952d62d99 | [
"Apache-2.0"
] | null | null | null | cloudshell/snmp/mibs/SNMPv2-MIB.py | QualiSystems/cloudshell-snmp | 9f8c4a927997d69cf85cac2a9bb1c36952d62d99 | [
"Apache-2.0"
] | 36 | 2016-05-13T08:42:13.000Z | 2021-07-07T13:53:23.000Z | cloudshell/snmp/mibs/SNMPv2-MIB.py | QualiSystems/cloudshell-snmp | 9f8c4a927997d69cf85cac2a9bb1c36952d62d99 | [
"Apache-2.0"
] | 5 | 2016-08-05T17:49:21.000Z | 2019-05-28T03:27:22.000Z | #
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pysnmp.sf.net/license.html
#
# PySNMP MIB module SNMPv2-MIB (http://pysnmp.sf.net)
# ASN.1 source http://mibs.snmplabs.com:80/asn1/SNMPv2-MIB
# Produced by pysmi-0.1.3 at Tue Apr 18 00:52:45 2017
# ... | 152.82439 | 2,264 | 0.787705 |
37046dc4b6b37ad802ca46e76bbdba1813cd77c5 | 5,127 | py | Python | mars/tensor/expressions/lib/index_tricks.py | pingrunhuang/mars | ae920c374e9844d7426d0cc09c0d97059dc5341c | [
"Apache-2.0"
] | 1 | 2019-09-22T16:00:48.000Z | 2019-09-22T16:00:48.000Z | mars/tensor/expressions/lib/index_tricks.py | turboFei/mars | cde691285d921add5460944764c7278e7ddec8ff | [
"Apache-2.0"
] | null | null | null | mars/tensor/expressions/lib/index_tricks.py | turboFei/mars | cde691285d921add5460944764c7278e7ddec8ff | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# 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-... | 32.04375 | 79 | 0.50868 |
2ae92f194d6333af24855367620993f48d11df97 | 1,943 | py | Python | tests/test_is_ip_v4.py | alvistack/daveoncode-python-string-utils | 78929d88d90b1f90cb4837528ed955166bf0f559 | [
"MIT"
] | 3 | 2020-08-20T10:27:13.000Z | 2021-11-02T20:28:16.000Z | tests/test_is_ip_v4.py | alvistack/daveoncode-python-string-utils | 78929d88d90b1f90cb4837528ed955166bf0f559 | [
"MIT"
] | null | null | null | tests/test_is_ip_v4.py | alvistack/daveoncode-python-string-utils | 78929d88d90b1f90cb4837528ed955166bf0f559 | [
"MIT"
] | null | null | null | from unittest import TestCase
from string_utils import is_ip_v4
class IsIpV4TestCase(TestCase):
def test_return_false_for_non_string_objects(self):
# noinspection PyTypeChecker
self.assertFalse(is_ip_v4(None))
# noinspection PyTypeChecker
self.assertFalse(is_ip_v4(1))
# ... | 34.087719 | 69 | 0.670612 |
328c635251adb6622ce01ce8aa17f72e4ece2a55 | 2,755 | py | Python | Decorator/index.py | edgardeng/design-patterns-in-python | 3b18fa8eabf2f8bc20c20103cc837ea90606c2d9 | [
"MIT"
] | null | null | null | Decorator/index.py | edgardeng/design-patterns-in-python | 3b18fa8eabf2f8bc20c20103cc837ea90606c2d9 | [
"MIT"
] | null | null | null | Decorator/index.py | edgardeng/design-patterns-in-python | 3b18fa8eabf2f8bc20c20103cc837ea90606c2d9 | [
"MIT"
] | null | null | null | class Component():
"""
The base Component interface defines operations that can be altered by
decorators.
"""
def operation(self) -> str:
pass
class ConcreteComponent(Component):
"""
Concrete Components provide default implementations of the operations. There
might be several ... | 27.55 | 80 | 0.673321 |
1f776c7718e625b2898c3b050cbc547bd02696c3 | 9,022 | py | Python | examples/swap.py | dpinte/pyql | 9e5b272947b269ee07c7741d05d21675983d69b4 | [
"BSD-3-Clause"
] | null | null | null | examples/swap.py | dpinte/pyql | 9e5b272947b269ee07c7741d05d21675983d69b4 | [
"BSD-3-Clause"
] | null | null | null | examples/swap.py | dpinte/pyql | 9e5b272947b269ee07c7741d05d21675983d69b4 | [
"BSD-3-Clause"
] | null | null | null | """ Port of the swap example of QuantLib SWIG to PyQL.
Warning: this is work in progress and currently not working.
"""
from quantlib.indexes.euribor import Euribor6M
from quantlib.pricingengines.swap import DiscountingSwapEngine
from quantlib.settings import Settings
from quantlib.quotes import SimpleQuote
from quant... | 32.336918 | 80 | 0.66759 |
3f0c03ab7437ce427da0dcd17ab85784b2641d3c | 3,302 | py | Python | virtparade/utils/strings.py | major1201/virtparade | a8fd18ea7c676317b71b748367694108b0984217 | [
"MIT"
] | 2 | 2019-01-29T20:48:12.000Z | 2020-06-03T12:58:28.000Z | virtparade/utils/strings.py | major1201/virtparade | a8fd18ea7c676317b71b748367694108b0984217 | [
"MIT"
] | null | null | null | virtparade/utils/strings.py | major1201/virtparade | a8fd18ea7c676317b71b748367694108b0984217 | [
"MIT"
] | null | null | null | # encoding= utf-8
from __future__ import division, absolute_import, with_statement, print_function
import string
import random
REG_IP = "^(([2][5][0-5]|[2][0-4][0-9]|[1][0-9]{2}|[1-9][0-9]|[0-9])[.]){3}([2][5][0-5]|[2][0-4][0-9]|[1][0-9]{2}|[1-9][0-9]|[0-9])$"
REG_DOMAIN = "^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9]... | 23.927536 | 133 | 0.589945 |
be427ab3ebef27e214830bf1c7fcc509daa57c08 | 45,819 | py | Python | NotionDump/Parser/base_parser.py | delta1037/notion-dump-kernel | 162fe2b72f9d4e571407a4dbe1f3c90b3c40fd5d | [
"MIT"
] | 8 | 2022-01-12T09:21:33.000Z | 2022-02-22T18:40:50.000Z | NotionDump/Parser/base_parser.py | delta1037/notion-dump-kernel | 162fe2b72f9d4e571407a4dbe1f3c90b3c40fd5d | [
"MIT"
] | 16 | 2022-01-11T12:01:33.000Z | 2022-03-02T12:09:31.000Z | NotionDump/Parser/base_parser.py | delta1037/notion-dump-kernel | 162fe2b72f9d4e571407a4dbe1f3c90b3c40fd5d | [
"MIT"
] | null | null | null | # author: delta1037
# Date: 2022/01/08
# mail:geniusrabbit@qq.com
import copy
import NotionDump
from NotionDump.utils import content_format, common_op
from NotionDump.utils import internal_var
from urllib.parse import unquote
from NotionDump.utils.content_format import color_transformer, color_transformer_db, format_d... | 44.657895 | 155 | 0.592789 |
17ab7f450cd32852f0e466a7ba7d00b3e1a0fa3a | 236 | py | Python | src/radish/parser/__init__.py | radish-bdd/radish2 | 4ea71291aac8700ec2b284b7f2bbf79bf2970324 | [
"MIT"
] | 182 | 2015-06-27T16:17:17.000Z | 2022-03-19T11:49:10.000Z | src/radish/parser/__init__.py | radish-bdd/radish2 | 4ea71291aac8700ec2b284b7f2bbf79bf2970324 | [
"MIT"
] | 357 | 2015-11-06T19:30:19.000Z | 2022-03-28T19:49:04.000Z | src/radish/parser/__init__.py | radish-bdd/radish2 | 4ea71291aac8700ec2b284b7f2bbf79bf2970324 | [
"MIT"
] | 52 | 2015-08-22T08:36:37.000Z | 2022-03-01T06:04:06.000Z | """
radish
~~~~~~
the root from red to green. BDD tooling for Python.
:copyright: (c) 2019 by Timo Furrer <tuxtimo@gmail.com>
:license: MIT, see LICENSE for more details.
"""
from radish.parser.core import FeatureFileParser # noqa
| 19.666667 | 56 | 0.711864 |
07bf23f579e8188558c5149156d25d1ca5f47132 | 298 | py | Python | demo_app/demo_app/urls.py | Visgean/django-session-activity | 470cd6468c69249ff066bf65cfda6795e05c34f7 | [
"MIT"
] | 2 | 2017-12-28T02:51:44.000Z | 2018-11-19T16:02:13.000Z | demo_app/demo_app/urls.py | Visgean/django-session-activity | 470cd6468c69249ff066bf65cfda6795e05c34f7 | [
"MIT"
] | 1 | 2017-06-14T15:25:26.000Z | 2017-06-14T15:25:26.000Z | demo_app/demo_app/urls.py | Visgean/django-session-activity | 470cd6468c69249ff066bf65cfda6795e05c34f7 | [
"MIT"
] | 3 | 2017-12-28T02:51:52.000Z | 2019-12-12T14:25:55.000Z | from django.conf.urls import url, include
from django.contrib import admin
from session_log import urls as session_urls
from simple_login import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r"^login/$", views.SimpleLogin.as_view()),
url(r"^", include(session_urls)),
]
| 24.833333 | 50 | 0.724832 |
9b996ebd6f9bce516e26a3b6014a8c92f8167218 | 2,271 | py | Python | sgains/commands/tests/test_mappable_regions_command.py | seqpipe/sgains | 70a0e2b4087f7d4ac8db98f3e478f1ad36c2581b | [
"MIT"
] | null | null | null | sgains/commands/tests/test_mappable_regions_command.py | seqpipe/sgains | 70a0e2b4087f7d4ac8db98f3e478f1ad36c2581b | [
"MIT"
] | null | null | null | sgains/commands/tests/test_mappable_regions_command.py | seqpipe/sgains | 70a0e2b4087f7d4ac8db98f3e478f1ad36c2581b | [
"MIT"
] | null | null | null | '''
Created on Aug 2, 2017
@author: lubo
'''
def test_mappable_regions_long(
argparser, tests_config, mappable_regions_command, mocker):
mappable_regions_command.add_options(tests_config)
argv = [
"--dry-run", "--force",
"--config", "tests/data/scpipe_tests.yml",
"mappable-re... | 29.493506 | 75 | 0.607662 |
6f074ab310d7e569443a022b41b1b0eef8f66580 | 10,242 | py | Python | api/ccxt-master/python/ccxt/async/__init__.py | EdgarSargsyan/post | da26b98f4e68df5510fa0603645b1c1c6633f058 | [
"MIT"
] | null | null | null | api/ccxt-master/python/ccxt/async/__init__.py | EdgarSargsyan/post | da26b98f4e68df5510fa0603645b1c1c6633f058 | [
"MIT"
] | null | null | null | api/ccxt-master/python/ccxt/async/__init__.py | EdgarSargsyan/post | da26b98f4e68df5510fa0603645b1c1c6633f058 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""CCXT: CryptoCurrency eXchange Trading Library (Async)"""
# -----------------------------------------------------------------------------
__version__ = '1.10.502'
# -----------------------------------------------------------------------------
from ccxt.async.base.exchange import Exchange ... | 45.118943 | 79 | 0.517965 |
d766a7099e7c62e83262ad0bac818d3752161d0a | 20,760 | py | Python | source/preprocessing.py | TMarquet/speech_recognition | 06cf66b89e706306d676e127126d525bd18588f0 | [
"CC-BY-4.0"
] | null | null | null | source/preprocessing.py | TMarquet/speech_recognition | 06cf66b89e706306d676e127126d525bd18588f0 | [
"CC-BY-4.0"
] | null | null | null | source/preprocessing.py | TMarquet/speech_recognition | 06cf66b89e706306d676e127126d525bd18588f0 | [
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 4 16:19:20 2020
@author: kahg8
"""
import os
# Helper libraries
import numpy as np
import time
from scipy.io import wavfile
import sys
import random
from python_speech_features import mfcc,ssc
from tensorflow.keras.models import load_model
labels = ["yes", "no", "up", ... | 37.676951 | 141 | 0.55843 |
043311f3b67d002217d28e31319a91c53d7c252b | 18,417 | py | Python | rasa/nlu/training_data/training_data.py | harada4atsushi/rasa | c6de93d9b4cd8343529f8f54853b861bee695a0b | [
"Apache-2.0"
] | 1 | 2020-07-20T16:29:56.000Z | 2020-07-20T16:29:56.000Z | rasa/nlu/training_data/training_data.py | DomAmato/rasa | b1bdd5faef79fb8de7022e614d5f58e85f505b4d | [
"Apache-2.0"
] | 14 | 2020-06-10T00:28:01.000Z | 2020-10-28T01:04:36.000Z | rasa/nlu/training_data/training_data.py | DomAmato/rasa | b1bdd5faef79fb8de7022e614d5f58e85f505b4d | [
"Apache-2.0"
] | null | null | null | import logging
import os
import random
from collections import Counter, OrderedDict
from copy import deepcopy
from os.path import relpath
from typing import Any, Dict, List, Optional, Set, Text, Tuple, Callable
import rasa.nlu.utils
from rasa.utils.common import raise_warning, lazy_property
from rasa.nlu.constants imp... | 36.397233 | 88 | 0.623554 |
b6f6bd3b44cd15e9d9f8735511dfe400ee16b25f | 1,048 | py | Python | pipeline/handlers.py | sphoebs/rockshell | a28297b2a3837e63ac7970344a598e51b0c298bc | [
"Apache-2.0"
] | 1 | 2016-01-22T08:21:15.000Z | 2016-01-22T08:21:15.000Z | src/lib/pipeline/handlers.py | Eforcers/inbox-cleaner | bbb516606cff4142ef355691d137e9ac4d2192e3 | [
"BSD-2-Clause",
"MIT",
"MIT-0",
"CC-BY-3.0",
"BSD-3-Clause"
] | 2 | 2019-01-13T22:47:08.000Z | 2019-02-03T08:02:57.000Z | src/pipeline/handlers.py | svn2github/appengine-pipeline | 103c2125aca95676faf8cf567355ce03d1d11466 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2.5
#
# Copyright 2010 Google 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... | 26.871795 | 80 | 0.765267 |
39f3714dc821406515f9a39781bb71324d5e9b2e | 703 | py | Python | src/convert_presidents.py | sjml/incumbency | 3fe98ad7dae54857304a90c2e5a7d6be9cf9b32c | [
"MIT"
] | 1 | 2020-03-02T00:38:42.000Z | 2020-03-02T00:38:42.000Z | src/convert_presidents.py | sjml/incumbency | 3fe98ad7dae54857304a90c2e5a7d6be9cf9b32c | [
"MIT"
] | null | null | null | src/convert_presidents.py | sjml/incumbency | 3fe98ad7dae54857304a90c2e5a7d6be9cf9b32c | [
"MIT"
] | null | null | null | import os
import shutil
import subprocess
os.chdir(os.path.dirname(os.path.abspath(__file__)))
GOV_PATH = "../data/raw/david_leip/Pres Election Data (xls)"
OUTPUT_PATH = "../data/interim/president_data"
# requires libreoffice to be installed :-/
if not os.path.exists(OUTPUT_PATH):
os.makedirs(OUTPUT_PATH)
for f i... | 27.038462 | 80 | 0.603129 |
949ab73941c65a3e0c22814704c72cce9be8b42b | 3,932 | py | Python | test/functional/test_framework/blocktools.py | gdrcoin/gdrcoin | f9f2137b3d9069bfc8e3c69c90a684a061dfb6aa | [
"MIT"
] | null | null | null | test/functional/test_framework/blocktools.py | gdrcoin/gdrcoin | f9f2137b3d9069bfc8e3c69c90a684a061dfb6aa | [
"MIT"
] | null | null | null | test/functional/test_framework/blocktools.py | gdrcoin/gdrcoin | f9f2137b3d9069bfc8e3c69c90a684a061dfb6aa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Gdrcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Utilities for manipulating blocks and transactions."""
from .mininode import *
from .script import CSc... | 35.423423 | 104 | 0.709054 |
362ac1585d7b67c60682d7ddd8a07f7568a39cf2 | 7,823 | py | Python | breaker_audio/component_cmn/encoder/inference.py | kozzion/breaker_audio | 0f27b3ae581fbeb8f79d0b8755a139f7438ca02b | [
"MIT",
"BSD-3-Clause"
] | null | null | null | breaker_audio/component_cmn/encoder/inference.py | kozzion/breaker_audio | 0f27b3ae581fbeb8f79d0b8755a139f7438ca02b | [
"MIT",
"BSD-3-Clause"
] | null | null | null | breaker_audio/component_cmn/encoder/inference.py | kozzion/breaker_audio | 0f27b3ae581fbeb8f79d0b8755a139f7438ca02b | [
"MIT",
"BSD-3-Clause"
] | null | null | null | from matplotlib import cm
from encoder import audio
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import torch
from breaker_audio.component_cmn.encoder.params_data import *
from breaker_audio.component_cmn.encoder.model import SpeakerEncoder
_model = None # type: SpeakerEncoder
_device ... | 43.949438 | 99 | 0.717755 |
3457c9f693ad3ba247172250a438460307dbac95 | 95 | py | Python | lightautoml/ml_algo/tuning/gpu/__init__.py | Rishat-skoltech/LightAutoML_GPU | 4a0a524dc097de94b90871e40f2e33159a0e19b5 | [
"Apache-2.0"
] | 2 | 2022-03-21T19:15:53.000Z | 2022-03-30T07:41:59.000Z | lightautoml/ml_algo/tuning/gpu/__init__.py | Rishat-skoltech/LightAutoML_GPU | 4a0a524dc097de94b90871e40f2e33159a0e19b5 | [
"Apache-2.0"
] | null | null | null | lightautoml/ml_algo/tuning/gpu/__init__.py | Rishat-skoltech/LightAutoML_GPU | 4a0a524dc097de94b90871e40f2e33159a0e19b5 | [
"Apache-2.0"
] | null | null | null | """Presets for end-to-end model training for special tasks."""
__all__ = [
"optuna_gpu"
]
| 15.833333 | 62 | 0.663158 |
330c17b251aef3e57d0e3ce711b7f648c88624cc | 1,373 | py | Python | gmaps_local/sample_result.py | asemic-horizon/gmaps_local | df56d878df81d7787c8835ce77f010ca1f1c4b9a | [
"MIT"
] | null | null | null | gmaps_local/sample_result.py | asemic-horizon/gmaps_local | df56d878df81d7787c8835ce77f010ca1f1c4b9a | [
"MIT"
] | null | null | null | gmaps_local/sample_result.py | asemic-horizon/gmaps_local | df56d878df81d7787c8835ce77f010ca1f1c4b9a | [
"MIT"
] | null | null | null | sample = [
{'address_components':
[{'long_name': '205',
'short_name': '205',
'types': ['street_number']},
{'long_name': 'Rua Marlo da Costa e Souza',
'short_name': 'R. Marlo da Costa e Souza',
'types': ['route']},
{'long_name': 'Barra da Tijuca',
'short_name': ... | 98.071429 | 889 | 0.619811 |
86c3ff71d9d9ecac545eed9a8df959194624f0f6 | 398 | py | Python | FIRMCORN/procedures/__init__.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:01.000Z | 2021-06-04T14:27:15.000Z | FIRMCORN/procedures/__init__.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | null | null | null | FIRMCORN/procedures/__init__.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:09.000Z | 2021-06-04T14:27:21.000Z | # from getenv import *
from memset import *
# from printf import *
from scanf import *
from strcpy import *
from sprintf import *
from strdup import *
from memmove import *
from memcpy import *
from free import *
from snprintf import *
from socket import *
from send import *
from connect import *
from fcntl import *
fr... | 20.947368 | 22 | 0.753769 |
06c1d6cc1755ef022aa78967d4b651e21fd66618 | 31,425 | py | Python | PythonAndroid/youtube-dl/lib/python3.5/youtube_dl/swfinterp.py | jianglei12138/python-3.5.1 | 2d248ceba8aa4c14ee43e57ece99cc1a43fd22b7 | [
"PSF-2.0"
] | 5 | 2016-04-25T16:26:07.000Z | 2021-04-28T16:10:29.000Z | PythonAndroid/youtube-dl/lib/python3.5/youtube_dl/swfinterp.py | jianglei12138/python-3.5.1 | 2d248ceba8aa4c14ee43e57ece99cc1a43fd22b7 | [
"PSF-2.0"
] | 5 | 2016-04-22T01:33:31.000Z | 2016-08-04T15:33:19.000Z | PythonAndroid/youtube-dl/lib/python3.5/youtube_dl/swfinterp.py | jianglei12138/python-3.5.1 | 2d248ceba8aa4c14ee43e57ece99cc1a43fd22b7 | [
"PSF-2.0"
] | 4 | 2016-04-26T15:27:38.000Z | 2018-11-12T21:04:54.000Z | from __future__ import unicode_literals
import collections
import io
import zlib
from .compat import compat_str
from .utils import (
ExtractorError,
struct_unpack,
)
def _extract_tags(file_contents):
if file_contents[1:3] != b'WS':
raise ExtractorError(
'Not an SWF file; header is %r... | 37.861446 | 83 | 0.453874 |
f90b90d5d1e260cbdcfcc9675af5359fbbc4cbfe | 260 | py | Python | gallerypics/admin.py | Steve99-coder/Gallery | 6303e75b6212d1567a77ea4b054580bd9ec6b0d1 | [
"MIT"
] | 1 | 2021-04-09T20:25:23.000Z | 2021-04-09T20:25:23.000Z | gallerypics/admin.py | Steve99-coder/Gallery | 6303e75b6212d1567a77ea4b054580bd9ec6b0d1 | [
"MIT"
] | null | null | null | gallerypics/admin.py | Steve99-coder/Gallery | 6303e75b6212d1567a77ea4b054580bd9ec6b0d1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import Image,Category,Location
# Register your models here.
admin.site.register(Image)
admin.site.register(Category)
admin.site.register(Location)
| 21.666667 | 43 | 0.788462 |
104ccf4b5e67ff7034ac4978b33520f62191480d | 2,484 | py | Python | Python/my-calendar-ii.py | xiaohalo/LeetCode | 68211ba081934b21bb1968046b7e3c1459b3da2d | [
"MIT"
] | 9 | 2019-06-30T07:15:18.000Z | 2022-02-10T20:13:40.000Z | Python/my-calendar-ii.py | pnandini/LeetCode | e746c3298be96dec8e160da9378940568ef631b1 | [
"MIT"
] | 1 | 2018-07-10T03:28:43.000Z | 2018-07-10T03:28:43.000Z | Python/my-calendar-ii.py | pnandini/LeetCode | e746c3298be96dec8e160da9378940568ef631b1 | [
"MIT"
] | 9 | 2019-01-16T22:16:49.000Z | 2022-02-06T17:33:41.000Z | # Time: O(n^2)
# Space: O(n)
# Implement a MyCalendarTwo class to store your events.
# A new event can be added if adding the event will not cause a triple booking.
#
# Your class will have one method, book(int start, int end).
# Formally, this represents a booking on the half open interval [start, end),
# the range ... | 38.215385 | 109 | 0.671498 |
b144821562d991c3fec73087a768738898783537 | 47,872 | py | Python | dandeliondiary/compare/views.py | amberdiehl/dandeliondiary_project | e9bace5bd7980def6ca763840ab5b38f1e05cd3d | [
"FSFAP"
] | null | null | null | dandeliondiary/compare/views.py | amberdiehl/dandeliondiary_project | e9bace5bd7980def6ca763840ab5b38f1e05cd3d | [
"FSFAP"
] | 6 | 2020-04-29T23:54:15.000Z | 2022-03-11T23:25:24.000Z | dandeliondiary/compare/views.py | amberdiehl/dandeliondiary_project | e9bace5bd7980def6ca763840ab5b38f1e05cd3d | [
"FSFAP"
] | null | null | null | import datetime
import operator
from decimal import *
from django.forms import fields
from django.shortcuts import redirect, render, render_to_response, HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
from django.core.exceptions import ObjectDoesNotEx... | 36.655436 | 122 | 0.635591 |
843f42b1b06cad50816d06ec5cb37be4c2e1adaa | 111 | py | Python | turf/helpers/__init__.py | malroc/pyturf | c89b6ea7094bd5ca26cf589d9dcd15bd819d82e9 | [
"MIT"
] | 11 | 2020-08-26T11:04:55.000Z | 2022-01-26T14:53:10.000Z | turf/helpers/__init__.py | malroc/pyturf | c89b6ea7094bd5ca26cf589d9dcd15bd819d82e9 | [
"MIT"
] | 36 | 2020-04-09T16:49:05.000Z | 2020-06-01T14:39:37.000Z | turf/helpers/__init__.py | malroc/pyturf | c89b6ea7094bd5ca26cf589d9dcd15bd819d82e9 | [
"MIT"
] | 5 | 2020-07-30T23:37:35.000Z | 2021-08-24T08:10:28.000Z | from turf.helpers._conversions import *
from turf.helpers._features import *
from turf.helpers._units import *
| 27.75 | 39 | 0.810811 |
aab75f702d4eb403c5051841e10871822e9e8ea8 | 12,337 | py | Python | homeassistant/components/media_player/demo.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 2 | 2017-02-25T00:27:06.000Z | 2017-02-25T03:09:30.000Z | homeassistant/components/media_player/demo.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 1 | 2017-03-10T22:17:06.000Z | 2017-03-10T22:17:06.000Z | homeassistant/components/media_player/demo.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 2 | 2018-06-03T11:14:44.000Z | 2018-11-04T18:18:12.000Z | """
Demo implementation of the media player.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/demo/
"""
from homeassistant.components.media_player import (
MEDIA_TYPE_MUSIC, MEDIA_TYPE_TVSHOW, MEDIA_TYPE_VIDEO, SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE, SUPPO... | 31.232911 | 79 | 0.638243 |
f16f1005b70ca07b78965cc13a23505f947bfe76 | 1,710 | py | Python | tests/matrix_max_pool_negative/test_matrix_max_pool_negative_int32_ksize2_stride2.py | RyusukeYamano/nngen | 9ed1f7fb83908794aa94d70287d89545d45fe875 | [
"Apache-2.0"
] | 207 | 2019-11-12T11:42:25.000Z | 2022-03-20T20:32:17.000Z | tests/matrix_max_pool_negative/test_matrix_max_pool_negative_int32_ksize2_stride2.py | RyusukeYamano/nngen | 9ed1f7fb83908794aa94d70287d89545d45fe875 | [
"Apache-2.0"
] | 31 | 2019-11-25T07:33:30.000Z | 2022-03-17T12:34:34.000Z | tests/matrix_max_pool_negative/test_matrix_max_pool_negative_int32_ksize2_stride2.py | RyusukeYamano/nngen | 9ed1f7fb83908794aa94d70287d89545d45fe875 | [
"Apache-2.0"
] | 29 | 2019-11-07T02:25:48.000Z | 2022-03-12T16:22:57.000Z | from __future__ import absolute_import
from __future__ import print_function
import os
import sys
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(
os.path.dirname(os.path.abspath(__file__)))))
import nngen as ng
import veriloggen
import matrix_max_pool_negati... | 31.666667 | 108 | 0.531579 |
72b065a98a8833477315344bdc630311f0ec5236 | 1,472 | py | Python | ddtn/transformers/construct_localization_net.py | DukeGonzo/ddtn | 156cf5fb2f2e46619c0243a5accfddbe3567f109 | [
"MIT"
] | 51 | 2018-03-25T07:18:21.000Z | 2022-02-11T12:05:52.000Z | ddtn/transformers/construct_localization_net.py | DukeGonzo/ddtn | 156cf5fb2f2e46619c0243a5accfddbe3567f109 | [
"MIT"
] | 2 | 2018-10-26T06:43:44.000Z | 2018-12-20T02:05:31.000Z | ddtn/transformers/construct_localization_net.py | DukeGonzo/ddtn | 156cf5fb2f2e46619c0243a5accfddbe3567f109 | [
"MIT"
] | 7 | 2018-04-11T20:34:27.000Z | 2021-07-19T17:57:40.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri May 18 10:01:13 2018
@author: nsde
"""
#%% Packages
from tensorflow.python.keras import Sequential
from tensorflow.python.keras.layers import Dense, Flatten
from tensorflow.python.keras.layers import Conv2D, MaxPool2D
#from ddtn.transformers.transformer_util import get_tran... | 35.902439 | 78 | 0.715353 |
1fd0fb4dd2db013d543f097f1f61e2ce2b6b1812 | 2,117 | py | Python | simulation/models/diet_models.py | BenLatham/Agricultural-Simulation | 23ae2c6ae2ae6d0b1ca318c6e4543ccbe40a0039 | [
"MIT"
] | null | null | null | simulation/models/diet_models.py | BenLatham/Agricultural-Simulation | 23ae2c6ae2ae6d0b1ca318c6e4543ccbe40a0039 | [
"MIT"
] | 5 | 2016-07-08T12:05:31.000Z | 2016-07-08T17:31:23.000Z | simulation/models/diet_models.py | BenLatham/FLOSS-Agricultural-Simulation | 23ae2c6ae2ae6d0b1ca318c6e4543ccbe40a0039 | [
"MIT"
] | null | null | null | from django.db import models
from .general_models import ScenarioSpecificBase
from django.forms.models import model_to_dict
class Feed(ScenarioSpecificBase):
me = models.FloatField()
fme = models.FloatField()
erdp = models.FloatField()
dup = models.FloatField()
adf = models.FloatField()
price ... | 35.881356 | 123 | 0.684459 |
6f49e4fe32a624d0b2fb3bf6756882dd1db0e28a | 14,050 | py | Python | altair/utils/core.py | hugovk/altair | a3c9f06790f7a8c5c7e2c98278d0f69e4630b5be | [
"BSD-3-Clause"
] | 1 | 2022-03-13T21:42:09.000Z | 2022-03-13T21:42:09.000Z | altair/utils/core.py | RoyMachineLearning/altair | 74a765b373694776e63d224d99536975cc173810 | [
"BSD-3-Clause"
] | null | null | null | altair/utils/core.py | RoyMachineLearning/altair | 74a765b373694776e63d224d99536975cc173810 | [
"BSD-3-Clause"
] | null | null | null | """
Utility routines
"""
import collections
from copy import deepcopy
import itertools
import re
import sys
import traceback
import warnings
import six
import pandas as pd
import numpy as np
try:
from pandas.api.types import infer_dtype
except ImportError: # Pandas before 0.20.0
from pandas.lib import infer_d... | 35.037406 | 105 | 0.59879 |
8c6c7365d4f3324c2cb7d68c436f41bfb9d363f4 | 1,492 | py | Python | app/obfuscators/base64_jumble.py | ManojKorrapati/robinhood | c12c136974f9ee42823952f995def203bfb9b5e7 | [
"Apache-2.0"
] | null | null | null | app/obfuscators/base64_jumble.py | ManojKorrapati/robinhood | c12c136974f9ee42823952f995def203bfb9b5e7 | [
"Apache-2.0"
] | null | null | null | app/obfuscators/base64_jumble.py | ManojKorrapati/robinhood | c12c136974f9ee42823952f995def203bfb9b5e7 | [
"Apache-2.0"
] | null | null | null | import random
import string
import binascii
from base64 import b64encode
from app.utility.base_obfuscator import BaseObfuscator
class Obfuscation(BaseObfuscator):
@property
def supported_platforms(self):
return dict(
windows=['psh'],
darwin=['sh'],
linux=['sh']
... | 29.84 | 110 | 0.612601 |
1c4a0541e9c6f3dabd3305439a3287d532a147dd | 1,361 | py | Python | app/core/tests/test_admin.py | kim-sun/recipe-app-api | c0c598f2188c42c820178ea7910c34ccdf641393 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | kim-sun/recipe-app-api | c0c598f2188c42c820178ea7910c34ccdf641393 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | kim-sun/recipe-app-api | c0c598f2188c42c820178ea7910c34ccdf641393 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@gmail.com',
... | 31.651163 | 68 | 0.635562 |
5d99322867bc078254e638019a748163e15b8f86 | 107,218 | py | Python | wildlifecompliance/components/applications/api.py | Djandwich/wildlifecompliance | ca296798526a56ce67ffc2f7e8ebdbae95077e6d | [
"Apache-2.0"
] | null | null | null | wildlifecompliance/components/applications/api.py | Djandwich/wildlifecompliance | ca296798526a56ce67ffc2f7e8ebdbae95077e6d | [
"Apache-2.0"
] | null | null | null | wildlifecompliance/components/applications/api.py | Djandwich/wildlifecompliance | ca296798526a56ce67ffc2f7e8ebdbae95077e6d | [
"Apache-2.0"
] | null | null | null | import traceback
import os
import logging
from datetime import datetime, timedelta
from django.db.models import Q
from django.db import transaction
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from django.core.exceptions import ValidationError
from rest_framework... | 41.095439 | 117 | 0.599414 |
75c358f5a494fbfd6d87a789a431aa2633edd326 | 1,413 | py | Python | bakery/management/commands/unpublish.py | NDevox/django-bakery | bc012735a54d6bddabd1264094acb138effb248d | [
"MIT"
] | 314 | 2015-01-14T20:00:09.000Z | 2021-08-12T15:06:03.000Z | bakery/management/commands/unpublish.py | NDevox/django-bakery | bc012735a54d6bddabd1264094acb138effb248d | [
"MIT"
] | 94 | 2015-01-02T16:12:53.000Z | 2021-06-10T20:32:01.000Z | bakery/management/commands/unpublish.py | NDevox/django-bakery | bc012735a54d6bddabd1264094acb138effb248d | [
"MIT"
] | 61 | 2015-01-12T17:03:47.000Z | 2021-05-27T11:12:42.000Z | import logging
from django.conf import settings
from django.core.management.base import CommandError
from bakery.management.commands import BasePublishCommand
logger = logging.getLogger(__name__)
class Command(BasePublishCommand):
help = "Empties the Amazon S3 bucket defined in settings.py"
bucket_unconfig_ms... | 38.189189 | 120 | 0.675867 |
fc40136414af9d340cb7038c28e5ad6d1a3f7136 | 1,601 | py | Python | sdoh/process.py | uw-bionlp/uwbionlp-parser | 2216b25521438d7ca53a6b717e5b2ed94731cf88 | [
"BSD-3-Clause"
] | 2 | 2021-02-24T21:32:26.000Z | 2021-05-17T02:27:23.000Z | sdoh/process.py | uw-bionlp/uwbionlp-parser | 2216b25521438d7ca53a6b717e5b2ed94731cf88 | [
"BSD-3-Clause"
] | null | null | null | sdoh/process.py | uw-bionlp/uwbionlp-parser | 2216b25521438d7ca53a6b717e5b2ed94731cf88 | [
"BSD-3-Clause"
] | null | null | null | import os
import json
from docker.extractor import Extractor
from proto.python.uwbionlp_pb2 import PredictionOutput, PredictionEvent, PredictionEventArgument
class DocumentProcessor():
def __init__(self):
self.model_dir = os.path.join('model','sdoh')
self.word_embed_dir = os.path.join('model... | 34.06383 | 96 | 0.625234 |
927ce323178c606eaa0cf02567deca7bfd2932a6 | 1,105 | py | Python | vispy/gloo/tests/test_globject.py | hmaarrfk/vispy | 7f3f6f60c8462bb8a3a8fa03344a2e6990b86eb2 | [
"BSD-3-Clause"
] | 3 | 2019-02-28T16:05:33.000Z | 2020-05-03T21:29:03.000Z | vispy/gloo/tests/test_globject.py | hmaarrfk/vispy | 7f3f6f60c8462bb8a3a8fa03344a2e6990b86eb2 | [
"BSD-3-Clause"
] | 19 | 2015-06-16T14:33:22.000Z | 2015-07-27T21:18:15.000Z | graphViz/vispy/gloo/tests/test_globject.py | onecklam/ethereum-graphviz | 6993accf0cb85e23013bf7ae6b04145724a6dbd2 | [
"Apache-2.0"
] | 1 | 2019-04-03T12:49:18.000Z | 2019-04-03T12:49:18.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier. All rights reserved.
# Distributed under the terms of the new BSD License.
# -----------------------------------------------------------------------------
from vispy.testing... | 29.864865 | 79 | 0.545701 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.