hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5a8786f0702c4449d94f8e1e0f5fa51c6ec2304b | 10,111 | py | Python | python/ee/cli/utils.py | HarshitBardana/earthengine-api | 58d4d4ffef60088326d548ead26417dba959ef19 | [
"Apache-2.0"
] | 3 | 2016-11-13T06:18:23.000Z | 2019-10-25T18:52:30.000Z | python/ee/cli/utils.py | tylere/earthengine-api | 12891a8aeedc2b9e8ad126eb65c388a69ac83a4f | [
"Apache-2.0"
] | null | null | null | python/ee/cli/utils.py | tylere/earthengine-api | 12891a8aeedc2b9e8ad126eb65c388a69ac83a4f | [
"Apache-2.0"
] | 1 | 2021-06-29T14:04:19.000Z | 2021-06-29T14:04:19.000Z | #!/usr/bin/env python
"""Support utilities used by the Earth Engine command line interface.
This module defines the Command class which is the base class of all
the commands supported by the EE command line tool. It also defines
the classes for configuration and runtime context management.
"""
from __future__ import p... | 34.274576 | 80 | 0.676887 |
055c828b8ae8fc963b031f3cbaf16d7f6f68dc95 | 9,563 | py | Python | solo/args/utils.py | xwyzsn/solo-learn | 16d021d8053439a3de205337ab2a11d191500b09 | [
"MIT"
] | 693 | 2021-05-31T15:48:32.000Z | 2022-03-31T17:12:46.000Z | solo/args/utils.py | xwyzsn/solo-learn | 16d021d8053439a3de205337ab2a11d191500b09 | [
"MIT"
] | 151 | 2021-06-15T00:22:57.000Z | 2022-03-27T15:17:02.000Z | solo/args/utils.py | xwyzsn/solo-learn | 16d021d8053439a3de205337ab2a11d191500b09 | [
"MIT"
] | 79 | 2021-06-02T10:31:15.000Z | 2022-03-25T01:25:09.000Z | # Copyright 2021 solo-learn development team.
# 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 the rights to use,
# copy, modify, merge, publ... | 34.523466 | 99 | 0.615288 |
e37607c136b8de35600ac5614db35acb195ed7e7 | 124,342 | py | Python | src/transformers/pipelines.py | hassoudi/transformers | d8cf077777bd30c97b66f8e5d39d67db4530db69 | [
"Apache-2.0"
] | 2 | 2020-11-03T22:52:22.000Z | 2021-11-09T10:29:16.000Z | src/transformers/pipelines.py | hassoudi/transformers | d8cf077777bd30c97b66f8e5d39d67db4530db69 | [
"Apache-2.0"
] | null | null | null | src/transformers/pipelines.py | hassoudi/transformers | d8cf077777bd30c97b66f8e5d39d67db4530db69 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 42.995159 | 183 | 0.610373 |
42d9545da7417fed740a834361feeec8340d0c56 | 270 | py | Python | zeronineseven/hotkeys/__init__.py | SF-300/zeronineseven-hotkeys | 852f1d3530eb455916394367b1b2e8c50b2fbaf3 | [
"MIT"
] | null | null | null | zeronineseven/hotkeys/__init__.py | SF-300/zeronineseven-hotkeys | 852f1d3530eb455916394367b1b2e8c50b2fbaf3 | [
"MIT"
] | null | null | null | zeronineseven/hotkeys/__init__.py | SF-300/zeronineseven-hotkeys | 852f1d3530eb455916394367b1b2e8c50b2fbaf3 | [
"MIT"
] | null | null | null | import enum
from enum import Enum
from itertools import chain
from ssost.hotkeys.pycharm import all_controls as pycharm_controls
from ssost.hotkeys.edge import all_controls as edge_controls
__all__ = "all_controls",
all_controls = (*pycharm_controls, *edge_controls)
| 24.545455 | 66 | 0.82963 |
60df08bc0d4c8cf1023c5f609c4753cd8bc92364 | 1,484 | py | Python | leetcode/401.py | zi-NaN/algorithm_exercise | 817916a62774145fe6387b715f76c5badbf99197 | [
"MIT"
] | null | null | null | leetcode/401.py | zi-NaN/algorithm_exercise | 817916a62774145fe6387b715f76c5badbf99197 | [
"MIT"
] | null | null | null | leetcode/401.py | zi-NaN/algorithm_exercise | 817916a62774145fe6387b715f76c5badbf99197 | [
"MIT"
] | 1 | 2018-11-21T05:14:07.000Z | 2018-11-21T05:14:07.000Z | '''
Author: ZHAO Zinan
Created: 01/17/2019
401. Binary Watch
'''
class Solution:
def readBinaryWatch(self, num):
import itertools
"""
:type num: int
:rtype: List[str]
"""
# if num > 10:
# raise Exception()
hourLight = [1, 2, 4,... | 32.26087 | 316 | 0.434636 |
b9fba06c68f9ccedc3b72cbbe588da0ca3a81bef | 156 | py | Python | fx/fx/doctype/test_tree/test_test_tree.py | gpdev001/fx | 2d8e835a403266b209f42ac9abe72adb8d45ee8d | [
"MIT"
] | null | null | null | fx/fx/doctype/test_tree/test_test_tree.py | gpdev001/fx | 2d8e835a403266b209f42ac9abe72adb8d45ee8d | [
"MIT"
] | null | null | null | fx/fx/doctype/test_tree/test_test_tree.py | gpdev001/fx | 2d8e835a403266b209f42ac9abe72adb8d45ee8d | [
"MIT"
] | null | null | null | # Copyright (c) 2021, SERVIO Technologies and Contributors
# See license.txt
# import frappe
import unittest
class TestTestTree(unittest.TestCase):
pass
| 17.333333 | 58 | 0.788462 |
e1f0db419ae0bc6ee6b4faf406a7e934b3c36a0c | 4,665 | py | Python | human_body_prior/tools/omni_tools.py | MichaelJBlack/human_body_prior | d979be94bf9fe14637da95f0dc76d69c968bbf55 | [
"Xnet",
"X11"
] | 9 | 2019-10-24T10:51:22.000Z | 2021-12-29T01:30:37.000Z | human_body_prior/tools/omni_tools.py | wangxihao/human_body_prior | 4d3a212b3671a465123d4a320ec7c6f03e831103 | [
"Xnet",
"X11"
] | null | null | null | human_body_prior/tools/omni_tools.py | wangxihao/human_body_prior | 4d3a212b3671a465123d4a320ec7c6f03e831103 | [
"Xnet",
"X11"
] | 2 | 2020-08-11T21:11:18.000Z | 2021-07-10T04:28:35.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG),
# acting on behalf of its Max Planck Institute for Intelligent Systems and the
# Max Planck Institute for Biological Cybernetics. All rights reserved.
#
# Max-Planck-Gesellschaft zur Förderung der Wissens... | 30.292208 | 115 | 0.628939 |
53927e6d932f082f4c0c41e62fad68fa2a10e405 | 1,263 | py | Python | multiple_smi/client/menu_frontend/default_frontend.py | ClementPinard/Multiple-smi | ae4e993186381e772324882e03cc69517c97df49 | [
"MIT"
] | 4 | 2020-06-16T07:57:11.000Z | 2021-09-29T16:48:37.000Z | multiple_smi/client/menu_frontend/default_frontend.py | ClementPinard/Multiple-smi | ae4e993186381e772324882e03cc69517c97df49 | [
"MIT"
] | null | null | null | multiple_smi/client/menu_frontend/default_frontend.py | ClementPinard/Multiple-smi | ae4e993186381e772324882e03cc69517c97df49 | [
"MIT"
] | null | null | null | import os
import json
class BaseFrontend(object):
def __init__(self, config_folder, *args, **kwargs):
self.config_folder = config_folder
self.paths = {}
def launch(self, func, *args, **kwargs):
kwargs['frontend'] = self
return func(*args, **kwargs)
def update_menu(self, m... | 34.135135 | 94 | 0.557403 |
756bd32f51408dd90e93596030e4f441bb63bd08 | 4,717 | py | Python | scripts/generate_IFPs.py | annacarbery/library-design | e71aa7738a5cc93b88e5f6ec16f2df04c21f8e59 | [
"MIT"
] | null | null | null | scripts/generate_IFPs.py | annacarbery/library-design | e71aa7738a5cc93b88e5f6ec16f2df04c21f8e59 | [
"MIT"
] | null | null | null | scripts/generate_IFPs.py | annacarbery/library-design | e71aa7738a5cc93b88e5f6ec16f2df04c21f8e59 | [
"MIT"
] | null | null | null | import os
from oddt.fingerprints_new import InteractionFingerprint, tanimoto
import oddt
import sys
from pymol import cmd
import statistics
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import DataStructs, SaltRemover
import json
def separate_files(filepath):
# takes in a protein-ligand ... | 27.584795 | 125 | 0.628365 |
f85dd8b54042ef732370c2279ae304c92d69a127 | 35,441 | py | Python | armi/reactor/tests/test_components.py | DennisYelizarov/armi | 3f0e63769abb2a57b3aac7a2f0975dcd629b015a | [
"Apache-2.0"
] | null | null | null | armi/reactor/tests/test_components.py | DennisYelizarov/armi | 3f0e63769abb2a57b3aac7a2f0975dcd629b015a | [
"Apache-2.0"
] | null | null | null | armi/reactor/tests/test_components.py | DennisYelizarov/armi | 3f0e63769abb2a57b3aac7a2f0975dcd629b015a | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 TerraPower, 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 writi... | 34.610352 | 136 | 0.611128 |
295381bc705a1eed391fbd787cb9a50b44c3e891 | 102 | py | Python | layers/ensemble_layers.py | tlatkowski/attention-ensemble-gene-expression | 7ef2361ddb758f6af7d3e948f2ae793363909f7d | [
"MIT"
] | null | null | null | layers/ensemble_layers.py | tlatkowski/attention-ensemble-gene-expression | 7ef2361ddb758f6af7d3e948f2ae793363909f7d | [
"MIT"
] | 7 | 2017-11-03T12:08:14.000Z | 2017-12-04T18:48:41.000Z | layers/ensemble_layers.py | tlatkowski/attention-ensemble-gene-expression | 7ef2361ddb758f6af7d3e948f2ae793363909f7d | [
"MIT"
] | null | null | null |
def majority_voting_layer(nn_outcomes):
pass
def weighted_voting_layer(nn_outcomes):
pass
| 11.333333 | 39 | 0.764706 |
8a8e52c5a4e957bb758582642aface34fb01dec2 | 8,836 | py | Python | httplib2shim/__init__.py | AtomicConductor/httplib2shim | 6ea416c776f8a535d42f6a8f4d8a9e708408892e | [
"MIT"
] | null | null | null | httplib2shim/__init__.py | AtomicConductor/httplib2shim | 6ea416c776f8a535d42f6a8f4d8a9e708408892e | [
"MIT"
] | null | null | null | httplib2shim/__init__.py | AtomicConductor/httplib2shim | 6ea416c776f8a535d42f6a8f4d8a9e708408892e | [
"MIT"
] | null | null | null | # Copyright (c) 2006 by Joe Gregorio, Google Inc.
#
# 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 the rights to use, copy, modify, merge,... | 34.787402 | 79 | 0.658782 |
ea3a96f8d11422a1ee7342ce72973227c97bad62 | 476 | py | Python | Blackjack/functions.py | Peter380/Python | 03b6cfda249cd538711d6a047a2e852dc91f84c5 | [
"MIT"
] | null | null | null | Blackjack/functions.py | Peter380/Python | 03b6cfda249cd538711d6a047a2e852dc91f84c5 | [
"MIT"
] | null | null | null | Blackjack/functions.py | Peter380/Python | 03b6cfda249cd538711d6a047a2e852dc91f84c5 | [
"MIT"
] | null | null | null | import os
#Functions for Blackjack
def display_players_cards(Player):
for card in Player.hand:
print(card)
def get_players_bet():
valid_input = False
while valid_input == False:
try:
bet = int(input("How much are you betting? Please insert a number: "))
vali... | 22.666667 | 82 | 0.596639 |
adfa99eeefc2404d506500fc95f77f5f021c5532 | 6,420 | py | Python | Level_Routines/Controllers/UnitController.py | sidav/ShadowPriest | 0ab3f9e4dde03237dff7389d0654112f1d1994e9 | [
"MIT"
] | 1 | 2017-12-12T15:34:54.000Z | 2017-12-12T15:34:54.000Z | Level_Routines/Controllers/UnitController.py | sidav/ShadowPriest | 0ab3f9e4dde03237dff7389d0654112f1d1994e9 | [
"MIT"
] | null | null | null | Level_Routines/Controllers/UnitController.py | sidav/ShadowPriest | 0ab3f9e4dde03237dff7389d0654112f1d1994e9 | [
"MIT"
] | null | null | null | from GLOBAL_DATA import Global_Constants as GC
from Level_Routines.Mechanics import TurnCosts as TC, StatusEffect as SE
from Level_Routines.Events import EventCreator as EC
from Level_Routines.Events.EventsStack import EventsStack as ESTCK
from Message_Log import MessageLog as LOG
from Routines import TdlConsoleWrapper... | 40.125 | 150 | 0.703583 |
ea9e8cc6b17802fa6499b2848bbea78c976edc59 | 16,189 | py | Python | rllib/algorithms/dqn/simple_q.py | Gekho457/ray | bed660b085fa9949bca71160addfc0a69931c64b | [
"Apache-2.0"
] | null | null | null | rllib/algorithms/dqn/simple_q.py | Gekho457/ray | bed660b085fa9949bca71160addfc0a69931c64b | [
"Apache-2.0"
] | null | null | null | rllib/algorithms/dqn/simple_q.py | Gekho457/ray | bed660b085fa9949bca71160addfc0a69931c64b | [
"Apache-2.0"
] | null | null | null | """
Simple Q-Learning
=================
This module provides a basic implementation of the DQN algorithm without any
optimizations.
This file defines the distributed Trainer class for the Simple Q algorithm.
See `simple_q_[tf|torch]_policy.py` for the definition of the policy loss.
"""
import logging
from typing imp... | 39.581907 | 88 | 0.626537 |
9907e497dfeecce5b514cccd64afef18b8058076 | 330 | py | Python | core/migrations/0021_merge_20161118_1133.py | EthanMarrs/digit2 | 207569a3b7a61282a2d0bd5f354a837ad81ef55d | [
"BSD-2-Clause"
] | null | null | null | core/migrations/0021_merge_20161118_1133.py | EthanMarrs/digit2 | 207569a3b7a61282a2d0bd5f354a837ad81ef55d | [
"BSD-2-Clause"
] | null | null | null | core/migrations/0021_merge_20161118_1133.py | EthanMarrs/digit2 | 207569a3b7a61282a2d0bd5f354a837ad81ef55d | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-11-18 11:33
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0018_auto_20161111_1035'),
('core', '0020_auto_20161117_2321'),
]
operations ... | 19.411765 | 46 | 0.657576 |
a6bcaa63c3bfdd17558e333720e7cb525b631ad7 | 252 | py | Python | manage.py | caulagi/django-mypy | 2e1eabe073810fd9a34c17fd10a2abe903660356 | [
"MIT"
] | 7 | 2016-04-22T05:42:15.000Z | 2017-01-06T12:54:44.000Z | manage.py | caulagi/django-mypy | 2e1eabe073810fd9a34c17fd10a2abe903660356 | [
"MIT"
] | 1 | 2016-07-07T07:58:57.000Z | 2016-07-07T07:58:57.000Z | manage.py | caulagi/django-mypy | 2e1eabe073810fd9a34c17fd10a2abe903660356 | [
"MIT"
] | 3 | 2016-07-07T04:12:25.000Z | 2018-11-23T10:06:30.000Z | #!/usr/bin/env python3
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tutorial.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 22.909091 | 72 | 0.77381 |
5abbb69f469353dc7baee71956aaecfb17bf0f19 | 14,954 | py | Python | userbot/modules/stickers.py | JoanLindo/slaaaaa | a5b08d832766717282785487bf15cc74ea0c905c | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/stickers.py | JoanLindo/slaaaaa | a5b08d832766717282785487bf15cc74ea0c905c | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/stickers.py | JoanLindo/slaaaaa | a5b08d832766717282785487bf15cc74ea0c905c | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for kanging stickers or making new ones. Thanks @rupansh"""
import io
import math
import random
imp... | 39.352632 | 113 | 0.556908 |
8b15a3c8af7545a1d231a4152ef78526772a327b | 4,656 | py | Python | chiasm_shell/assembler.py | 0xbc/chiasm-shell | e20ed9fdf3fcb87d9469aa6fd52bf9e3eed92bc7 | [
"MIT"
] | 27 | 2016-12-11T12:01:14.000Z | 2020-06-05T22:01:06.000Z | chiasm_shell/assembler.py | 0xbc/chiasm-shell | e20ed9fdf3fcb87d9469aa6fd52bf9e3eed92bc7 | [
"MIT"
] | null | null | null | chiasm_shell/assembler.py | 0xbc/chiasm-shell | e20ed9fdf3fcb87d9469aa6fd52bf9e3eed92bc7 | [
"MIT"
] | 6 | 2016-12-12T12:28:26.000Z | 2021-02-14T01:42:04.000Z | """
Handles assembler functionality, powered by the Keystone engine.
:author: Ben Cheney
:license: MIT
"""
from __future__ import absolute_import
import logging
import re
from chiasm_shell.backend import Backend
l = logging.getLogger('chiasm_shell.assembler')
try:
import keystone as ks
except ImportError as e:... | 32.110345 | 87 | 0.578608 |
d749f37cfab4cc680d696cc62ee2d35033931db9 | 4,828 | py | Python | python_modules/libraries/dagstermill/dagstermill/context.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagstermill/dagstermill/context.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagstermill/dagstermill/context.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, Set
from dagster import PipelineDefinition, PipelineRun, SolidDefinition, check
from dagster.core.definitions.dependency import Solid
from dagster.core.execution.context.compute import AbstractComputeExecutionContext
from dagster.core.execution.context.system import SystemPipelineExecutio... | 34.241135 | 94 | 0.680199 |
aa11b70d07bdbde0195a0018e5eb49ae0ee1693f | 8,721 | py | Python | waitress/buffers.py | invisibleroads/waitress | e2210c9258702b7a46fa23f3f5e8389d56999748 | [
"ZPL-2.1"
] | 1 | 2020-03-01T04:38:24.000Z | 2020-03-01T04:38:24.000Z | waitress/buffers.py | invisibleroads/waitress | e2210c9258702b7a46fa23f3f5e8389d56999748 | [
"ZPL-2.1"
] | 10 | 2020-05-11T20:29:28.000Z | 2022-01-13T01:41:27.000Z | waitress/buffers.py | invisibleroads/waitress | e2210c9258702b7a46fa23f3f5e8389d56999748 | [
"ZPL-2.1"
] | 17 | 2019-11-21T14:11:29.000Z | 2019-11-21T15:26:23.000Z | ##############################################################################
#
# Copyright (c) 2001-2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THI... | 28.6875 | 78 | 0.553148 |
8085ae1f3da45b1035bf8c2f610490e7d6f75dd0 | 8,611 | py | Python | envergo/evaluations/views.py | MTES-MCT/envergo | 8bb6e4ffa15a39edda51b39401db6cc12e73ad0a | [
"MIT"
] | null | null | null | envergo/evaluations/views.py | MTES-MCT/envergo | 8bb6e4ffa15a39edda51b39401db6cc12e73ad0a | [
"MIT"
] | 6 | 2021-07-12T14:33:18.000Z | 2022-02-14T10:36:09.000Z | envergo/evaluations/views.py | MTES-MCT/envergo | 8bb6e4ffa15a39edda51b39401db6cc12e73ad0a | [
"MIT"
] | null | null | null | import logging
from django.conf import settings
from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.files.storage import get_storage_class
from django.db.models.query import Prefetch
from django.http.response import Http404, HttpResponseRedirect, JsonResponse
from django.shortcuts import render
... | 32.741445 | 84 | 0.67948 |
15e4e50b76b8aec0781569614a7114c18063d417 | 258 | py | Python | src/Thumbnail/Content/api/serializers.py | Bhagyarsh/django-Thumbnail | 050461528e69456ebcd442480363e2d4178f870a | [
"MIT"
] | null | null | null | src/Thumbnail/Content/api/serializers.py | Bhagyarsh/django-Thumbnail | 050461528e69456ebcd442480363e2d4178f870a | [
"MIT"
] | 12 | 2020-06-05T19:17:31.000Z | 2022-03-11T23:31:17.000Z | src/Thumbnail/Content/api/serializers.py | Bhagyarsh/django-thumbnail | 050461528e69456ebcd442480363e2d4178f870a | [
"MIT"
] | null | null | null | from rest_framework import serializers
from Content.models import Content
class ContentSerializer(serializers.ModelSerializer):
class Meta:
model = Content
fields = [
'name',
'type',
'file'
]
| 19.846154 | 53 | 0.589147 |
fdea1337ae3a331127839495bcf28083b008c7e0 | 549 | py | Python | hackerrank/Algorithms/Connected Cells in a Grid/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerrank/Algorithms/Connected Cells in a Grid/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerrank/Algorithms/Connected Cells in a Grid/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | import unittest
import solution
class TestQ(unittest.TestCase):
def test_case_0(self):
self.assertEqual(solution.connectedCell([
[1, 1, 0, 0, 0],
[0, 1, 1, 0, 0],
[0, 0, 1, 0, 1],
[1, 0, 0, 0, 1],
[0, 1, 0, 1, 1]
]), 5)
def test_cas... | 20.333333 | 49 | 0.428051 |
daec40a8d9628cd5f2380c611613b6292290edba | 6,835 | py | Python | keystone/common/manager.py | Afkupuz/4jaewoo | fc69258feac7858f5af99d2feab39c86ceb70203 | [
"Apache-2.0"
] | 1 | 2019-05-08T06:09:35.000Z | 2019-05-08T06:09:35.000Z | keystone/common/manager.py | Afkupuz/4jaewoo | fc69258feac7858f5af99d2feab39c86ceb70203 | [
"Apache-2.0"
] | 4 | 2018-08-22T14:51:02.000Z | 2018-10-17T14:04:26.000Z | keystone/common/manager.py | Afkupuz/4jaewoo | fc69258feac7858f5af99d2feab39c86ceb70203 | [
"Apache-2.0"
] | 5 | 2018-08-03T17:19:34.000Z | 2019-01-11T15:54:42.000Z | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 38.184358 | 79 | 0.588149 |
722259976f05fd17d2c81339fd99402073fc898a | 616 | py | Python | application/location/forms.py | roklem314/PotilasArkisto | b005dcad4442820a265b62156ddfe61abb5b9707 | [
"MIT"
] | 2 | 2018-03-23T08:45:10.000Z | 2021-01-22T11:17:14.000Z | application/location/forms.py | roklem314/PotilasArkisto | b005dcad4442820a265b62156ddfe61abb5b9707 | [
"MIT"
] | 1 | 2018-05-07T18:56:00.000Z | 2019-02-11T21:10:44.000Z | application/location/forms.py | roklem314/Laakari-palvelu | b005dcad4442820a265b62156ddfe61abb5b9707 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from flask_login import current_user
from wtforms import StringField,IntegerField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo
from application.registration.models import Accounts
# import bcrypt
class LocationForm(FlaskForm):
address = StringField('... | 38.5 | 97 | 0.787338 |
ca790409461dca52ff86083b8ad4da3c4bd9c045 | 2,484 | py | Python | tests/unit-test.py | vignesh-pagadala/worm-propagation-simulator | 665d05b4bb27d8d57d7886923f3787192eb61ef7 | [
"MIT"
] | null | null | null | tests/unit-test.py | vignesh-pagadala/worm-propagation-simulator | 665d05b4bb27d8d57d7886923f3787192eb61ef7 | [
"MIT"
] | null | null | null | tests/unit-test.py | vignesh-pagadala/worm-propagation-simulator | 665d05b4bb27d8d57d7886923f3787192eb61ef7 | [
"MIT"
] | null | null | null | # Project 2
# Get graph from CSV and run simulation.
import random
import csv
import networkx as nx
import matplotlib.pyplot as plt
import time
import sys
filename = sys.argv[1]
with open(filename, 'r') as f:
reader = csv.reader(f)
edgeList = list(reader)
edgeList = [[int(float(j)) for j in i] for i in edgeL... | 27.910112 | 89 | 0.641707 |
b0e96bd439a5677668533265f7047d4cb81d9b8a | 555 | py | Python | portfolio/migrations/0011_auto_20200515_1456.py | ghostforpy/bonds-docker | fda77225b85264cb4ba06b15ff63bc807858425a | [
"MIT"
] | 2 | 2020-09-08T12:51:56.000Z | 2021-08-18T15:27:52.000Z | portfolio/migrations/0011_auto_20200515_1456.py | ghostforpy/bonds-docker | fda77225b85264cb4ba06b15ff63bc807858425a | [
"MIT"
] | 1 | 2021-12-13T20:43:35.000Z | 2021-12-13T20:43:35.000Z | portfolio/migrations/0011_auto_20200515_1456.py | ghostforpy/bonds-docker | fda77225b85264cb4ba06b15ff63bc807858425a | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-05-15 11:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('portfolio', '0010_auto_20200515_1228'),
]
operations = [
migrations.RemoveField(
model_name='portfolioinvesthistory',
... | 24.130435 | 80 | 0.610811 |
a26036f3c507aec24f65ca7438a3f2319c04b140 | 16,596 | py | Python | DockerMigrator.py | johnmlwright/docker2artifactory | 3f6da645c6cc7aa86041989cabbc1ebc488b1a2b | [
"Apache-2.0"
] | null | null | null | DockerMigrator.py | johnmlwright/docker2artifactory | 3f6da645c6cc7aa86041989cabbc1ebc488b1a2b | [
"Apache-2.0"
] | null | null | null | DockerMigrator.py | johnmlwright/docker2artifactory | 3f6da645c6cc7aa86041989cabbc1ebc488b1a2b | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import sys
import Queue
from migrator.Migrator import Migrator
from migrator.ArtifactoryDockerAccess import ArtifactoryDockerAccess
from migrator.DockerRegistryAccess import DockerRegistryAccess
from migrator.QuayAccess import QuayAccess
import os
import shutil
dir_path = os.path.dirname(... | 41.386534 | 125 | 0.684502 |
395b057c5d5e1dbc3719fd5795bc983ec17f28fa | 36,706 | py | Python | src/toil_vg/iostore.py | xchang1/toil-vg | 15eb6cd679590f3a326c6bf6194ff63aad32f108 | [
"Apache-2.0"
] | 6 | 2019-08-04T17:15:53.000Z | 2022-01-19T03:54:57.000Z | src/toil_vg/iostore.py | xchang1/toil-vg | 15eb6cd679590f3a326c6bf6194ff63aad32f108 | [
"Apache-2.0"
] | 245 | 2017-07-19T16:41:13.000Z | 2021-06-12T05:06:46.000Z | src/toil_vg/iostore.py | xchang1/toil-vg | 15eb6cd679590f3a326c6bf6194ff63aad32f108 | [
"Apache-2.0"
] | 11 | 2017-08-03T05:42:28.000Z | 2021-04-06T08:06:58.000Z | """
IOStore class originated here
https://github.com/BD2KGenomics/hgvm-graph-bakeoff-evaluations/blob/master/scripts/toillib.py
and was then here:
https://github.com/cmarkello/toil-lib/blob/master/src/toil_lib/toillib.py
In a perfect world, this would be deprecated and replaced with Toil's stores.
Actually did t... | 34.050093 | 138 | 0.559718 |
c82ce0697d7f7f8544ca1f6d42023be102d764c5 | 541 | py | Python | docplex/version.py | ctzhu/docplex | 783d2137bedfe8b01553cf31035803085fb8819a | [
"Apache-2.0"
] | null | null | null | docplex/version.py | ctzhu/docplex | 783d2137bedfe8b01553cf31035803085fb8819a | [
"Apache-2.0"
] | 1 | 2019-11-14T09:30:19.000Z | 2019-11-22T23:23:27.000Z | docplex/version.py | ctzhu/docplex | 783d2137bedfe8b01553cf31035803085fb8819a | [
"Apache-2.0"
] | null | null | null | # --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2019
# --------------------------------------------------------------------------
# gendoc: ignore
# Thi... | 31.823529 | 76 | 0.55268 |
4f620786f1093eb30a777cf2303c8682de7c3c14 | 1,279 | py | Python | main.py | CaioCesarS/Heranca-e-Composicao-em-Python-OO | 4060261f30e100c50db7547c810e006c21396999 | [
"MIT"
] | 2 | 2021-02-21T03:02:35.000Z | 2021-06-06T21:22:37.000Z | main.py | CaioCesarS/Heranca-e-Composicao-em-Python-OO | 4060261f30e100c50db7547c810e006c21396999 | [
"MIT"
] | null | null | null | main.py | CaioCesarS/Heranca-e-Composicao-em-Python-OO | 4060261f30e100c50db7547c810e006c21396999 | [
"MIT"
] | null | null | null | '''
Herança e Composição em Python
'''
__author__ = 'Caio César'
__license__ = 'MIT'
__version__ = '0.0.1'
__status__ = 'Development'
from pessoaMedico import PessoaMedico
from pessoaAdvogado import PessoaAdvogado
listPessoaMedico = []
listPessoaAdvogado = []
pessoaMedico1 = PessoaMedico(154790, 'Ana Júlia', 26, 787... | 35.527778 | 97 | 0.724003 |
ae40a599bd5c5d10e99ce402f1e9eff4bb211b89 | 1,460 | py | Python | python-translate/translate.py | vpodk/coding-challenges | d4df044fa0508c01e2cd71cef0b24ae3f34aea49 | [
"Apache-2.0"
] | null | null | null | python-translate/translate.py | vpodk/coding-challenges | d4df044fa0508c01e2cd71cef0b24ae3f34aea49 | [
"Apache-2.0"
] | null | null | null | python-translate/translate.py | vpodk/coding-challenges | d4df044fa0508c01e2cd71cef0b24ae3f34aea49 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# http://google.github.io/styleguide/pyguide.html
#
# Assumptions:
# 1. We don't limit the length of phone number.
# 2. We assume the phone number can contain only numbers and a dash symbol
# (no spaces).
# 3. We assume 0 and 1 are not valid numbers for the phone number to c... | 23.548387 | 79 | 0.530822 |
c83d734791f008be97f554c4e5cadf932b5ccd9b | 557 | py | Python | examples/triangle/plot_normal.py | CristianoPizzamiglio/scikit-spatial | 95ca2d4f2948cf6a69ec4bc7236b70fd66db1de5 | [
"BSD-3-Clause"
] | 35 | 2019-08-22T04:25:29.000Z | 2022-03-10T16:23:45.000Z | examples/triangle/plot_normal.py | CristianoPizzamiglio/scikit-spatial | 95ca2d4f2948cf6a69ec4bc7236b70fd66db1de5 | [
"BSD-3-Clause"
] | 241 | 2019-03-04T23:08:26.000Z | 2022-03-27T13:25:30.000Z | examples/triangle/plot_normal.py | CristianoPizzamiglio/scikit-spatial | 95ca2d4f2948cf6a69ec4bc7236b70fd66db1de5 | [
"BSD-3-Clause"
] | 7 | 2020-11-13T21:40:05.000Z | 2022-02-07T00:38:30.000Z | """
Triangle with Normal Vector
===========================
Plotting a triangle with its normal vector. The tail of the vector is set to be the triangle centroid.
"""
from skspatial.objects import Triangle
from skspatial.plotting import plot_3d
triangle = Triangle([0, 0, 1], [1, 1, 0], [0, 2, 1])
centroid = triang... | 25.318182 | 102 | 0.648115 |
8a6720132c8f918b41150baaf081e113f26f2fd5 | 68,512 | py | Python | kms/scripts/dba_script.py | phenixmzy/ranger-2.1.0-with-cdh6.3 | bb9fb307d72d8fe3bd86ba52ea83ce7d7d02d2bc | [
"Apache-2.0"
] | null | null | null | kms/scripts/dba_script.py | phenixmzy/ranger-2.1.0-with-cdh6.3 | bb9fb307d72d8fe3bd86ba52ea83ce7d7d02d2bc | [
"Apache-2.0"
] | null | null | null | kms/scripts/dba_script.py | phenixmzy/ranger-2.1.0-with-cdh6.3 | bb9fb307d72d8fe3bd86ba52ea83ce7d7d02d2bc | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | 45.858099 | 293 | 0.677954 |
32a449fc5f7c0302fbd73ad715ceb2455a959a10 | 10,587 | py | Python | tests/eth2/core/beacon/state_machines/forks/test_serenity_block_attestation_validation.py | Gauddel/trinity | 0b12943ac36f4090abc22fc965e9e9a4f42c6f35 | [
"MIT"
] | null | null | null | tests/eth2/core/beacon/state_machines/forks/test_serenity_block_attestation_validation.py | Gauddel/trinity | 0b12943ac36f4090abc22fc965e9e9a4f42c6f35 | [
"MIT"
] | null | null | null | tests/eth2/core/beacon/state_machines/forks/test_serenity_block_attestation_validation.py | Gauddel/trinity | 0b12943ac36f4090abc22fc965e9e9a4f42c6f35 | [
"MIT"
] | null | null | null | import pytest
from hypothesis import (
given,
settings,
strategies as st,
)
from eth_utils import (
ValidationError,
)
from eth.constants import (
ZERO_HASH32,
)
from eth2.beacon.committee_helpers import (
get_crosslink_committees_at_slot,
)
from eth2.beacon.helpers import (
get_epoch_star... | 30.598266 | 92 | 0.567205 |
53efe8fb6dc075d52d9c7f7c609531b081818f82 | 9,824 | py | Python | utils.py | buaacarzp/Faster-RCNN | db2229f6f2a3701886e4b4d43a4ce2d37e2f1f14 | [
"Apache-2.0"
] | 1 | 2021-08-13T01:34:08.000Z | 2021-08-13T01:34:08.000Z | utils.py | buaacarzp/Faster-RCNN | db2229f6f2a3701886e4b4d43a4ce2d37e2f1f14 | [
"Apache-2.0"
] | null | null | null | utils.py | buaacarzp/Faster-RCNN | db2229f6f2a3701886e4b4d43a4ce2d37e2f1f14 | [
"Apache-2.0"
] | 1 | 2021-08-13T01:34:12.000Z | 2021-08-13T01:34:12.000Z | import torch
import numpy as np
from torch.nn import functional as F
def bbox2loc(src_bbox, dst_bbox):
width = src_bbox[:, 2] - src_bbox[:, 0]
height = src_bbox[:, 3] - src_bbox[:, 1]
ctr_x = src_bbox[:, 0] + 0.5 * width
ctr_y = src_bbox[:, 1] + 0.5 * height
base_width = dst_bbox[:, 2] - d... | 37.930502 | 129 | 0.576649 |
7436ffb933e1e5cccf7c8a6afc81aaaca1fb9de7 | 493 | py | Python | video/rest/recordings/list-deleted-recordings/list-deleted-recordings.6.x.py | Tshisuaka/api-snippets | 52b50037d4af0f3b96adf76197964725a1501e96 | [
"MIT"
] | 234 | 2016-01-27T03:04:38.000Z | 2022-02-25T20:13:43.000Z | video/rest/recordings/list-deleted-recordings/list-deleted-recordings.6.x.py | Tshisuaka/api-snippets | 52b50037d4af0f3b96adf76197964725a1501e96 | [
"MIT"
] | 351 | 2016-04-06T16:55:33.000Z | 2022-03-10T18:42:36.000Z | video/rest/recordings/list-deleted-recordings/list-deleted-recordings.6.x.py | Tshisuaka/api-snippets | 52b50037d4af0f3b96adf76197964725a1501e96 | [
"MIT"
] | 494 | 2016-03-30T15:28:20.000Z | 2022-03-28T19:39:36.000Z | # Download the Python helper library from twilio.com/docs/python/install
import os
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
# To set up environmental variables, see http://twil.io/secure
api_key_sid = os.environ['TWILIO_API_KEY']
api_key_secret = os.environ['TWILIO_API_K... | 32.866667 | 72 | 0.795132 |
75664a4ce6dc4410cddd4e486d2c750667ab076b | 14,351 | py | Python | tests/hwsim/test_ap_track.py | DreadsCasey/Krackattack | 4278e2aae10b013c06f40b653fda3441f2c6a73a | [
"BSD-3-Clause"
] | 138 | 2018-01-30T00:24:21.000Z | 2022-03-28T02:00:12.000Z | tests/hwsim/test_ap_track.py | DreadsCasey/Krackattack | 4278e2aae10b013c06f40b653fda3441f2c6a73a | [
"BSD-3-Clause"
] | 6 | 2018-02-02T14:46:36.000Z | 2021-09-21T13:28:00.000Z | tests/hwsim/test_ap_track.py | DreadsCasey/Krackattack | 4278e2aae10b013c06f40b653fda3441f2c6a73a | [
"BSD-3-Clause"
] | 62 | 2018-02-06T09:10:59.000Z | 2022-03-28T02:00:14.000Z | # Test cases for hostapd tracking unconnected stations
# Copyright (c) 2015, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import subprocess
import time
import hostapd
from wpasupplicant impor... | 36.423858 | 85 | 0.602467 |
de2aef92215f1bfbaba4c7aa9b37507680997850 | 2,999 | py | Python | Nelly.py | Punnisher80/NellyX | 6cac09d45f7e55e539b34ee427fb6ca776641a05 | [
"MIT"
] | 1 | 2021-08-10T05:55:34.000Z | 2021-08-10T05:55:34.000Z | Nelly.py | Punnisher80/NellyX | 6cac09d45f7e55e539b34ee427fb6ca776641a05 | [
"MIT"
] | null | null | null | Nelly.py | Punnisher80/NellyX | 6cac09d45f7e55e539b34ee427fb6ca776641a05 | [
"MIT"
] | 2 | 2021-08-09T16:03:02.000Z | 2021-09-18T05:28:39.000Z | print("[INFO]: Importing Your API_ID, API_HASH, BOT_TOKEN")
import re
import emoji
from asyncio import (gather, get_event_loop, sleep)
from aiohttp import ClientSession
from pyrogram import (Client, filters, idle)
from Python_ARQ import ARQ
from config import bot, BOT_TOKEN, ARQ_API_KEY, ARQ_API_BASE_URL, LANGUAGE
bo... | 26.078261 | 80 | 0.646882 |
5d836c5ade48a2ee42b72d2748dba4706840edde | 46,186 | py | Python | zerver/lib/bugdown/__init__.py | TanJay/zulip | 294030ca0427fb168292673b3150852c19e2692e | [
"Apache-2.0"
] | null | null | null | zerver/lib/bugdown/__init__.py | TanJay/zulip | 294030ca0427fb168292673b3150852c19e2692e | [
"Apache-2.0"
] | null | null | null | zerver/lib/bugdown/__init__.py | TanJay/zulip | 294030ca0427fb168292673b3150852c19e2692e | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import codecs
import markdown
import logging
import traceback
from six.moves import urllib
import re
import os.path
import glob
import twitter
import platform
import time
import six.moves.html_parser
import httplib2
import itertools
from six.moves import urllib
import xml.etree.c... | 40.728395 | 196 | 0.593102 |
f5129d481ba9515d10a01caffb7aeb6ae91b1aea | 8,360 | py | Python | build/config/fuchsia/build_manifest.py | metahashorg/v8_vm | 0d2ca034d48cc4b796ddb52730ebc06ed21509ab | [
"BSD-3-Clause"
] | 1 | 2019-04-25T17:50:34.000Z | 2019-04-25T17:50:34.000Z | build/config/fuchsia/build_manifest.py | metahashorg/v8_vm | 0d2ca034d48cc4b796ddb52730ebc06ed21509ab | [
"BSD-3-Clause"
] | null | null | null | build/config/fuchsia/build_manifest.py | metahashorg/v8_vm | 0d2ca034d48cc4b796ddb52730ebc06ed21509ab | [
"BSD-3-Clause"
] | 1 | 2018-11-28T07:47:41.000Z | 2018-11-28T07:47:41.000Z | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Creates a archive manifest used for Fuchsia package generation.
Arguments:
root_dir: The absolute path to the Chromium source tree root.
out_dir: Th... | 34.979079 | 80 | 0.659569 |
7a5991c4ff2c03b0be5dc9eb8c4e928eddea6fbf | 11,529 | py | Python | web/server.py | minus34/census-loader | 89e16fba1df7b962122ee874dd3e18115f27ba64 | [
"Apache-2.0"
] | 32 | 2017-06-06T23:47:18.000Z | 2022-03-10T02:54:57.000Z | web/server.py | minus34/census-loader | 89e16fba1df7b962122ee874dd3e18115f27ba64 | [
"Apache-2.0"
] | 8 | 2017-06-28T04:32:19.000Z | 2020-03-06T05:10:13.000Z | web/server.py | minus34/census-loader | 89e16fba1df7b962122ee874dd3e18115f27ba64 | [
"Apache-2.0"
] | 13 | 2017-06-28T23:42:48.000Z | 2021-11-21T06:45:43.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import arguments
import ast
import json
import psycopg2
import psycopg2.extras
# import utils
from datetime import datetime
from contextlib import contextmanager
from flask import Flask
from flask import render_template
from flask import request
from flask import Respons... | 33.417391 | 119 | 0.623731 |
52da92196891be66e044fdcc39ef93ee13972318 | 1,075 | py | Python | download_model.py | jterrellSchool21/maya_tg_www | b31047344afe2976969450a2160fd7c90dfc8fdf | [
"MIT"
] | 38 | 2020-03-27T17:00:22.000Z | 2021-11-05T19:39:35.000Z | download_model.py | jterrellSchool21/maya_tg_www | b31047344afe2976969450a2160fd7c90dfc8fdf | [
"MIT"
] | null | null | null | download_model.py | jterrellSchool21/maya_tg_www | b31047344afe2976969450a2160fd7c90dfc8fdf | [
"MIT"
] | 22 | 2020-04-03T06:49:09.000Z | 2021-09-22T11:26:26.000Z | import os
import sys
import requests
from tqdm import tqdm
if len(sys.argv) != 2:
print('You must enter the model name as a parameter, e.g.: download_model.py 117M')
sys.exit(1)
model = sys.argv[1]
subdir = os.path.join('models', model)
if not os.path.exists(subdir):
os.makedirs(subdir)
subdir = subdir.r... | 37.068966 | 146 | 0.660465 |
eae0b660d4ee956f93f1b4282a9888d9bed0a501 | 249,121 | py | Python | tests/test_browser.py | RyanCargan/emscripten | 6d3859f88e1d6394395760153c0a8cfa6a876ac7 | [
"MIT"
] | null | null | null | tests/test_browser.py | RyanCargan/emscripten | 6d3859f88e1d6394395760153c0a8cfa6a876ac7 | [
"MIT"
] | null | null | null | tests/test_browser.py | RyanCargan/emscripten | 6d3859f88e1d6394395760153c0a8cfa6a876ac7 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import argparse
import json
import multiprocessing
imp... | 48.943222 | 324 | 0.646798 |
2554f7e3768b64c8fa49f18a84e60a830fcdf6f3 | 210 | py | Python | bitmovin_api_sdk/models/max_ctu_size.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 11 | 2019-07-03T10:41:16.000Z | 2022-02-25T21:48:06.000Z | bitmovin_api_sdk/models/max_ctu_size.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 8 | 2019-11-23T00:01:25.000Z | 2021-04-29T12:30:31.000Z | bitmovin_api_sdk/models/max_ctu_size.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 13 | 2020-01-02T14:58:18.000Z | 2022-03-26T12:10:30.000Z | # coding: utf-8
from enum import Enum
from six import string_types, iteritems
from bitmovin_api_sdk.common.poscheck import poscheck_model
class MaxCtuSize(Enum):
S16 = "16"
S32 = "32"
S64 = "64"
| 17.5 | 59 | 0.714286 |
624a008b24c5b07276d065c342bb13f2ccd7d483 | 9,418 | py | Python | scico/test/linop/test_radon_svmbir.py | lanl/scico | 976c9e5833f8f67eed2eaa43460d89fb09bb9f78 | [
"BSD-3-Clause"
] | 18 | 2021-09-21T18:55:11.000Z | 2022-03-21T20:13:05.000Z | scico/test/linop/test_radon_svmbir.py | lanl/scico | 976c9e5833f8f67eed2eaa43460d89fb09bb9f78 | [
"BSD-3-Clause"
] | 218 | 2021-09-21T21:45:08.000Z | 2022-03-30T18:45:27.000Z | scico/test/linop/test_radon_svmbir.py | lanl/scico | 976c9e5833f8f67eed2eaa43460d89fb09bb9f78 | [
"BSD-3-Clause"
] | 2 | 2021-09-23T22:44:47.000Z | 2021-12-18T16:01:43.000Z | import numpy as np
import jax
import pytest
import scico
import scico.numpy as snp
from scico.linop import Diagonal
from scico.loss import SquaredL2Loss
from scico.test.functional.prox import prox_test
from scico.test.linop.test_linop import adjoint_test
try:
import svmbir
from scico.linop.radon_svmbir imp... | 25.592391 | 100 | 0.649289 |
aaf746f29c6a205d2535f87547ed424e7393a272 | 1,130 | py | Python | asset/migrations/0003_assethistory.py | shoaibsaikat/Django-Office-Management-BackEnd | bb8ec201e4d414c16f5bac1907a2641d80c5970a | [
"Apache-2.0"
] | null | null | null | asset/migrations/0003_assethistory.py | shoaibsaikat/Django-Office-Management-BackEnd | bb8ec201e4d414c16f5bac1907a2641d80c5970a | [
"Apache-2.0"
] | null | null | null | asset/migrations/0003_assethistory.py | shoaibsaikat/Django-Office-Management-BackEnd | bb8ec201e4d414c16f5bac1907a2641d80c5970a | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.6 on 2021-10-06 09:57
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),
('asset', '0002_auto_20211... | 41.851852 | 160 | 0.676991 |
21397310f50ad329f721ed383d65ab99970a3423 | 10,208 | py | Python | modoboa/admin/tests/test_alias.py | HarshCasper/modoboa | a00baa0593107992f545ee3e89cd4346b9615a96 | [
"0BSD"
] | 1,602 | 2016-12-15T14:25:34.000Z | 2022-03-31T16:49:25.000Z | modoboa/admin/tests/test_alias.py | sebageek/modoboa | 57f5d57ea60a57e8dcac970085dfc07082481fc6 | [
"0BSD"
] | 1,290 | 2016-12-14T15:39:05.000Z | 2022-03-31T13:49:09.000Z | modoboa/admin/tests/test_alias.py | sebageek/modoboa | 57f5d57ea60a57e8dcac970085dfc07082481fc6 | [
"0BSD"
] | 272 | 2016-12-22T11:58:18.000Z | 2022-03-17T15:57:24.000Z | """Admin test cases."""
from django.urls import reverse
from modoboa.core.models import User
from modoboa.lib.tests import ModoTestCase
from .. import factories
from ..models import Alias, AliasRecipient, Domain
class AliasTestCase(ModoTestCase):
@classmethod
def setUpTestData(cls): # NOQA:N802
""... | 34.958904 | 80 | 0.561912 |
3b7a0f3182cd32a3e5a4bd1a8fb9f3ba526f9afa | 335 | py | Python | tests/test_day03.py | khwilson/advent2021 | 6499b883f1b6d7366f3fe75dc229d646154a4cf8 | [
"MIT"
] | null | null | null | tests/test_day03.py | khwilson/advent2021 | 6499b883f1b6d7366f3fe75dc229d646154a4cf8 | [
"MIT"
] | null | null | null | tests/test_day03.py | khwilson/advent2021 | 6499b883f1b6d7366f3fe75dc229d646154a4cf8 | [
"MIT"
] | null | null | null | from pathlib import Path
from advent.solutions import day03
def test_part1(fixtures_path: Path):
solution = day03.Day03(fixtures_path / "test_input03.txt")
assert solution.part1() == 198
def test_part2(fixtures_path: Path):
solution = day03.Day03(fixtures_path / "test_input03.txt")
assert solution.... | 23.928571 | 62 | 0.737313 |
14a5afa530361abfca088c7445c2ac8c2c4e227a | 486 | py | Python | 01 Fundamental/Session 02/homework/shapez.py | culee/c4e | 775c53fa92a31696431760f58a79a52889bfb46f | [
"MIT"
] | null | null | null | 01 Fundamental/Session 02/homework/shapez.py | culee/c4e | 775c53fa92a31696431760f58a79a52889bfb46f | [
"MIT"
] | null | null | null | 01 Fundamental/Session 02/homework/shapez.py | culee/c4e | 775c53fa92a31696431760f58a79a52889bfb46f | [
"MIT"
] | null | null | null | from turtle import *
color("red")
speed(-1)
# a 1st shape
penup()
goto(-200,0)
pendown()
setheading(-30)
for i in range(4):
forward(50)
left(60)
forward(50)
left(120)
forward(50)
left(60)
forward(50)
right(150)
# a 2nd shape
penup()
goto(50,-80)
pendown()
setheading(0)
for i in rang... | 12.789474 | 26 | 0.545267 |
349d630cfa6f869dd6b4fd50b300080bd45d95be | 4,469 | py | Python | soc/hps_platform.py | marcmerlin/CFU-Playground | ce4909f986064c488c43f9e3e0ad9d0113bb51e4 | [
"Apache-2.0"
] | null | null | null | soc/hps_platform.py | marcmerlin/CFU-Playground | ce4909f986064c488c43f9e3e0ad9d0113bb51e4 | [
"Apache-2.0"
] | null | null | null | soc/hps_platform.py | marcmerlin/CFU-Playground | ce4909f986064c488c43f9e3e0ad9d0113bb51e4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from migen import Module, ClockDomain, Signal, If, log2_int
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.build.generic_platform im... | 35.188976 | 96 | 0.603491 |
6541a00ea045ee8eabbd31cba08aa39247888a60 | 9,220 | py | Python | facial-au/models/g_net.py | XLEric/Facial-Expression-Analysis | 7ba4004e38c1d4ef0844ad647ae33aaed948fb85 | [
"MIT"
] | null | null | null | facial-au/models/g_net.py | XLEric/Facial-Expression-Analysis | 7ba4004e38c1d4ef0844ad647ae33aaed948fb85 | [
"MIT"
] | null | null | null | facial-au/models/g_net.py | XLEric/Facial-Expression-Analysis | 7ba4004e38c1d4ef0844ad647ae33aaed948fb85 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
# import torch.nn.functional as F
# from models.sequence_modeling import BidirectionalLSTM
# from sequence_modeling import BidirectionalLSTM
class G_Net(nn.Module):
def __init__(self, n_class =2, input_size=112,dropout_factor=0.5):
super(G_Net, self).__init__()
... | 44.97561 | 120 | 0.602169 |
5ca415ee738c33f4368d7fadb82998d641f14f08 | 42,077 | py | Python | google/cloud/dialogflowcx_v3/services/pages/client.py | LaudateCorpus1/python-dialogflow-cx | cf9579171290ecf5afeeb6a38a3504857808a4ef | [
"Apache-2.0"
] | null | null | null | google/cloud/dialogflowcx_v3/services/pages/client.py | LaudateCorpus1/python-dialogflow-cx | cf9579171290ecf5afeeb6a38a3504857808a4ef | [
"Apache-2.0"
] | null | null | null | google/cloud/dialogflowcx_v3/services/pages/client.py | LaudateCorpus1/python-dialogflow-cx | cf9579171290ecf5afeeb6a38a3504857808a4ef | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 43.557971 | 167 | 0.622953 |
63f5ab46a47a92434b84822db85c2520be7554d5 | 7,476 | py | Python | mdns/Phidget22Python/Phidget22/Devices/Encoder.py | rabarar/phidget_docker | ceca56c86d27f291a4300a1257c02096862335ec | [
"MIT"
] | null | null | null | mdns/Phidget22Python/Phidget22/Devices/Encoder.py | rabarar/phidget_docker | ceca56c86d27f291a4300a1257c02096862335ec | [
"MIT"
] | null | null | null | mdns/Phidget22Python/Phidget22/Devices/Encoder.py | rabarar/phidget_docker | ceca56c86d27f291a4300a1257c02096862335ec | [
"MIT"
] | null | null | null | import sys
import ctypes
from Phidget22.PhidgetSupport import PhidgetSupport
from Phidget22.Async import *
from Phidget22.EncoderIOMode import EncoderIOMode
from Phidget22.PhidgetException import PhidgetException
from Phidget22.Phidget import Phidget
class Encoder(Phidget):
def __init__(self):
Phidget.__init__(se... | 27.185455 | 136 | 0.775548 |
1b6951090e88d8d03ab87ab816116811a0280642 | 1,127 | py | Python | apps/controllerx/cx_core/feature_support/cover.py | Digital-Lemon/controllerx | 6b90ede37fd7bfaa2771862e326bee48f7650d64 | [
"MIT"
] | null | null | null | apps/controllerx/cx_core/feature_support/cover.py | Digital-Lemon/controllerx | 6b90ede37fd7bfaa2771862e326bee48f7650d64 | [
"MIT"
] | null | null | null | apps/controllerx/cx_core/feature_support/cover.py | Digital-Lemon/controllerx | 6b90ede37fd7bfaa2771862e326bee48f7650d64 | [
"MIT"
] | null | null | null | from typing import Optional
from cx_core.controller import Controller
from cx_core.feature_support import FeatureSupport
SUPPORT_OPEN = 1
SUPPORT_CLOSE = 2
SUPPORT_SET_POSITION = 4
SUPPORT_STOP = 8
SUPPORT_OPEN_TILT = 16
SUPPORT_CLOSE_TILT = 32
SUPPORT_STOP_TILT = 64
SUPPORT_SET_TILT_POSITION = 128
class CoverSuppor... | 23.978723 | 50 | 0.614907 |
bd203bc4f1a332087deca733dfc405dcf7fe8419 | 1,226 | py | Python | plotdevice/run/__init__.py | plotdevice/plotdevice | 598f66a19cd58b8cfea8295024998b322ed66adf | [
"MIT"
] | 110 | 2015-01-17T03:22:51.000Z | 2022-02-12T06:04:27.000Z | plotdevice/run/__init__.py | Jason-Cooke/plotdevice | 598f66a19cd58b8cfea8295024998b322ed66adf | [
"MIT"
] | 38 | 2015-01-02T01:06:59.000Z | 2021-10-05T06:34:42.000Z | plotdevice/run/__init__.py | Jason-Cooke/plotdevice | 598f66a19cd58b8cfea8295024998b322ed66adf | [
"MIT"
] | 17 | 2015-04-28T17:29:03.000Z | 2021-07-11T21:26:25.000Z | import sys, site
from os.path import abspath, dirname, relpath, exists, join
try:
# under normal circumstances the PyObjC site-dir is in the .lib directory...
objc_dir = abspath(join(dirname(__file__), '../lib/PyObjC'))
# ...but if run from the sdist, the binaries will be in setup.py's build directory
... | 38.3125 | 111 | 0.707993 |
de1d7a9ed6f7205539ace97a6f1278377247bfbd | 7,803 | py | Python | ssd.py | sashuIya/ssd.pytorch | fe7d8722414fef4cce32f67422c896ef0c45d6bc | [
"MIT"
] | 1 | 2019-04-03T16:48:43.000Z | 2019-04-03T16:48:43.000Z | ssd.py | sashuIya/ssd.pytorch | fe7d8722414fef4cce32f67422c896ef0c45d6bc | [
"MIT"
] | null | null | null | ssd.py | sashuIya/ssd.pytorch | fe7d8722414fef4cce32f67422c896ef0c45d6bc | [
"MIT"
] | null | null | null | import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from layers import PriorBox, L2Norm, Detect
from data import v2
class SSD(nn.Module):
"""Single Shot Multibox Architecture
The network is composed of a base VGG network followed by the
added ... | 36.125 | 79 | 0.557606 |
e09ed76860f0023b59237963cceacd162af091a2 | 2,456 | py | Python | nikola/plugins/compile/rest/gist.py | Proteus-tech/nikola | 2862a8c6bf80709d69b1cb344c8ae8b73c29b353 | [
"MIT"
] | null | null | null | nikola/plugins/compile/rest/gist.py | Proteus-tech/nikola | 2862a8c6bf80709d69b1cb344c8ae8b73c29b353 | [
"MIT"
] | 1 | 2019-08-18T13:37:20.000Z | 2019-08-18T16:09:08.000Z | nikola/plugins/compile/rest/gist.py | Proteus-tech/nikola | 2862a8c6bf80709d69b1cb344c8ae8b73c29b353 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file is public domain according to its author, Brian Hsu
from docutils.parsers.rst import Directive, directives
from docutils import nodes
try:
import requests
except ImportError:
requests = None # NOQA
from nikola.plugin_categories import RestExtension
from nikola.utils impor... | 28.894118 | 77 | 0.572476 |
f8ab0f04fef9e66775fcce6582feef2ec5c8a453 | 59,539 | py | Python | airflow/gcp/operators/bigquery.py | codejunction/airflow | 04614841c77154cae64df175252a3bcf64d4e6ea | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/gcp/operators/bigquery.py | codejunction/airflow | 04614841c77154cae64df175252a3bcf64d4e6ea | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/gcp/operators/bigquery.py | codejunction/airflow | 04614841c77154cae64df175252a3bcf64d4e6ea | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- 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
#... | 42.864651 | 106 | 0.646198 |
c2fca984fb9bff76ee5994e64b003484fda2e811 | 394 | py | Python | pygeodiff/__init__.py | RichardScottOZ/geodiff | 485409147008bf500d33a1792ce4bf9799cee844 | [
"MIT"
] | null | null | null | pygeodiff/__init__.py | RichardScottOZ/geodiff | 485409147008bf500d33a1792ce4bf9799cee844 | [
"MIT"
] | null | null | null | pygeodiff/__init__.py | RichardScottOZ/geodiff | 485409147008bf500d33a1792ce4bf9799cee844 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
pygeodiff
-----------
This module provides tools for create diffs of geospatial data formats
:copyright: (c) 2019 Peter Petrik
:license: MIT, see LICENSE for more details.
'''
from .main import GeoDiff
from .geodifflib import (
GeoDiffLibError,
GeoDiffLibConflict... | 23.176471 | 74 | 0.687817 |
470aef9374aab930a90d7d60073c3f382d7ea792 | 5,029 | py | Python | scripts/strace-jobtree.py | concc-build/concc | 6f31947604dc03ac2270c449a32d3eb7bf920964 | [
"MIT"
] | 2 | 2021-09-29T01:59:26.000Z | 2022-01-03T08:22:55.000Z | scripts/strace-jobtree.py | masnagam/concc | 6f31947604dc03ac2270c449a32d3eb7bf920964 | [
"MIT"
] | 7 | 2021-09-12T06:23:54.000Z | 2022-01-09T06:52:02.000Z | scripts/strace-jobtree.py | concc-build/concc | 6f31947604dc03ac2270c449a32d3eb7bf920964 | [
"MIT"
] | null | null | null | import glob
import json
import os
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def get_path_label(path):
if path.startswith('pipe:'):
return 'pipe'
if path.startswith('/workspace/'):
return 'src'
if path.startswith('/'):
return 'sys'
return 'src'
def collect_j... | 32.445161 | 83 | 0.563333 |
a8ebc37ae42bdea9d21236bd50ac9a956c2ee9b4 | 19,790 | py | Python | Bio/Align/Applications/_Clustalw.py | ntamas/biopython | ff12c3dd533274678113ecdbd88b0136fb77e565 | [
"PostgreSQL"
] | 1 | 2022-01-18T22:33:06.000Z | 2022-01-18T22:33:06.000Z | Bio/Align/Applications/_Clustalw.py | phillord/biopython | c8dfe46f192d6ccfac94b156cef024776545638e | [
"PostgreSQL"
] | null | null | null | Bio/Align/Applications/_Clustalw.py | phillord/biopython | c8dfe46f192d6ccfac94b156cef024776545638e | [
"PostgreSQL"
] | null | null | null | # Copyright 2009 by Cymon J. Cox. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Command line wrapper for the multiple alignment program Clustal W.
"""
from __future__ impor... | 58.205882 | 94 | 0.466246 |
8eec2ec0ec661ff99cb2e77523d79230990cd9b9 | 8,702 | py | Python | test/test_faiss_and_milvus.py | bhanuprakashd/haystack | db9eeeb6fd7c24e7213c682466e6fb93190bf36f | [
"Apache-2.0"
] | null | null | null | test/test_faiss_and_milvus.py | bhanuprakashd/haystack | db9eeeb6fd7c24e7213c682466e6fb93190bf36f | [
"Apache-2.0"
] | null | null | null | test/test_faiss_and_milvus.py | bhanuprakashd/haystack | db9eeeb6fd7c24e7213c682466e6fb93190bf36f | [
"Apache-2.0"
] | null | null | null | import faiss
import numpy as np
import pytest
from haystack import Document
from haystack.pipeline import DocumentSearchPipeline
from haystack.document_store.faiss import FAISSDocumentStore
from haystack.pipeline import Pipeline
from haystack.retriever.dense import EmbeddingRetriever
DOCUMENTS = [
{"name": "name_1... | 41.836538 | 111 | 0.728913 |
7e50b135b9e387b2ef472aa85359098e872f3b0c | 206 | py | Python | code/1085.py | minssoj/Learning_Algorithm_Up | 45ec4e2eb4c07c9ec907a74dbd31370e1645c50b | [
"MIT"
] | null | null | null | code/1085.py | minssoj/Learning_Algorithm_Up | 45ec4e2eb4c07c9ec907a74dbd31370e1645c50b | [
"MIT"
] | null | null | null | code/1085.py | minssoj/Learning_Algorithm_Up | 45ec4e2eb4c07c9ec907a74dbd31370e1645c50b | [
"MIT"
] | null | null | null | # [기초-종합] 소리 파일 저장용량 계산하기(설명)
# minso.jeong@daum.net
'''
문제링크 : https://www.codeup.kr/problem.php?id=1085
'''
h, b, c, s = map(int, input().split())
print('{:.1f} MB'.format(h * b * c * s / (8 *(2 ** 20)))) | 29.428571 | 57 | 0.553398 |
9a3ecdf77726ab991bb5aaf40827788ca23e5abe | 1,037 | py | Python | setup.py | emencia/emencia-django-forum | cda74ed7e5822675c340ee5ec71548d981bccd3b | [
"MIT"
] | null | null | null | setup.py | emencia/emencia-django-forum | cda74ed7e5822675c340ee5ec71548d981bccd3b | [
"MIT"
] | 3 | 2015-01-06T20:39:49.000Z | 2015-05-04T01:26:36.000Z | setup.py | emencia/emencia-django-forum | cda74ed7e5822675c340ee5ec71548d981bccd3b | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='emencia-django-forum',
version=__import__('forum').__version__,
description=__import__('forum').__doc__,
long_description=open('README.rst').read(),
author='David Thenon',
author_email='dthenon@emencia.com',
url='https://github.com/em... | 33.451613 | 71 | 0.628737 |
33dfeef548b52d9d5dd3015d16598e9d3837ca73 | 6,769 | py | Python | examples/all.py | ethankward/sympy | 44664d9f625a1c68bc492006cfe1012cb0b49ee4 | [
"BSD-3-Clause"
] | 2 | 2021-02-16T14:20:37.000Z | 2021-02-16T16:37:47.000Z | examples/all.py | ethankward/sympy | 44664d9f625a1c68bc492006cfe1012cb0b49ee4 | [
"BSD-3-Clause"
] | null | null | null | examples/all.py | ethankward/sympy | 44664d9f625a1c68bc492006cfe1012cb0b49ee4 | [
"BSD-3-Clause"
] | 1 | 2020-02-06T17:54:20.000Z | 2020-02-06T17:54:20.000Z | #!/usr/bin/env python
from __future__ import print_function
DESCRIPTION = """
Runs all the examples for testing purposes and reports successes and failures
to stderr. An example is marked successful if the running thread does not
throw an exception, for threaded examples, such as plotting, one needs to
check the stde... | 27.855967 | 84 | 0.638795 |
0538b37a2df96f40babcb0aba031817e98b4bffd | 19,958 | py | Python | starthinker/util/google_api/__init__.py | wunderkennd/starthinker | ec66e02d26e5636a55ecb56803a7cec638629ace | [
"Apache-2.0"
] | null | null | null | starthinker/util/google_api/__init__.py | wunderkennd/starthinker | ec66e02d26e5636a55ecb56803a7cec638629ace | [
"Apache-2.0"
] | null | null | null | starthinker/util/google_api/__init__.py | wunderkennd/starthinker | ec66e02d26e5636a55ecb56803a7cec638629ace | [
"Apache-2.0"
] | null | null | null | ###########################################################################
#
# 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
#
# https://www.apache.org/l... | 27.719444 | 153 | 0.644704 |
42e2e4e745c220f54c9419f53ad9a9c58be6e516 | 5,410 | py | Python | website/sphinx/conf.py | jfrery/hummingbird | 1c92c6619cf3b1f97aba69bc44e4a8a3d9de66fc | [
"MIT"
] | 1 | 2021-12-30T17:04:55.000Z | 2021-12-30T17:04:55.000Z | website/sphinx/conf.py | zama-ai/hummingbird | cba2e41e35f97fc06930071a23e00d87c69b879d | [
"MIT"
] | null | null | null | website/sphinx/conf.py | zama-ai/hummingbird | cba2e41e35f97fc06930071a23e00d87c69b879d | [
"MIT"
] | null | null | null | import sys
import os
import sphinx_rtd_theme
sys.path.insert(0, os.path.abspath(".."))
sys.path.insert(0, os.path.abspath("sphinxext"))
print(sys.path)
from github_link import make_linkcode_resolve # noqa
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys... | 30.914286 | 107 | 0.719593 |
2db755fc195c562b8764b7630e92ef5953d97db0 | 4,467 | py | Python | fruit-classification/fruit_classification.py | lcskrishna/my-pytorch-experiments | b846760bbf8dfa930fa914edcee8f1a71a43fc98 | [
"MIT"
] | null | null | null | fruit-classification/fruit_classification.py | lcskrishna/my-pytorch-experiments | b846760bbf8dfa930fa914edcee8f1a71a43fc98 | [
"MIT"
] | null | null | null | fruit-classification/fruit_classification.py | lcskrishna/my-pytorch-experiments | b846760bbf8dfa930fa914edcee8f1a71a43fc98 | [
"MIT"
] | null | null | null | import os
import sys
import argparse
import numpy as np
## Pytorch modules.
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
fruit_names = [
'Apple Braeburn',
'Apple Golden 1',
'Apple Golden 2',
'Apple Golden 3',
'Apple Granny Smith',
'Apple Red 1'... | 27.574074 | 95 | 0.598164 |
b28b9093bfa72e3399a50d5da92928be4e33ec6f | 27,064 | py | Python | certipy/find.py | Clayno/Certipy | 7dfc2cb8560874436a7110deac9a4c03b0908baf | [
"MIT"
] | null | null | null | certipy/find.py | Clayno/Certipy | 7dfc2cb8560874436a7110deac9a4c03b0908baf | [
"MIT"
] | null | null | null | certipy/find.py | Clayno/Certipy | 7dfc2cb8560874436a7110deac9a4c03b0908baf | [
"MIT"
] | null | null | null | # Certipy - Active Directory certificate abuse
#
# Description:
# Find certificate templates
#
# Authors:
# @ly4k (https://github.com/ly4k)
#
# References:
# https://stackoverflow.com/questions/38878647/python-convert-filetime-to-datetime-for-dates-before-1970
# https://github.com/GhostPack/Certify/blob/2b15303... | 32.450839 | 118 | 0.58188 |
7be535f3e2f51d0a7a047dd46d1ce907c3fb959a | 560 | py | Python | CodingInterviews/python/41_find_continuous_sequence_3.py | YorkFish/git_study | 6e023244daaa22e12b24e632e76a13e5066f2947 | [
"MIT"
] | null | null | null | CodingInterviews/python/41_find_continuous_sequence_3.py | YorkFish/git_study | 6e023244daaa22e12b24e632e76a13e5066f2947 | [
"MIT"
] | null | null | null | CodingInterviews/python/41_find_continuous_sequence_3.py | YorkFish/git_study | 6e023244daaa22e12b24e632e76a13e5066f2947 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding:utf-8
class Solution:
def FindContinuousSequence(self, tsum):
l, r = 1, 2
tmpSum = 3
res = []
while l < r:
if tmpSum > tsum:
tmpSum -= l
l += 1
else:
if tmpSum == tsum:
... | 20 | 60 | 0.432143 |
2d1053ec23653e989376712afe0e5de28595c752 | 23 | py | Python | tests.py | mamal72/shekam | dd64d503d34a4957edf28accbf4bd7e863f4fa13 | [
"MIT"
] | 1 | 2017-03-03T15:24:23.000Z | 2017-03-03T15:24:23.000Z | tests.py | mamal72/shekam | dd64d503d34a4957edf28accbf4bd7e863f4fa13 | [
"MIT"
] | null | null | null | tests.py | mamal72/shekam | dd64d503d34a4957edf28accbf4bd7e863f4fa13 | [
"MIT"
] | null | null | null | from main_test import * | 23 | 23 | 0.826087 |
e7ab59bff3f57fdb3f586b776af29028a535679a | 8,535 | py | Python | pretrained-model/stt/test/quartznet-ctc-librispeech-adam.py | ishine/malaya-speech | fd34afc7107af1656dff4b3201fa51dda54fde18 | [
"MIT"
] | 111 | 2020-08-31T04:58:54.000Z | 2022-03-29T15:44:18.000Z | pretrained-model/stt/test/quartznet-ctc-librispeech-adam.py | ishine/malaya-speech | fd34afc7107af1656dff4b3201fa51dda54fde18 | [
"MIT"
] | 14 | 2020-12-16T07:27:22.000Z | 2022-03-15T17:39:01.000Z | pretrained-model/stt/test/quartznet-ctc-librispeech-adam.py | ishine/malaya-speech | fd34afc7107af1656dff4b3201fa51dda54fde18 | [
"MIT"
] | 29 | 2021-02-09T08:57:15.000Z | 2022-03-12T14:09:19.000Z | import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0,1'
import tensorflow as tf
import malaya_speech
import malaya_speech.augmentation.waveform as augmentation
import malaya_speech.augmentation.spectrogram as mask_augmentation
import malaya_speech.train.model.quartznet as quartznet
import malaya_speech.train.model.ctc a... | 29.229452 | 80 | 0.624253 |
7bcca784efd39006741a3f0da263d071ea38f57a | 2,484 | py | Python | petroflow/src/abstract_classes.py | atwahsz/petroflow | 089ca9559a94a7b597cde94601999489ac43d5ec | [
"Apache-2.0"
] | 44 | 2019-10-15T07:03:14.000Z | 2022-01-11T09:09:24.000Z | petroflow/src/abstract_classes.py | atwahsz/petroflow | 089ca9559a94a7b597cde94601999489ac43d5ec | [
"Apache-2.0"
] | 15 | 2019-10-18T07:51:45.000Z | 2022-03-10T21:17:16.000Z | petroflow/src/abstract_classes.py | atwahsz/petroflow | 089ca9559a94a7b597cde94601999489ac43d5ec | [
"Apache-2.0"
] | 21 | 2019-10-30T14:21:54.000Z | 2022-03-23T16:19:34.000Z | """Implements abstract classes for WellSegment, Well and WellBatch."""
# pylint: disable=missing-docstring
from abc import ABCMeta, abstractmethod
class AbstractWellSegment(metaclass=ABCMeta):
"""Abstract class to check that all nesessary methods are implemented in
`WellSegment` class."""
@abstractmethod... | 17.131034 | 76 | 0.623994 |
4c7f889be44dd49de6d6b390ea50990c642b405b | 3,684 | py | Python | lasagne_extensions/layers/density_layers.py | ylfzr/ADGM | a29907ca75f9536f6632004ace17e959a66c542d | [
"MIT"
] | 117 | 2015-12-16T17:51:32.000Z | 2021-11-20T05:10:22.000Z | lasagne_extensions/layers/density_layers.py | ylfzr/ADGM | a29907ca75f9536f6632004ace17e959a66c542d | [
"MIT"
] | 6 | 2016-03-14T02:25:18.000Z | 2019-11-10T19:14:08.000Z | lasagne_extensions/layers/density_layers.py | ylfzr/ADGM | a29907ca75f9536f6632004ace17e959a66c542d | [
"MIT"
] | 39 | 2015-12-17T02:00:37.000Z | 2021-07-17T00:01:26.000Z | import numpy as np
import theano.tensor as T
import lasagne
from lasagne.layers.base import Layer
import math
class StandardNormalLogDensityLayer(lasagne.layers.MergeLayer):
def __init__(self, x, **kwargs):
input_lst = [x]
super(StandardNormalLogDensityLayer, self).__init__(input_lst, **kwargs)
... | 34.429907 | 106 | 0.594191 |
fabff3b84882b25ccc0d294e5bb71e731142f976 | 6,302 | py | Python | p2p/protocol.py | sgnoo/py-evm | ea08a4c37a61537f34b303e87928ca59f62cd5ec | [
"MIT"
] | null | null | null | p2p/protocol.py | sgnoo/py-evm | ea08a4c37a61537f34b303e87928ca59f62cd5ec | [
"MIT"
] | null | null | null | p2p/protocol.py | sgnoo/py-evm | ea08a4c37a61537f34b303e87928ca59f62cd5ec | [
"MIT"
] | 1 | 2018-07-03T22:17:54.000Z | 2018-07-03T22:17:54.000Z | from abc import ABC
import logging
import struct
from typing import (
Any,
Dict,
Generic,
List,
Tuple,
Type,
TypeVar,
TYPE_CHECKING,
Union,
)
import rlp
from rlp import sedes
from eth.constants import NULL_BYTE
from p2p.exceptions import (
MalformedMessage,
)
from p2p.utils im... | 34.25 | 97 | 0.651063 |
5b7cc41911e11fefa4f356652f1e0270c39bc897 | 31,740 | py | Python | _pytest/_code/code.py | solackerman/pytest | 0fc00c02a7a39ebd6c57886a85580ea3341e76eb | [
"MIT"
] | null | null | null | _pytest/_code/code.py | solackerman/pytest | 0fc00c02a7a39ebd6c57886a85580ea3341e76eb | [
"MIT"
] | 2 | 2017-07-15T22:12:00.000Z | 2017-08-09T00:34:51.000Z | _pytest/_code/code.py | solackerman/pytest | 0fc00c02a7a39ebd6c57886a85580ea3341e76eb | [
"MIT"
] | 1 | 2019-06-25T13:04:31.000Z | 2019-06-25T13:04:31.000Z | from __future__ import absolute_import, division, print_function
import sys
from inspect import CO_VARARGS, CO_VARKEYWORDS
import re
from weakref import ref
from _pytest.compat import _PY2, _PY3, PY35, safe_str
import py
builtin_repr = repr
reprlib = py.builtin._tryimport('repr', 'reprlib')
if _PY3:
from traceba... | 35.424107 | 117 | 0.578859 |
d47f234da9e9b6f2077bd048f448138f511aca06 | 570 | py | Python | yatube/posts/migrations/0011_auto_20210428_1256.py | Torolfr/hw05_final | a9732f241b2074fcf6642c6ae98e0574284ed84d | [
"MIT"
] | null | null | null | yatube/posts/migrations/0011_auto_20210428_1256.py | Torolfr/hw05_final | a9732f241b2074fcf6642c6ae98e0574284ed84d | [
"MIT"
] | null | null | null | yatube/posts/migrations/0011_auto_20210428_1256.py | Torolfr/hw05_final | a9732f241b2074fcf6642c6ae98e0574284ed84d | [
"MIT"
] | null | null | null | # Generated by Django 2.2.6 on 2021-04-28 09:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('posts', '0010_auto_20210427_2307'),
]
operations = [
migrations.AlterModelOptions(
name='group',
options={'verbose_name': 'Г... | 25.909091 | 112 | 0.592982 |
93374cac6146bfef4cdac5302f792e048e81491b | 582 | py | Python | arelle/examples/plugin/importTestGrandchild1.py | jukrupa/Arelle-master | 0f8108e60fa86c8e324c5aa453765c44766f882f | [
"Apache-2.0"
] | null | null | null | arelle/examples/plugin/importTestGrandchild1.py | jukrupa/Arelle-master | 0f8108e60fa86c8e324c5aa453765c44766f882f | [
"Apache-2.0"
] | null | null | null | arelle/examples/plugin/importTestGrandchild1.py | jukrupa/Arelle-master | 0f8108e60fa86c8e324c5aa453765c44766f882f | [
"Apache-2.0"
] | null | null | null | '''
pluginPackages test case
(c) Copyright 2012 Mark V Systems Limited, All rights reserved.
'''
def foo():
print ("imported unpackaged plug-in grandchild 1")
__pluginInfo__ = {
'name': 'Unpackaged Listed Import Grandchild 1.1',
'version': '0.9',
'description': "This is a packages-containing unpackaged ... | 27.714286 | 83 | 0.678694 |
a1a4703abf716f1c750735a5251da6ef8a79facb | 13,541 | py | Python | sqlparse/lexer.py | Yelp/sqlparse | a29c8c1fb827863c6b57d8811ed3b69e982a3877 | [
"BSD-3-Clause"
] | 4 | 2015-03-16T17:08:44.000Z | 2017-02-21T22:33:18.000Z | sqlparse/lexer.py | Yelp/sqlparse | a29c8c1fb827863c6b57d8811ed3b69e982a3877 | [
"BSD-3-Clause"
] | 3 | 2015-09-30T23:53:08.000Z | 2016-05-27T18:37:02.000Z | sqlparse/lexer.py | Yelp/sqlparse | a29c8c1fb827863c6b57d8811ed3b69e982a3877 | [
"BSD-3-Clause"
] | 7 | 2015-03-16T20:55:44.000Z | 2020-06-18T18:17:51.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2008 Andi Albrecht, albrecht.andi@gmail.com
#
# This module is part of python-sqlparse and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php.
"""SQL Lexer"""
# This code is based on the SqlLexer in pygments.
# http://pygments.org/
# It's s... | 37.613889 | 125 | 0.482461 |
31492226371c2b99b44d33e33ccd224fa423732d | 4,861 | py | Python | src/azure-cli/azure/cli/command_modules/synapse/operations/sparkpool.py | GalGrinblat/azure-cli | b30b9cf9f90d01b9b6708cc56b82e32cd7182dae | [
"MIT"
] | 1 | 2021-11-17T18:09:28.000Z | 2021-11-17T18:09:28.000Z | src/azure-cli/azure/cli/command_modules/synapse/operations/sparkpool.py | GalGrinblat/azure-cli | b30b9cf9f90d01b9b6708cc56b82e32cd7182dae | [
"MIT"
] | 1 | 2021-09-14T14:15:25.000Z | 2021-09-14T14:30:44.000Z | src/azure-cli/azure/cli/command_modules/synapse/operations/sparkpool.py | GalGrinblat/azure-cli | b30b9cf9f90d01b9b6708cc56b82e32cd7182dae | [
"MIT"
] | 2 | 2021-07-07T12:43:11.000Z | 2021-07-09T19:30:53.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 55.873563 | 140 | 0.666118 |
2d6a1c328abdb9cf6eda290a124ae92561b5fece | 2,854 | py | Python | causal_da/api_support/logging/param_history_manager.py | sharmapulkit/few-shot-domain-adaptation-by-causal-mechanism-transfer | 05b4cab288dbb2ad7e30bbd174c22beb39d5c4cd | [
"Apache-2.0"
] | null | null | null | causal_da/api_support/logging/param_history_manager.py | sharmapulkit/few-shot-domain-adaptation-by-causal-mechanism-transfer | 05b4cab288dbb2ad7e30bbd174c22beb39d5c4cd | [
"Apache-2.0"
] | null | null | null | causal_da/api_support/logging/param_history_manager.py | sharmapulkit/few-shot-domain-adaptation-by-causal-mechanism-transfer | 05b4cab288dbb2ad7e30bbd174c22beb39d5c4cd | [
"Apache-2.0"
] | null | null | null | from abc import abstractmethod
# Type hinting
from typing import Iterable, Dict, Any, List
from pandas import DataFrame
class ParamHistoryManagerBase:
"""The base class of a parameter history manager."""
@abstractmethod
def filter(self, param_grid: List[Dict[str, Any]]) -> Iterable[Dict]:
"""Give... | 35.675 | 123 | 0.592151 |
e7c958e28ff0520960c9180ea406fadf719db2df | 1,387 | py | Python | test/functional/bcs_gas_limit_overflow.py | btc20/bitcoin2.0 | e7a54b00ebd0e8d20f4d5315cc9a21c77ded25cd | [
"MIT"
] | null | null | null | test/functional/bcs_gas_limit_overflow.py | btc20/bitcoin2.0 | e7a54b00ebd0e8d20f4d5315cc9a21c77ded25cd | [
"MIT"
] | null | null | null | test/functional/bcs_gas_limit_overflow.py | btc20/bitcoin2.0 | e7a54b00ebd0e8d20f4d5315cc9a21c77ded25cd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.address import *
from test_framework.bitcoin2 import *
import sys
import random
import time
import io
cl... | 36.5 | 152 | 0.711608 |
3171aafdfda50783b155336d400ccfe1975157f6 | 1,664 | py | Python | mdd/transforms/defaults.py | orobix/mdd-domain-adaptation | 345af1db29f11071526423973ea8a886c824c1b9 | [
"MIT"
] | 16 | 2021-01-14T02:37:56.000Z | 2021-05-16T10:20:07.000Z | mdd/transforms/defaults.py | orobix/mdd-domain-adaptation | 345af1db29f11071526423973ea8a886c824c1b9 | [
"MIT"
] | null | null | null | mdd/transforms/defaults.py | orobix/mdd-domain-adaptation | 345af1db29f11071526423973ea8a886c824c1b9 | [
"MIT"
] | null | null | null | import albumentations
import torch
import torchvision
from albumentations.pytorch import ToTensorV2
def train(resize_size=256, crop_size=224):
return albumentations.Compose(
[
albumentations.Resize(resize_size, resize_size),
albumentations.RandomResizedCrop(crop_size, crop_size),
... | 30.814815 | 70 | 0.570913 |
88c9e26c72cfa6f30135e967cd427ccccc9b39a9 | 30 | py | Python | challenges/exc_01_01_01.py | teaglebuilt/interactive-code-blocks- | a5df7dc76684180c012f53b3e458daf87500ffcd | [
"MIT"
] | null | null | null | challenges/exc_01_01_01.py | teaglebuilt/interactive-code-blocks- | a5df7dc76684180c012f53b3e458daf87500ffcd | [
"MIT"
] | null | null | null | challenges/exc_01_01_01.py | teaglebuilt/interactive-code-blocks- | a5df7dc76684180c012f53b3e458daf87500ffcd | [
"MIT"
] | null | null | null | import json
print(___[____]) | 7.5 | 16 | 0.733333 |
a669e0fbc2c5966c03267466eee99dced3260dff | 323 | py | Python | Task-Week-4/Task-6/mean_var_std.py | Bijay555/innomatics-Apr21-internship | 69ff447b8303b9dec1242f7244f7b21e96420c1e | [
"MIT"
] | null | null | null | Task-Week-4/Task-6/mean_var_std.py | Bijay555/innomatics-Apr21-internship | 69ff447b8303b9dec1242f7244f7b21e96420c1e | [
"MIT"
] | null | null | null | Task-Week-4/Task-6/mean_var_std.py | Bijay555/innomatics-Apr21-internship | 69ff447b8303b9dec1242f7244f7b21e96420c1e | [
"MIT"
] | null | null | null | import numpy
nm = input().split()
n = int(nm[0])
m = int(nm[1])
arr = []
for i in range(n):
m = list(map(int, input().split()))
arr.append(m)
arr = numpy.array(arr)
mean = numpy.mean(arr, axis = 1)
var = numpy.var(arr, axis = 0)
std = numpy.std(arr)
print(mean)
print(var)
rnd = numpy.around(std, 11)
print(r... | 16.15 | 39 | 0.609907 |
dae36ac995612a38438c3f2a2491cd7dbd6db065 | 2,477 | py | Python | 2020/03/Day3-TobogganTrajectory.py | zseen/advent-of-code | 0c3f8e8f4d7fd7b7193e417f841ddec6997f265a | [
"MIT"
] | null | null | null | 2020/03/Day3-TobogganTrajectory.py | zseen/advent-of-code | 0c3f8e8f4d7fd7b7193e417f841ddec6997f265a | [
"MIT"
] | null | null | null | 2020/03/Day3-TobogganTrajectory.py | zseen/advent-of-code | 0c3f8e8f4d7fd7b7193e417f841ddec6997f265a | [
"MIT"
] | null | null | null | import unittest
import enum
from typing import List
from SlopeGradient import SlopeGradient
INPUT_FILE = "input.txt"
TEST_INPUT_FILE = "test_input.txt"
ALL_WALK_METHODS_DIRECTIONS = [SlopeGradient(1, 1), SlopeGradient(3, 1), SlopeGradient(5, 1), SlopeGradient(7, 1),
SlopeGradient(1, 2)]
... | 30.207317 | 114 | 0.702866 |
7518ffe496b51b6063eaf4ef2266b9a69bb26861 | 7,897 | py | Python | tools/azure-sdk-tools/packaging_tools/change_log.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | tools/azure-sdk-tools/packaging_tools/change_log.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | tools/azure-sdk-tools/packaging_tools/change_log.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | import json
import logging
from json_delta import diff
_LOGGER = logging.getLogger(__name__)
class ChangeLog:
def __init__(self, old_report, new_report):
self.features = []
self.breaking_changes = []
self._old_report = old_report
self._new_report = new_report
def build_md(sel... | 39.094059 | 151 | 0.645941 |
3164d584c1b9b64a42fbd9dae6ebb6f4c6c78697 | 55 | py | Python | config.py | Franr/caulfield | b6d3ae0e624ff10fb89637fd5be2a2314c08d22f | [
"MIT"
] | 2 | 2016-12-12T04:44:25.000Z | 2017-09-09T20:29:09.000Z | config.py | Franr/caulfield | b6d3ae0e624ff10fb89637fd5be2a2314c08d22f | [
"MIT"
] | 3 | 2016-12-12T02:46:36.000Z | 2016-12-13T00:56:09.000Z | config.py | Franr/caulfield | b6d3ae0e624ff10fb89637fd5be2a2314c08d22f | [
"MIT"
] | null | null | null | musixmatch_apikey = 'ee6f91bc62e049e77176590e43e3b4fa'
| 27.5 | 54 | 0.890909 |
746e93a5de04f7c39e5073735969f974ab750293 | 11,315 | py | Python | hydrus/client/gui/ClientGUILocatorSearchProviders.py | tasadar2/hydrus | 63c992048ca1d060391ce7e6a69576ec65e77d8f | [
"WTFPL"
] | null | null | null | hydrus/client/gui/ClientGUILocatorSearchProviders.py | tasadar2/hydrus | 63c992048ca1d060391ce7e6a69576ec65e77d8f | [
"WTFPL"
] | null | null | null | hydrus/client/gui/ClientGUILocatorSearchProviders.py | tasadar2/hydrus | 63c992048ca1d060391ce7e6a69576ec65e77d8f | [
"WTFPL"
] | null | null | null | from hydrus.client.gui.QLocator import QAbstractLocatorSearchProvider, QCalculatorSearchProvider, QLocatorSearchResult
from hydrus.core import HydrusGlobals as HG
from qtpy import QtWidgets as QW
from html import escape
def highlight_result_text( result_text: str, query_text: str ):
result_text = escape( result_... | 29.620419 | 182 | 0.526646 |
1718f7779e39285e875f1480196d9d0dd35ee244 | 12,548 | py | Python | twisted/internet/_dumbwin32proc.py | sxamit/twisted | 30f6966329c857c3631c60aeb420d84d7828e01e | [
"MIT",
"Unlicense"
] | 1 | 2017-08-07T14:52:02.000Z | 2017-08-07T14:52:02.000Z | Lib/site-packages/twisted/internet/_dumbwin32proc.py | adzhou/Python27 | a7113b69d54a04cc780143241c2f1fe81939ad3a | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/twisted/internet/_dumbwin32proc.py | adzhou/Python27 | a7113b69d54a04cc780143241c2f1fe81939ad3a | [
"bzip2-1.0.6"
] | 1 | 2018-11-07T12:52:07.000Z | 2018-11-07T12:52:07.000Z | # -*- test-case-name: twisted.test.test_process -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
http://isometri.cc/strips/gates_in_the_head
"""
from __future__ import print_function
import os
# Win32 imports
import win32api
import win32con
import win32event
import win32file
import wi... | 32.092072 | 93 | 0.609818 |
6b0db82e5214707668bd2e83c89fe310ea26182c | 1,951 | py | Python | django_categories/settings.py | artemudovyk-konstankino/django-categories | ed53496b836edad3ad3a7924b21fd6f1d73f12d1 | [
"Apache-2.0"
] | null | null | null | django_categories/settings.py | artemudovyk-konstankino/django-categories | ed53496b836edad3ad3a7924b21fd6f1d73f12d1 | [
"Apache-2.0"
] | null | null | null | django_categories/settings.py | artemudovyk-konstankino/django-categories | ed53496b836edad3ad3a7924b21fd6f1d73f12d1 | [
"Apache-2.0"
] | null | null | null | """Manages settings for the categories application."""
import collections
from django.conf import settings
from django.db.models import Q
from django.utils.translation import gettext_lazy as _
DEFAULT_SETTINGS = {
"ALLOW_SLUG_CHANGE": False,
"M2M_REGISTRY": {},
"FK_REGISTRY": {},
"THUMBNAIL_UPLOAD_PAT... | 34.839286 | 111 | 0.717581 |
a46c6c077bd254ed25e31d8212b15ebb7cf4358f | 1,944 | py | Python | 2018/day6.py | RutgerMoons/AdventOfCode | 89fc0a75199bcaa8d814ead823d22f76774c2e4a | [
"MIT"
] | null | null | null | 2018/day6.py | RutgerMoons/AdventOfCode | 89fc0a75199bcaa8d814ead823d22f76774c2e4a | [
"MIT"
] | null | null | null | 2018/day6.py | RutgerMoons/AdventOfCode | 89fc0a75199bcaa8d814ead823d22f76774c2e4a | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
with open('input/day6') as input:
coords = list(map(lambda x: (int(x.split(", ")[0]), int(x.split(", ")[1])), input.readlines()))
max_x = max(map(lambda x : x[0], coords))
max_y = max(map(lambda x : x[1], coords))
board_width = 3 * max_x
board_height = 3 * max_y
board = []
# cell:
# fst -> ... | 20.903226 | 96 | 0.613169 |
7e52e5459beef89dbde5df7e38aa4d430b9e1a6b | 129 | py | Python | anet/tasks/hexagrid/__init__.py | thomasaunger/Anet | 1d353f280a30c3207fa6d09af91a85c4955bbda4 | [
"BSD-3-Clause"
] | null | null | null | anet/tasks/hexagrid/__init__.py | thomasaunger/Anet | 1d353f280a30c3207fa6d09af91a85c4955bbda4 | [
"BSD-3-Clause"
] | null | null | null | anet/tasks/hexagrid/__init__.py | thomasaunger/Anet | 1d353f280a30c3207fa6d09af91a85c4955bbda4 | [
"BSD-3-Clause"
] | null | null | null | from gym.envs.registration import register
register(
id="ArdaEnv-v0",
entry_point="anet.tasks.hexagrid.envs:ArdaEnv",
)
| 18.428571 | 51 | 0.736434 |
65dfd5633a8b1f600d4eb0fb24939bbb23b8de3a | 17,270 | py | Python | tester/view_handler_dlma.py | pchero/asterisk-outbound | 62c48abe83a7868c2af2519517081022a85cf503 | [
"BSD-2-Clause"
] | 12 | 2015-11-26T10:54:47.000Z | 2021-05-26T08:35:49.000Z | tester/view_handler_dlma.py | surereddy/asterisk-outbound | 62c48abe83a7868c2af2519517081022a85cf503 | [
"BSD-2-Clause"
] | 70 | 2015-11-23T09:31:51.000Z | 2017-01-20T20:47:58.000Z | tester/view_handler_dlma.py | surereddy/asterisk-outbound | 62c48abe83a7868c2af2519517081022a85cf503 | [
"BSD-2-Clause"
] | 5 | 2017-09-10T12:25:48.000Z | 2020-06-07T16:06:25.000Z | # -*- coding: utf-8 -*-
"""
Created on Sat Dec 31 21:28:29 2016
@author: pchero
"""
import Tkinter as tk
import ttk
import tkFont
import tkSimpleDialog
class FrameMain(object):
container = None
action_handler = None
data_handler = None
# info
list_headers = ["uuid"]
detail_headers =... | 33.27553 | 123 | 0.597915 |
2f85b82afeb0484492440e51013fad3ee80205e5 | 2,774 | py | Python | ffthompy/postprocess.py | song2001/FFTHomPy | 2a3af3f2e310a9383b5402e2e521f6d4d4700c71 | [
"MIT"
] | 2 | 2019-05-27T00:19:56.000Z | 2019-05-27T00:28:34.000Z | ffthompy/postprocess.py | song2001/FFTHomPy | 2a3af3f2e310a9383b5402e2e521f6d4d4700c71 | [
"MIT"
] | null | null | null | ffthompy/postprocess.py | song2001/FFTHomPy | 2a3af3f2e310a9383b5402e2e521f6d4d4700c71 | [
"MIT"
] | 1 | 2019-05-27T00:28:36.000Z | 2019-05-27T00:28:36.000Z | import numpy as np
from ffthompy.general.base import Timer
from ffthompy.matvec import VecTri
def postprocess(pb, A, mat, solutions, results, primaldual):
"""
The function post-process the results.
"""
tim = Timer(name='postprocessing')
print('\npostprocessing')
matrices = {}
for pp in pb.... | 31.885057 | 79 | 0.524153 |
c94fc02141834e8d8cd553ec970589ff308dbd10 | 3,419 | py | Python | DataStructure-Algorithm/Divede-and-conquer/maximum_subarray.py | Supegg/Python_demo | 0ef0ba9edd2fa7e96b197549187292981bbdaf88 | [
"MIT"
] | null | null | null | DataStructure-Algorithm/Divede-and-conquer/maximum_subarray.py | Supegg/Python_demo | 0ef0ba9edd2fa7e96b197549187292981bbdaf88 | [
"MIT"
] | null | null | null | DataStructure-Algorithm/Divede-and-conquer/maximum_subarray.py | Supegg/Python_demo | 0ef0ba9edd2fa7e96b197549187292981bbdaf88 | [
"MIT"
] | null | null | null | from timeit import Timer
def di_cal_wrong(A):
max_sub_sum = -float('inf') # init
for i in range(len(A)):
for j in range(i+1, len(A)):
if sum(A[i:j+1]) > max_sub_sum:
max_sub_sum = sum(A[i:j+1])
low = i
high = j
return(max_sub_sum, low, h... | 31.081818 | 119 | 0.564493 |
a4992bb93c73501b558b6e10e88f47fe0b89a183 | 6,513 | py | Python | src/pymordemos/thermalblock_gui.py | TiKeil/pymor | 5c6b3b6e1714b5ede11ce7cf03399780ab29d252 | [
"Unlicense"
] | 1 | 2020-12-31T18:45:48.000Z | 2020-12-31T18:45:48.000Z | src/pymordemos/thermalblock_gui.py | TreeerT/pymor | e8b18d2d4c4b5998f0bd84f6728e365e0693b753 | [
"Unlicense"
] | null | null | null | src/pymordemos/thermalblock_gui.py | TreeerT/pymor | e8b18d2d4c4b5998f0bd84f6728e365e0693b753 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2020 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import sys
import time
import numpy as np
import OpenGL
from typer import A... | 34.643617 | 110 | 0.656994 |
24a37027c5a5bb38deb9a4f9d8876396d2819d47 | 3,662 | py | Python | src/build_tools/gen_win32_resource_header.py | kbc-developers/Mozc | 97f225ceb1759eedd58f4f09b16411bcb5a62885 | [
"BSD-3-Clause"
] | null | null | null | src/build_tools/gen_win32_resource_header.py | kbc-developers/Mozc | 97f225ceb1759eedd58f4f09b16411bcb5a62885 | [
"BSD-3-Clause"
] | null | null | null | src/build_tools/gen_win32_resource_header.py | kbc-developers/Mozc | 97f225ceb1759eedd58f4f09b16411bcb5a62885 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2010-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this... | 32.40708 | 79 | 0.733206 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.