hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a21ea3f7be2160152511d231c86be018a965ae7 | 527 | py | Python | parsec/commands/histories/delete_history.py | abretaud/parsec | 8ebcafac34b5d6df45de4cecc882b129bb604170 | [
"Apache-2.0"
] | null | null | null | parsec/commands/histories/delete_history.py | abretaud/parsec | 8ebcafac34b5d6df45de4cecc882b129bb604170 | [
"Apache-2.0"
] | null | null | null | parsec/commands/histories/delete_history.py | abretaud/parsec | 8ebcafac34b5d6df45de4cecc882b129bb604170 | [
"Apache-2.0"
] | null | null | null | import click
from parsec.cli import pass_context, json_loads
from parsec.decorators import custom_exception, dict_output, _arg_split
@click.command('delete_history')
@click.argument("history_id", type=str)
@click.option(
"--purge",
help="if ``True``, also purge (permanently delete) the history",
is_flag=T... | 21.08 | 71 | 0.732448 |
4a21eabb6a2a377243ea6d4737044c7ed6f810d4 | 2,922 | py | Python | blog/user/views.py | znf896/Django-React- | 44bfbffc8f6a6fa13e001f3fc4b42005afa426bc | [
"MIT"
] | 1 | 2021-05-10T15:29:00.000Z | 2021-05-10T15:29:00.000Z | blog/user/views.py | znf896/Django-React- | 44bfbffc8f6a6fa13e001f3fc4b42005afa426bc | [
"MIT"
] | 7 | 2020-09-07T12:44:21.000Z | 2022-02-26T18:35:20.000Z | blog/user/views.py | znf896/Django-React- | 44bfbffc8f6a6fa13e001f3fc4b42005afa426bc | [
"MIT"
] | null | null | null | # Create your views here.
from django.http import HttpRequest, HttpResponse, JsonResponse, HttpResponseBadRequest
import simplejson
from .models import User
import jwt
from datetime import datetime
from blog.settings import SECRET_KEY
import bcrypt
AUTHOR_VER = 60 * 60 * 8
def gen_token(user_id):
ret = jwt.encod... | 28.096154 | 88 | 0.578029 |
4a21eb8afcb395e3804302185844f4ffbc838ed2 | 847 | py | Python | src/sheets/spreadsheet.py | y3rsh/lawrencetrailhawks-treasury | 53418df0543daa62add686ca15c46ceadf98c3d8 | [
"MIT"
] | null | null | null | src/sheets/spreadsheet.py | y3rsh/lawrencetrailhawks-treasury | 53418df0543daa62add686ca15c46ceadf98c3d8 | [
"MIT"
] | null | null | null | src/sheets/spreadsheet.py | y3rsh/lawrencetrailhawks-treasury | 53418df0543daa62add686ca15c46ceadf98c3d8 | [
"MIT"
] | null | null | null | import os
import gspread
from oauth2client.service_account import ServiceAccountCredentials
def get_sheet(worksheet_name, worksheet_title):
# use creds to create a client to interact with the Google Drive API
scope = ['https://spreadsheets.google.com/feeds']
creds = ServiceAccountCredentials.from_json_keyfile_na... | 35.291667 | 93 | 0.765053 |
4a21ebcf22d9bed7d52354619074e0ff4034f6be | 31,217 | py | Python | formats/base.py | wyim-pgl/jcvi | f79ead2fb30a80ead4e3b9602e0bc4a256995864 | [
"BSD-2-Clause"
] | 2 | 2019-02-22T12:56:39.000Z | 2020-03-02T03:51:45.000Z | formats/base.py | wyim-pgl/jcvi | f79ead2fb30a80ead4e3b9602e0bc4a256995864 | [
"BSD-2-Clause"
] | null | null | null | formats/base.py | wyim-pgl/jcvi | f79ead2fb30a80ead4e3b9602e0bc4a256995864 | [
"BSD-2-Clause"
] | 1 | 2021-05-10T17:26:43.000Z | 2021-05-10T17:26:43.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import os.path as op
import math
import sys
import logging
from itertools import groupby, islice, cycle, izip
from Bio import SeqIO
from jcvi.apps.base import OptionParser, ActionDispatcher, sh, debug, need_update, \
mkdir, popen
debug()
FastaExt ... | 30.366732 | 97 | 0.551334 |
4a21ec55e38a00aed65b6c883517237a9855c49c | 6,090 | py | Python | make_photo_gallery.py | Tapyr/tapyr | 4235fba6dce169fe747cce4d17d88dcf4a3f9f1d | [
"BSD-3-Clause"
] | 6 | 2016-12-10T17:51:10.000Z | 2021-10-11T07:51:48.000Z | make_photo_gallery.py | Tapyr/tapyr | 4235fba6dce169fe747cce4d17d88dcf4a3f9f1d | [
"BSD-3-Clause"
] | null | null | null | make_photo_gallery.py | Tapyr/tapyr | 4235fba6dce169fe747cce4d17d88dcf4a3f9f1d | [
"BSD-3-Clause"
] | 3 | 2020-03-29T07:37:03.000Z | 2021-01-21T16:08:40.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2008-2014 Mag. Christian Tanzer. All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. tanzer@swing.co.at
# ****************************************************************************
#
# This module is licensed under the terms of the BSD 3-Clause License
# <http://www.... | 34.40678 | 84 | 0.534647 |
4a21eccbbad657de37602bc0cccb202df3e04148 | 2,292 | py | Python | airflow/operators/pig_operator.py | rubeshdcube/incubator-airflow | 5419fbb78a2ea2388456c356d2f899ea1991b2de | [
"Apache-2.0"
] | 6 | 2016-04-20T20:40:43.000Z | 2022-02-20T10:32:00.000Z | airflow/operators/pig_operator.py | curest0x1021/incubator-airflow | e6d3160a061dbaa6042d524095dcd1cbc15e0bcd | [
"Apache-2.0"
] | 8 | 2017-09-07T22:20:35.000Z | 2021-05-14T17:35:27.000Z | airflow/operators/pig_operator.py | curest0x1021/incubator-airflow | e6d3160a061dbaa6042d524095dcd1cbc15e0bcd | [
"Apache-2.0"
] | 9 | 2017-08-24T15:47:44.000Z | 2022-02-14T03:30:49.000Z | # -*- coding: utf-8 -*-
#
# 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
... | 32.742857 | 78 | 0.679319 |
4a21ee2903b0ad595960b9cc8e2b40960d26304c | 1,155 | py | Python | setup.py | gurneesh/harvey | 393308bfc2a833ddbbfe7aca4ddf157a7593aa73 | [
"MIT"
] | null | null | null | setup.py | gurneesh/harvey | 393308bfc2a833ddbbfe7aca4ddf157a7593aa73 | [
"MIT"
] | null | null | null | setup.py | gurneesh/harvey | 393308bfc2a833ddbbfe7aca4ddf157a7593aa73 | [
"MIT"
] | null | null | null | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
REQUIREMENTS = [
'flask == 1.*', # TODO: bump to v2 after thorough testing
'requests == 2.*',
'requests_unixsocket == 0.2.*',
'slackclient == 2.*',
'python-dotenv == 0.17.*',
]
DEV_REQUIREMENTS = [
'coveral... | 25.108696 | 73 | 0.606061 |
4a21ee3d0605529f089e67d4ae57631a2004a642 | 1,368 | py | Python | metricbeat/tests/system/test_kafka.py | wklken/beats | 60e8999da198f1c8c4242c8afc77e39a82b6e47f | [
"Apache-2.0"
] | 16 | 2018-08-22T03:29:31.000Z | 2021-09-05T14:01:10.000Z | metricbeat/tests/system/test_kafka.py | wklken/beats | 60e8999da198f1c8c4242c8afc77e39a82b6e47f | [
"Apache-2.0"
] | 3 | 2020-05-29T13:53:51.000Z | 2021-06-01T22:19:56.000Z | metricbeat/tests/system/test_kafka.py | andyhao567/beats | 242524e6d8e6b157ad1c2e1516dc49fd353fa895 | [
"Apache-2.0"
] | 6 | 2018-10-31T06:55:01.000Z | 2021-02-06T18:50:04.000Z | import os
import metricbeat
import unittest
from nose.plugins.attrib import attr
from nose.plugins.skip import SkipTest
class KafkaTest(metricbeat.BaseTest):
COMPOSE_SERVICES = ['kafka']
@unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test")
def test_partition(self):
"""
k... | 27.36 | 74 | 0.61769 |
4a21ee6a79cd156c7dd2b5ea54b8343632b359ce | 1,535 | py | Python | topsim/algorithms/scheduling.py | top-sim/topsim | 90cb3cff2612ced3d51f94fe852dc814dcca7730 | [
"MIT"
] | 2 | 2022-03-30T01:19:20.000Z | 2022-03-30T02:53:51.000Z | topsim/algorithms/scheduling.py | firewood1996/topsim | 90cb3cff2612ced3d51f94fe852dc814dcca7730 | [
"MIT"
] | 15 | 2020-10-21T08:35:12.000Z | 2022-01-20T07:55:24.000Z | topsim/algorithms/scheduling.py | firewood1996/topsim | 90cb3cff2612ced3d51f94fe852dc814dcca7730 | [
"MIT"
] | 1 | 2021-11-02T14:21:05.000Z | 2021-11-02T14:21:05.000Z | """
Algorithm presents the abstract base class for any Scheduling algorithm.
"""
from abc import ABC, abstractmethod
class Algorithm(ABC):
"""
Abstract base class for all Scheduling Algorithms (used in the dynamic
allocation by the 'scheduler').
The Algorithm base class only requires the single `ru... | 23.615385 | 135 | 0.616287 |
4a21eeb258ad5f918c06009c0830d960dcb1c5ba | 8,878 | py | Python | pandapower/results_bus.py | suzannejanssen/pandapower | 8d0d422c28924c85e774e0e357e4abff86ff3c55 | [
"BSD-3-Clause"
] | null | null | null | pandapower/results_bus.py | suzannejanssen/pandapower | 8d0d422c28924c85e774e0e357e4abff86ff3c55 | [
"BSD-3-Clause"
] | null | null | null | pandapower/results_bus.py | suzannejanssen/pandapower | 8d0d422c28924c85e774e0e357e4abff86ff3c55 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2018 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import numpy as np
from pandapower.auxiliary import _sum_by_group
from pandapower.idx_bus import VM, VA, PD, QD, LAM_P, LAM_Q, BAS... | 34.410853 | 115 | 0.575693 |
4a21f020550ea6baf20b0fb77cdb7e73dc22c703 | 12,962 | py | Python | tools/tcpstates.py | Birch-san/bcc | b374be886b555ead8feaad9ec2d86ccd39d748dd | [
"Apache-2.0"
] | 1 | 2021-07-07T12:38:15.000Z | 2021-07-07T12:38:15.000Z | tools/tcpstates.py | Birch-san/bcc | b374be886b555ead8feaad9ec2d86ccd39d748dd | [
"Apache-2.0"
] | null | null | null | tools/tcpstates.py | Birch-san/bcc | b374be886b555ead8feaad9ec2d86ccd39d748dd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# @lint-avoid-python-3-compatibility-imports
#
# tcpstates Trace the TCP session state changes with durations.
# For Linux, uses BCC, BPF. Embedded C.
#
# USAGE: tcpstates [-h] [-C] [-S] [interval [count]]
#
# This uses the sock:inet_sock_set_state tracepoint, add... | 32.982188 | 102 | 0.61094 |
4a21f0935d54f91bbeac7c6c4509ce6ed9bcd698 | 8,457 | py | Python | docs/conf.py | globocom/dbaas-zabbix | 3d38c522abcbaac26a6702101b0754b037332dba | [
"BSD-3-Clause"
] | 3 | 2017-01-24T10:56:39.000Z | 2019-07-23T12:19:29.000Z | docs/conf.py | globocom/dbaas-zabbix | 3d38c522abcbaac26a6702101b0754b037332dba | [
"BSD-3-Clause"
] | 5 | 2017-02-08T16:17:13.000Z | 2019-10-10T16:34:56.000Z | docs/conf.py | globocom/dbaas-zabbix | 3d38c522abcbaac26a6702101b0754b037332dba | [
"BSD-3-Clause"
] | 1 | 2019-10-10T16:32:27.000Z | 2019-10-10T16:32:27.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# ... | 30.752727 | 76 | 0.716093 |
4a21f0a97567cb67bf322139d09d8bf56fe824d7 | 91 | py | Python | authentication/urls.py | Rasel-Al-Mamun/Fiction-Django | b5f25b84abdabc62cf82af7cdfe63fd45f265ded | [
"MIT"
] | null | null | null | authentication/urls.py | Rasel-Al-Mamun/Fiction-Django | b5f25b84abdabc62cf82af7cdfe63fd45f265ded | [
"MIT"
] | null | null | null | authentication/urls.py | Rasel-Al-Mamun/Fiction-Django | b5f25b84abdabc62cf82af7cdfe63fd45f265ded | [
"MIT"
] | null | null | null | from .import views
from django.urls import path
app_name = 'auth'
urlpatterns = [
]
| 10.111111 | 28 | 0.681319 |
4a21f0c5eda434f87e7c58ac57241bea45b2894c | 279 | py | Python | src/rating/processing/bisect.py | alterway/processing-operator | f959bb023ff0b549897ee426a17a096b9437ab71 | [
"Apache-2.0"
] | null | null | null | src/rating/processing/bisect.py | alterway/processing-operator | f959bb023ff0b549897ee426a17a096b9437ab71 | [
"Apache-2.0"
] | null | null | null | src/rating/processing/bisect.py | alterway/processing-operator | f959bb023ff0b549897ee426a17a096b9437ab71 | [
"Apache-2.0"
] | null | null | null | import bisect
def get_closest_configs_bisect(timestamp, timestamps):
timestamps_len = len(timestamps)
if timestamps_len == 1:
return 0
index = bisect.bisect_left(timestamps, timestamp)
if index == timestamps_len:
return index - 1
return index | 27.9 | 54 | 0.702509 |
4a21f3279034131e287608aa7f238be08a6231f6 | 986 | py | Python | project4github/largest_digit.py | chinkaih319/SC101 | 25c179c96e0a2bbc4e47768c029ee4bf49e06245 | [
"MIT"
] | null | null | null | project4github/largest_digit.py | chinkaih319/SC101 | 25c179c96e0a2bbc4e47768c029ee4bf49e06245 | [
"MIT"
] | null | null | null | project4github/largest_digit.py | chinkaih319/SC101 | 25c179c96e0a2bbc4e47768c029ee4bf49e06245 | [
"MIT"
] | null | null | null | """
File: largest_digit.py
Name:
----------------------------------
This file recursively prints the biggest digit in
5 different integers, 12345, 281, 6, -111, -9453
If your implementation is correct, you should see
5, 8, 6, 1, 9 on Console.
"""
def main():
print(find_largest_digit(12345)) # 5
print(find_larg... | 18.603774 | 54 | 0.558824 |
4a21f32ebbdece2a011fd78d4e334f0837e9fc76 | 8,402 | py | Python | torch_geometric/graphgym/contrib/layer/generalconv.py | Kenneth-Schroeder/pytorch_geometric | f7ec9e964bfae1ce5fb21d9b2b30e9e717bf8e24 | [
"MIT"
] | 12,651 | 2017-10-28T15:14:24.000Z | 2021-09-12T07:22:57.000Z | torch_geometric/graphgym/contrib/layer/generalconv.py | Kenneth-Schroeder/pytorch_geometric | f7ec9e964bfae1ce5fb21d9b2b30e9e717bf8e24 | [
"MIT"
] | 2,472 | 2017-10-30T23:38:47.000Z | 2021-09-12T06:41:44.000Z | torch_geometric/graphgym/contrib/layer/generalconv.py | Kenneth-Schroeder/pytorch_geometric | f7ec9e964bfae1ce5fb21d9b2b30e9e717bf8e24 | [
"MIT"
] | 2,363 | 2017-12-01T13:25:05.000Z | 2021-09-12T07:23:09.000Z | import torch
import torch.nn as nn
from torch.nn import Parameter
from torch_scatter import scatter_add
from torch_geometric.nn.conv import MessagePassing
from torch_geometric.utils import add_remaining_self_loops
from torch_geometric.nn.inits import glorot, zeros
from torch_geometric.graphgym.config import cfg
clas... | 38.365297 | 79 | 0.580576 |
4a21f415874f39402c1cec6c6d51b94e95489831 | 22,103 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/ipv4trafficendpoint_ccf0ac687ab3e96bf323237e4242c33d.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/ipv4trafficendpoint_ccf0ac687ab3e96bf323237e4242c33d.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/ipv4trafficendpoint_ccf0ac687ab3e96bf323237e4242c33d.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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,... | 42.587669 | 420 | 0.64032 |
4a21f45043d55d317110d69215b26852191a4417 | 9,645 | py | Python | src/fileseq/utils.py | justinfx/fileseq | 9ec049373af37ec21a21d2a5564deb344a96f97f | [
"MIT"
] | 69 | 2019-09-25T13:08:14.000Z | 2022-03-21T07:47:24.000Z | src/fileseq/utils.py | justinfx/fileseq | 9ec049373af37ec21a21d2a5564deb344a96f97f | [
"MIT"
] | 28 | 2020-02-19T04:58:59.000Z | 2021-10-21T02:40:01.000Z | src/fileseq/utils.py | justinfx/fileseq | 9ec049373af37ec21a21d2a5564deb344a96f97f | [
"MIT"
] | 11 | 2020-04-14T10:22:06.000Z | 2021-12-06T09:49:00.000Z | #! /usr/bin/env python
"""
utils - General tools of use to fileseq operations.
"""
from __future__ import absolute_import, division
from builtins import bytes
from builtins import next
from builtins import range
from builtins import object
import future.utils as futils
import decimal
from itertools import chain, coun... | 29.138973 | 99 | 0.654536 |
4a21f55dbae7f5efc8428b682f48677b50551b4d | 71 | py | Python | py_tdlib/constructors/secret_chat_state_pending.py | Mr-TelegramBot/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 24 | 2018-10-05T13:04:30.000Z | 2020-05-12T08:45:34.000Z | py_tdlib/constructors/secret_chat_state_pending.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 3 | 2019-06-26T07:20:20.000Z | 2021-05-24T13:06:56.000Z | py_tdlib/constructors/secret_chat_state_pending.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 5 | 2018-10-05T14:29:28.000Z | 2020-08-11T15:04:10.000Z | from ..factory import Type
class secretChatStatePending(Type):
pass
| 11.833333 | 35 | 0.788732 |
4a21f6232cb09ce96806fd53d5e832c2f6ff0878 | 26,589 | py | Python | src/transformers/__init__.py | SoumyaBarikeri/transformers | 996c6e113404000f50444287aa8a31a174ebd92f | [
"Apache-2.0"
] | 1 | 2021-08-07T06:06:45.000Z | 2021-08-07T06:06:45.000Z | src/transformers/__init__.py | SoumyaBarikeri/transformers | 996c6e113404000f50444287aa8a31a174ebd92f | [
"Apache-2.0"
] | null | null | null | src/transformers/__init__.py | SoumyaBarikeri/transformers | 996c6e113404000f50444287aa8a31a174ebd92f | [
"Apache-2.0"
] | 2 | 2021-05-31T08:50:50.000Z | 2022-01-26T13:14:58.000Z | # flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
__version__ = "3.3.0"
# Work around to update TensorFlow's absl.logging threshold which alters the
# default Python logging output behavior when pre... | 35.499332 | 117 | 0.760427 |
4a21f6be64f592263dd23f2ec21509df09450bce | 791 | py | Python | test/test_grompp.py | bioexcel/virtualscreening | e973958e012e38f99b0c8ed2b798c5e5a7f72b22 | [
"Apache-2.0"
] | 3 | 2020-02-17T11:11:08.000Z | 2021-12-03T18:54:47.000Z | test/test_grompp.py | bioexcel/virtualscreening | e973958e012e38f99b0c8ed2b798c5e5a7f72b22 | [
"Apache-2.0"
] | 1 | 2019-12-05T15:32:50.000Z | 2019-12-10T16:13:08.000Z | test/test_grompp.py | bioexcel/virtualscreening | e973958e012e38f99b0c8ed2b798c5e5a7f72b22 | [
"Apache-2.0"
] | 2 | 2019-09-26T20:21:14.000Z | 2021-07-10T04:37:31.000Z | from os.path import join as opj
from test import fixtures as fx
from gromacs_wrapper.grompp import Grompp
class TestGrompp(object):
def setUp(self):
fx.test_setup(self,'grompp')
def tearDown(self):
fx.test_teardown(self)
def test_launch(self):
output_tpr_path = opj(self.propertie... | 35.954545 | 107 | 0.656131 |
4a21f70bbf38998b13ceefdcfd94e54a814ffcb9 | 706 | py | Python | util/chplenv/chplenv.py | MayukhSobo/chapel | c64476af40e5b49689983ac172fa201deb133af9 | [
"ECL-2.0",
"Apache-2.0"
] | 1,602 | 2015-01-06T11:26:31.000Z | 2022-03-30T06:17:21.000Z | util/chplenv/chplenv.py | sthagen/chapel | 888fcc282385f31fe866511e3652c4e88b7721a1 | [
"ECL-2.0",
"Apache-2.0"
] | 11,789 | 2015-01-05T04:50:15.000Z | 2022-03-31T23:39:19.000Z | util/chplenv/chplenv.py | sthagen/chapel | 888fcc282385f31fe866511e3652c4e88b7721a1 | [
"ECL-2.0",
"Apache-2.0"
] | 498 | 2015-01-08T18:58:18.000Z | 2022-03-20T15:37:45.000Z | import chpl_cpu
import chpl_atomics
import chpl_aux_filesys
import chpl_bin_subdir
import chpl_make
import chpl_platform
import chpl_comm
import chpl_comm_debug
import chpl_comm_segment
import chpl_comm_substrate
import chpl_compiler
import chpl_gasnet
import chpl_gmp
import chpl_hwloc
import chpl_jemalloc
import chpl_... | 19.611111 | 26 | 0.896601 |
4a21f7ae0a7049aa0e0ef42f49ae239149ad8ea3 | 1,123 | py | Python | src/models/classifier/__init__.py | alexmlamb/SPUDT | 5d4ff32c9e37a485c176d3e68c58723e544972e5 | [
"MIT"
] | null | null | null | src/models/classifier/__init__.py | alexmlamb/SPUDT | 5d4ff32c9e37a485c176d3e68c58723e544972e5 | [
"MIT"
] | null | null | null | src/models/classifier/__init__.py | alexmlamb/SPUDT | 5d4ff32c9e37a485c176d3e68c58723e544972e5 | [
"MIT"
] | null | null | null | # Model inspired from: https://github.com/szagoruyko/wide-residual-networks
from .train import train
from common.loaders import images
def parse_args(parser):
parser.add_argument('--dataset', type=str, default='mnist')
parser.add_argument('--dataset-loc', type=str, default='.')
parser.add_argument(... | 40.107143 | 118 | 0.707035 |
4a21f7d37d0e39fc4c5a191df087a53ee43ba73a | 545 | py | Python | core/management/commands/init_admin.py | HiroshiFuu/django-rest-drf-yasg-boilerplate | 93221b2dbca0635eb42a18096e805b00f36ff9c1 | [
"Apache-2.0"
] | null | null | null | core/management/commands/init_admin.py | HiroshiFuu/django-rest-drf-yasg-boilerplate | 93221b2dbca0635eb42a18096e805b00f36ff9c1 | [
"Apache-2.0"
] | null | null | null | core/management/commands/init_admin.py | HiroshiFuu/django-rest-drf-yasg-boilerplate | 93221b2dbca0635eb42a18096e805b00f36ff9c1 | [
"Apache-2.0"
] | null | null | null | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
class Command(BaseCommand):
help = "Initilize admin user"
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
if User.objects.all().count() == 0:
User.objects... | 34.0625 | 148 | 0.66422 |
4a21f9405c27f4bcfe005b80c08d74f5b04c1d29 | 4,203 | py | Python | modyz-streamlit/app1.py | KiranKhanna721/study-easy | 8ad33bbb958282ccdabcb0622e988d5a96ae1d2f | [
"MIT"
] | null | null | null | modyz-streamlit/app1.py | KiranKhanna721/study-easy | 8ad33bbb958282ccdabcb0622e988d5a96ae1d2f | [
"MIT"
] | null | null | null | modyz-streamlit/app1.py | KiranKhanna721/study-easy | 8ad33bbb958282ccdabcb0622e988d5a96ae1d2f | [
"MIT"
] | null | null | null | from langdetect import detect
from modzy import ApiClient
import streamlit as st
SECRET_KEY = 'modzy modelops are incredibles'
API_URL = "https://app.modzy.com/api"
API_KEY ="BLHlhckkavs13Oz3TZqm.MCwXnXb3KaSlLybyEXoP"
client = ApiClient(base_url=API_URL, api_key=API_KEY)
def text_topic_modeling(input_text):
... | 51.256098 | 88 | 0.626695 |
4a21f989038a760f70e112311126a813a683bdf5 | 6,263 | py | Python | mimo/abstractions.py | MichaelLutter/mimo | 8a6a770ee90cbd6fd5cc12141d19442a3477af2c | [
"MIT"
] | null | null | null | mimo/abstractions.py | MichaelLutter/mimo | 8a6a770ee90cbd6fd5cc12141d19442a3477af2c | [
"MIT"
] | null | null | null | mimo/abstractions.py | MichaelLutter/mimo | 8a6a770ee90cbd6fd5cc12141d19442a3477af2c | [
"MIT"
] | null | null | null | import abc
import copy
import numpy as np
from future.utils import with_metaclass
from mimo.util.text import progprint_xrange
# Base classes
class Distribution(with_metaclass(abc.ABCMeta, object)):
@abc.abstractmethod
def rvs(self, size=[]):
# random variates (samples)
pass
@abc.abstrac... | 28.729358 | 103 | 0.643781 |
4a21fa0e328b8baecf4b4e00d94feefbfe78d3bc | 68 | py | Python | ORCSchlange/__main__.py | Fabianexe/ORC-Schlange | c94ad41622ddcea2bc25a59c5debcfe4c823d9c7 | [
"Apache-2.0"
] | null | null | null | ORCSchlange/__main__.py | Fabianexe/ORC-Schlange | c94ad41622ddcea2bc25a59c5debcfe4c823d9c7 | [
"Apache-2.0"
] | null | null | null | ORCSchlange/__main__.py | Fabianexe/ORC-Schlange | c94ad41622ddcea2bc25a59c5debcfe4c823d9c7 | [
"Apache-2.0"
] | null | null | null | from ORCSchlange import main
if __name__ == "__main__":
main()
| 13.6 | 28 | 0.691176 |
4a21fb6866a37bf0546019a5293a39580da3e87a | 9,753 | py | Python | test/functional/mining_pos_reorg.py | OasisCoinTeam/oasis-1 | a5e996144bf484db751c5feb8ed38c94ab317ca5 | [
"MIT"
] | 10 | 2018-10-07T14:04:48.000Z | 2019-07-14T15:48:05.000Z | test/functional/mining_pos_reorg.py | OasisCoinTeam/oasis-1 | a5e996144bf484db751c5feb8ed38c94ab317ca5 | [
"MIT"
] | 3 | 2019-01-18T22:23:23.000Z | 2020-02-15T19:34:13.000Z | test/functional/mining_pos_reorg.py | OasisCoinTeam/oasis-1 | a5e996144bf484db751c5feb8ed38c94ab317ca5 | [
"MIT"
] | 14 | 2018-12-24T18:33:29.000Z | 2022-03-08T06:26:14.000Z | #!/usr/bin/env python3
# Copyright (c) 2019 The OASIS developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.authproxy import JSONRPCException
from test_framework.test_framework import OasisTestFramework
fr... | 46.665072 | 116 | 0.636317 |
4a21fc4ca03b5c70e7ea0acb2c16e9af3897afa4 | 1,167 | py | Python | userbot/plugins/gps.py | thecyberbyte-tech/Secktor-Userbot | 5ede9c98e4480ec48ad5dd114a5bf2da3df6dc3f | [
"MIT"
] | null | null | null | userbot/plugins/gps.py | thecyberbyte-tech/Secktor-Userbot | 5ede9c98e4480ec48ad5dd114a5bf2da3df6dc3f | [
"MIT"
] | null | null | null | userbot/plugins/gps.py | thecyberbyte-tech/Secktor-Userbot | 5ede9c98e4480ec48ad5dd114a5bf2da3df6dc3f | [
"MIT"
] | null | null | null | # Credits ;- @mrconfused
from geopy.geocoders import Nominatim
from userbot.utils import admin_cmd
from telethon.tl import types
from userbot import CMD_HELP
@borg.on(admin_cmd(pattern="gps ?(.*)"))
async def gps(event):
if event.fwd_from:
return
reply_to_id = event.message
if event.reply_to_msg_... | 25.933333 | 69 | 0.61868 |
4a21fcaa55dc4eb0e3b0e5341f990164f95fed1a | 2,780 | py | Python | lnt/server/db/search.py | llvm/lnt | 77e0a25f996a5363e23f701c0d995525a5c6484a | [
"Apache-2.0"
] | 19 | 2019-01-15T03:04:00.000Z | 2021-12-08T00:09:01.000Z | lnt/server/db/search.py | llvm/lnt | 77e0a25f996a5363e23f701c0d995525a5c6484a | [
"Apache-2.0"
] | 5 | 2019-04-11T06:22:18.000Z | 2021-09-13T17:41:14.000Z | lnt/server/db/search.py | llvm/lnt | 77e0a25f996a5363e23f701c0d995525a5c6484a | [
"Apache-2.0"
] | 21 | 2019-02-10T02:47:55.000Z | 2022-03-31T14:16:36.000Z | import re
def _naive_search_for_run(session, ts, query, num_results, default_machine):
"""
This 'naive' search doesn't rely on any indexes so can be used without
full-text search enabled. This does make it less clever however.
It is able to match queries for machine names and order numbers
(speci... | 33.902439 | 79 | 0.635971 |
4a21fd70e2181f6388fe357c63bec0d8b00df1c3 | 3,221 | py | Python | diagnostics/RMHD/plot_kspectrum.py | ykawazura/calliope | 343b72a0930d70332172a5d87a579b0f8dcced66 | [
"MIT"
] | 2 | 2022-02-04T19:27:11.000Z | 2022-02-05T05:37:38.000Z | diagnostics/RMHD/plot_kspectrum.py | ykawazura/calliope | 343b72a0930d70332172a5d87a579b0f8dcced66 | [
"MIT"
] | null | null | null | diagnostics/RMHD/plot_kspectrum.py | ykawazura/calliope | 343b72a0930d70332172a5d87a579b0f8dcced66 | [
"MIT"
] | 2 | 2022-02-03T10:45:48.000Z | 2022-02-03T10:48:28.000Z | # -*- coding: utf-8 -*-
from load import *
from fft import *
from plots import *
print('\nplotting kspectrum\n')
outdir = './fig_kspectrum/'
upe2_bin = sum_negative_kz2d(upe2_bin)
bpe2_bin = sum_negative_kz2d(bpe2_bin)
if nlz == nkz:
kp_end = np.argmin(np.abs(kpbin - kpbin.max()*2./3.))
if not is2D:
kz... | 35.788889 | 181 | 0.451723 |
4a21fed9fe9c470531f2020af790f8e83631f9c0 | 7,699 | py | Python | test/test_nt_misc.py | TOMOTON/rdflib | 388e47258c14adbf796172e61be629f0f5c34709 | [
"BSD-3-Clause"
] | 2 | 2021-02-06T17:36:05.000Z | 2021-04-21T07:33:39.000Z | test/test_nt_misc.py | pragya16067/rdflib | 6b5bd37ccc67bdec62d2e36d174eb7933b5020b2 | [
"BSD-3-Clause"
] | null | null | null | test/test_nt_misc.py | pragya16067/rdflib | 6b5bd37ccc67bdec62d2e36d174eb7933b5020b2 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import logging
import os
import re
from rdflib import Graph, Literal, URIRef
from rdflib.plugins.parsers import ntriples
from urllib.request import urlopen
log = logging.getLogger(__name__)
class NTTestCase(unittest.TestCase):
def testIssue859(self):
graphA = Graph()
graphB = Grap... | 38.113861 | 183 | 0.621769 |
4a21feeabc8e30b6ff43f946464501e905f96efd | 15,426 | py | Python | src/emuvim/test/unittests/test_resourcemodel.py | PedroPCardoso/fogbed | 11d9c8ce6ccd32ee71fbb77d719cc322dd9515da | [
"Apache-2.0"
] | null | null | null | src/emuvim/test/unittests/test_resourcemodel.py | PedroPCardoso/fogbed | 11d9c8ce6ccd32ee71fbb77d719cc322dd9515da | [
"Apache-2.0"
] | null | null | null | src/emuvim/test/unittests/test_resourcemodel.py | PedroPCardoso/fogbed | 11d9c8ce6ccd32ee71fbb77d719cc322dd9515da | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2015 SONATA-NFV
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 agreed to... | 41.245989 | 137 | 0.654868 |
4a21ff063180f88cc7e4269a01fd7e0275c70e87 | 4,561 | py | Python | test/mitmproxy/proxy2/layers/http/test_http_version_interop.py | itsintern/mitmproxy | b7efe9b2d4b986933f904912324b770dfb3e3da4 | [
"MIT"
] | 2 | 2022-03-21T16:47:15.000Z | 2022-03-24T11:38:12.000Z | test/mitmproxy/proxy2/layers/http/test_http_version_interop.py | Zer0Power/mitmproxy | b7efe9b2d4b986933f904912324b770dfb3e3da4 | [
"MIT"
] | null | null | null | test/mitmproxy/proxy2/layers/http/test_http_version_interop.py | Zer0Power/mitmproxy | b7efe9b2d4b986933f904912324b770dfb3e3da4 | [
"MIT"
] | null | null | null | from typing import Tuple
import h2.config
import h2.connection
import h2.events
from mitmproxy.http import HTTPFlow
from mitmproxy.proxy.protocol.http import HTTPMode
from mitmproxy.proxy2.commands import CloseConnection, OpenConnection, SendData
from mitmproxy.proxy2.context import Context, Server
from mitmproxy.pro... | 35.084615 | 115 | 0.653585 |
4a21ff1f809e8a338db7ed6d1960549ba1adae4a | 135 | py | Python | utils/__init__.py | tamnguyenvan/lipreading | 37f7fc4840cacad9767beba0452cfcc194a2ba1f | [
"Apache-2.0"
] | null | null | null | utils/__init__.py | tamnguyenvan/lipreading | 37f7fc4840cacad9767beba0452cfcc194a2ba1f | [
"Apache-2.0"
] | null | null | null | utils/__init__.py | tamnguyenvan/lipreading | 37f7fc4840cacad9767beba0452cfcc194a2ba1f | [
"Apache-2.0"
] | null | null | null | from .dataset import LRWDataset
from .dataset_lrw1000 import LRW1000_Dataset
from .dataset import AVDataset
from .cvtransforms import * | 33.75 | 44 | 0.851852 |
4a21ff762dcaa1e842347a88e852fa68e44a2f8b | 129,367 | py | Python | Lib/test/test_os.py | ekhavana/cpython | a0e3d2dd09346b01e7d29a35ed31ed28041570b1 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_os.py | ekhavana/cpython | a0e3d2dd09346b01e7d29a35ed31ed28041570b1 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_os.py | ekhavana/cpython | a0e3d2dd09346b01e7d29a35ed31ed28041570b1 | [
"PSF-2.0"
] | null | null | null | # As a test suite for the os module, this is woefully inadequate, but this
# does add tests for a few functions which have been determined to be more
# portable than they had been thought to be.
import asynchat
import asyncore
import codecs
import contextlib
import decimal
import errno
import fractions
import getpass
... | 37.23863 | 101 | 0.595005 |
4a22013f7c1f8e84fa1006b847fd38a6e09d9136 | 2,389 | py | Python | app/soc/views/helper/templates.py | jamslevy/gsoc | e995e1a8d34e0291ab988ba501ae4efc61f9516d | [
"Apache-2.0"
] | 1 | 2016-05-09T14:43:53.000Z | 2016-05-09T14:43:53.000Z | app/soc/views/helper/templates.py | jamslevy/gsoc | e995e1a8d34e0291ab988ba501ae4efc61f9516d | [
"Apache-2.0"
] | null | null | null | app/soc/views/helper/templates.py | jamslevy/gsoc | e995e1a8d34e0291ab988ba501ae4efc61f9516d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 34.128571 | 78 | 0.701549 |
4a2201d4e6342f3633b1f53b7c76ba1712de1244 | 4,197 | py | Python | mentalist/view/substitution.py | qkum/mentalist | fb6944f5f60d0964a085606abcdf6ad0dad8905f | [
"MIT"
] | 1,293 | 2017-11-07T15:36:24.000Z | 2022-03-30T06:28:34.000Z | mentalist/view/substitution.py | qkum/mentalist | fb6944f5f60d0964a085606abcdf6ad0dad8905f | [
"MIT"
] | 22 | 2018-01-17T12:49:55.000Z | 2021-12-24T03:45:08.000Z | mentalist/view/substitution.py | qkum/mentalist | fb6944f5f60d0964a085606abcdf6ad0dad8905f | [
"MIT"
] | 215 | 2017-11-07T19:55:20.000Z | 2022-03-30T06:28:36.000Z | import tkinter as Tk
from functools import partial
from .base import BaseNode
from .main import center_window
from .const import SUBSTITUTION_CHECKS, SPECIAL_TYPES
from .. import model
class SubstitutionNode(BaseNode):
'''Substitute one character for another
'''
def __init__(self, controller, master=None,... | 46.120879 | 183 | 0.627353 |
4a22023c68e05bd941096efad3c7f93687b5e08c | 1,609 | py | Python | milk2/milk2.py | jasonhuh/UASCO-Solutions | dfcd574d12b574f396ac041dc1b33c20e9282e5c | [
"MIT"
] | null | null | null | milk2/milk2.py | jasonhuh/UASCO-Solutions | dfcd574d12b574f396ac041dc1b33c20e9282e5c | [
"MIT"
] | null | null | null | milk2/milk2.py | jasonhuh/UASCO-Solutions | dfcd574d12b574f396ac041dc1b33c20e9282e5c | [
"MIT"
] | null | null | null | """
ID: jasonhu5
LANG: PYTHON3
TASK: milk2
"""
def solve(ar):
# Combine overlapping events
def merge_events(ar):
ar = sorted(ar, key=lambda x: x[0]) # Sort by start time
stack = [ar[0]]
for _, event in enumerate(ar[1:]):
top = stack[-1]
if top[1] >= event[0]:... | 32.836735 | 79 | 0.497825 |
4a220372594bc419c6e7de1c95df55a49cc8c5a0 | 12,520 | py | Python | Train_faceNet_model/Train+FaceNet+model/tf_slim/nets/inception_v3_test.py | yxing0225/Masked_Face_Detection-Recognition | 126c5bebcefb5b5fbbb105007f32574cb9359064 | [
"Apache-2.0"
] | 307 | 2019-06-28T00:25:39.000Z | 2022-03-27T15:56:15.000Z | Train_faceNet_model/Train+FaceNet+model/tf_slim/nets/inception_v3_test.py | yxing0225/Masked_Face_Detection-Recognition | 126c5bebcefb5b5fbbb105007f32574cb9359064 | [
"Apache-2.0"
] | 17 | 2019-07-26T08:21:40.000Z | 2022-02-25T02:53:23.000Z | Train_faceNet_model/Train+FaceNet+model/tf_slim/nets/inception_v3_test.py | yxing0225/Masked_Face_Detection-Recognition | 126c5bebcefb5b5fbbb105007f32574cb9359064 | [
"Apache-2.0"
] | 95 | 2019-06-30T05:44:07.000Z | 2022-03-28T04:38:52.000Z | # coding=utf-8
# coding=utf-8
# Copyright 2016 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
... | 39.746032 | 80 | 0.692093 |
4a220501b117daae1426ce85f57c2b902a8b2b36 | 7,775 | py | Python | report_stats_on_json_kg.py | RTXteam/RTX-KG2 | 2e4affbd423550e5b2456f97da07184a4833d66a | [
"MIT"
] | 3 | 2021-11-09T19:41:40.000Z | 2021-12-26T21:51:38.000Z | report_stats_on_json_kg.py | RTXteam/RTX-KG2 | 2e4affbd423550e5b2456f97da07184a4833d66a | [
"MIT"
] | 190 | 2021-05-22T01:25:49.000Z | 2022-03-20T05:05:37.000Z | report_stats_on_json_kg.py | RTXteam/RTX-KG2 | 2e4affbd423550e5b2456f97da07184a4833d66a | [
"MIT"
] | 1 | 2021-05-26T22:51:26.000Z | 2021-05-26T22:51:26.000Z | #!/usr/bin/env python3
'''Prints a JSON overview report of a JSON knowledge graph in Biolink format, to STDOUT.
Usage: report_stats_on_json_kg.py [--useSimplifiedPredicates] <inputKGFile.json> <outputKGFile.json>
The input file can be optionally gzipped (specify with the .gz extension).
'''
__author__ = 'Steph... | 42.486339 | 126 | 0.720129 |
4a22055c05768cad7b118754ca41fc27214ebb80 | 3,114 | py | Python | gitea_api/models/dismiss_pull_review_options.py | r7l/python-gitea-api | 31d3dba27ea7e551e2048a1230c4ab4d73365006 | [
"MIT"
] | 1 | 2022-02-09T23:43:26.000Z | 2022-02-09T23:43:26.000Z | gitea_api/models/dismiss_pull_review_options.py | r7l/python-gitea-api | 31d3dba27ea7e551e2048a1230c4ab4d73365006 | [
"MIT"
] | null | null | null | gitea_api/models/dismiss_pull_review_options.py | r7l/python-gitea-api | 31d3dba27ea7e551e2048a1230c4ab4d73365006 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Gitea API.
This documentation describes the Gitea API. # noqa: E501
OpenAPI spec version: 1.16.7
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class DismissPullReviewOptions(object):
"""NOTE: This... | 28.054054 | 83 | 0.563263 |
4a22065024f098e88d909e90f93566a9572e31fa | 3,198 | py | Python | google/cloud/asset_v1/types/__init__.py | Abdur-rahmaanJ/python-asset | c79d51d31dd04a6cf2b903d91259c093bf200010 | [
"Apache-2.0"
] | null | null | null | google/cloud/asset_v1/types/__init__.py | Abdur-rahmaanJ/python-asset | c79d51d31dd04a6cf2b903d91259c093bf200010 | [
"Apache-2.0"
] | null | null | null | google/cloud/asset_v1/types/__init__.py | Abdur-rahmaanJ/python-asset | c79d51d31dd04a6cf2b903d91259c093bf200010 | [
"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... | 26.429752 | 74 | 0.730457 |
4a2206e795477bb8b2367786fbb990a095120fca | 2,563 | py | Python | aleph/logic/resolver.py | nabla-c0d3/aleph | d0e4e04e23cb7ee3971298e33ccb1c5171ae0779 | [
"MIT"
] | 2 | 2021-01-09T17:27:23.000Z | 2021-01-09T17:27:25.000Z | aleph/logic/resolver.py | nabla-c0d3/aleph | d0e4e04e23cb7ee3971298e33ccb1c5171ae0779 | [
"MIT"
] | null | null | null | aleph/logic/resolver.py | nabla-c0d3/aleph | d0e4e04e23cb7ee3971298e33ccb1c5171ae0779 | [
"MIT"
] | null | null | null | # Bulk object resolver.
# The purpose of this module is to quickly load objects of different
# types from the backend. It's typically used by the API serialiser
# to ensure that nested objects are loaded only once.
#
import logging
from normality import stringify
from collections import defaultdict
from aleph.core imp... | 30.879518 | 81 | 0.672649 |
4a2207259cdc5fae2e34c8d285f4399b293cef6d | 38,158 | py | Python | salt/states/esxi.py | nielsk/salt | be5d400d903e68d99c216fd63a7146d86a64a55d | [
"Apache-2.0"
] | null | null | null | salt/states/esxi.py | nielsk/salt | be5d400d903e68d99c216fd63a7146d86a64a55d | [
"Apache-2.0"
] | null | null | null | salt/states/esxi.py | nielsk/salt | be5d400d903e68d99c216fd63a7146d86a64a55d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Manage VMware ESXi Hosts.
.. versionadded:: 2015.8.4
Dependencies
============
- pyVmomi Python Module
- ESXCLI
pyVmomi
-------
PyVmomi can be installed via pip:
.. code-block:: bash
pip install pyVmomi
.. note::
Version 6.0 of pyVmomi has some problems with SSL error handl... | 37.15482 | 113 | 0.568452 |
4a22073bc84efffe46e17ccae811a00b5bca20e6 | 15,838 | py | Python | core/forecastMod.py | champham/WrfHydroForcing | 90f1cbcc233eb007818ae159be81814e5754f233 | [
"BSD-3-Clause"
] | null | null | null | core/forecastMod.py | champham/WrfHydroForcing | 90f1cbcc233eb007818ae159be81814e5754f233 | [
"BSD-3-Clause"
] | null | null | null | core/forecastMod.py | champham/WrfHydroForcing | 90f1cbcc233eb007818ae159be81814e5754f233 | [
"BSD-3-Clause"
] | null | null | null | import datetime
import os
from core import bias_correction
from core import downscale
from core import err_handler
from core import layeringMod
from core import disaggregateMod
def process_forecasts(ConfigOptions, wrfHydroGeoMeta, inputForcingMod, suppPcpMod, MpiConfig, OutputObj):
"""
Main calling module fo... | 55.767606 | 141 | 0.607211 |
4a22082210a8bab1f61f322b0436afa738a166f9 | 6,484 | py | Python | qa/rpc-tests/zkey_import_export.py | amicoin/amicoin | 84673cb24619766d77b0c1695688ef9b40e20319 | [
"Unlicense"
] | null | null | null | qa/rpc-tests/zkey_import_export.py | amicoin/amicoin | 84673cb24619766d77b0c1695688ef9b40e20319 | [
"Unlicense"
] | null | null | null | qa/rpc-tests/zkey_import_export.py | amicoin/amicoin | 84673cb24619766d77b0c1695688ef9b40e20319 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2017 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import sys; assert sys.version_info < (3,), ur"This script does not run under Python 3. Please use Python 2.7.x."
fro... | 38.141176 | 113 | 0.635873 |
4a2208d41e53c61e63fb0afd3d97a36f176ad0ab | 17,100 | py | Python | src/bin/rifle.py | jrha/aquilon-tools | cfbd6c29eed5facc278bbfe315199bba59f543b4 | [
"Apache-2.0"
] | null | null | null | src/bin/rifle.py | jrha/aquilon-tools | cfbd6c29eed5facc278bbfe315199bba59f543b4 | [
"Apache-2.0"
] | null | null | null | src/bin/rifle.py | jrha/aquilon-tools | cfbd6c29eed5facc278bbfe315199bba59f543b4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
##############################################################################
#
# See COPYRIGHT file in source distribution for copyright holders
#
# 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... | 33.595285 | 80 | 0.460643 |
4a220a20e4f204d62199ef36efb1c09c65e970db | 547 | py | Python | docs/fund_info.py | txqzzz/xingqi_fund | d5cb59759a713ccddd95b6ba6e09fc8f0dae9d84 | [
"MIT"
] | null | null | null | docs/fund_info.py | txqzzz/xingqi_fund | d5cb59759a713ccddd95b6ba6e09fc8f0dae9d84 | [
"MIT"
] | null | null | null | docs/fund_info.py | txqzzz/xingqi_fund | d5cb59759a713ccddd95b6ba6e09fc8f0dae9d84 | [
"MIT"
] | null | null | null | from typing import List, Any, Union
fund_id: List[Union[str, Any]] = ['000834', '519674', '160225', '007301', '161631', '000148', '007531', '007874',
'161725', '161726', '161720', '006020', '110003', '110022', '161028', '320007',
'007824', '001593', '... | 68.375 | 113 | 0.464351 |
4a220a466fdcfa14be15986d352cafa55f1a679f | 739 | py | Python | integration/airflow/openlineage/airflow/extractors/__init__.py | kedar-cz/OpenLineage | bd75b53c84fd9655f593c4f161e15c14785eb93e | [
"Apache-2.0"
] | 1 | 2021-11-19T15:00:39.000Z | 2021-11-19T15:00:39.000Z | integration/airflow/openlineage/airflow/extractors/__init__.py | kedar-cz/OpenLineage | bd75b53c84fd9655f593c4f161e15c14785eb93e | [
"Apache-2.0"
] | null | null | null | integration/airflow/openlineage/airflow/extractors/__init__.py | kedar-cz/OpenLineage | bd75b53c84fd9655f593c4f161e15c14785eb93e | [
"Apache-2.0"
] | 1 | 2021-09-07T04:16:02.000Z | 2021-09-07T04:16:02.000Z | # 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 th... | 43.470588 | 75 | 0.788904 |
4a220ab75433d967bc55e921cdf77cb77697b3bd | 277 | py | Python | md4c/types.py | Exahilosys/md4c | 3c37ba8892870af212108c546a6249cea0c4199e | [
"MIT"
] | null | null | null | md4c/types.py | Exahilosys/md4c | 3c37ba8892870af212108c546a6249cea0c4199e | [
"MIT"
] | null | null | null | md4c/types.py | Exahilosys/md4c | 3c37ba8892870af212108c546a6249cea0c4199e | [
"MIT"
] | null | null | null | import ctypes
__all__ = ('char', 'char_p', 'size', 'offset', 'enum', 'void', 'ires', 'vres')
char = ctypes.c_char
char_p = ctypes.c_char_p
size = ctypes.c_uint
offset = ctypes.c_uint
enum = ctypes.c_uint
void = ctypes.c_void_p
ires = ctypes.c_int
vres = void
| 9.551724 | 78 | 0.65704 |
4a220acc41a46e1d5f13169a01754f4721c58de8 | 465 | py | Python | scripts/wanderer_self_test.py | IRASatUC/turtle_roomba | e562de7a875e3f732e80002f658174f6e0496cba | [
"MIT"
] | null | null | null | scripts/wanderer_self_test.py | IRASatUC/turtle_roomba | e562de7a875e3f732e80002f658174f6e0496cba | [
"MIT"
] | null | null | null | scripts/wanderer_self_test.py | IRASatUC/turtle_roomba | e562de7a875e3f732e80002f658174f6e0496cba | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import absolute_import, print_function
import numpy as np
import math
import random
import time
import rospy
import tf
from geometry_msgs.msg import Point, Pose, Twist
from wanderer import Wanderer
if __name__ == "__main__":
rospy.init_node("wanderer_test", anonymous=True, log... | 23.25 | 73 | 0.797849 |
4a220ae2c4938810e88f0a475494c6f3817a3487 | 13,973 | py | Python | build/PureCloudPlatformClientV2/models/o_auth_client_request.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 10 | 2019-02-22T00:27:08.000Z | 2021-09-12T23:23:44.000Z | build/PureCloudPlatformClientV2/models/o_auth_client_request.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 5 | 2018-06-07T08:32:00.000Z | 2021-07-28T17:37:26.000Z | build/PureCloudPlatformClientV2/models/o_auth_client_request.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 6 | 2020-04-09T17:43:07.000Z | 2022-02-17T08:48:05.000Z | # coding: utf-8
"""
Copyright 2016 SmartBear Software
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... | 37.461126 | 731 | 0.648966 |
4a220b6bce4fa4e938a78f5bdbdf78fcaa742ff4 | 9,706 | py | Python | accelerator/methods.py | sebras/berkeman-acceldev | 72efd8f3f8d4a4f4bf71612f1d9703fd89fd48e4 | [
"Apache-2.0"
] | null | null | null | accelerator/methods.py | sebras/berkeman-acceldev | 72efd8f3f8d4a4f4bf71612f1d9703fd89fd48e4 | [
"Apache-2.0"
] | null | null | null | accelerator/methods.py | sebras/berkeman-acceldev | 72efd8f3f8d4a4f4bf71612f1d9703fd89fd48e4 | [
"Apache-2.0"
] | 1 | 2020-02-15T17:09:16.000Z | 2020-02-15T17:09:16.000Z | ############################################################################
# #
# Copyright (c) 2017 eBay Inc. #
# Modifications copyright (c) 2018-2019 Carl Drougge #
# ... | 34.41844 | 170 | 0.625592 |
4a220ce6783a612ad5fdb71e3532778105df0896 | 1,441 | py | Python | src/users/tests/test_models.py | zkkamir/planning-project | f1b82194c41145272569028b36088c2e9834c72f | [
"MIT"
] | null | null | null | src/users/tests/test_models.py | zkkamir/planning-project | f1b82194c41145272569028b36088c2e9834c72f | [
"MIT"
] | null | null | null | src/users/tests/test_models.py | zkkamir/planning-project | f1b82194c41145272569028b36088c2e9834c72f | [
"MIT"
] | null | null | null | import pytest
@pytest.mark.django_db
def test_create_user(django_user_model):
"""
Test user creation.
"""
user = django_user_model.objects.create_user(
email="test@test.test", password="testtest"
)
assert django_user_model.objects.count() == 1
assert user.email == "test@test.test"
... | 31.326087 | 75 | 0.69882 |
4a2210af7fb4db99416975899d5c4de7da1d6fed | 3,048 | py | Python | docs/conf.py | tonitick/horovod | 73d860f2396321761e0f5ef6fe934130afd69094 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | tonitick/horovod | 73d860f2396321761e0f5ef6fe934130afd69094 | [
"Apache-2.0"
] | 1 | 2019-07-29T10:08:33.000Z | 2019-07-29T10:08:33.000Z | docs/conf.py | tonitick/horovod | 73d860f2396321761e0f5ef6fe934130afd69094 | [
"Apache-2.0"
] | 1 | 2019-04-08T17:12:48.000Z | 2019-04-08T17:12:48.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | 31.102041 | 102 | 0.650262 |
4a22110880d10b3922ea4afb0ed19ee3af1c55c3 | 1,451 | py | Python | Python/Listas/Q22.py | Flavio-Varejao/Exercicios | 69d62d09e5ef5da4446b6bf7dccda9eae7361d96 | [
"MIT"
] | null | null | null | Python/Listas/Q22.py | Flavio-Varejao/Exercicios | 69d62d09e5ef5da4446b6bf7dccda9eae7361d96 | [
"MIT"
] | null | null | null | Python/Listas/Q22.py | Flavio-Varejao/Exercicios | 69d62d09e5ef5da4446b6bf7dccda9eae7361d96 | [
"MIT"
] | null | null | null | mouses={'1':0,'2':0,'3':0,'4':0}
resposta=1
while resposta != "0":
opcao=input("\nEscolha uma opção:\n"+
"<1> - Necessita de esfera\n"+
"<2> - Necessita de limpeza\n"+
"<3> - Necessita trocar do cabo ou conector\n"+
"<4> - Quebrado ou inutilizado: ")
if opcao == "... | 46.806452 | 111 | 0.532047 |
4a2212c1d6a8d2c18a7f2e3573d4db93bc57aefa | 7,697 | py | Python | notifications/views.py | facundojmaero/django-notifications | 74edab0ab45d8ca3eee2d2b20c5d3f4a127ef652 | [
"BSD-3-Clause"
] | null | null | null | notifications/views.py | facundojmaero/django-notifications | 74edab0ab45d8ca3eee2d2b20c5d3f4a127ef652 | [
"BSD-3-Clause"
] | null | null | null | notifications/views.py | facundojmaero/django-notifications | 74edab0ab45d8ca3eee2d2b20c5d3f4a127ef652 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
''' Django Notifications example views '''
from distutils.version import StrictVersion # pylint: disable=no-name-in-module,import-error
from django import get_version
from django.contrib.auth.decorators import login_required
from django.forms import model_to_dict
from django.shortcuts import g... | 29.718147 | 93 | 0.67169 |
4a2212df19fd4354258808f9f5d685729bd853f0 | 1,456 | py | Python | scripts/species/data_loader.py | JDonini/Cats-and-Dogs-Classification | 1322f80536ff077ab87e5176a13ea5db242254b1 | [
"MIT"
] | 10 | 2018-11-30T08:31:09.000Z | 2020-03-30T09:34:12.000Z | scripts/species/data_loader.py | JDonini/Cats_Dogs_Classification | 1322f80536ff077ab87e5176a13ea5db242254b1 | [
"MIT"
] | 1 | 2019-10-05T14:07:09.000Z | 2019-10-05T14:07:09.000Z | scripts/species/data_loader.py | JDonini/Cats_Dogs_Classification | 1322f80536ff077ab87e5176a13ea5db242254b1 | [
"MIT"
] | 4 | 2018-04-30T05:12:12.000Z | 2018-06-21T13:56:43.000Z | import warnings
import torch
import torchvision.transforms as transforms
from torchvision import datasets
import os
import sys
sys.path.append('utils')
from config import IMG_SIZE, BATCH_SIZE, NUM_WORKERS, DATA_PATH
warnings.filterwarnings("ignore")
print("Processing Species...")
transform = {
'train': transform... | 36.4 | 118 | 0.513049 |
4a22135ea3474f8e428d4ef7d4cc93d49f80e52c | 871 | py | Python | test/unit/rules/resources/lmbd/test_deprecated_runtime_eol.py | tomislacker/cfn-python-lint | f209ddfef9bcc1a005adfebcfcc16220b18deddb | [
"MIT-0"
] | 1,134 | 2019-03-02T14:58:34.000Z | 2021-05-15T00:57:16.000Z | test/unit/rules/resources/lmbd/test_deprecated_runtime_eol.py | tomislacker/cfn-python-lint | f209ddfef9bcc1a005adfebcfcc16220b18deddb | [
"MIT-0"
] | 1,122 | 2019-03-03T04:27:15.000Z | 2021-05-14T20:51:16.000Z | test/unit/rules/resources/lmbd/test_deprecated_runtime_eol.py | tomislacker/cfn-python-lint | f209ddfef9bcc1a005adfebcfcc16220b18deddb | [
"MIT-0"
] | 297 | 2019-03-11T09:56:57.000Z | 2021-05-14T16:41:19.000Z | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
from test.unit.rules import BaseRuleTestCase
from datetime import datetime
from cfnlint.rules.resources.lmbd.DeprecatedRuntimeEol import DeprecatedRuntimeEol # pylint: disable=E0401
class TestDeprecatedRuntimeEo... | 33.5 | 107 | 0.723307 |
4a22144e5631ed1acbc39175093ae35139fa1fe2 | 1,241 | py | Python | sayhitotheworld/urls.py | RUAN-ZX/sayhitothwworld | 0258ef715484d300e43b2a193b85ab7e5a01fba4 | [
"MIT"
] | 1 | 2020-07-22T10:20:32.000Z | 2020-07-22T10:20:32.000Z | sayhitotheworld/urls.py | RUAN-ZX/sayhitothwworld | 0258ef715484d300e43b2a193b85ab7e5a01fba4 | [
"MIT"
] | null | null | null | sayhitotheworld/urls.py | RUAN-ZX/sayhitothwworld | 0258ef715484d300e43b2a193b85ab7e5a01fba4 | [
"MIT"
] | null | null | null | """sayhitotheworld URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cla... | 36.5 | 77 | 0.730862 |
4a22146bd64b5129993809b06da71e5ca9d301db | 1,221 | py | Python | packages/pyright-internal/src/tests/samples/typeNarrowing11.py | sransara/pyright | 4e117682c946b60f2b24fd75a07736954b21f158 | [
"MIT"
] | 1 | 2020-12-28T16:58:24.000Z | 2020-12-28T16:58:24.000Z | packages/pyright-internal/src/tests/samples/typeNarrowing11.py | sransara/pyright | 4e117682c946b60f2b24fd75a07736954b21f158 | [
"MIT"
] | null | null | null | packages/pyright-internal/src/tests/samples/typeNarrowing11.py | sransara/pyright | 4e117682c946b60f2b24fd75a07736954b21f158 | [
"MIT"
] | null | null | null | # This sample tests the type narrowing capabilities involving
# types that have enumerated literals (bool and enums).
from enum import Enum
from typing import Literal, Union
class SomeEnum(Enum):
SOME_ENUM_VALUE1 = 1
SOME_ENUM_VALUE2 = 2
SOME_ENUM_VALUE3 = 3
def func1(a: SomeEnum) -> Literal[3]:
if... | 19.078125 | 72 | 0.622441 |
4a221597a950d7a2b40f7cf2c71e783e2bb28f86 | 62,321 | py | Python | selfdrive/car/hyundai/values.py | barghe/Barghe_OP | 013e2f9a69352fae0c0eff62bd247247d0219452 | [
"MIT"
] | null | null | null | selfdrive/car/hyundai/values.py | barghe/Barghe_OP | 013e2f9a69352fae0c0eff62bd247247d0219452 | [
"MIT"
] | null | null | null | selfdrive/car/hyundai/values.py | barghe/Barghe_OP | 013e2f9a69352fae0c0eff62bd247247d0219452 | [
"MIT"
] | null | null | null | from cereal import car
from selfdrive.car import dbc_dict
Ecu = car.CarParams.Ecu
class CarControllerParams:
ACCEL_MAX = 2.0
ACCEL_MIN = -3.7
STEER_MAX = 384 # 409 is the max, 255 is stock
STEER_DELTA_UP = 3
STEER_DELTA_DOWN = 5
STEER_DRIVER_ALLOWANCE = 50
STEER_DRIVER_MULTIPLIER = 2
STEER_DRIVER_F... | 143.596774 | 1,136 | 0.552591 |
4a2215c14c6e64aef1667e271eb0758b75e1dc1f | 1,134 | py | Python | exercises/0138-CopyListWithRandomPointer/copy_list_with_random_pointer.py | tqa236/leetcode-solutions | 556147981c43509a6e8a7f59f138d1ab027ebfd1 | [
"MIT"
] | 1 | 2020-09-26T15:09:25.000Z | 2020-09-26T15:09:25.000Z | exercises/0138-CopyListWithRandomPointer/copy_list_with_random_pointer.py | tqa236/leetcode-solutions | 556147981c43509a6e8a7f59f138d1ab027ebfd1 | [
"MIT"
] | null | null | null | exercises/0138-CopyListWithRandomPointer/copy_list_with_random_pointer.py | tqa236/leetcode-solutions | 556147981c43509a6e8a7f59f138d1ab027ebfd1 | [
"MIT"
] | null | null | null | class Node:
def __init__(self, x: int, next: "Node" = None, random: "Node" = None):
self.val = int(x)
self.next = next
self.random = random
class Solution:
def copyRandomList(self, head: "Node") -> "Node":
if not head:
return None
node = head
new_nod... | 32.4 | 75 | 0.518519 |
4a221682ad63daa2939630d0a95dbd8f1493eb30 | 11,547 | py | Python | modeling/backbone/xception.py | PenG-hy/DeepLabv3 | 3eda6c5b395053324251d963477c5fd26ae046dd | [
"MIT"
] | 4 | 2021-12-22T01:52:33.000Z | 2022-03-29T07:46:23.000Z | modeling/backbone/xception.py | PenG-hy/DeepLabv3 | 3eda6c5b395053324251d963477c5fd26ae046dd | [
"MIT"
] | null | null | null | modeling/backbone/xception.py | PenG-hy/DeepLabv3 | 3eda6c5b395053324251d963477c5fd26ae046dd | [
"MIT"
] | null | null | null | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from ..sync_batchnorm.batchnorm import SynchronizedBatchNorm2d
def fixed_padding(inputs, kernel_size, dilation):
kernel_size_effective = kernel_size + (kernel_size - 1) * (dilation - 1)
pad_... | 39.955017 | 116 | 0.582835 |
4a2216d230203cf4d2b51f8d68075c0e3e4462d1 | 161,776 | py | Python | test/test_tensor_creation_ops.py | kulinseth/pytorch | 337c71be05f959799a305164e6edf86c686bb673 | [
"Intel"
] | null | null | null | test/test_tensor_creation_ops.py | kulinseth/pytorch | 337c71be05f959799a305164e6edf86c686bb673 | [
"Intel"
] | null | null | null | test/test_tensor_creation_ops.py | kulinseth/pytorch | 337c71be05f959799a305164e6edf86c686bb673 | [
"Intel"
] | null | null | null | import torch
import numpy as np
import sys
import math
import warnings
import unittest
from itertools import product, combinations, combinations_with_replacement, permutations
import random
from torch.testing import make_tensor
from torch.testing._internal.common_utils import (
TestCase, run_tests, do_test_empty_... | 46.823734 | 132 | 0.589673 |
4a22174da326db0be109b35e27cd1bf611b9c53c | 30,939 | py | Python | tests/test_plugin.py | queilawithaQ/lightning | 78064f8773685238c780d065edb037090c62b47f | [
"MIT"
] | null | null | null | tests/test_plugin.py | queilawithaQ/lightning | 78064f8773685238c780d065edb037090c62b47f | [
"MIT"
] | null | null | null | tests/test_plugin.py | queilawithaQ/lightning | 78064f8773685238c780d065edb037090c62b47f | [
"MIT"
] | null | null | null | from collections import OrderedDict
from fixtures import * # noqa: F401,F403
from flaky import flaky # noqa: F401
from lightning import RpcError, Millisatoshi
from utils import DEVELOPER, only_one, sync_blockheight, TIMEOUT, wait_for, TEST_NETWORK
import json
import os
import pytest
import re
import sqlite3
import s... | 39.563939 | 135 | 0.659459 |
4a22174f05051bca63d41ffdea87e13639a0e25c | 4,983 | py | Python | torchOnVideo/super_resolution/SOF_VSR/train_model.py | torchOnVideo/torchOnVideo | aa07d5661f772eca027ecc6b79e14bd68a515aa1 | [
"MIT"
] | 2 | 2021-03-19T08:05:06.000Z | 2021-05-22T21:54:10.000Z | torchOnVideo/super_resolution/SOF_VSR/train_model.py | torchOnVideo/torchOnVideo | aa07d5661f772eca027ecc6b79e14bd68a515aa1 | [
"MIT"
] | null | null | null | torchOnVideo/super_resolution/SOF_VSR/train_model.py | torchOnVideo/torchOnVideo | aa07d5661f772eca027ecc6b79e14bd68a515aa1 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import numpy as np
from torch.utils.data import DataLoader
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
import os
from ..SOF_VSR import SOF_VSR
from ..models import SOFVSR, OFRnet, SRne... | 38.038168 | 117 | 0.554686 |
4a22189b4204d1c416525a653d94f4fc026ebb68 | 559 | py | Python | sheetfu/__init__.py | shilik/sheetfu | 3b77e27fe3295f3168c8361f495eb873c2ac3bf3 | [
"MIT"
] | 1 | 2020-01-04T14:37:27.000Z | 2020-01-04T14:37:27.000Z | sheetfu/__init__.py | shilik/sheetfu | 3b77e27fe3295f3168c8361f495eb873c2ac3bf3 | [
"MIT"
] | null | null | null | sheetfu/__init__.py | shilik/sheetfu | 3b77e27fe3295f3168c8361f495eb873c2ac3bf3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
sheetfu
~~~~~~~
A python library to interact with Google Sheets.
:copyright: © 2018 by Social Point Labs.
:license: MIT, see LICENSE for more details.
"""
# Important! Never update this version manually. The automatic semantic-releases library takes care of updating it... | 25.409091 | 116 | 0.733453 |
4a221941b9c5473e8ef3a19a3f3e4f79aa5387f9 | 10,786 | py | Python | tests/coworks/tech/test_ms.py | sidneyarcidiacono/coworks | 7f51b83e8699ced991d16a5a43ad19e569b6e814 | [
"MIT"
] | null | null | null | tests/coworks/tech/test_ms.py | sidneyarcidiacono/coworks | 7f51b83e8699ced991d16a5a43ad19e569b6e814 | [
"MIT"
] | null | null | null | tests/coworks/tech/test_ms.py | sidneyarcidiacono/coworks | 7f51b83e8699ced991d16a5a43ad19e569b6e814 | [
"MIT"
] | null | null | null | from coworks.coworks import ApiResponse
from tests.coworks.ms import *
class ParamMS(TechMicroService):
value = "123"
def token_authorizer(self, token):
return True
@entry
def get(self, str):
return str
@entry
def get_concat(self, str1, str2):
return str1 + str2
... | 45.70339 | 116 | 0.589746 |
4a2219d787dadfb374bc1b6490512cd3922c5c59 | 6,850 | py | Python | riboviz/utils.py | acope3/riboviz | 03a4f13b2d833b8650ebf33bdce81fe2639eb9cf | [
"Apache-2.0"
] | null | null | null | riboviz/utils.py | acope3/riboviz | 03a4f13b2d833b8650ebf33bdce81fe2639eb9cf | [
"Apache-2.0"
] | null | null | null | riboviz/utils.py | acope3/riboviz | 03a4f13b2d833b8650ebf33bdce81fe2639eb9cf | [
"Apache-2.0"
] | null | null | null | """
Useful functions.
"""
import os
import os.path
import numpy as np
import pandas as pd
def value_in_dict(key, dictionary, allow_false_empty=False):
"""
Check that a value is in a dictionary and the value is not
``None``.
If dictionary is::
{
"A":1,
"B":None,
"C"... | 33.578431 | 75 | 0.619854 |
4a2219e935a46db2a10cd0664ade7e8df859ef97 | 625 | py | Python | project/data/scrapers/ambitiouskitchen.py | bmogyorodi/recipe_search | 0e7fa4b961342b6c37f36f444337109836618938 | [
"BSD-3-Clause"
] | 1 | 2021-08-13T08:33:09.000Z | 2021-08-13T08:33:09.000Z | project/data/scrapers/ambitiouskitchen.py | bmogyorodi/recipe_search | 0e7fa4b961342b6c37f36f444337109836618938 | [
"BSD-3-Clause"
] | null | null | null | project/data/scrapers/ambitiouskitchen.py | bmogyorodi/recipe_search | 0e7fa4b961342b6c37f36f444337109836618938 | [
"BSD-3-Clause"
] | 2 | 2021-08-13T08:33:35.000Z | 2022-02-21T19:42:23.000Z | from ._generic import RootSitemapScraper
class AmbitiousKitchenScraper(RootSitemapScraper):
"""
A scraper for ambitiouskitchen.com
"""
NAME = "ambitiouskitchen"
RECIPE_URL_FORMAT = "https://www.ambitiouskitchen.com/{id}/"
# e.g. https://www.ambitiouskitchen.com/healthy-white-chicken-chili/
... | 36.764706 | 88 | 0.7104 |
4a221a76950c9089348ea067f0687386643517e9 | 1,045 | py | Python | deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/ATI/separate_stencil.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/ATI/separate_stencil.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/ATI/separate_stencil.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | 43.541667 | 117 | 0.831579 |
4a221ad8e36673e26fd65dfb44de0ad5828d99f7 | 3,317 | py | Python | test/functional/mining_getblocktemplate_longpoll.py | sirlanceoflompoc/karmacoin | 3a75016399f75c27f97856f842915b5c7c4e8fb6 | [
"MIT"
] | null | null | null | test/functional/mining_getblocktemplate_longpoll.py | sirlanceoflompoc/karmacoin | 3a75016399f75c27f97856f842915b5c7c4e8fb6 | [
"MIT"
] | null | null | null | test/functional/mining_getblocktemplate_longpoll.py | sirlanceoflompoc/karmacoin | 3a75016399f75c27f97856f842915b5c7c4e8fb6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Karmacoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test longpolling with getblocktemplate."""
from decimal import Decimal
from test_framework.test_fra... | 43.644737 | 112 | 0.685258 |
4a221afeae99e04de23f03669453b340a1cd2450 | 1,889 | py | Python | gym-uds-server.py | tiberiu92/gym-uds-api | 65ff4a4368197ce43e954d66ed0daa31a93236af | [
"MIT"
] | 1 | 2018-06-29T10:31:23.000Z | 2018-06-29T10:31:23.000Z | gym-uds-server.py | tiberiu92/gym-uds-api | 65ff4a4368197ce43e954d66ed0daa31a93236af | [
"MIT"
] | null | null | null | gym-uds-server.py | tiberiu92/gym-uds-api | 65ff4a4368197ce43e954d66ed0daa31a93236af | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import os
import time
from concurrent import futures
import grpc
import gym
import gym_uds_pb2
import gym_uds_pb2_grpc
import numpy as np
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
class Environment(gym_uds_pb2_grpc.EnvironmentServicer):
def __init__(self, env_id):
self.en... | 30.967213 | 99 | 0.707253 |
4a221b32106f31c980bb3572da64784a9844a0c3 | 2,264 | py | Python | cohesity_management_sdk/models/couchbase_connect_params.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 18 | 2019-09-24T17:35:53.000Z | 2022-03-25T08:08:47.000Z | cohesity_management_sdk/models/couchbase_connect_params.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 18 | 2019-03-29T19:32:29.000Z | 2022-01-03T23:16:45.000Z | cohesity_management_sdk/models/couchbase_connect_params.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 16 | 2019-02-27T06:54:12.000Z | 2021-11-16T18:10:24.000Z | # -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
class CouchbaseConnectParams(object):
"""Implementation of the 'CouchbaseConnectParams' model.
Specifies an Object containing information about a registered couchbase
source.
Attributes:
carrier_direct_port (int): Specifies the Carrier dire... | 31.444444 | 81 | 0.636926 |
4a221b46cffa440adc8d81dcc9dea389237194d0 | 358 | py | Python | runtests/mpi/tests/test_benchmark.py | pastewka/runtests | 9b6d4806e3b662fac2f266a8aadf79ce1caca134 | [
"BSD-2-Clause"
] | 3 | 2019-11-04T10:50:20.000Z | 2019-11-13T13:03:20.000Z | card_test/venv/Lib/site-packages/runtests/mpi/tests/test_benchmark.py | latedude2/P3_image_processing | 69ce6de8f6c962f961edb83e6974d60e86343faa | [
"MIT"
] | 9 | 2018-03-13T20:59:26.000Z | 2021-02-24T15:34:40.000Z | card_test/venv/Lib/site-packages/runtests/mpi/tests/test_benchmark.py | latedude2/P3_image_processing | 69ce6de8f6c962f961edb83e6974d60e86343faa | [
"MIT"
] | 1 | 2019-08-05T06:43:28.000Z | 2019-08-05T06:43:28.000Z | from runtests.mpi import MPITest
import pytest
import time
def test_benchmark1(benchmark):
comm = benchmark.comm
with benchmark("test 1"):
time.sleep((1+comm.rank)*0.25)
@pytest.mark.parametrize('x', [1, 2])
def test_benchmark2(benchmark, x):
comm = benchmark.comm
with benchmark("test 2"):
... | 21.058824 | 38 | 0.673184 |
4a221bccb3e610591fe0a0320ee0958fb2a38885 | 11,256 | py | Python | util.py | baronrustamov/bulka | fe19fa993e0d1fa013b83bc08705c70cd26d84aa | [
"MIT"
] | null | null | null | util.py | baronrustamov/bulka | fe19fa993e0d1fa013b83bc08705c70cd26d84aa | [
"MIT"
] | null | null | null | util.py | baronrustamov/bulka | fe19fa993e0d1fa013b83bc08705c70cd26d84aa | [
"MIT"
] | 1 | 2021-06-07T14:45:57.000Z | 2021-06-07T14:45:57.000Z | import logging
import threading
from collections import namedtuple
from functools import wraps
import requests
from bs4 import BeautifulSoup
from fuzzywuzzy import process, fuzz
from requests import Session
from telegram import ParseMode, Update
from telegram.ext import CallbackContext
from const import USER_AGENT
A... | 42.315789 | 110 | 0.565387 |
4a221c02052a92cd77593b96ba4dd2c0bda1529b | 19,819 | py | Python | v1_7_0/dx_operations_vdb.py | mcbrune/delphixpy-automation | f986dbf69809748a8c9721a19663c6f6fb66fc3c | [
"MIT"
] | 2 | 2017-01-18T20:27:33.000Z | 2017-07-25T14:23:29.000Z | v1_7_0/dx_operations_vdb.py | mcbrune/delphixpy-automation | f986dbf69809748a8c9721a19663c6f6fb66fc3c | [
"MIT"
] | null | null | null | v1_7_0/dx_operations_vdb.py | mcbrune/delphixpy-automation | f986dbf69809748a8c9721a19663c6f6fb66fc3c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Corey Brune - Oct 2016
#This script starts or stops a VDB
#requirements
#pip install docopt delphixpy
#The below doc follows the POSIX compliant standards and allows us to use
#this doc to also define our arguments for the script.
"""List all VDBs or Start, stop, enable, disable a VDB
Usage:
... | 34.467826 | 142 | 0.593219 |
4a221c98e4d01e520edcfb2a9246e5af5d8bda4d | 251 | py | Python | Tupla revisao/tupla.py | Hipparcus/Python-Learning | a3bd5787ceb67f20a0a053e3db4cf77a18e12112 | [
"MIT"
] | null | null | null | Tupla revisao/tupla.py | Hipparcus/Python-Learning | a3bd5787ceb67f20a0a053e3db4cf77a18e12112 | [
"MIT"
] | null | null | null | Tupla revisao/tupla.py | Hipparcus/Python-Learning | a3bd5787ceb67f20a0a053e3db4cf77a18e12112 | [
"MIT"
] | null | null | null | palavras = ('programacao','nomes','legal','que bacana','yeaaah','astronomia')
for i in palavras:
print(f"Na palavra {i} há as vogais", end=' ')
for j in i:
if j.lower() in ('aeiou'):
print (f"{j}", end=',')
print("\n") | 31.375 | 77 | 0.537849 |
4a221d236564bfaa226c07e4893068f9dee66c78 | 25,638 | py | Python | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_diagnostic_operations.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_diagnostic_operations.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_diagnostic_operations.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 51.689516 | 208 | 0.661713 |
4a221d248637a20e62d695f12e02037197d13976 | 616 | py | Python | examples/assign.py | LayneInNL/py2flows | 5ecb555c64350cb13c3885a78fe89a40994e9d0e | [
"Apache-2.0"
] | 3 | 2022-03-21T12:10:37.000Z | 2022-03-24T13:31:19.000Z | examples/assign.py | LayneInNL/py2flows | 5ecb555c64350cb13c3885a78fe89a40994e9d0e | [
"Apache-2.0"
] | 1 | 2022-03-17T02:09:37.000Z | 2022-03-17T10:08:14.000Z | examples/assign.py | LayneInNL/py2flows | 5ecb555c64350cb13c3885a78fe89a40994e9d0e | [
"Apache-2.0"
] | 1 | 2022-03-21T12:10:18.000Z | 2022-03-21T12:10:18.000Z | # Copyright 2022 Layne Liu
#
# 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... | 36.235294 | 75 | 0.725649 |
4a221eca901c24d51311a894ad9a257ae367f04d | 772 | py | Python | api/tacticalrmm/logs/migrations/0009_auto_20201110_1431.py | BaDTaG/tacticalrmm | 7bdd8c4626e0629d393edb5dec2541150d1802ef | [
"MIT"
] | 1 | 2021-01-19T20:39:02.000Z | 2021-01-19T20:39:02.000Z | api/tacticalrmm/logs/migrations/0009_auto_20201110_1431.py | BaDTaG/tacticalrmm | 7bdd8c4626e0629d393edb5dec2541150d1802ef | [
"MIT"
] | null | null | null | api/tacticalrmm/logs/migrations/0009_auto_20201110_1431.py | BaDTaG/tacticalrmm | 7bdd8c4626e0629d393edb5dec2541150d1802ef | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-10 14:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('logs', '0008_auto_20201110_1431'),
]
operations = [
migrations.AlterField(
model_name='auditlog',
name='action',
... | 40.631579 | 437 | 0.623057 |
4a221f5ee0288e18fb56178d4892d0740a3a5782 | 4,619 | py | Python | src/embit/script.py | jimmysong/embit | 36299bd0fe123d6e3a5318a9f9acfd16564c26c1 | [
"MIT"
] | 2 | 2021-03-26T22:41:55.000Z | 2021-05-27T17:38:53.000Z | src/embit/script.py | jimmysong/embit | 36299bd0fe123d6e3a5318a9f9acfd16564c26c1 | [
"MIT"
] | null | null | null | src/embit/script.py | jimmysong/embit | 36299bd0fe123d6e3a5318a9f9acfd16564c26c1 | [
"MIT"
] | 2 | 2021-03-27T10:16:21.000Z | 2021-06-07T18:01:03.000Z | from .networks import NETWORKS
from . import base58
from . import bech32
from . import hashes
from . import compact
from .base import EmbitBase, EmbitError
import io
SIGHASH_ALL = 1
class Script(EmbitBase):
def __init__(self, data):
self.data = data
def address(self, network=NETWORKS["main"]):
... | 29.050314 | 88 | 0.598398 |
4a221fa002e94b1d958f31ec37c854a6a9a5b2a3 | 3,301 | py | Python | code/MMServerEngine/others/table/table.py | xuerong/MMServerEngine | f11c34680ea56645e91bab9ef02a808ee2e1730d | [
"Apache-2.0"
] | 9 | 2016-09-14T11:27:25.000Z | 2020-11-06T06:33:33.000Z | code/MMServerEngine/others/table/table.py | wangxianglong3/MMServerEngine | d3bf90da536ab84efefba2c7128ba88695153495 | [
"Apache-2.0"
] | null | null | null | code/MMServerEngine/others/table/table.py | wangxianglong3/MMServerEngine | d3bf90da536ab84efefba2c7128ba88695153495 | [
"Apache-2.0"
] | 7 | 2016-09-14T11:27:24.000Z | 2019-11-04T08:30:10.000Z | #!/usr/bin/python
#-*- coding: utf-8 -*-
import xlrd
import os
import sys
import shutil
from xlrd import xldate_as_tuple
from datetime import date,datetime
table_file_name = sys.argv[1]
data = xlrd.open_workbook(table_file_name)
def createJavaFile(name,content):
java_class_path = "com/table/"+name+".java"
#... | 31.141509 | 151 | 0.581036 |
4a22202d4b5d48a5582e13ed20560c8a6ffc60bf | 1,662 | py | Python | Gem/PythonTests/Automated/test_suites/periodic/NonMaterialAssetsExcludedInBrowser_test.py | incisor/o3de-atomtest | 026fef06827bf0dd559510882df5cb426ab00a99 | [
"Apache-2.0",
"MIT"
] | 2 | 2021-07-18T11:20:41.000Z | 2022-02-01T20:17:50.000Z | Gem/PythonTests/Automated/test_suites/periodic/NonMaterialAssetsExcludedInBrowser_test.py | incisor/o3de-atomtest | 026fef06827bf0dd559510882df5cb426ab00a99 | [
"Apache-2.0",
"MIT"
] | 5 | 2021-07-14T02:24:07.000Z | 2021-10-04T21:24:35.000Z | Gem/PythonTests/Automated/test_suites/periodic/NonMaterialAssetsExcludedInBrowser_test.py | incisor/o3de-atomtest | 026fef06827bf0dd559510882df5cb426ab00a99 | [
"Apache-2.0",
"MIT"
] | 7 | 2021-07-06T18:21:14.000Z | 2021-12-06T09:12:40.000Z | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
from Automated.atom_utils import hydra_test_utils as hydra
TEST_DIRECTORY = os.path.d... | 34.625 | 97 | 0.6787 |
4a222067165b4cd2dc5dd855429d29466be4271c | 1,465 | py | Python | bars3d_demo.py | kingslair/MatPlotLib | 66d1accf1a049b901dece69d18edadafbf4b687f | [
"MIT"
] | null | null | null | bars3d_demo.py | kingslair/MatPlotLib | 66d1accf1a049b901dece69d18edadafbf4b687f | [
"MIT"
] | null | null | null | bars3d_demo.py | kingslair/MatPlotLib | 66d1accf1a049b901dece69d18edadafbf4b687f | [
"MIT"
] | null | null | null | from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.animation as animation
import time
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
op_array = np.array([])
def animate(i):
pullData = open("bars_3d.txt","r").read()
dataArray = pullData.s... | 24.416667 | 77 | 0.565188 |
4a2220d2400c1620e374e02acf264bf5dace5983 | 6,550 | py | Python | SQLNet/scripts/model/modules/order_predict.py | Bhaskers-Blu-Org2/EMNLP2019-Adjective-Knowledge-for-Text-to-SQL | 246f52ee70d2eeb776fe99597712b57bca3883c7 | [
"MIT"
] | 5 | 2019-11-15T11:02:31.000Z | 2020-05-09T09:32:26.000Z | SQLNet/scripts/model/modules/order_predict.py | Bhaskers-Blu-Org2/EMNLP2019-Adjective-Knowledge-for-Text-to-SQL | 246f52ee70d2eeb776fe99597712b57bca3883c7 | [
"MIT"
] | 1 | 2020-04-07T09:20:51.000Z | 2020-04-07T09:20:51.000Z | SQLNet/scripts/model/modules/order_predict.py | microsoft/EMNLP2019-Adjective-Knowledge-for-Text-to-SQL | 246f52ee70d2eeb776fe99597712b57bca3883c7 | [
"MIT"
] | 7 | 2020-01-01T02:22:23.000Z | 2021-11-05T04:49:19.000Z | import json
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from net_utils import run_lstm, col_name_encode
class OrderPredictor(nn.Module):
def __init__(self, N_word, N_h, N_depth, gpu, feats_format=""):
super(OrderPredictor, self)... | 40.9375 | 138 | 0.593282 |
4a2221dcc1dbbee761d960e48a54e00ed4c67ca9 | 1,851 | py | Python | augpathlib/repo_patch.py | tmsincomb/augpathlib | ed9c0edff540741fca866780a3d043a3b7644f08 | [
"MIT"
] | null | null | null | augpathlib/repo_patch.py | tmsincomb/augpathlib | ed9c0edff540741fca866780a3d043a3b7644f08 | [
"MIT"
] | null | null | null | augpathlib/repo_patch.py | tmsincomb/augpathlib | ed9c0edff540741fca866780a3d043a3b7644f08 | [
"MIT"
] | null | null | null | import git
class _Repo(git.Repo): # FIXME should we subclass Repo for this or patch ??
""" monkey patching """
def getRef(self, ref_name):
for ref in self.refs:
if ref.name == ref_name:
return ref
else:
raise ValueError(f'No ref with name: {ref_name}'... | 28.921875 | 84 | 0.612102 |
4a2222d1ffe1c59b24e53ba72f1adff8ae5202a8 | 2,445 | py | Python | SearchUtility_Backend/PDFTokenizer.py | ramacpr/AnyDocSearch | 1b3547f418be2fcc5e1f8ae8d83af61e7234dea3 | [
"MIT"
] | 1 | 2020-12-30T13:51:22.000Z | 2020-12-30T13:51:22.000Z | SearchUtility_Backend/PDFTokenizer.py | ramacpr/AnyDocSearch | 1b3547f418be2fcc5e1f8ae8d83af61e7234dea3 | [
"MIT"
] | null | null | null | SearchUtility_Backend/PDFTokenizer.py | ramacpr/AnyDocSearch | 1b3547f418be2fcc5e1f8ae8d83af61e7234dea3 | [
"MIT"
] | null | null | null | import time
import MyExtendedStopWords as StopWordsHelper
import MyDatabaseManager as dbManager
import PyPDFEx as PDFHelper
from nltk.tokenize import word_tokenize as WordHelper
from nltk.stem import PorterStemmer
from wordsegment import load
from SearchUtility_Backend.SearchUtilityLogger import SearchUtilityLog... | 41.440678 | 104 | 0.622086 |
4a222310e407a3dd9106b01210dde6ee3443a807 | 8,391 | py | Python | tests/io/test_yaml_dataset.py | lblanche/kedro | 659a47b161d452557504b07971722125a80f6294 | [
"Apache-2.0"
] | null | null | null | tests/io/test_yaml_dataset.py | lblanche/kedro | 659a47b161d452557504b07971722125a80f6294 | [
"Apache-2.0"
] | null | null | null | tests/io/test_yaml_dataset.py | lblanche/kedro | 659a47b161d452557504b07971722125a80f6294 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2019 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... | 39.394366 | 85 | 0.687046 |
4a2223eb045882f94ff2e63780be8aac996373eb | 837 | py | Python | aoc-2021-python/day1.py | mihaicostin/advent-of-code | f6c1121e831fb55a7620369970b31654ee5e50e3 | [
"MIT"
] | 1 | 2018-12-07T13:48:24.000Z | 2018-12-07T13:48:24.000Z | aoc-2021-python/day1.py | mihaicostin/adventofcode-2018 | f6c1121e831fb55a7620369970b31654ee5e50e3 | [
"MIT"
] | null | null | null | aoc-2021-python/day1.py | mihaicostin/adventofcode-2018 | f6c1121e831fb55a7620369970b31654ee5e50e3 | [
"MIT"
] | null | null | null | # count the number of times a depth measurement increases from the previous measurement.
# (There is no measurement before the first measurement.)
count = 0
with open("day1.txt") as f:
lines = f.readlines()
prev = -1
for line in lines:
if (int(line) > prev) & (prev != -1):
count = count... | 23.914286 | 88 | 0.575866 |
4a22264368e1bd9e5dd5939ca743cef0bebb4616 | 4,782 | py | Python | experiments/ants3d_atlas_fine_remap_labels.py | BlueBrain/atlas-annotation | 118af9b95518a19b64a9d8008aabed557eb0f646 | [
"Apache-2.0"
] | null | null | null | experiments/ants3d_atlas_fine_remap_labels.py | BlueBrain/atlas-annotation | 118af9b95518a19b64a9d8008aabed557eb0f646 | [
"Apache-2.0"
] | 8 | 2021-11-02T17:23:22.000Z | 2022-03-02T12:29:26.000Z | experiments/ants3d_atlas_fine_remap_labels.py | BlueBrain/atlas-annotation | 118af9b95518a19b64a9d8008aabed557eb0f646 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2021, Blue Brain Project, EPFL
#
# 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 appl... | 32.97931 | 78 | 0.719783 |
4a22264870ccdf95932f4a5b2fa01f6e3dbecb2c | 20,037 | py | Python | kopf/structs/references.py | asteven/kopf | 433709dc8846f4b399e98f04c843362230357225 | [
"MIT"
] | null | null | null | kopf/structs/references.py | asteven/kopf | 433709dc8846f4b399e98f04c843362230357225 | [
"MIT"
] | null | null | null | kopf/structs/references.py | asteven/kopf | 433709dc8846f4b399e98f04c843362230357225 | [
"MIT"
] | null | null | null | import asyncio
import dataclasses
import enum
import fnmatch
import re
import urllib.parse
from typing import Collection, Iterable, Iterator, List, Mapping, \
MutableMapping, NewType, Optional, Pattern, Set, Union
# A namespace specification with globs, negations, and some minimal syntax; see `match... | 44.725446 | 118 | 0.658182 |
4a222722b18e220e523b12f68d6b5143f3d55a84 | 1,214 | py | Python | src/recognition/recognize.py | amaanabbasi/LicensePlateDetectionRecognition | 5b44d0cab8d084dbfa7af6a4609c062bbc8c1935 | [
"CNRI-Python"
] | 2 | 2020-01-22T13:24:11.000Z | 2020-04-24T08:03:14.000Z | src/recognition/recognize.py | amaanabbasi/LicensePlateDetectionRecognition | 5b44d0cab8d084dbfa7af6a4609c062bbc8c1935 | [
"CNRI-Python"
] | 5 | 2020-01-28T23:15:25.000Z | 2022-02-10T01:24:45.000Z | src/recognition/recognize.py | amaanabbasi/LicensePlateDetectionRecognition | 5b44d0cab8d084dbfa7af6a4609c062bbc8c1935 | [
"CNRI-Python"
] | 1 | 2020-02-03T16:17:24.000Z | 2020-02-03T16:17:24.000Z | from keras.models import load_model
import cv2
import numpy as np
import matplotlib.pyplot as plt
from keras.models import model_from_json
def preprocess_img(img, flag=0):
"""
Takes in a character image, convert to gray, 28x28, add dimensions acc to
model input.
"""
# print(img.shape)
# im... | 24.77551 | 77 | 0.603789 |
4a22287a78aa56848bfe57266b9f7d39a6105f2a | 1,663 | py | Python | tests/grammpy_test/oldapi_tests/term-nonterm-grammar-handling_tests/TerminalGetTest.py | PatrikValkovic/grammpy | 8308a1fd349bf9ea0d267360cc9a4ab20d1629e8 | [
"MIT"
] | 1 | 2021-02-04T12:41:08.000Z | 2021-02-04T12:41:08.000Z | tests/grammpy_test/oldapi_tests/term-nonterm-grammar-handling_tests/TerminalGetTest.py | PatrikValkovic/grammpy | 8308a1fd349bf9ea0d267360cc9a4ab20d1629e8 | [
"MIT"
] | 3 | 2017-07-08T16:28:52.000Z | 2020-04-23T18:06:24.000Z | tests/grammpy_test/oldapi_tests/term-nonterm-grammar-handling_tests/TerminalGetTest.py | PatrikValkovic/grammpy | 8308a1fd349bf9ea0d267360cc9a4ab20d1629e8 | [
"MIT"
] | 1 | 2021-02-04T12:41:10.000Z | 2021-02-04T12:41:10.000Z | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 03.08.2017 12:28
:Licence MIT
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.old_api import Grammar
class TempClass:
pass
class TerminalGetTest(TestCase):
def test_getTermEmpty(self):
gr = Grammar()
self.asser... | 26.396825 | 61 | 0.593506 |
4a2229205d2e6e931c93ab61d2fc81607972de96 | 3,919 | py | Python | shop/models/ordermodel.py | bennylope/django-shop | 7e7cd743773405f193abefdb8aa30f28b17d71cd | [
"BSD-3-Clause"
] | 1 | 2015-03-23T20:40:39.000Z | 2015-03-23T20:40:39.000Z | shop/models/ordermodel.py | bennylope/django-shop | 7e7cd743773405f193abefdb8aa30f28b17d71cd | [
"BSD-3-Clause"
] | null | null | null | shop/models/ordermodel.py | bennylope/django-shop | 7e7cd743773405f193abefdb8aa30f28b17d71cd | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from distutils.version import LooseVersion
from django.conf import settings
from django.db import models
from django.db.models.signals import pre_delete
from django.utils.translation import ugettext_lazy as _
from shop.models.productmodel import Product
from shop.util.fields import CurrencyField... | 36.971698 | 79 | 0.684358 |
4a222a507050bf6a7c629e71f28f38508e0146a2 | 3,758 | py | Python | core/dbt/task/seed.py | f1fe/dbt | e943b9fc842535e958ef4fd0b8703adc91556bc6 | [
"Apache-2.0"
] | 3,156 | 2017-03-05T09:59:23.000Z | 2021-06-30T01:27:52.000Z | core/dbt/task/seed.py | f1fe/dbt | e943b9fc842535e958ef4fd0b8703adc91556bc6 | [
"Apache-2.0"
] | 2,608 | 2017-02-27T15:39:40.000Z | 2021-06-30T01:49:20.000Z | core/dbt/task/seed.py | f1fe/dbt | e943b9fc842535e958ef4fd0b8703adc91556bc6 | [
"Apache-2.0"
] | 693 | 2017-03-13T03:04:49.000Z | 2021-06-25T15:57:41.000Z | import random
from .run import ModelRunner, RunTask
from .printer import (
print_run_end_messages,
)
from dbt.contracts.results import RunStatus
from dbt.exceptions import InternalException
from dbt.graph import ResourceTypeSelector
from dbt.logger import TextOnly
from dbt.events.functions import fire_event
from ... | 30.803279 | 78 | 0.608302 |
4a222d4f488663708af0e650c2c5eb01cec3e1e7 | 1,373 | py | Python | shred.py | Skeen/lodextract | 1e9cdc3aa41335b6d9a0a67949bb12205aceb167 | [
"Linux-OpenIB"
] | 10 | 2017-08-25T12:03:20.000Z | 2021-08-29T22:55:15.000Z | shred.py | Skeen/lodextract | 1e9cdc3aa41335b6d9a0a67949bb12205aceb167 | [
"Linux-OpenIB"
] | null | null | null | shred.py | Skeen/lodextract | 1e9cdc3aa41335b6d9a0a67949bb12205aceb167 | [
"Linux-OpenIB"
] | 10 | 2015-08-15T04:04:32.000Z | 2021-12-28T08:18:19.000Z | #!/usr/bin/env python
import numpy as np
from PIL import Image
import crcmod
import os
crc24_func = crcmod.mkCrcFun(0x1864CFBL) # polynomial from libgcrypt
def handle_img(inf, color):
with open(inf) as f:
im = Image.open(f)
pal = im.getpalette()
pixels = np.array(im)
if pal:
p... | 26.921569 | 68 | 0.568099 |
4a222d589eaf029a5be7b78146c818eeae6b5393 | 16,799 | py | Python | py/acmacs_py/zero_do_3.py | acorg/acmacs-py | e0bf6ff7ecfe7332980d15b50f9b6dd6f6f78de1 | [
"MIT"
] | null | null | null | py/acmacs_py/zero_do_3.py | acorg/acmacs-py | e0bf6ff7ecfe7332980d15b50f9b6dd6f6f78de1 | [
"MIT"
] | null | null | null | py/acmacs_py/zero_do_3.py | acorg/acmacs-py | e0bf6ff7ecfe7332980d15b50f9b6dd6f6f78de1 | [
"MIT"
] | null | null | null | # 0do.py v3 support, e.g. ssm report custom
import sys, os, json, subprocess, pprint, traceback
from pathlib import Path
from typing import List, Union, Callable
import acmacs
# ======================================================================
def main():
def main_commands():
return [name for name,... | 49.119883 | 244 | 0.57301 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.