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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
797b0611018e73ff1654fccc7c378e9d4fce1302 | 3,322 | py | Python | miniids/sensor.py | hosseinnyu/semanids | 4e083807f463eaf3faa125812e92a6984325c77d | [
"MIT"
] | 1 | 2018-03-24T15:57:13.000Z | 2018-03-24T15:57:13.000Z | miniids/sensor.py | hosseinnyu/semanids | 4e083807f463eaf3faa125812e92a6984325c77d | [
"MIT"
] | null | null | null | miniids/sensor.py | hosseinnyu/semanids | 4e083807f463eaf3faa125812e92a6984325c77d | [
"MIT"
] | null | null | null | ## @package sensor
# This module senses the network traffic and notifies the plugged objects.
from scapy.all import * #import scapy module to python
from collections import defaultdict
from scapy.layers import http
from scapy.utils import *
import logging
import ConfigParser as configparser
import os.path
## Docu... | 33.897959 | 118 | 0.708007 |
797b06272f52f472b13d77033cc906f3bd09650c | 1,041 | py | Python | tests/outlook/test_graph_mail.py | domdinicola/Office365-REST-Python-Client | c64adb6c3fdc2786e0c9529e8b0f4c3ee207d2a0 | [
"MIT"
] | null | null | null | tests/outlook/test_graph_mail.py | domdinicola/Office365-REST-Python-Client | c64adb6c3fdc2786e0c9529e8b0f4c3ee207d2a0 | [
"MIT"
] | null | null | null | tests/outlook/test_graph_mail.py | domdinicola/Office365-REST-Python-Client | c64adb6c3fdc2786e0c9529e8b0f4c3ee207d2a0 | [
"MIT"
] | null | null | null | from tests.graph_case import GraphTestCase
class TestGraphMail(GraphTestCase):
def test1_send_mail_json(self):
message_json = {
"Message": {
"Subject": "Meet for lunch?",
"Body": {
"ContentType": "Text",
"Content": "The n... | 31.545455 | 83 | 0.407301 |
797b068cdd35f3146c92f73475746c7a6929527f | 27,311 | py | Python | src/spencer_people_tracking/visualization/srl_tracking_exporter/scripts/tracks_to_svg.py | CodeToPoem/HumanAwareRobotNavigation | d44eb7e5acd73a5a7bf8bf1cd88c23d6a4a3c330 | [
"BSD-3-Clause"
] | 20 | 2017-10-26T05:58:24.000Z | 2021-06-13T11:18:54.000Z | src/spencer_people_tracking/visualization/srl_tracking_exporter/scripts/tracks_to_svg.py | dmr-goncalves/HumanAwareRobotNavigation | d44eb7e5acd73a5a7bf8bf1cd88c23d6a4a3c330 | [
"BSD-3-Clause"
] | null | null | null | src/spencer_people_tracking/visualization/srl_tracking_exporter/scripts/tracks_to_svg.py | dmr-goncalves/HumanAwareRobotNavigation | d44eb7e5acd73a5a7bf8bf1cd88c23d6a4a3c330 | [
"BSD-3-Clause"
] | 6 | 2018-02-05T09:31:42.000Z | 2022-02-07T22:05:57.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2013-2015, Timm Linder, Social Robotics Lab, University of Freiburg
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that th... | 44.192557 | 205 | 0.621654 |
797b069e8cb6eecb01c2abbeeb08c7b0a158687e | 12,964 | py | Python | tests/test_config.py | weijia/couchapp | 83a1b5c0754f9c205179f4c7d6b0f95e9632ae77 | [
"Apache-2.0"
] | 224 | 2015-01-03T13:35:56.000Z | 2022-02-13T14:27:17.000Z | tests/test_config.py | weijia/couchapp | 83a1b5c0754f9c205179f4c7d6b0f95e9632ae77 | [
"Apache-2.0"
] | 79 | 2015-03-11T15:28:00.000Z | 2022-02-17T13:53:46.000Z | tests/test_config.py | weijia/couchapp | 83a1b5c0754f9c205179f4c7d6b0f95e9632ae77 | [
"Apache-2.0"
] | 56 | 2015-01-03T13:37:22.000Z | 2022-01-11T08:33:38.000Z | # -*- coding: utf-8 -*-
from couchapp.config import Config
from couchapp.errors import AppError
from mock import Mock, patch
from nose.tools import raises, with_setup
@patch('couchapp.config.util.findcouchapp', return_value=None)
@patch('couchapp.config.util.rcpath', return_value=['/mock/couchapp.conf'])
def test_c... | 33.15601 | 81 | 0.592487 |
797b06a2d407ce09034bfad0ffe3f89c3d682605 | 1,690 | py | Python | examples/docs_snippets/docs_snippets_tests/concepts_tests/solids_pipelines_tests/test_composite_solids.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | 1 | 2021-01-31T19:16:29.000Z | 2021-01-31T19:16:29.000Z | examples/docs_snippets/docs_snippets_tests/concepts_tests/solids_pipelines_tests/test_composite_solids.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets_tests/concepts_tests/solids_pipelines_tests/test_composite_solids.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | 1 | 2019-09-11T03:02:27.000Z | 2019-09-11T03:02:27.000Z | import yaml
from dagster import job
from dagster.utils import file_relative_path
from docs_snippets.concepts.solids_pipelines.composite_solids import (
all_together_nested,
subgraph_config_job,
subgraph_multiple_outputs_job,
)
from docs_snippets.concepts.solids_pipelines.graph_provides_config import celsius... | 27.704918 | 100 | 0.74497 |
797b074fc5e49bc9f1e89d682a70dd2f6d307229 | 4,865 | py | Python | integrationtest/vm/virtualrouter/scheduler/test_delete_vm_check_simple_scheduler_state.py | sherry546/zstack-woodpecker | 54a37459f2d72ce6820974feaa6eb55772c3d2ce | [
"Apache-2.0"
] | 1 | 2021-03-21T12:41:11.000Z | 2021-03-21T12:41:11.000Z | integrationtest/vm/virtualrouter/scheduler/test_delete_vm_check_simple_scheduler_state.py | sherry546/zstack-woodpecker | 54a37459f2d72ce6820974feaa6eb55772c3d2ce | [
"Apache-2.0"
] | null | null | null | integrationtest/vm/virtualrouter/scheduler/test_delete_vm_check_simple_scheduler_state.py | sherry546/zstack-woodpecker | 54a37459f2d72ce6820974feaa6eb55772c3d2ce | [
"Apache-2.0"
] | 1 | 2017-05-19T06:40:40.000Z | 2017-05-19T06:40:40.000Z | '''
New Integration Test for Simple VM stop/start scheduler.
@author: MengLai
'''
import os
import time
import zstackwoodpecker.operations.vm_operations as vm_ops
import zstackwoodpecker.operations.scheduler_operations as schd_ops
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.tes... | 38.92 | 121 | 0.717575 |
797b0799af054f948d1ee0cb9c30be8e496c5e3a | 31,759 | py | Python | appengine/monorail/tracker/test/tracker_views_test.py | xswz8015/infra | f956b78ce4c39cc76acdda47601b86794ae0c1ba | [
"BSD-3-Clause"
] | null | null | null | appengine/monorail/tracker/test/tracker_views_test.py | xswz8015/infra | f956b78ce4c39cc76acdda47601b86794ae0c1ba | [
"BSD-3-Clause"
] | 7 | 2022-02-15T01:11:37.000Z | 2022-03-02T12:46:13.000Z | appengine/monorail/tracker/test/tracker_views_test.py | NDevTK/chromium-infra | d38e088e158d81f7f2065a38aa1ea1894f735ec4 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 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 or at
# https://developers.google.com/open-source/licenses/bsd
"""Unittest for issue tracker views."""
from __future__ import print_function
from __future__ i... | 40.303299 | 80 | 0.705028 |
797b090ccf77cf85efc6c73e9ef2e6e2281f908d | 236 | py | Python | Cap_3/ex3.10.py | gguilherme42/Livro-de-Python | 465a509d50476fd1a87239c71ed741639d58418b | [
"MIT"
] | 4 | 2020-04-07T00:38:46.000Z | 2022-03-10T03:34:42.000Z | Cap_3/ex3.10.py | gguilherme42/Livro-de-Python | 465a509d50476fd1a87239c71ed741639d58418b | [
"MIT"
] | null | null | null | Cap_3/ex3.10.py | gguilherme42/Livro-de-Python | 465a509d50476fd1a87239c71ed741639d58418b | [
"MIT"
] | 1 | 2021-04-22T02:45:38.000Z | 2021-04-22T02:45:38.000Z | salario = float(input('Valor do salário: R$'))
aumento = float(input('Valor do aumento (ex.: 5%): '))
r = salario * aumento / 100
salfinal = salario + aumento
print(f'''Valor do aumento: R${r:.2f}
→ Salário final: R${salfinal:.2f}''')
| 33.714286 | 54 | 0.648305 |
797b099e64c6aacaf4d2ea4eb86885eebd93ccb5 | 389 | py | Python | webapp/python/python/asgi.py | QuicketSolutions/collabora-online-sdk-examples | 1d9a2ba04e5837df7192bd3ed3959de4c9b69e6b | [
"Apache-2.0"
] | 11 | 2021-04-18T00:29:03.000Z | 2022-03-09T00:13:40.000Z | webapp/python/python/asgi.py | QuicketSolutions/collabora-online-sdk-examples | 1d9a2ba04e5837df7192bd3ed3959de4c9b69e6b | [
"Apache-2.0"
] | 4 | 2021-10-04T09:48:17.000Z | 2021-10-04T10:12:43.000Z | webapp/python/python/asgi.py | QuicketSolutions/collabora-online-sdk-examples | 1d9a2ba04e5837df7192bd3ed3959de4c9b69e6b | [
"Apache-2.0"
] | 6 | 2021-04-27T06:40:48.000Z | 2022-03-10T09:35:58.000Z | """
ASGI config for python project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
797b09b31cde1d7cca1dec21549b3e44a88a1beb | 6,841 | py | Python | scheduler/models.py | SectorLabs/django-rq-scheduler | 58060e7044c2c51ec3c2e870f9d5cabcdcd2299d | [
"MIT"
] | null | null | null | scheduler/models.py | SectorLabs/django-rq-scheduler | 58060e7044c2c51ec3c2e870f9d5cabcdcd2299d | [
"MIT"
] | null | null | null | scheduler/models.py | SectorLabs/django-rq-scheduler | 58060e7044c2c51ec3c2e870f9d5cabcdcd2299d | [
"MIT"
] | null | null | null | import importlib
from datetime import timedelta
import croniter
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.templatetags.tz import utc
from django.utils.translation import ugettext_lazy as _
import django_rq
from model_utils import Choi... | 29.614719 | 78 | 0.594504 |
797b09cbac1495f6e9dcc4b1349b57bf698364f5 | 9,272 | py | Python | doc/source/conf.py | iawells/gluon-variant-nova | 8b1bc6a042b30710b8828e011f79206acc3cca46 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | iawells/gluon-variant-nova | 8b1bc6a042b30710b8828e011f79206acc3cca46 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | iawells/gluon-variant-nova | 8b1bc6a042b30710b8828e011f79206acc3cca46 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# nova documentation build configuration file, created by
# sphinx-quickstart on Sat May 1 15:17:47 2010.
#
# This file is execfile()d with the current directory set to
# its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | 34.857143 | 84 | 0.690682 |
797b0a35a78c452942f8f3c04856f6103ac3a7da | 4,335 | py | Python | expert/Satellite/mlp.py | rtu715/NAS-Bench-360 | d075006848c664371855c34082b0a00cda62be67 | [
"MIT"
] | 10 | 2021-06-15T17:48:34.000Z | 2022-02-23T18:34:28.000Z | expert/Satellite/mlp.py | rtu715/NAS-Bench-360 | d075006848c664371855c34082b0a00cda62be67 | [
"MIT"
] | 1 | 2021-11-12T15:12:38.000Z | 2021-11-12T19:38:00.000Z | expert/Satellite/mlp.py | rtu715/NAS-Bench-360 | d075006848c664371855c34082b0a00cda62be67 | [
"MIT"
] | 1 | 2021-11-15T04:07:17.000Z | 2021-11-15T04:07:17.000Z | import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
import numpy as np
import os
import torch.utils.data as data_utils
from torch.utils.data import Dataset
torch.manual_seed(1)
# Device configuration
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
#... | 34.404762 | 142 | 0.664821 |
797b0a746d9a0a414296738c49bbde600050b94f | 2,329 | py | Python | tests/datasets/utils.py | MarkusSagen/pytorch-adapt | 947b9f1b748d2078cecbf4a00c34f73108d9ecde | [
"MIT"
] | 1 | 2021-12-15T19:36:01.000Z | 2021-12-15T19:36:01.000Z | tests/datasets/utils.py | MarkusSagen/pytorch-adapt | 947b9f1b748d2078cecbf4a00c34f73108d9ecde | [
"MIT"
] | null | null | null | tests/datasets/utils.py | MarkusSagen/pytorch-adapt | 947b9f1b748d2078cecbf4a00c34f73108d9ecde | [
"MIT"
] | null | null | null | import os
from collections import defaultdict
import torch
import tqdm
from torchvision import transforms as torch_transforms
skip_reason = "RUN_DATASET_TESTS is False"
def simple_transform():
return torch_transforms.Compose(
[
torch_transforms.Resize((2, 2)),
torch_transforms.To... | 33.753623 | 88 | 0.723486 |
797b0ada9ff689a4b681c07137cbfedd6b7763f3 | 89 | py | Python | tests/test_airtools.py | project-bluebird/airtools | 46f8945feae732fadf2426feaecc50bea07c240a | [
"MIT"
] | null | null | null | tests/test_airtools.py | project-bluebird/airtools | 46f8945feae732fadf2426feaecc50bea07c240a | [
"MIT"
] | 6 | 2021-08-19T12:20:14.000Z | 2021-09-28T18:23:26.000Z | tests/test_airtools.py | project-bluebird/airtools | 46f8945feae732fadf2426feaecc50bea07c240a | [
"MIT"
] | null | null | null | from airtools import __version__
def test_version():
assert __version__ == "0.1.0"
| 14.833333 | 33 | 0.719101 |
797b0af23959d949856c1bf998457f41603d2b31 | 343 | py | Python | sdp_2021_03/decorators/class_decorator.py | iproduct/intro-python | 8fcf682286dad3fc65f46ccff33aefab9c601306 | [
"Apache-2.0"
] | 3 | 2022-01-10T07:56:37.000Z | 2022-02-14T16:37:56.000Z | sdp_2021_03/decorators/class_decorator.py | iproduct/intro-python | 8fcf682286dad3fc65f46ccff33aefab9c601306 | [
"Apache-2.0"
] | null | null | null | sdp_2021_03/decorators/class_decorator.py | iproduct/intro-python | 8fcf682286dad3fc65f46ccff33aefab9c601306 | [
"Apache-2.0"
] | 1 | 2022-02-14T16:36:46.000Z | 2022-02-14T16:36:46.000Z | def trace_get_attributes(cls: type):
class Wrapper:
def __init__(self, *args, **kwargs):
self.wrapped = cls(*args, **kwargs)
def __getattr__(self, item):
result = getattr(self.wrapped, item)
print(f"-- getting attribute '{item}' = {result}")
return res... | 34.3 | 62 | 0.577259 |
797b0b80dbba2eaf68972453fa772516ae1852d3 | 332 | py | Python | problems/172.Factorial_Trailing_Zeroes/li.py | subramp-prep/leetcode | d125201d9021ab9b1eea5e5393c2db4edd84e740 | [
"Unlicense"
] | null | null | null | problems/172.Factorial_Trailing_Zeroes/li.py | subramp-prep/leetcode | d125201d9021ab9b1eea5e5393c2db4edd84e740 | [
"Unlicense"
] | null | null | null | problems/172.Factorial_Trailing_Zeroes/li.py | subramp-prep/leetcode | d125201d9021ab9b1eea5e5393c2db4edd84e740 | [
"Unlicense"
] | null | null | null | # coding=utf-8
# Author: Han
# Question: 172. Factorial Trailing Zeroes
# Date: 2017-03-11
# Complexity: O(LogN)
class Solution(object):
def trailingZeroes(self, n):
r = 0
while n > 0:
n /= 5
r += n
return r
s = Solution()
print s.trailingZeroes(10)
print 2**32
... | 14.434783 | 42 | 0.566265 |
797b0bfa6769ee25418d9d09b0ee97d2c171764d | 4,245 | py | Python | vsum_tools.py | ymlwww/rlproject | b4fe26090776b7cde80de635254ce0bf8f4d17cf | [
"MIT"
] | 378 | 2018-04-20T13:45:03.000Z | 2022-03-30T02:05:23.000Z | vsum_tools.py | ymlwww/rlproject | b4fe26090776b7cde80de635254ce0bf8f4d17cf | [
"MIT"
] | 81 | 2018-06-06T13:57:06.000Z | 2022-03-22T07:11:58.000Z | vsum_tools.py | ymlwww/rlproject | b4fe26090776b7cde80de635254ce0bf8f4d17cf | [
"MIT"
] | 134 | 2018-04-21T12:42:54.000Z | 2022-03-31T14:55:11.000Z | import numpy as np
from knapsack import knapsack_dp
import math
def generate_summary(ypred, cps, n_frames, nfps, positions, proportion=0.15, method='knapsack'):
"""Generate keyshot-based video summary i.e. a binary vector.
Args:
---------------------------------------------
- ypred: predicted importanc... | 37.566372 | 96 | 0.627562 |
797b0c2ef41f6cd0e5fa5be7166efebcb21ebecc | 118 | py | Python | learn_suc/predict/admin.py | adamwang0705/learn_suc-gui | 1ae5dfbe49fcaaef5917c324c984bd0148a2a944 | [
"MIT"
] | null | null | null | learn_suc/predict/admin.py | adamwang0705/learn_suc-gui | 1ae5dfbe49fcaaef5917c324c984bd0148a2a944 | [
"MIT"
] | null | null | null | learn_suc/predict/admin.py | adamwang0705/learn_suc-gui | 1ae5dfbe49fcaaef5917c324c984bd0148a2a944 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Item
# Register your models here.
admin.site.register([Item])
| 14.75 | 32 | 0.771186 |
797b0c55e91fd8a6575a9ae5c218a632bee0b346 | 2,925 | py | Python | research/hetero_dnn_logistic_regression/test/mock_models.py | chenj133/FATE | 7065fc73ab83f83e699efec69ff8efb499159ef4 | [
"Apache-2.0"
] | 32 | 2020-06-12T08:39:58.000Z | 2022-03-20T06:57:08.000Z | research/hetero_dnn_logistic_regression/test/mock_models.py | ErikSun2020/FATE | bdda535c7d8a974fc2c43102837964b7da199730 | [
"Apache-2.0"
] | 14 | 2019-11-13T11:25:36.000Z | 2021-12-14T21:31:59.000Z | research/hetero_dnn_logistic_regression/test/mock_models.py | ErikSun2020/FATE | bdda535c7d8a974fc2c43102837964b7da199730 | [
"Apache-2.0"
] | 16 | 2020-06-12T06:51:46.000Z | 2022-03-29T10:23:42.000Z | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 27.857143 | 86 | 0.640684 |
797b0cfbd1f1d4bd87b9beffc50326216bd835bd | 3,329 | py | Python | setup.py | jtwhite79/MetPy | 8f1880be1ee98c17cd00ae556324386d2a6301ac | [
"BSD-3-Clause"
] | null | null | null | setup.py | jtwhite79/MetPy | 8f1880be1ee98c17cd00ae556324386d2a6301ac | [
"BSD-3-Clause"
] | null | null | null | setup.py | jtwhite79/MetPy | 8f1880be1ee98c17cd00ae556324386d2a6301ac | [
"BSD-3-Clause"
] | 1 | 2021-06-15T07:29:05.000Z | 2021-06-15T07:29:05.000Z | # Copyright (c) 2008-2015 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import print_function
import sys
from setuptools import setup, find_packages, Command
import versioneer
class MakeExamples(Command):
description = 'Create... | 35.795699 | 83 | 0.610994 |
797b0d8ee4665f2cae2213c435505ec42eb1eb13 | 25,016 | py | Python | gsl/pat.py | wzh99/GSL | 49f8e071ae53d393ba6494ab0aa762787bc49f04 | [
"Apache-2.0"
] | 2 | 2021-03-05T11:22:41.000Z | 2021-10-02T12:39:26.000Z | gsl/pat.py | wzh99/GSL | 49f8e071ae53d393ba6494ab0aa762787bc49f04 | [
"Apache-2.0"
] | 1 | 2021-03-05T11:23:09.000Z | 2021-11-08T01:46:32.000Z | gsl/pat.py | wzh99/GSL | 49f8e071ae53d393ba6494ab0aa762787bc49f04 | [
"Apache-2.0"
] | 1 | 2022-01-02T09:18:29.000Z | 2022-01-02T09:18:29.000Z | from typing import List, Dict, Callable, Union, Any, Optional, Generic, TypeVar, Set
import numpy as np
from . import attr, spec
from .attr import Attr, Symbol, AttrLike
class Pattern:
"""
Base class for all pattern graph nodes. This class cannot be directly instantiated.
"""
NOT_IN_SRC = -1
d... | 31.427136 | 98 | 0.601175 |
797b0dd710d539ba1014143d81a130f5827e92fa | 310 | py | Python | 509_Fibonacci_Number.py | rpm1995/LeetCode | 147d99e273bc398c107f2aef73aba0d6bb88dea0 | [
"MIT"
] | null | null | null | 509_Fibonacci_Number.py | rpm1995/LeetCode | 147d99e273bc398c107f2aef73aba0d6bb88dea0 | [
"MIT"
] | null | null | null | 509_Fibonacci_Number.py | rpm1995/LeetCode | 147d99e273bc398c107f2aef73aba0d6bb88dea0 | [
"MIT"
] | null | null | null | class Solution(object):
def fib(self, N):
"""
:type N: int
:rtype: int
"""
def helper(n):
if n == 1:
return 1
elif n == 0:
return 0
return helper(n - 1) + helper(n - 2)
return helper(N)
| 17.222222 | 48 | 0.370968 |
797b0df65cbd0a4f2e5fe9fc93a3b5719900de90 | 1,225 | py | Python | glitchart/__init__.py | delivrance/glitchart | de8ffd91565c1b4388476a46f28764573bee2eab | [
"MIT"
] | 29 | 2019-03-05T16:20:56.000Z | 2022-03-24T06:05:39.000Z | glitchart/__init__.py | delivrance/glitchart | de8ffd91565c1b4388476a46f28764573bee2eab | [
"MIT"
] | null | null | null | glitchart/__init__.py | delivrance/glitchart | de8ffd91565c1b4388476a46f28764573bee2eab | [
"MIT"
] | 9 | 2019-06-13T07:58:16.000Z | 2022-03-15T15:08:54.000Z | # MIT License
#
# Copyright (c) 2019 Dan Tès <https://github.com/delivrance>
#
# 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
# t... | 51.041667 | 89 | 0.776327 |
797b0eb9fba680857bf723d0b93435c25d05abfe | 392 | py | Python | lib/PDCurses/man/manext.py | neophyt1983/Walball | efd83833aa728cb268d71c595aa0329d31469bd7 | [
"MIT"
] | null | null | null | lib/PDCurses/man/manext.py | neophyt1983/Walball | efd83833aa728cb268d71c595aa0329d31469bd7 | [
"MIT"
] | null | null | null | lib/PDCurses/man/manext.py | neophyt1983/Walball | efd83833aa728cb268d71c595aa0329d31469bd7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
BAR = '\n\n' + ('-' * 74) + '\n\n'
for f in sys.argv:
inman = False
for line in open(f):
if inman:
if line.startswith('**man-end'):
inman = False
sys.stdout.write(BAR)
else:
sys.stdout.write(line)... | 21.777778 | 45 | 0.466837 |
797b0f1104706af08f30c9e33e178d7ac0233f56 | 2,578 | py | Python | lib/builder/mixup_sampler.py | shuto-keio/3DSSD | dd6d64b72c986bd567a28f7538e22664744e8be4 | [
"MIT"
] | 1 | 2021-04-18T09:13:45.000Z | 2021-04-18T09:13:45.000Z | lib/builder/mixup_sampler.py | shuto-keio/3DSSD | dd6d64b72c986bd567a28f7538e22664744e8be4 | [
"MIT"
] | 11 | 2021-03-31T19:55:17.000Z | 2022-03-12T00:31:34.000Z | dddssd/lib/builder/mixup_sampler.py | dd-iuonac/object-detector-in-carla | fb900f7a1dcd366e326d044fcd8dc2c6ddc697fb | [
"MIT"
] | null | null | null | import tensorflow as tf
import sys, os
import numpy as np
import cv2
import itertools
from core.config import cfg
class MixupSampler:
def __init__(self, shuffle=True):
"""
pc_list: train / val / trainval
cls_list: ['Car', 'Pedestrian', 'Cyclist']
"""
self.base_dir = cfg.TR... | 37.911765 | 134 | 0.611715 |
797b0f4b867ad5145ba4a4f8194339d950c13466 | 30,123 | py | Python | tests/agent_unittests/test_harvest_loop.py | bradleycamacho/newrelic-python-agent | d41fb461e7a4eb428fa85b0abc21734814bd7390 | [
"Apache-2.0"
] | null | null | null | tests/agent_unittests/test_harvest_loop.py | bradleycamacho/newrelic-python-agent | d41fb461e7a4eb428fa85b0abc21734814bd7390 | [
"Apache-2.0"
] | null | null | null | tests/agent_unittests/test_harvest_loop.py | bradleycamacho/newrelic-python-agent | d41fb461e7a4eb428fa85b0abc21734814bd7390 | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 New Relic, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 33.358804 | 92 | 0.688411 |
797b0f706b147158d7c917c5e67a7e392db5df50 | 5,228 | py | Python | notebook_invoke/invoke_py.py | michalgregor/notebook_invoke | b64abbad56491d3c2f5d41d7f19bb8250333d2c7 | [
"BSD-3-Clause"
] | 1 | 2021-10-30T09:56:10.000Z | 2021-10-30T09:56:10.000Z | notebook_invoke/invoke_py.py | michalgregor/notebook_invoke | b64abbad56491d3c2f5d41d7f19bb8250333d2c7 | [
"BSD-3-Clause"
] | null | null | null | notebook_invoke/invoke_py.py | michalgregor/notebook_invoke | b64abbad56491d3c2f5d41d7f19bb8250333d2c7 | [
"BSD-3-Clause"
] | 1 | 2021-10-30T09:56:12.000Z | 2021-10-30T09:56:12.000Z | import json
import types
from weakref import ref, WeakMethod
from .encoder import NumpyEncoder
_jupyter_javascript_callbacks = globals()['_jupyter_javascript_callbacks'] = {}
def register_callback(callback_id, callback):
if isinstance(callback, types.MethodType):
_jupyter_javascript_callbacks[callback_id] ... | 34.394737 | 113 | 0.583206 |
797b0f9fd343357b330e0052c51f4e52bc5fc345 | 3,138 | py | Python | ucr/datasets/personx.py | chenhao2345/UCR | 954e64964bf0f09d1a959a9e6e646b55e1ac5b26 | [
"Apache-2.0"
] | null | null | null | ucr/datasets/personx.py | chenhao2345/UCR | 954e64964bf0f09d1a959a9e6e646b55e1ac5b26 | [
"Apache-2.0"
] | 1 | 2022-03-19T07:34:44.000Z | 2022-03-22T09:41:52.000Z | ucr/datasets/personx.py | chenhao2345/UCR | 954e64964bf0f09d1a959a9e6e646b55e1ac5b26 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function, absolute_import
import os.path as osp
import glob
import re
import urllib
import zipfile
from ..utils.data import BaseImageDataset
from ..utils.osutils import mkdir_if_missing
from ..utils.serialization import write_json
class PersonX(BaseImageDataset):
"""
PersonX
R... | 38.740741 | 115 | 0.65615 |
797b0fd550a641f75238f98a0af9957ce7e03a16 | 2,842 | py | Python | dhis2_core/src/dhis2/code_list/cli.py | dhis2/dhis2-python | 45a17e174b15243fa829e8186715c080cad7696c | [
"BSD-3-Clause"
] | 7 | 2020-10-15T08:54:50.000Z | 2021-12-19T14:37:49.000Z | dhis2_core/src/dhis2/code_list/cli.py | dhis2/dhis2-python | 45a17e174b15243fa829e8186715c080cad7696c | [
"BSD-3-Clause"
] | 3 | 2016-08-12T14:11:14.000Z | 2021-03-08T17:06:29.000Z | dhis2_core/src/dhis2/code_list/cli.py | dhis2/dhis2-python | 45a17e174b15243fa829e8186715c080cad7696c | [
"BSD-3-Clause"
] | 4 | 2016-02-10T23:03:08.000Z | 2020-12-28T13:18:49.000Z | import json
import logging
import sys
import click
from dhis2.core.inventory import resolve_one
from dhis2.core.utils import parse_file
from . import svcm
from .icd11 import fetch_icd11_dhis2_option_sets
from .icd10 import fetch_icd10_dhis2_option_sets
log = logging.getLogger(__name__)
@click.group("code-list")
de... | 24.5 | 89 | 0.665728 |
797b10adfb424bdde9715ab5f8bef45badd16661 | 1,868 | py | Python | network.py | Habejota/Tenaya | efe745f1b13ef5f0fd9c4f537d0b2a9ad4a0d085 | [
"MIT"
] | 4 | 2021-05-18T23:10:51.000Z | 2021-05-27T01:53:14.000Z | network.py | TenayaOS/Tenaya | efe745f1b13ef5f0fd9c4f537d0b2a9ad4a0d085 | [
"MIT"
] | null | null | null | network.py | TenayaOS/Tenaya | efe745f1b13ef5f0fd9c4f537d0b2a9ad4a0d085 | [
"MIT"
] | null | null | null | from socket import gethostname, gethostbyname
import os
print("Booting from Network. . .")
print("\n")
input("")
os.system("title Network Driver System: iPXE")
os.system("cls")
print("iPXE -- Open Source Network Boot Firmware -- http://ipxe.org")
print("Features: HTTP iSCSI DNS TFTP AoE FCoE TFTP COMBOOT EL... | 33.963636 | 132 | 0.510171 |
797b10ce766037b4080a2a924308fe9d0cf8cd2f | 232 | py | Python | confab/tests/data/callables/environment.py | locationlabs/confab | a39c3d7aae11b2f373b8911b4f3caa75548a00c6 | [
"Apache-2.0"
] | 3 | 2015-01-23T09:39:25.000Z | 2022-02-25T15:47:26.000Z | confab/tests/data/callables/environment.py | locationlabs/confab | a39c3d7aae11b2f373b8911b4f3caa75548a00c6 | [
"Apache-2.0"
] | null | null | null | confab/tests/data/callables/environment.py | locationlabs/confab | a39c3d7aae11b2f373b8911b4f3caa75548a00c6 | [
"Apache-2.0"
] | 1 | 2021-09-08T09:52:11.000Z | 2021-09-08T09:52:11.000Z | from confab.merge import append, prepend, unique_union, rotate
appended = append('environment')
prepended = prepend('environment')
unique = unique_union('default')
rotated = rotate(lambda: 'pivot', ['itemA', 'pivot', 'itemB'])
| 21.090909 | 62 | 0.724138 |
797b10fb3aaa2a72228c6ceb192363670f092195 | 2,264 | py | Python | heroku_config.py | Ahmad99Ahmad/PaYtHoNMeMbEr | fc2b97e9a0826123b938d56d9ce405bef3560d55 | [
"MIT"
] | null | null | null | heroku_config.py | Ahmad99Ahmad/PaYtHoNMeMbEr | fc2b97e9a0826123b938d56d9ce405bef3560d55 | [
"MIT"
] | null | null | null | heroku_config.py | Ahmad99Ahmad/PaYtHoNMeMbEr | fc2b97e9a0826123b938d56d9ce405bef3560d55 | [
"MIT"
] | null | null | null | import os
class Var(object):
APP_ID = int(os.environ.get("APP_ID", 6))
# 6 is a placeholder
API_HASH = os.environ.get("API_HASH", "057ecc4d8f91dd6f0038cd409f477918")
STRING_SESSION = os.environ.get("STRING_SESSION", None)
DB_URI = os.environ.get("DATABASE_URL", None)
TEMP_DOWNLOAD_DIRECTORY = o... | 49.217391 | 134 | 0.713339 |
797b11071c0787134bdc8b78e04185df1c3e7789 | 1,100 | py | Python | python/audio/pyaudio_rec.py | mura303/snippet | 03ee713e37650853708153f815a357fec497784d | [
"Unlicense"
] | null | null | null | python/audio/pyaudio_rec.py | mura303/snippet | 03ee713e37650853708153f815a357fec497784d | [
"Unlicense"
] | null | null | null | python/audio/pyaudio_rec.py | mura303/snippet | 03ee713e37650853708153f815a357fec497784d | [
"Unlicense"
] | null | null | null | # https://realpython.com/playing-and-recording-sound-python/#pyaudio_1
import pyaudio
import wave
import time
chunk = 1024 # Record in chunks of 1024 samples
sample_format = pyaudio.paInt16 # 16 bits per sample
channels = 1
fs = 32000 # Record at 44100 samples per second
seconds = 5
filename = "output.wav"
p = pyau... | 24.444444 | 70 | 0.705455 |
797b114ff11e5251cfd955d188fb5a231afde8ca | 5,248 | py | Python | tests/integration/conftest.py | neuro-inc/platform-buckets-api | ba04edeb8565fa06e5af6d0316957a8816b087b2 | [
"Apache-2.0"
] | null | null | null | tests/integration/conftest.py | neuro-inc/platform-buckets-api | ba04edeb8565fa06e5af6d0316957a8816b087b2 | [
"Apache-2.0"
] | 55 | 2021-11-16T00:26:52.000Z | 2022-03-29T03:16:55.000Z | tests/integration/conftest.py | neuro-inc/platform-buckets-api | ba04edeb8565fa06e5af6d0316957a8816b087b2 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import secrets
import subprocess
import time
from collections.abc import AsyncIterator, Callable
from contextlib import asynccontextmanager
from dataclasses import dataclass
from typing import Any
import aiohttp
import aiohttp.web
import pytest
from aiobotocore.client import AioBaseClient
fr... | 27.333333 | 82 | 0.630907 |
797b1192ed725373df4b90b4fe69540ec2c60669 | 14,750 | py | Python | indra/tests/test_belief_engine.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | 1 | 2020-12-27T14:37:10.000Z | 2020-12-27T14:37:10.000Z | indra/tests/test_belief_engine.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | null | null | null | indra/tests/test_belief_engine.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from nose.tools import raises
from indra.statements import *
from indra.belief import BeliefEngine, load_default_probs, _get_belief_package,\
sample_statements, evidence_random_noise_prior, tag_evidence_subtype, ... | 37.436548 | 80 | 0.634576 |
797b11affd06cc42c6be775d133e360f11914e90 | 1,492 | py | Python | lib/sylvester/utils/log_likelihood.py | KelvinKan/CP-Flow | d01303cb4ebeb5a0bbfca638ffaf5b7a8ec22fb1 | [
"MIT"
] | 64 | 2021-02-22T21:24:39.000Z | 2022-03-25T20:30:39.000Z | lib/sylvester/utils/log_likelihood.py | KelvinKan/CP-Flow | d01303cb4ebeb5a0bbfca638ffaf5b7a8ec22fb1 | [
"MIT"
] | null | null | null | lib/sylvester/utils/log_likelihood.py | KelvinKan/CP-Flow | d01303cb4ebeb5a0bbfca638ffaf5b7a8ec22fb1 | [
"MIT"
] | 9 | 2021-02-24T15:12:40.000Z | 2022-03-05T06:14:17.000Z | from __future__ import print_function
import numpy as np
from scipy.special import logsumexp
from lib.sylvester.optimization.loss import calculate_loss_array
def calculate_likelihood(X, model, args, S=5000, MB=500):
# set auxiliary variables for number of training and test sets
N_test = X.size(0)
X = X.... | 26.175439 | 83 | 0.581099 |
797b120e50e08e544c93720699300dc234027cea | 242 | py | Python | backend/train_net/run_test.py | wutiancai/electron-vue-admin | 81528ea4a1a4dddf9fd6af28a104b6a1a0151169 | [
"MIT"
] | 2 | 2020-10-19T11:13:45.000Z | 2021-08-23T12:28:13.000Z | backend/train_net/run_test.py | wutiancai/electron-vue-admin | 81528ea4a1a4dddf9fd6af28a104b6a1a0151169 | [
"MIT"
] | null | null | null | backend/train_net/run_test.py | wutiancai/electron-vue-admin | 81528ea4a1a4dddf9fd6af28a104b6a1a0151169 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/4/7 14:39
# @Author : tiancai.wu
from time import sleep
def test():
for i in range(10):
print('>>' * (i + 1))
sleep(1)
if __name__ == '__main__':
test() | 20.166667 | 29 | 0.528926 |
797b128c4cc2bf30455a69836824b769917da104 | 718 | py | Python | p2ner/components/output/vlcoutput/vlcoutput/__init__.py | schristakidis/p2ner | 46694a41e8c1ebdc28f520b58c126da8785f3eed | [
"Apache-2.0"
] | 2 | 2015-06-01T22:04:34.000Z | 2017-07-06T09:35:00.000Z | p2ner/components/output/vlcoutput/vlcoutput/__init__.py | schristakidis/p2ner | 46694a41e8c1ebdc28f520b58c126da8785f3eed | [
"Apache-2.0"
] | null | null | null | p2ner/components/output/vlcoutput/vlcoutput/__init__.py | schristakidis/p2ner | 46694a41e8c1ebdc28f520b58c126da8785f3eed | [
"Apache-2.0"
] | 1 | 2019-11-26T10:22:35.000Z | 2019-11-26T10:22:35.000Z | # -*- coding: utf-8 -*
# Copyright 2012 Loris Corazza, Sakis Christakidis
#
# 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
#
# Un... | 39.888889 | 76 | 0.745125 |
797b14b34568c6a829c420365a6922af5ad91bef | 19,163 | py | Python | onem/tests.py | mvnm/onem-py | c3719cc1b5ca605d4cd6e99e5659f857942204a3 | [
"Apache-2.0"
] | null | null | null | onem/tests.py | mvnm/onem-py | c3719cc1b5ca605d4cd6e99e5659f857942204a3 | [
"Apache-2.0"
] | null | null | null | onem/tests.py | mvnm/onem-py | c3719cc1b5ca605d4cd6e99e5659f857942204a3 | [
"Apache-2.0"
] | null | null | null | import unittest
from onem.menus import MenuItem, Menu, MenuMeta
from onem import forms
class TestMenu(unittest.TestCase):
def test_menu_item_option(self):
item = MenuItem('Some option label',
'/callback-path',
method='GET',
text_sear... | 46.739024 | 105 | 0.397067 |
797b14b5ab28fef54ab5090101448617cc552f2c | 69,502 | py | Python | chat_downloader/sites/youtube.py | Takayamashi/chat-downloader | 4283443e6bd328b9f68ba89eef73a7d3f65c497b | [
"MIT"
] | null | null | null | chat_downloader/sites/youtube.py | Takayamashi/chat-downloader | 4283443e6bd328b9f68ba89eef73a7d3f65c497b | [
"MIT"
] | null | null | null | chat_downloader/sites/youtube.py | Takayamashi/chat-downloader | 4283443e6bd328b9f68ba89eef73a7d3f65c497b | [
"MIT"
] | null | null | null |
from .common import (
BaseChatDownloader,
Chat,
Remapper as r,
Image
)
from ..errors import (
ChatDownloaderError,
NoChatReplay,
ChatDisabled,
NoContinuation,
ParsingError,
VideoUnavailable,
LoginRequired,
VideoUnplayable,
InvalidParameter,
UserNotFound,
NoV... | 37.127137 | 177 | 0.537898 |
797b14f38f8b2c186064762b34b81bc70edd9056 | 304 | py | Python | flask/app.py | willrushi/web-boilerplates | 31d318d65a8462af9c9a14c626507800da733369 | [
"MIT"
] | null | null | null | flask/app.py | willrushi/web-boilerplates | 31d318d65a8462af9c9a14c626507800da733369 | [
"MIT"
] | null | null | null | flask/app.py | willrushi/web-boilerplates | 31d318d65a8462af9c9a14c626507800da733369 | [
"MIT"
] | null | null | null | from flask import Flask
from blueprints.routes import routes
app = Flask(__name__, static_url_path='/assets', static_folder='assets')
# change this!
app.secret_key = "965caf956f95a7928345abafcb9f156"
app.register_blueprint(routes)
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0') | 21.714286 | 72 | 0.756579 |
797b1598d532ed2937852d87017990add344ac4f | 1,365 | py | Python | news/info/__init__.py | soulmatewhat/flask_xjnews | 016693183d27c9ec376085054280abbdc8a2fe37 | [
"MIT"
] | null | null | null | news/info/__init__.py | soulmatewhat/flask_xjnews | 016693183d27c9ec376085054280abbdc8a2fe37 | [
"MIT"
] | null | null | null | news/info/__init__.py | soulmatewhat/flask_xjnews | 016693183d27c9ec376085054280abbdc8a2fe37 | [
"MIT"
] | null | null | null | import logging
from logging.handlers import RotatingFileHandler
import redis
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_wtf import CSRFProtect
from flask_session import Session
from config import configs
# 数据库配置
db = SQLAlchemy()
redis_store = None
def setup_log(level):
"""配置日志""... | 27.857143 | 98 | 0.744322 |
797b15f8bb494ba47dc498f5f564bb06082c7fe2 | 8,356 | py | Python | omnipresence/plugins/dice/__init__.py | kxz/omnipresence | ffb3dbc30d36331a68e8dea3a85db6a4d2928cd7 | [
"BSD-3-Clause"
] | null | null | null | omnipresence/plugins/dice/__init__.py | kxz/omnipresence | ffb3dbc30d36331a68e8dea3a85db6a4d2928cd7 | [
"BSD-3-Clause"
] | 10 | 2016-04-05T04:36:15.000Z | 2018-03-25T00:15:47.000Z | omnipresence/plugins/dice/__init__.py | kxz/omnipresence | ffb3dbc30d36331a68e8dea3a85db6a4d2928cd7 | [
"BSD-3-Clause"
] | null | null | null | # -*- test-case-name: omnipresence.plugins.dice.test_dice
"""Event plugins for storing banks of die rolls used in role-playing
games."""
from collections import defaultdict, Counter
from random import Random
from ...humanize import andify
from ...message import collapse
from ...plugin import SubcommandEventPlugin, U... | 39.415094 | 79 | 0.576831 |
797b160bdc68e103c3a41390cfc98f3b69e6deff | 3,061 | py | Python | mwlib/epub/siteconfig.py | pediapress/mwlib.epub | d0989cf34d58a0db95744c4c39578853eb5f40f1 | [
"Unlicense"
] | 2 | 2015-02-17T11:18:12.000Z | 2020-06-09T14:48:01.000Z | mwlib/epub/siteconfig.py | pediapress/mwlib.epub | d0989cf34d58a0db95744c4c39578853eb5f40f1 | [
"Unlicense"
] | null | null | null | mwlib/epub/siteconfig.py | pediapress/mwlib.epub | d0989cf34d58a0db95744c4c39578853eb5f40f1 | [
"Unlicense"
] | null | null | null | #! /usr/bin/env python
#! -*- coding:utf-8 -*-
# Copyright (c) 2012, PediaPress GmbH
# See README.txt for additional licensing information.
import urlparse
# content: 'xpath-expr' query which selects the content that is supposed to be printed
# remove: 'xpath-expr' query that selects elements which are supposed to b... | 34.393258 | 88 | 0.484156 |
797b174aeb1ea4f6a40cb8efd866685c1bd0844e | 4,068 | py | Python | distest/TestInterface/_embeds.py | sean-keisuke/distest | 98bb06051d15a04f4cbe15f1f63902864cf6b4f1 | [
"MIT"
] | 34 | 2019-05-07T20:29:37.000Z | 2021-08-10T02:19:03.000Z | distest/TestInterface/_embeds.py | sean-keisuke/distest | 98bb06051d15a04f4cbe15f1f63902864cf6b4f1 | [
"MIT"
] | 69 | 2019-05-16T01:05:52.000Z | 2021-08-17T12:03:17.000Z | distest/TestInterface/_embeds.py | sean-keisuke/distest | 98bb06051d15a04f4cbe15f1f63902864cf6b4f1 | [
"MIT"
] | 10 | 2019-05-07T20:29:45.000Z | 2021-04-01T00:48:46.000Z | from discord import Message, Embed
from typing import Dict
from distest.exceptions import ResponseDidNotMatchError
import re
async def assert_embed_equals(
message: Message, matches: Embed, attributes_to_prove: list = None,
):
"""If ``matches`` doesn't match the embed of ``message``, fail the test.
Che... | 36.648649 | 111 | 0.580875 |
797b1ab7db849a204d081546e27dd53ddd2c4d7a | 170 | py | Python | utils/url.py | Aazerra/utils | f6781fedde093840f6b2d82be168e4b13ba22e82 | [
"MIT"
] | 4 | 2021-02-06T13:03:05.000Z | 2021-02-06T13:40:39.000Z | utils/url.py | TahaPY/utils | 03336d0998f346465908d192468123424c3930d8 | [
"MIT"
] | null | null | null | utils/url.py | TahaPY/utils | 03336d0998f346465908d192468123424c3930d8 | [
"MIT"
] | null | null | null | def join(*args):
"""
join url with paths and url queries
:param args:
:return:
"""
return '/'.join([arg.rstrip('/') for arg in args if len(arg)])
| 21.25 | 66 | 0.552941 |
797b1b133324f51a92d2c76805d6e16b889d09fe | 508 | py | Python | tests/r/test_genfan.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 199 | 2017-07-24T01:34:27.000Z | 2022-01-29T00:50:55.000Z | tests/r/test_genfan.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 46 | 2017-09-05T19:27:20.000Z | 2019-01-07T09:47:26.000Z | tests/r/test_genfan.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 45 | 2017-07-26T00:10:44.000Z | 2022-03-16T20:44:59.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.genfan import genfan
def test_genfan():
"""Test module genfan.py by downloading
genfan.csv and testing shape of
extracted data has 70 rows... | 21.166667 | 43 | 0.75 |
797b1b24a2876c43afdd26523b82589cd75c6cb1 | 1,113 | py | Python | kde/applications/kdialog/kdialog.py | wrobelda/craft-blueprints-kde | 366f460cecd5baebdf3a695696767c8c0e5e7c7e | [
"BSD-2-Clause"
] | 14 | 2017-09-04T09:01:03.000Z | 2022-01-04T20:09:00.000Z | kde/applications/kdialog/kdialog.py | wrobelda/craft-blueprints-kde | 366f460cecd5baebdf3a695696767c8c0e5e7c7e | [
"BSD-2-Clause"
] | 14 | 2017-12-15T08:11:22.000Z | 2020-12-29T19:11:13.000Z | kde/applications/kdialog/kdialog.py | wrobelda/craft-blueprints-kde | 366f460cecd5baebdf3a695696767c8c0e5e7c7e | [
"BSD-2-Clause"
] | 19 | 2017-09-05T19:16:21.000Z | 2020-10-18T12:46:06.000Z | import info
from CraftOS.osutils import OsUtils
class subinfo(info.infoclass):
def setTargets(self):
self.versionInfo.setDefaultValues()
def setDependencies(self):
self.runtimeDependencies["virtual/base"] = None
self.buildDependencies["kde/frameworks/extra-cmake-modules"] = None
... | 41.222222 | 78 | 0.731357 |
797b1b43e036d75e5ee18c67b4bf7dd5f70d7f30 | 4,865 | py | Python | timesketch/models/sketch_test.py | Marwolf/timesketch | 8fbbb3d0a5a50dc0214fc56a9bbec82050908103 | [
"Apache-2.0"
] | null | null | null | timesketch/models/sketch_test.py | Marwolf/timesketch | 8fbbb3d0a5a50dc0214fc56a9bbec82050908103 | [
"Apache-2.0"
] | null | null | null | timesketch/models/sketch_test.py | Marwolf/timesketch | 8fbbb3d0a5a50dc0214fc56a9bbec82050908103 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 37.713178 | 79 | 0.618294 |
797b1decac2795727ebe82f9a2797e80683a8b5f | 368 | py | Python | parser/fase2/team21/Analisis_Ascendente/Instrucciones/Sentencias_De_Control/Do.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | parser/fase2/team21/Analisis_Ascendente/Instrucciones/Sentencias_De_Control/Do.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | parser/fase2/team21/Analisis_Ascendente/Instrucciones/Sentencias_De_Control/Do.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | from tytus.parser.fase2.team21.Analisis_Ascendente.Instrucciones.instruccion import Instruccion
class Do(Instruccion):
def __init__(self, caso, E, declareInst, beginInst, linea, columna):
self.caso = caso
self.E = E
self.declareInst = declareInst
self.beginInst = beginInst
s... | 36.8 | 95 | 0.690217 |
797b1eb4d208b39e20aebba14fddc1baf56abc1e | 952 | py | Python | tests/test_logic.py | isoteemu/TJTS5901-BeeMapTemlate | 83a9ccbda4eb2ce4edf2f05e83a78f8ee5403c0b | [
"MIT"
] | null | null | null | tests/test_logic.py | isoteemu/TJTS5901-BeeMapTemlate | 83a9ccbda4eb2ce4edf2f05e83a78f8ee5403c0b | [
"MIT"
] | null | null | null | tests/test_logic.py | isoteemu/TJTS5901-BeeMapTemlate | 83a9ccbda4eb2ce4edf2f05e83a78f8ee5403c0b | [
"MIT"
] | null | null | null | import unittest
class LogicTests(unittest.TestCase):
def test_boolean_logic(self):
""" Test that boolean logic works """
self.assertTrue(True, "True should be equal to True.")
self.assertFalse(False, "False should not be equal to True.")
self.assertNotEqual(True, False, "True shou... | 35.259259 | 91 | 0.644958 |
797b1fb16c390003977485ed3fa6eb97510a2077 | 84,494 | py | Python | py/desitarget/sv1/sv1_cuts.py | echaussidon/desitarget | 1206380dac5155b9e7bf238c7cb187bc797d78a3 | [
"BSD-3-Clause"
] | 13 | 2016-02-02T00:26:21.000Z | 2022-01-14T07:31:59.000Z | py/desitarget/sv1/sv1_cuts.py | echaussidon/desitarget | 1206380dac5155b9e7bf238c7cb187bc797d78a3 | [
"BSD-3-Clause"
] | 674 | 2015-09-15T15:02:06.000Z | 2022-02-23T18:39:02.000Z | py/desitarget/sv1/sv1_cuts.py | echaussidon/desitarget | 1206380dac5155b9e7bf238c7cb187bc797d78a3 | [
"BSD-3-Clause"
] | 29 | 2015-06-09T13:51:48.000Z | 2021-06-05T06:03:18.000Z | """
desitarget.sv1.sv1_cuts
=======================
Target Selection for DESI Survey Validation derived from `the SV wiki`_.
A collection of helpful (static) methods to check whether an object's
flux passes a given selection criterion (*e.g.* LRG, ELG or QSO).
.. _`the Gaia data model`: https://gea.esac.esa.int/arch... | 40.897386 | 150 | 0.611416 |
797b21509185e1e91b76c9952e25ff358eaffa40 | 329 | py | Python | www/config_default.py | haibo-yu/awesome-python-webapp | 69f36eb941fbdcc5469c178f4e5d428d3f495e8b | [
"Unlicense"
] | null | null | null | www/config_default.py | haibo-yu/awesome-python-webapp | 69f36eb941fbdcc5469c178f4e5d428d3f495e8b | [
"Unlicense"
] | null | null | null | www/config_default.py | haibo-yu/awesome-python-webapp | 69f36eb941fbdcc5469c178f4e5d428d3f495e8b | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Haibo Yu'
'''
Default configurations.
'''
configs = {
'db': {
'host': '127.0.0.1',
'port': 3306,
'user': 'www-data',
'password': 'www-data',
'database': 'awesome'
},
'session': {
'secret': 'AwEsOmE... | 15.666667 | 31 | 0.458967 |
797b21ab017478a1d8418796f9a0b43246a0d191 | 10,596 | py | Python | Simulate.py | vmishra04/Pydial | a689fa1177cd34f32dd4d30a5a6140fb721855bf | [
"Apache-2.0"
] | 2 | 2020-01-20T14:43:27.000Z | 2021-04-29T12:21:05.000Z | Simulate.py | vmishra04/Pydial | a689fa1177cd34f32dd4d30a5a6140fb721855bf | [
"Apache-2.0"
] | null | null | null | Simulate.py | vmishra04/Pydial | a689fa1177cd34f32dd4d30a5a6140fb721855bf | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################################
#
# Copyright 2015 - 2019
# Cambridge University Engineering Department Dialogue Systems Grou... | 42.725806 | 134 | 0.575972 |
797b22c22f7addec0b88b7a5f460db4e5bf3f23e | 5,157 | py | Python | homeassistant/components/emulated_hue/upnp.py | eyager1/core | c0ae31d86c841107930cf471fd60d65b5c163f16 | [
"Apache-2.0"
] | 3 | 2019-10-02T04:40:26.000Z | 2020-02-16T13:19:08.000Z | homeassistant/components/emulated_hue/upnp.py | LW-Ho/home-assistant | 209f37196e779d96da8451a31d712313e3ae29e2 | [
"Apache-2.0"
] | 1,016 | 2019-06-18T21:27:47.000Z | 2020-03-06T11:09:58.000Z | homeassistant/components/emulated_hue/upnp.py | LW-Ho/home-assistant | 209f37196e779d96da8451a31d712313e3ae29e2 | [
"Apache-2.0"
] | null | null | null | """Support UPNP discovery method that mimics Hue hubs."""
import asyncio
import logging
import socket
from aiohttp import web
from homeassistant import core
from homeassistant.components.http import HomeAssistantView
from .const import HUE_SERIAL_NUMBER, HUE_UUID
_LOGGER = logging.getLogger(__name__)
BROADCAST_POR... | 31.638037 | 87 | 0.694396 |
797b230dfab26e28a31d026aa0764b2b85e65b7c | 4,627 | py | Python | onpolicy/algorithms/r_mappo_single/algorithm/r_actor_critic.py | LUMO666/Highway | 05e1ad318bd14d405bd78d612e5706f7db2b3266 | [
"MIT"
] | 5 | 2021-06-15T05:06:10.000Z | 2021-12-01T05:11:49.000Z | onpolicy/algorithms/r_mappo_single/algorithm/r_actor_critic.py | LUMO666/Highway | 05e1ad318bd14d405bd78d612e5706f7db2b3266 | [
"MIT"
] | null | null | null | onpolicy/algorithms/r_mappo_single/algorithm/r_actor_critic.py | LUMO666/Highway | 05e1ad318bd14d405bd78d612e5706f7db2b3266 | [
"MIT"
] | null | null | null | import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from onpolicy.algorithms.utils.cnn import CNNBase
from onpolicy.algorithms.utils.mlp import MLPBase, MLPLayer
from onpolicy.algorithms.utils.rnn import RNNLayer
from onpolicy.algorithms.utils.act import ACTLayer
from onp... | 40.234783 | 139 | 0.68619 |
797b23a175f4fdbcf1b3b32d137cf4d400a03242 | 6,915 | py | Python | aequilibrae/matrix/aequilibrae_data.py | jamiecook/AequilibraE | b1013d59cbeaf6fc4e1a944cf31f20460a2a4156 | [
"MIT"
] | null | null | null | aequilibrae/matrix/aequilibrae_data.py | jamiecook/AequilibraE | b1013d59cbeaf6fc4e1a944cf31f20460a2a4156 | [
"MIT"
] | null | null | null | aequilibrae/matrix/aequilibrae_data.py | jamiecook/AequilibraE | b1013d59cbeaf6fc4e1a944cf31f20460a2a4156 | [
"MIT"
] | null | null | null | """
-----------------------------------------------------------------------------------------------------------
Package: AequilibraE
Name: AequilibraE Database
Purpose: Implements a class to represent flat databases with an unique id field.
It is really just a wrapper around numpy recarray... | 37.786885 | 127 | 0.565293 |
797b250a4c2db805e6733272a3811699312d7a7e | 1,688 | py | Python | cell.py | taraSherman/Game-of-Life | 5aa6f315ac193664324eac6980c5cb635ec70c78 | [
"MIT"
] | null | null | null | cell.py | taraSherman/Game-of-Life | 5aa6f315ac193664324eac6980c5cb635ec70c78 | [
"MIT"
] | 1 | 2020-10-25T19:39:29.000Z | 2020-10-25T19:39:29.000Z | cell.py | taraSherman/Game-of-Life | 5aa6f315ac193664324eac6980c5cb635ec70c78 | [
"MIT"
] | null | null | null | import pygame
from settings import *
class Cell:
def __init__(self, surface, grid_x, grid_y):
self.alive = False
self.surface = surface
self.grid_x = grid_x
self.grid_y = grid_y
self.image = pygame.Surface((18, 18))
self.rect = self.image.get_rect()
self.frie... | 27.672131 | 75 | 0.471564 |
797b25b3d33ebc71dfdeb3c82ea1db883a41817f | 4,662 | py | Python | configs/representation/archive/uvc2/uvc_r18_aug_coord_nlf_l1_video_4x4x1_sgd_50e_k400_rgb.py | happywu/mmaction2-CycleContrast | 019734e471dffd1161b7a9c617ba862d2349a96c | [
"Apache-2.0"
] | null | null | null | configs/representation/archive/uvc2/uvc_r18_aug_coord_nlf_l1_video_4x4x1_sgd_50e_k400_rgb.py | happywu/mmaction2-CycleContrast | 019734e471dffd1161b7a9c617ba862d2349a96c | [
"Apache-2.0"
] | null | null | null | configs/representation/archive/uvc2/uvc_r18_aug_coord_nlf_l1_video_4x4x1_sgd_50e_k400_rgb.py | happywu/mmaction2-CycleContrast | 019734e471dffd1161b7a9c617ba862d2349a96c | [
"Apache-2.0"
] | null | null | null | # model settings
temperature = 0.01
with_norm = True
model = dict(
type='UVCTrackerV2',
backbone=dict(
type='ResNet',
pretrained=None,
depth=18,
out_indices=(3, ),
strides=(1, 2, 1, 1),
norm_eval=False,
zero_init_residual=True),
cls_head=dict(
... | 30.272727 | 78 | 0.627413 |
797b25e201e3b9878cf2762862cb3e612a7b4be4 | 13,118 | py | Python | rest_rpc/training/models.py | aimakerspace/synergos_rest | d7b45216e5d1854fe65213f06ae3f3bb6d99cab0 | [
"Apache-2.0"
] | null | null | null | rest_rpc/training/models.py | aimakerspace/synergos_rest | d7b45216e5d1854fe65213f06ae3f3bb6d99cab0 | [
"Apache-2.0"
] | null | null | null | rest_rpc/training/models.py | aimakerspace/synergos_rest | d7b45216e5d1854fe65213f06ae3f3bb6d99cab0 | [
"Apache-2.0"
] | 2 | 2022-01-21T01:06:01.000Z | 2022-01-26T01:11:06.000Z | #!/usr/bin/env python
####################
# Required Modules #
####################
# Generic/Built-in
import os
from typing import Dict, List, Union, Any
# Libs
from flask import request
from flask_restx import Namespace, Resource, fields
from tinydb.database import Document
# Custom
from rest_rpc... | 33.896641 | 153 | 0.576307 |
797b27487d5caba134f3e00011fb98c85bcbf7fe | 952 | py | Python | bellatrix/start_instance.py | deccico/bellatrix | ed60286b91ec5d268529535bdd515ca0c96aa2b9 | [
"Apache-2.0"
] | 1 | 2018-11-22T01:04:32.000Z | 2018-11-22T01:04:32.000Z | bellatrix/start_instance.py | deccico/bellatrix | ed60286b91ec5d268529535bdd515ca0c96aa2b9 | [
"Apache-2.0"
] | null | null | null | bellatrix/start_instance.py | deccico/bellatrix | ed60286b91ec5d268529535bdd515ca0c96aa2b9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
'''
this needs a good refactor
'''
import sys
from bellatrix.lib.ec2_lib import Ec2lib
from bellatrix.lib import bellatrix_util
from bellatrix.lib import util
class Run():
def __init__(self, key, sec):
self._ec2 = Ec2lib(key, sec)
self.out_file = bellatrix_util.getOutFile(__fi... | 29.75 | 105 | 0.703782 |
797b27706ba5b2628440df3fb1db2e3c15014d7e | 647 | py | Python | raiden_contracts/tests/fixtures/config.py | konradkonrad/raiden-contracts | 5726f744e8d7e80f7ca61401bd3f1084de57e30c | [
"MIT"
] | null | null | null | raiden_contracts/tests/fixtures/config.py | konradkonrad/raiden-contracts | 5726f744e8d7e80f7ca61401bd3f1084de57e30c | [
"MIT"
] | null | null | null | raiden_contracts/tests/fixtures/config.py | konradkonrad/raiden-contracts | 5726f744e8d7e80f7ca61401bd3f1084de57e30c | [
"MIT"
] | null | null | null | from enum import IntEnum
CONTRACTS_VERSION = '0.3.0'
MAX_UINT256 = 2 ** 256 - 1
MAX_UINT192 = 2 ** 192 - 1
MAX_UINT32 = 2 ** 32 - 1
FAKE_ADDRESS = '0x03432'
EMPTY_ADDRESS = '0x0000000000000000000000000000000000000000'
EMPTY_BALANCE_HASH = b'\x00' * 32
EMPTY_ADDITIONAL_HASH = b'\x00' * 32
EMPTY_LOCKSROOT = b'\x00' * 3... | 21.566667 | 60 | 0.675425 |
797b27d92975d67bf46931afe90f5a5110797f2b | 2,420 | py | Python | scripts/vol_test.py | kanishkaganguly/VolumeController | f14cbb5531416f0f4e8d8b3767470764daee78bf | [
"MIT"
] | null | null | null | scripts/vol_test.py | kanishkaganguly/VolumeController | f14cbb5531416f0f4e8d8b3767470764daee78bf | [
"MIT"
] | null | null | null | scripts/vol_test.py | kanishkaganguly/VolumeController | f14cbb5531416f0f4e8d8b3767470764daee78bf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import pulsectl
import notify2
from sys import argv
def notify(vol):
notify2.init("Volume Controller")
n = notify2.Notification("Setting volume: {}".format(vol))
n.set_urgency(notify2.URGENCY_NORMAL)
n.set_timeout(1000)
n.show()
def get_sink_by_name(sink_name, pulse):
... | 29.512195 | 77 | 0.659091 |
797b2842db4a68849110a25bb52a47c658966186 | 15,138 | py | Python | fairseq/fairseq/options.py | zhaoguangxiang/OFA | cc1719df2713f0a046f34acb0afd8782e08ea6be | [
"Apache-2.0"
] | 367 | 2022-02-07T10:46:36.000Z | 2022-03-31T14:20:57.000Z | fairseq/fairseq/options.py | zhaoguangxiang/OFA | cc1719df2713f0a046f34acb0afd8782e08ea6be | [
"Apache-2.0"
] | 29 | 2022-02-16T03:43:33.000Z | 2022-03-31T03:23:35.000Z | fairseq/fairseq/options.py | zhaoguangxiang/OFA | cc1719df2713f0a046f34acb0afd8782e08ea6be | [
"Apache-2.0"
] | 44 | 2022-02-11T05:14:59.000Z | 2022-03-30T19:54:33.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
from pathlib import Path
from typing import Callable, List, Optional, Union
import torch
from fairseq import utils
from fairs... | 37.194103 | 88 | 0.682389 |
797b28bdebbb008e37174b4aea3f393d63d279ff | 3,544 | py | Python | bindings/python/ensmallen/datasets/string/acholeplasmaaxanthum.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/acholeplasmaaxanthum.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/acholeplasmaaxanthum.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Acholeplasma axanthum.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein ... | 32.814815 | 223 | 0.677201 |
797b28c9efc747623f3aa8ce4a53f12e35996e1a | 6,461 | py | Python | src/meltano/core/plugin_location_remove.py | Mu-L/meltano | 7bf8f370608ee9a8833b33ea94112c6e219c8161 | [
"MIT"
] | null | null | null | src/meltano/core/plugin_location_remove.py | Mu-L/meltano | 7bf8f370608ee9a8833b33ea94112c6e219c8161 | [
"MIT"
] | null | null | null | src/meltano/core/plugin_location_remove.py | Mu-L/meltano | 7bf8f370608ee9a8833b33ea94112c6e219c8161 | [
"MIT"
] | null | null | null | """Defines PluginLocationRemoveStatus, PluginLocationRemoveManager, DbRemoveManager, MeltanoYmlRemoveManager and InstallationRemoveManager."""
import shutil
from abc import ABC, abstractmethod
from enum import Enum
import sqlalchemy
from meltano.core.db import project_engine
from meltano.core.plugin.error import Plu... | 33.133333 | 142 | 0.664603 |
797b28d96e7b68076a146778d88ad94bfc7c0e22 | 12,792 | py | Python | pg.py | SandStormHoldings/ScratchDocs | 24f3e4239781791385c0a14056335ec5f043b533 | [
"MIT"
] | 1 | 2018-05-18T15:45:35.000Z | 2018-05-18T15:45:35.000Z | pg.py | SandStormHoldings/ScratchDocs | 24f3e4239781791385c0a14056335ec5f043b533 | [
"MIT"
] | null | null | null | pg.py | SandStormHoldings/ScratchDocs | 24f3e4239781791385c0a14056335ec5f043b533 | [
"MIT"
] | null | null | null | from __future__ import print_function
from builtins import object
import psycopg2
import psycopg2.extras
from gevent.lock import BoundedSemaphore as Semaphore
from gevent.local import local as gevent_local
from config import PG_DSN,DONESTATES
from gevent import sleep
# migration stuff
import json,re
from datetime impo... | 34.387097 | 217 | 0.569497 |
797b290a1aa10b72ab3a39093aed5e33e2ecef04 | 10,306 | py | Python | experimental/inject.py | martindevora/SHERLOCK | 5e7492552cbce29e960684a44fd6ad875c8cf60e | [
"MIT"
] | 1 | 2021-01-14T16:44:48.000Z | 2021-01-14T16:44:48.000Z | experimental/inject.py | martindevora/SHERLOCK | 5e7492552cbce29e960684a44fd6ad875c8cf60e | [
"MIT"
] | null | null | null | experimental/inject.py | martindevora/SHERLOCK | 5e7492552cbce29e960684a44fd6ad875c8cf60e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
#::: modules
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os, sys
import ellc
from transitleastsquares import transitleastsquares
from transitleastsquares... | 38.599251 | 136 | 0.586843 |
797b29208660aeb086317a7592233be18c782e70 | 1,888 | py | Python | package.py | kerrmarin/luath-signup | 59d474417454a383485b8e4a908eb10268c8806b | [
"MIT"
] | null | null | null | package.py | kerrmarin/luath-signup | 59d474417454a383485b8e4a908eb10268c8806b | [
"MIT"
] | null | null | null | package.py | kerrmarin/luath-signup | 59d474417454a383485b8e4a908eb10268c8806b | [
"MIT"
] | null | null | null |
import os, subprocess, argparse, zipfile, shutil, io
import boto3
def getDirectoriesFromArguments():
"""
Gets the list of directories to package up from the command line
"""
parser = argparse.ArgumentParser()
parser.add_argument('--directories',
help='Directories whose cont... | 31.466667 | 76 | 0.611229 |
797b29220fbe951d348149e71a669a2733acd149 | 10,285 | py | Python | tensorflow_federated/python/research/baseline_fedavg/simple_fedavg_test.py | xueyuuu/federated | ad617401324c133eb838e4e0af7442a4dfa71d6e | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/research/baseline_fedavg/simple_fedavg_test.py | xueyuuu/federated | ad617401324c133eb838e4e0af7442a4dfa71d6e | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/research/baseline_fedavg/simple_fedavg_test.py | xueyuuu/federated | ad617401324c133eb838e4e0af7442a4dfa71d6e | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 32.964744 | 112 | 0.705882 |
797b292fdc74dd313c352e10200d6ed10a884f79 | 2,135 | py | Python | omnizart/patch_cnn/inference.py | nicolasanjoran/omnizart | b0e74af39b2e3a312ef32dbf0837626b2e043cb6 | [
"MIT"
] | 1,145 | 2020-11-13T10:07:47.000Z | 2022-03-29T17:35:36.000Z | omnizart/patch_cnn/inference.py | nicolasanjoran/omnizart | b0e74af39b2e3a312ef32dbf0837626b2e043cb6 | [
"MIT"
] | 44 | 2020-12-29T04:51:16.000Z | 2022-03-15T06:52:04.000Z | omnizart/patch_cnn/inference.py | nicolasanjoran/omnizart | b0e74af39b2e3a312ef32dbf0837626b2e043cb6 | [
"MIT"
] | 61 | 2020-12-19T09:09:42.000Z | 2022-03-23T01:26:22.000Z | import numpy as np
def inference(pred, mapping, zzz, cenf, threshold=0.5, max_method="posterior"):
"""Infers pitch contour from the model prediction.
Parameters
----------
pred:
The predicted results of the model.
mapping: 2D numpy array
The original frequency and time index of pa... | 35.583333 | 83 | 0.604215 |
797b294d813dc3f6f2de011c92fb3f311224073e | 11,563 | py | Python | language_model/discriminative/source/train_lm_sets.py | gonenhila/codeswitching-lm | 5a8b843a7ab952d62de76d50f77bb75f38897620 | [
"Apache-2.0"
] | 10 | 2019-02-22T20:54:47.000Z | 2021-03-22T02:03:53.000Z | language_model/discriminative/source/train_lm_sets.py | gonenhila/codeswitching-lm | 5a8b843a7ab952d62de76d50f77bb75f38897620 | [
"Apache-2.0"
] | 1 | 2020-04-29T14:16:30.000Z | 2020-04-29T14:16:30.000Z | language_model/discriminative/source/train_lm_sets.py | gonenhila/codeswitching-lm | 5a8b843a7ab952d62de76d50f77bb75f38897620 | [
"Apache-2.0"
] | 5 | 2019-02-22T20:54:54.000Z | 2020-04-28T18:05:56.000Z |
import dynet as dy
import sys
import argparse
import time
import random
import numpy as np
from collections import defaultdict
import codecs
import math
import seaborn as sns
import pandas as pd
import pickle
import json
from LM_sets import LM_sets
parser = argparse.ArgumentParser()
parser.add_argu... | 36.021807 | 142 | 0.603477 |
797b2b3bead772a07c506488876e9e8f2f532a15 | 836 | py | Python | services/web/apps/kb/macros/loader.py | xUndero/noc | 9fb34627721149fcf7064860bd63887e38849131 | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | services/web/apps/kb/macros/loader.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | services/web/apps/kb/macros/loader.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Macro Loader
# ----------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# See LICENSE for details
# -----------------------------------------------------------------... | 26.967742 | 72 | 0.521531 |
797b2c3808e192ded682eccb34506e4d94e53ab7 | 610 | py | Python | ch4/get_observation_action_space.py | megamindsecurity/Hands-On-Intelligent-Agents-with-OpenAI-Gym- | 14f6931009f4d2ff5597b9059a836c0210a45ff2 | [
"MIT"
] | null | null | null | ch4/get_observation_action_space.py | megamindsecurity/Hands-On-Intelligent-Agents-with-OpenAI-Gym- | 14f6931009f4d2ff5597b9059a836c0210a45ff2 | [
"MIT"
] | null | null | null | ch4/get_observation_action_space.py | megamindsecurity/Hands-On-Intelligent-Agents-with-OpenAI-Gym- | 14f6931009f4d2ff5597b9059a836c0210a45ff2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import gym
from gym.spaces import *
import sys
def print_spaces(space):
print(space)
if isinstance(space, Box): # Print lower and upper bound if it's a Box space
print("\n space.low: ", space.low)
print("\n space.high: ", space.high)
if __name__ == "__main__":
en... | 26.521739 | 80 | 0.662295 |
797b2d3d4eff0cbadf1fe6004aa21a756601baa2 | 7,630 | py | Python | samples/sampleopenflow/demos/demo29.py | gaberger/pysdn | 67442e1c259d8ca8620ada95b95977e3852463c5 | [
"BSD-3-Clause"
] | 1 | 2017-08-22T14:17:10.000Z | 2017-08-22T14:17:10.000Z | samples/sampleopenflow/demos/demo29.py | gaberger/pysdn | 67442e1c259d8ca8620ada95b95977e3852463c5 | [
"BSD-3-Clause"
] | 1 | 2021-03-26T00:47:22.000Z | 2021-03-26T00:47:22.000Z | samples/sampleopenflow/demos/demo29.py | gaberger/pysdn | 67442e1c259d8ca8620ada95b95977e3852463c5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, 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:
# 1. Redistributions of source code must retain the above copyright n... | 36.682692 | 79 | 0.603408 |
797b2d4b24370b78fba24c026c0cd04206bf1db7 | 4,072 | py | Python | selfdrive/controls/lib/drive_helpers.py | birdman6450/openpilot | 2429f86bed65cca163122ac9f7a0c1d53597d463 | [
"MIT"
] | 1 | 2021-01-12T01:38:25.000Z | 2021-01-12T01:38:25.000Z | selfdrive/controls/lib/drive_helpers.py | birdman6450/openpilot | 2429f86bed65cca163122ac9f7a0c1d53597d463 | [
"MIT"
] | null | null | null | selfdrive/controls/lib/drive_helpers.py | birdman6450/openpilot | 2429f86bed65cca163122ac9f7a0c1d53597d463 | [
"MIT"
] | null | null | null | from cereal import car
from common.numpy_fast import clip, interp
from common.realtime import DT_MDL
from selfdrive.config import Conversions as CV
from selfdrive.modeld.constants import T_IDXS
# kph
V_CRUISE_MAX = 135
V_CRUISE_MIN = 8
V_CRUISE_DELTA = 8
V_CRUISE_ENABLE_MIN = 40
LAT_MPC_N = 16
LON_MPC_N = 32
CONTROL_... | 40.316832 | 147 | 0.740177 |
797b2df06b8410ee0e7f02f145b05f77b87acc64 | 377 | py | Python | pymoog/private.py | MingjieJian/pymoog | e5abaf5ce844f6ce38eb2b69e515da4442caa607 | [
"MIT"
] | 5 | 2020-06-29T13:24:42.000Z | 2022-01-02T20:02:55.000Z | pymoog/private.py | MingjieJian/pymoog | e5abaf5ce844f6ce38eb2b69e515da4442caa607 | [
"MIT"
] | 21 | 2020-06-26T13:51:48.000Z | 2021-09-10T04:45:34.000Z | pymoog/private.py | MingjieJian/pymoog | e5abaf5ce844f6ce38eb2b69e515da4442caa607 | [
"MIT"
] | 2 | 2021-01-04T05:33:09.000Z | 2021-02-15T02:07:03.000Z | #!/usr/bin/python
import os
import subprocess
import warnings
import numpy as np
import re
import pandas as pd
import matplotlib.pyplot as plt
from shutil import copyfile
from tqdm.notebook import tqdm
from itertools import compress
from datetime import datetime
from scipy.spatial import Delaunay
from astropy import u... | 20.944444 | 45 | 0.832891 |
797b2f0633e83826ecf0ab2ce3dc63df18df2146 | 1,943 | py | Python | voter.py | mbaharan/PyBranchPredictor | 768044c42d6c5ff0325d933363c0db272ba06eed | [
"MIT"
] | null | null | null | voter.py | mbaharan/PyBranchPredictor | 768044c42d6c5ff0325d933363c0db272ba06eed | [
"MIT"
] | null | null | null | voter.py | mbaharan/PyBranchPredictor | 768044c42d6c5ff0325d933363c0db272ba06eed | [
"MIT"
] | null | null | null | '''
Copyright (c) <2018> <Mohammadreza Baharani>
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, publish, ... | 34.087719 | 78 | 0.675759 |
797b2fc14e024528b4c9345f69d3b64b4d2a8938 | 8,537 | py | Python | 47_train_cars_new_rotation_squared_euclidean_10_interpolate_without_loss_uniform_dist_int_reg_remove_half_fl_fr.py | Florian-Barthel/stylegan2 | 4ef87038bf9370596cf2b729e1d1a1bc3ebcddd8 | [
"BSD-Source-Code"
] | null | null | null | 47_train_cars_new_rotation_squared_euclidean_10_interpolate_without_loss_uniform_dist_int_reg_remove_half_fl_fr.py | Florian-Barthel/stylegan2 | 4ef87038bf9370596cf2b729e1d1a1bc3ebcddd8 | [
"BSD-Source-Code"
] | null | null | null | 47_train_cars_new_rotation_squared_euclidean_10_interpolate_without_loss_uniform_dist_int_reg_remove_half_fl_fr.py | Florian-Barthel/stylegan2 | 4ef87038bf9370596cf2b729e1d1a1bc3ebcddd8 | [
"BSD-Source-Code"
] | null | null | null | # Copyright (c) 2019, NVIDIA Corporation. All rights reserved.
#
# This work is made available under the Nvidia Source Code License-NC.
# To view a copy of this license, visit
# https://nvlabs.github.io/stylegan2/license.html
import argparse
import copy
import sys
import os
import dnnlib
from dnnlib import EasyDict... | 41.241546 | 182 | 0.64648 |
797b3013781d22722f3681ab8deddd47b6de6833 | 23,372 | py | Python | test/functional/test_framework/test_framework.py | danhper/bitcoin-abc | d2b4bfc4d42d054cfebb5d951d23bbe96115f262 | [
"MIT"
] | 1 | 2021-09-08T14:26:46.000Z | 2021-09-08T14:26:46.000Z | test/functional/test_framework/test_framework.py | danhper/bitcoin-abc | d2b4bfc4d42d054cfebb5d951d23bbe96115f262 | [
"MIT"
] | 1 | 2020-02-19T10:28:45.000Z | 2020-02-19T10:28:45.000Z | test/functional/test_framework/test_framework.py | danhper/bitcoin-abc | d2b4bfc4d42d054cfebb5d951d23bbe96115f262 | [
"MIT"
] | 1 | 2017-06-30T20:58:07.000Z | 2017-06-30T20:58:07.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Base class for RPC testing."""
import argparse
import configparser
from enum import Enum
import loggin... | 40.366149 | 312 | 0.611116 |
797b3015ec20a463dc5f593605be52abae3d5a9c | 636 | py | Python | theone/server.py | laozijiaojiangnan/TheOne | 73c1e7cee545c2eb2b2118f2dbf2d4d0c56e3824 | [
"Apache-2.0"
] | null | null | null | theone/server.py | laozijiaojiangnan/TheOne | 73c1e7cee545c2eb2b2118f2dbf2d4d0c56e3824 | [
"Apache-2.0"
] | null | null | null | theone/server.py | laozijiaojiangnan/TheOne | 73c1e7cee545c2eb2b2118f2dbf2d4d0c56e3824 | [
"Apache-2.0"
] | null | null | null | """wsgi web 服务器"""
import typing as t
from http.server import BaseHTTPRequestHandler, HTTPServer
class WsgiHandler(BaseHTTPRequestHandler):
pass
class WsgiServer(HTTPServer):
def __init__(
self,
address: t.Tuple[str, int] = ("127.0.0.1", 5000),
handler_class: t.ClassVar[WsgiHandler... | 24.461538 | 64 | 0.650943 |
797b3039aa9edcca96ad9bab969f21646a25f959 | 8,314 | py | Python | csvtools/_csv_merger.py | pandrey-fr/csvtools | 9c11bb5a1564f5774117fd33682727f51c51bd58 | [
"MIT"
] | null | null | null | csvtools/_csv_merger.py | pandrey-fr/csvtools | 9c11bb5a1564f5774117fd33682727f51c51bd58 | [
"MIT"
] | null | null | null | csvtools/_csv_merger.py | pandrey-fr/csvtools | 9c11bb5a1564f5774117fd33682727f51c51bd58 | [
"MIT"
] | null | null | null | # coding: utf-8
"""Class to handle csv files merging."""
import os
import shutil
from yaptools import alphanum_sort, _alphanum_key, check_type_validity
class CsvMerger:
"""Class to handle csv files merging with minimum memory usage.
Any file encoding or value separator may be used. However, text
field... | 41.57 | 79 | 0.586962 |
797b3080cef21d243ad5c4514731743d409012cc | 8,451 | py | Python | Tests/ML/histopathology/models/test_deepmil.py | faz1993/InnerEye-DeepLearning | fb258d5c9a3ba18565b5a67e7ac1f00127d9ecb9 | [
"MIT"
] | 402 | 2020-09-22T16:38:16.000Z | 2022-03-30T09:56:03.000Z | Tests/ML/histopathology/models/test_deepmil.py | wensincai/InnerEye-DeepLearning | ccb53d01ad0f1c20336588c0066059b8de5266fd | [
"MIT"
] | 259 | 2020-09-23T09:32:33.000Z | 2022-03-30T18:15:01.000Z | Tests/ML/histopathology/models/test_deepmil.py | wensincai/InnerEye-DeepLearning | ccb53d01ad0f1c20336588c0066059b8de5266fd | [
"MIT"
] | 112 | 2020-09-23T00:12:58.000Z | 2022-03-31T07:39:55.000Z | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 36.270386 | 125 | 0.680984 |
797b31d836655a93a9bdbcb46d050f4b87595833 | 2,175 | py | Python | src/docsapp/models.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | src/docsapp/models.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | src/docsapp/models.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
import datetime
class Doc(models.Model):
NORMAL = 'light'
DANGER = 'danger'
WARNING = 'warning'
INFORMATION = 'info'
COLOR_CHOICES = [
(NORMAL, 'Normal'),
(DANGER, 'Danger'),
(WARNING, 'Warning'),
(INFORMATION, 'Information'),
]
... | 23.901099 | 143 | 0.575632 |
797b327352a42a8eea55fae93eb9271b0147fa2f | 1,011 | py | Python | tests/test_requests.py | djeromov/pytest-filedata | d0d429445f0424745c499054993f5209af5b4548 | [
"Apache-2.0"
] | 1 | 2020-02-03T12:30:07.000Z | 2020-02-03T12:30:07.000Z | tests/test_requests.py | djeromov/pytest-filedata | d0d429445f0424745c499054993f5209af5b4548 | [
"Apache-2.0"
] | 2 | 2018-04-02T18:46:41.000Z | 2021-07-23T16:02:12.000Z | tests/test_requests.py | djeromov/pytest-filedata | d0d429445f0424745c499054993f5209af5b4548 | [
"Apache-2.0"
] | 1 | 2021-07-24T18:48:48.000Z | 2021-07-24T18:48:48.000Z | # -*- coding: utf-8 -*-
import requests
import pytest
import pytest_filedata
def assert_test0(data):
res = requests.get('https://example.com/test0')
assert res.status_code == 200
assert data.expected == res.json()
@pytest_filedata.RequestsData("req")
def test_decorator(data_json):
assert_test0(data... | 22.466667 | 58 | 0.731949 |
797b32f1e2221b45343f9cac2d347c848ad6bf6d | 114,950 | py | Python | python/ccxt/async_support/deribit.py | Dan-krm/ccxt | 2ed8b7b8598e2934559822d81a8d14885b4d4ad3 | [
"MIT"
] | null | null | null | python/ccxt/async_support/deribit.py | Dan-krm/ccxt | 2ed8b7b8598e2934559822d81a8d14885b4d4ad3 | [
"MIT"
] | null | null | null | python/ccxt/async_support/deribit.py | Dan-krm/ccxt | 2ed8b7b8598e2934559822d81a8d14885b4d4ad3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors impor... | 46.956699 | 284 | 0.503636 |
797b32f5d4768af59fa4e6aceb75e4b6d9029d91 | 197,048 | py | Python | python/paddle/fluid/framework.py | Huangheyl/Paddle | a1b640bc66a5cc9583de503e7406aeba67565e8d | [
"Apache-2.0"
] | 8 | 2019-06-16T12:36:11.000Z | 2021-03-05T05:33:21.000Z | python/paddle/fluid/framework.py | Huangheyl/Paddle | a1b640bc66a5cc9583de503e7406aeba67565e8d | [
"Apache-2.0"
] | 1 | 2020-09-10T09:05:52.000Z | 2020-09-10T09:06:22.000Z | python/paddle/fluid/framework.py | Huangheyl/Paddle | a1b640bc66a5cc9583de503e7406aeba67565e8d | [
"Apache-2.0"
] | 25 | 2019-12-07T02:14:14.000Z | 2021-12-30T06:16:30.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 34.931395 | 337 | 0.563436 |
797b3308206b3256e3bae90aa67d0988e4c9a846 | 2,481 | py | Python | src/quocspyside2interface/logic/ComunicationSettingsDictionaries/LocalCommunicationDictionaries.py | Quantum-OCS/QuOCS-pyside2interface | 69436666a67da6884aed1ddd087b7062dcd2ad90 | [
"Apache-2.0"
] | 1 | 2021-03-27T17:41:16.000Z | 2021-03-27T17:41:16.000Z | src/quocspyside2interface/logic/ComunicationSettingsDictionaries/LocalCommunicationDictionaries.py | Quantum-OCS/QuOCS-pyside2interface | 69436666a67da6884aed1ddd087b7062dcd2ad90 | [
"Apache-2.0"
] | null | null | null | src/quocspyside2interface/logic/ComunicationSettingsDictionaries/LocalCommunicationDictionaries.py | Quantum-OCS/QuOCS-pyside2interface | 69436666a67da6884aed1ddd087b7062dcd2ad90 | [
"Apache-2.0"
] | null | null | null | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright 2021- QuOCS 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://ww... | 43.526316 | 90 | 0.663039 |
797b3478cf3af02e102f3f27f0526b794a21ffd6 | 2,303 | py | Python | meutils/db/mongo.py | Jie-Yuan/MeUtils | 2bb191b0d35b809af037c0f65b37570b8828bea3 | [
"Apache-2.0"
] | 3 | 2020-12-03T07:30:02.000Z | 2021-02-07T13:37:33.000Z | meutils/db/mongo.py | Jie-Yuan/MeUtils | 2bb191b0d35b809af037c0f65b37570b8828bea3 | [
"Apache-2.0"
] | null | null | null | meutils/db/mongo.py | Jie-Yuan/MeUtils | 2bb191b0d35b809af037c0f65b37570b8828bea3 | [
"Apache-2.0"
] | 1 | 2021-02-07T13:37:38.000Z | 2021-02-07T13:37:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project : Python.
# @File : mimongo
# @Time : 2020-03-20 11:26
# @Author : yuanjie
# @Email : yuanjie@xiaomi.com
# @Software : PyCharm
# @Description :
# https://www.jb51.net/article/159652.htm
# https://www.cnblogs.com/kaituorenshe... | 28.085366 | 129 | 0.584889 |
797b357521cf5efd0dfe458a026397cb8f8c488e | 12,298 | py | Python | djaveDT/__init__.py | dasmith2/djaveDT | 7045ec919f88989f819d727b86a22aac111fa0e0 | [
"MIT"
] | null | null | null | djaveDT/__init__.py | dasmith2/djaveDT | 7045ec919f88989f819d727b86a22aac111fa0e0 | [
"MIT"
] | null | null | null | djaveDT/__init__.py | dasmith2/djaveDT | 7045ec919f88989f819d727b86a22aac111fa0e0 | [
"MIT"
] | null | null | null | from collections import namedtuple
from datetime import datetime, date, timedelta, time
import math
import pytz
import re
from django.conf import settings
from django.utils.dateparse import parse_datetime, parse_date
from django.utils.timezone import make_aware, is_aware, now as django_now
def tz_dt_to_str(tz_dt, t... | 31.292621 | 79 | 0.69556 |
797b35feda40703d058e4aff184b001b0519d7e0 | 3,630 | py | Python | analysis/filter.py | weishi/praat | 132f6a1e152541780c97cebf95609375d506bff0 | [
"MIT"
] | 1 | 2020-05-21T15:26:07.000Z | 2020-05-21T15:26:07.000Z | analysis/filter.py | weishi/praat | 132f6a1e152541780c97cebf95609375d506bff0 | [
"MIT"
] | null | null | null | analysis/filter.py | weishi/praat | 132f6a1e152541780c97cebf95609375d506bff0 | [
"MIT"
] | null | null | null | import itertools
class BaseFilter(object):
def GetValue(self):
raise NotImplementedError
def GetType(self):
raise NotImplementedError
def IsMatched(self, row):
raise NotImplementedError
def GetAgeGender(self, row):
comps = row['Filename'].split('_')
assert le... | 22 | 63 | 0.600551 |
797b37e61369e7c421575aff20ef0e72ac02dd5f | 875 | py | Python | add_device.py | YYSunshine0912/mycroft-client-setup | 7368e3901107857ba4a9187cf5af97bd9438a674 | [
"Apache-2.0"
] | null | null | null | add_device.py | YYSunshine0912/mycroft-client-setup | 7368e3901107857ba4a9187cf5af97bd9438a674 | [
"Apache-2.0"
] | null | null | null | add_device.py | YYSunshine0912/mycroft-client-setup | 7368e3901107857ba4a9187cf5af97bd9438a674 | [
"Apache-2.0"
] | 1 | 2021-06-28T16:30:52.000Z | 2021-06-28T16:30:52.000Z | import requests
#import os
from datetime import datetime
import json
from util.auth_cookies import load_cookies
def add_device():
cookies = load_cookies()
print('Loaded cookies info is:')
print(json.dumps(cookies))
device = dict(
city="Singapore",
country="Singapore",
name="... | 20.833333 | 157 | 0.624 |
797b3835f4e252b81b920117a0226bc7b6de2dc3 | 2,056 | py | Python | embeddings/bert/args.py | Ji-Xin/bovina | 3690ca73c99e0fb451547ce690e03cb9c4d6213c | [
"Apache-2.0"
] | 6 | 2019-04-08T05:53:03.000Z | 2021-02-06T08:19:36.000Z | embeddings/bert/args.py | Ji-Xin/bovina | 3690ca73c99e0fb451547ce690e03cb9c4d6213c | [
"Apache-2.0"
] | 18 | 2019-03-13T20:19:02.000Z | 2019-07-30T18:53:03.000Z | embeddings/bert/args.py | Ji-Xin/bovina | 3690ca73c99e0fb451547ce690e03cb9c4d6213c | [
"Apache-2.0"
] | 2 | 2019-03-08T05:21:51.000Z | 2019-03-08T19:47:10.000Z | import argparse
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('--model', default='bert-base-uncased', type=str, required=False)
parser.add_argument("--batch-size", default=128, type=int)
parser.add_argument("--epochs", default=3.0, type=float)
parser.add_argument("--lr", ... | 62.30303 | 117 | 0.70428 |
797b3a05448cf00ea4f4a545db8428dca041e1bf | 4,814 | py | Python | arpa-rfp-evaluation/check_stats.py | cityofasheville/abi-vendro-processing | 72ed24216ee4772d72abd26b956d7f97ed23bdd3 | [
"MIT"
] | null | null | null | arpa-rfp-evaluation/check_stats.py | cityofasheville/abi-vendro-processing | 72ed24216ee4772d72abd26b956d7f97ed23bdd3 | [
"MIT"
] | 1 | 2021-09-02T19:58:09.000Z | 2021-09-02T19:58:09.000Z | arpa-rfp-evaluation/check_stats.py | cityofasheville/data-processing-scripts | 72ed24216ee4772d72abd26b956d7f97ed23bdd3 | [
"MIT"
] | null | null | null | from googleapiclient.discovery import build
import json
import sys
import time
from csv import reader
from google.oauth2 import service_account
import numpy as np
import statistics as stat
from os.path import exists
SERVICE_ACCOUNT_FILE = None
SCOPES = ['https://www.googleapis.com/auth/spreadsheets']
# The ID and r... | 31.058065 | 162 | 0.678853 |
797b3af7d3085faaac6874bde902550dd59a4f7e | 20,722 | py | Python | Lib/test/pythoninfo.py | umoqnier/cpython | d8ca2354ed30c12b9ce37c4535222b700a727b32 | [
"CNRI-Python-GPL-Compatible"
] | 5 | 2018-07-02T19:10:39.000Z | 2021-09-27T04:05:10.000Z | Lib/test/pythoninfo.py | umoqnier/cpython | d8ca2354ed30c12b9ce37c4535222b700a727b32 | [
"CNRI-Python-GPL-Compatible"
] | 3 | 2018-06-10T06:28:06.000Z | 2021-09-24T13:54:19.000Z | Lib/test/pythoninfo.py | umoqnier/cpython | d8ca2354ed30c12b9ce37c4535222b700a727b32 | [
"CNRI-Python-GPL-Compatible"
] | 2 | 2019-11-16T02:03:51.000Z | 2019-11-16T02:10:57.000Z | """
Collect various information about Python to help debugging test failures.
"""
from __future__ import print_function
import errno
import re
import sys
import traceback
import warnings
def normalize_text(text):
if text is None:
return None
text = str(text)
text = re.sub(r'\s+', ' ', text)
re... | 26.098237 | 91 | 0.592945 |
797b3b1fff4c8d181e99f4a40328b586614e4f17 | 2,818 | py | Python | main.py | jfmaes/transformationsuite | 658cdf5cf2e63a286d3a3fb6692d2fc00f529692 | [
"MIT"
] | null | null | null | main.py | jfmaes/transformationsuite | 658cdf5cf2e63a286d3a3fb6692d2fc00f529692 | [
"MIT"
] | null | null | null | main.py | jfmaes/transformationsuite | 658cdf5cf2e63a286d3a3fb6692d2fc00f529692 | [
"MIT"
] | null | null | null | import argparse
from transformer import Transformer
from format import Formatter
from Crypto.Hash import MD5
parser = argparse.ArgumentParser(description="Transformer next generation by jfmaes")
#DONT FORGET TO PUT REQUIRED TRUE
parser.add_argument("-f", "--file", help="the payload file", required=True)
parser... | 42.69697 | 107 | 0.677076 |
797b3bb8829c551eca40f2233f50b8d4157a1991 | 16,297 | py | Python | asset_app/views.py | orlandofv/sianna | f07dd6dbc62a9604f31ab800e482e62f14fba766 | [
"MIT"
] | null | null | null | asset_app/views.py | orlandofv/sianna | f07dd6dbc62a9604f31ab800e482e62f14fba766 | [
"MIT"
] | null | null | null | asset_app/views.py | orlandofv/sianna | f07dd6dbc62a9604f31ab800e482e62f14fba766 | [
"MIT"
] | null | null | null | import json
import pstats
from django.shortcuts import render, redirect, HttpResponseRedirect, get_object_or_404
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.views.generic import (
ListView,
DetailView,
CreateView,
UpdateView,
DeleteView
)
from django.c... | 33.532922 | 105 | 0.611524 |
797b3c3b661ce95a094be493290f09859807159d | 10,485 | py | Python | Pseudogenome/creatermskPseudo.py | YiZhang-lab/2CLike_analysis | 07805c59a67569896006d7d4508016a8724d8fb2 | [
"MIT"
] | null | null | null | Pseudogenome/creatermskPseudo.py | YiZhang-lab/2CLike_analysis | 07805c59a67569896006d7d4508016a8724d8fb2 | [
"MIT"
] | null | null | null | Pseudogenome/creatermskPseudo.py | YiZhang-lab/2CLike_analysis | 07805c59a67569896006d7d4508016a8724d8fb2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
## Orignal : https://raw.githubusercontent.com/nerettilab/RepEnrich/master/RepEnrich_setup.py
## Modified by : M.N Djekidel
## Date : 10/31/2016
##Run Example:
## python creatermskPseudo.py mm9_repeatmasker_clean.txt ../fasta/mm9_withRandom.fa rms_Pseudo_out
import argparse
import csv
import os
i... | 46.189427 | 988 | 0.64578 |
797b3c9a01c35e5cb794433d38a2d19000bc3003 | 1,325 | py | Python | caffe2/python/operator_test/rms_norm_op_test.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 60,067 | 2017-01-18T17:21:31.000Z | 2022-03-31T21:37:45.000Z | caffe2/python/operator_test/rms_norm_op_test.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 66,955 | 2017-01-18T17:21:38.000Z | 2022-03-31T23:56:11.000Z | caffe2/python/operator_test/rms_norm_op_test.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 19,210 | 2017-01-18T17:45:04.000Z | 2022-03-31T23:51:56.000Z |
from caffe2.python import core
from hypothesis import given, settings
import caffe2.python.hypothesis_test_util as hu
import hypothesis.strategies as st
import numpy as np
import unittest
class TestRMSNormOp(hu.HypothesisTestCase):
@given(
M=st.integers(0, 8),
N=st.integers(1, 16),
eps... | 27.604167 | 69 | 0.578113 |
797b3dab61432efe489e6b1c64b94ec35166e7b9 | 6,338 | py | Python | examples/set_chassis_indicator_led.py | lenovo/lenovo-python-redfish | a2d2608aa33ee5087b62bf46695394571a1aaad9 | [
"Apache-2.0"
] | null | null | null | examples/set_chassis_indicator_led.py | lenovo/lenovo-python-redfish | a2d2608aa33ee5087b62bf46695394571a1aaad9 | [
"Apache-2.0"
] | null | null | null | examples/set_chassis_indicator_led.py | lenovo/lenovo-python-redfish | a2d2608aa33ee5087b62bf46695394571a1aaad9 | [
"Apache-2.0"
] | null | null | null | ###
#
# Lenovo Redfish examples - set chassis indicator led
# Copyright Notice:
#
# Copyright 2018 Lenovo Corporation
#
# 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.apach... | 41.155844 | 141 | 0.639161 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.