hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e18519800d7fdfc3c09ad4f19d1624b4549b0c48 | 6,855 | py | Python | util/convex.py | alters-mit/magnebot | 97641717ad7964a67e24d11379b7aa04693b38d2 | [
"MIT"
] | 3 | 2021-04-21T20:45:59.000Z | 2021-11-18T22:05:57.000Z | util/convex.py | alters-mit/magnebot | 97641717ad7964a67e24d11379b7aa04693b38d2 | [
"MIT"
] | 7 | 2021-03-01T00:00:41.000Z | 2022-01-12T16:19:17.000Z | util/convex.py | alters-mit/magnebot | 97641717ad7964a67e24d11379b7aa04693b38d2 | [
"MIT"
] | 3 | 2021-02-26T02:13:08.000Z | 2021-07-10T06:50:28.000Z | from typing import List, Dict
from json import dumps, loads, JSONEncoder
import numpy as np
from tqdm import tqdm
from tdw.controller import Controller
from tdw.tdw_utils import TDWUtils
from tdw.librarian import ModelLibrarian
from tdw.output_data import Bounds, Raycast
from magnebot.paths import CONVEX_SIDES_PATH
c... | 50.036496 | 118 | 0.521663 |
dcad28f0c97a3b29769b7ffcddc06adc04ca89f6 | 2,037 | py | Python | src/move_source_.py | Jwolter0/OBS-Studio-Python-Scripting-Cheatsheet-obspython-Examples-of-API | 6d6396f2da410bc29f9665dbc40a21fc390aaa57 | [
"MIT"
] | null | null | null | src/move_source_.py | Jwolter0/OBS-Studio-Python-Scripting-Cheatsheet-obspython-Examples-of-API | 6d6396f2da410bc29f9665dbc40a21fc390aaa57 | [
"MIT"
] | null | null | null | src/move_source_.py | Jwolter0/OBS-Studio-Python-Scripting-Cheatsheet-obspython-Examples-of-API | 6d6396f2da410bc29f9665dbc40a21fc390aaa57 | [
"MIT"
] | null | null | null | import obspython as obs
class Example:
def __init__(self):
pos = obs.vec2()
self.location = pos
def create_text_source(self):
current_scene = obs.obs_frontend_get_current_scene()
scene = obs.obs_scene_from_source(current_scene)
settings = obs.obs_data_create... | 30.863636 | 84 | 0.636721 |
f0db2ce834c5e198ea4c2c76bd392e87fa38dc39 | 250 | py | Python | accounting/accounting/doctype/party/party.py | pateljannat/accounting-app | 5e41746b4566b98cb4e72c3625c71d8310c138ba | [
"MIT"
] | null | null | null | accounting/accounting/doctype/party/party.py | pateljannat/accounting-app | 5e41746b4566b98cb4e72c3625c71d8310c138ba | [
"MIT"
] | null | null | null | accounting/accounting/doctype/party/party.py | pateljannat/accounting-app | 5e41746b4566b98cb4e72c3625c71d8310c138ba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class Party(Document):
pass
| 22.727273 | 49 | 0.768 |
618a35481004a0f823c2d5fa74c8d6b459244819 | 1,503 | py | Python | Python/number-of-islands-ii.py | black-shadows/LeetCode-Solutions | b1692583f7b710943ffb19b392b8bf64845b5d7a | [
"Fair",
"Unlicense"
] | null | null | null | Python/number-of-islands-ii.py | black-shadows/LeetCode-Solutions | b1692583f7b710943ffb19b392b8bf64845b5d7a | [
"Fair",
"Unlicense"
] | null | null | null | Python/number-of-islands-ii.py | black-shadows/LeetCode-Solutions | b1692583f7b710943ffb19b392b8bf64845b5d7a | [
"Fair",
"Unlicense"
] | null | null | null | # Time: O(klog*k) ~= O(k), k is the length of the positions
# Space: O(k)
class Solution(object):
def numIslands2(self, m, n, positions):
"""
:type m: int
:type n: int
:type positions: List[List[int]]
:rtype: List[int]
"""
def node_id(node, n):
... | 33.4 | 84 | 0.457086 |
ca558b7f3998c223920114334151f5dbe94fefcb | 3,287 | py | Python | manyssh/input.py | linkdd/manyssh | 1f95d9abbf3215d115c627fad41cabcba02f5e28 | [
"MIT"
] | 3 | 2015-02-08T23:50:53.000Z | 2015-02-09T09:14:34.000Z | manyssh/input.py | linkdd/manyssh | 1f95d9abbf3215d115c627fad41cabcba02f5e28 | [
"MIT"
] | 5 | 2015-02-09T09:20:20.000Z | 2015-02-09T09:41:29.000Z | manyssh/input.py | linkdd/manyssh | 1f95d9abbf3215d115c627fad41cabcba02f5e28 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from gi.repository import Gdk, Gtk
class Input(Gtk.Entry):
"""
ManySSH command line.
"""
def __init__(self, win, *args, **kwargs):
"""
:param win: ManySSH window
:type win: manyssh.win.Window
"""
super(Input, self).__init__(*args, **kw... | 25.284615 | 75 | 0.524186 |
b50acaf8414641f8cef7af44b51132f7690988a3 | 38,733 | py | Python | tools/linter_lib/custom_check.py | adi611/zulip | e1f42c1ac54f74176fa69c360791f4cca3c7c87d | [
"Apache-2.0"
] | null | null | null | tools/linter_lib/custom_check.py | adi611/zulip | e1f42c1ac54f74176fa69c360791f4cca3c7c87d | [
"Apache-2.0"
] | null | null | null | tools/linter_lib/custom_check.py | adi611/zulip | e1f42c1ac54f74176fa69c360791f4cca3c7c87d | [
"Apache-2.0"
] | null | null | null | from typing import List
from zulint.custom_rules import Rule, RuleList
# Rule help:
# By default, a rule applies to all files within the extension for which it is specified (e.g. all .py files)
# There are three operators we can use to manually include or exclude files from linting for a rule:
# 'exclude': 'set([<pat... | 40.771579 | 224 | 0.534996 |
ed0e06b3805a10757c529bbee79b14c1e7fcf162 | 1,049 | py | Python | azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering_paged.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering_paged.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering_paged.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # 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.
# C... | 37.464286 | 162 | 0.593899 |
480dfd617c179948490e6a5f635bf419df290ab0 | 3,970 | py | Python | xknx/devices/sensor.py | onkelbeh/xknx | b7c7427b77b1a709aef8e25b39bbbb62ace6f708 | [
"MIT"
] | null | null | null | xknx/devices/sensor.py | onkelbeh/xknx | b7c7427b77b1a709aef8e25b39bbbb62ace6f708 | [
"MIT"
] | null | null | null | xknx/devices/sensor.py | onkelbeh/xknx | b7c7427b77b1a709aef8e25b39bbbb62ace6f708 | [
"MIT"
] | null | null | null | """
Module for managing a sensor via KNX.
It provides functionality for
* reading the current state from KNX bus.
* watching for state updates from KNX bus.
"""
from typing import TYPE_CHECKING, Any, Iterator, Optional, Union
from xknx.remote_value import RemoteValueControl, RemoteValueSensor
from .device import De... | 34.824561 | 87 | 0.634005 |
a1094d37ed79737b1c039137eaf78f9c0af3c56b | 7,613 | py | Python | models/utils/lrs_scheduler.py | AutuanLiu/PyTorch-ML | 884c7723843d9ffb4da09d95eb97886b2cc38f28 | [
"MIT"
] | 9 | 2018-11-05T05:16:06.000Z | 2021-02-17T16:52:29.000Z | models/utils/lrs_scheduler.py | AutuanLiu/PyTorch-DNN | 884c7723843d9ffb4da09d95eb97886b2cc38f28 | [
"MIT"
] | null | null | null | models/utils/lrs_scheduler.py | AutuanLiu/PyTorch-DNN | 884c7723843d9ffb4da09d95eb97886b2cc38f28 | [
"MIT"
] | 1 | 2019-06-19T18:53:14.000Z | 2019-06-19T18:53:14.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
Description : lrs_scheduler
Reference:
1. https://towardsdatascience.com/transfer-learning-using-pytorch-4c3475f4495
2. https://discuss.pytorch.org/t/solved-learning-rate-decay/6825/5
3. https://d... | 42.294444 | 182 | 0.651254 |
e4422612fb79992ce00a4364d3f6a8a386f2c7c2 | 388 | py | Python | py/tests/problems/dynamic/fib_test.py | bmoretz/Daily-Coding-Problem | f79e062e9f6e7b18b7e95c071fbe71ad104affcb | [
"MIT"
] | 1 | 2020-06-26T13:28:43.000Z | 2020-06-26T13:28:43.000Z | py/tests/problems/dynamic/fib_test.py | bmoretz/Daily-Coding-Problem | f79e062e9f6e7b18b7e95c071fbe71ad104affcb | [
"MIT"
] | 7 | 2021-11-18T19:46:08.000Z | 2022-03-12T01:03:01.000Z | py/tests/problems/dynamic/fib_test.py | bmoretz/Daily-Coding-Problem | f79e062e9f6e7b18b7e95c071fbe71ad104affcb | [
"MIT"
] | null | null | null | import unittest
from dcp.problems.dynamic.fib import fib1
class Test_Fibonacci(unittest.TestCase):
def setUp(self):
pass
def test_case1(self):
assert fib1(10) == 55
from dcp.problems.dynamic.fib import fib2
class Test_Fibonacci(unittest.TestCase):
def setUp(self):
pas... | 16.166667 | 41 | 0.639175 |
81a7f651b42a3acf9247fc7ea9db00cd7bf7c4cc | 5,890 | py | Python | flexget/plugins/sites/iptorrents.py | davidcollom/Flexget | cd763e04afdf6da8f1673dd567a42d55d4cb3b6c | [
"MIT"
] | 1 | 2021-03-24T11:54:01.000Z | 2021-03-24T11:54:01.000Z | flexget/plugins/sites/iptorrents.py | davidcollom/Flexget | cd763e04afdf6da8f1673dd567a42d55d4cb3b6c | [
"MIT"
] | null | null | null | flexget/plugins/sites/iptorrents.py | davidcollom/Flexget | cd763e04afdf6da8f1673dd567a42d55d4cb3b6c | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.parse import quote_plus
import re
import logging
from flexget import plugin
from flexget.config_schema import one_or_more
from flexget.entry impor... | 34.244186 | 113 | 0.561969 |
88af56cc4326032792ce9c95fb7cf1f549ae91b6 | 3,521 | py | Python | ipdb/views.py | ojarva/switch-management-django | 63900a5ffb6bfee4c96b9949bd7caa32d0cb217e | [
"MIT",
"Unlicense"
] | 1 | 2021-01-27T16:53:41.000Z | 2021-01-27T16:53:41.000Z | ipdb/views.py | ojarva/switch-management-django | 63900a5ffb6bfee4c96b9949bd7caa32d0cb217e | [
"MIT",
"Unlicense"
] | null | null | null | ipdb/views.py | ojarva/switch-management-django | 63900a5ffb6bfee4c96b9949bd7caa32d0cb217e | [
"MIT",
"Unlicense"
] | 3 | 2016-06-01T07:08:52.000Z | 2021-05-18T05:45:51.000Z | """
IP database views
"""
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib import messages
from django.views.deco... | 50.3 | 238 | 0.685885 |
b8cdf88c51916ace90279cc86bd0f952e4326f31 | 166 | py | Python | testing/redis_smoke_tests.py | rallen10/ergo_particle_gym | 5bb8073d880ab1da60ee333d892ea8a4720f3396 | [
"FSFULLR",
"FSFUL"
] | null | null | null | testing/redis_smoke_tests.py | rallen10/ergo_particle_gym | 5bb8073d880ab1da60ee333d892ea8a4720f3396 | [
"FSFULLR",
"FSFUL"
] | null | null | null | testing/redis_smoke_tests.py | rallen10/ergo_particle_gym | 5bb8073d880ab1da60ee333d892ea8a4720f3396 | [
"FSFULLR",
"FSFUL"
] | 3 | 2019-12-08T08:36:23.000Z | 2021-11-07T17:35:53.000Z | # #Setup connection
# from redis import Redis
# from rq import Queue
# q = Queue(connection=Redis('10.0.0.32'))
# #Create a task
# results = q.enqueue('smoke_tests') | 27.666667 | 42 | 0.698795 |
30ded230fb1fd5c22332638e838d55c1f7cc8482 | 1,463 | py | Python | ooobuild/lo/ucb/package_content_provider.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/ucb/package_content_provider.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/ucb/package_content_provider.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 34.833333 | 144 | 0.756664 |
43b7013f1f6c3d9b640231a16d32c48abbe67303 | 5,313 | py | Python | opacus/validators/module_validator.py | bogdan-kulynych/opacus | e2d13003a179f64920835bc585f3729b8148279f | [
"Apache-2.0"
] | null | null | null | opacus/validators/module_validator.py | bogdan-kulynych/opacus | e2d13003a179f64920835bc585f3729b8148279f | [
"Apache-2.0"
] | null | null | null | opacus/validators/module_validator.py | bogdan-kulynych/opacus | e2d13003a179f64920835bc585f3729b8148279f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import logging
from typing import List
import torch.nn as nn
from opacus.grad_sample.grad_sample_module import GradSampleModule
from opacus.utils.module_utils import clone_module, get_submodule
from opacus.validators.errors ... | 34.277419 | 90 | 0.615095 |
801cc9c3a1ff6050e2d259e85e998d4d1674a1d1 | 764 | py | Python | N_tree/problems/E_print_left_view_of_binary_tree.py | Princeton21/DSA | 0f2321b284fc54f4ddf73733cc1a8d05e549aeea | [
"MIT"
] | 58 | 2021-01-06T10:05:51.000Z | 2022-02-10T05:15:19.000Z | N_tree/problems/E_print_left_view_of_binary_tree.py | Princeton21/DSA | 0f2321b284fc54f4ddf73733cc1a8d05e549aeea | [
"MIT"
] | 5 | 2021-02-22T04:14:24.000Z | 2021-12-26T09:19:17.000Z | N_tree/problems/E_print_left_view_of_binary_tree.py | Princeton21/DSA | 0f2321b284fc54f4ddf73733cc1a8d05e549aeea | [
"MIT"
] | 27 | 2021-02-09T13:58:33.000Z | 2022-03-06T03:48:08.000Z | class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def leftViewUtil(root, level, max_level):
if root is None:
return
if max_level[0] < level:
print("% d\t" % (root.data))
max_level[0] = level
leftViewUtil(root.le... | 20.648649 | 77 | 0.602094 |
4e054197e3744573a7b57584298c00372547d049 | 5,644 | py | Python | libcloud/utils/py3.py | vanclevstik/libcloud | 2d58fa9ed4defec7f44ce0b83aede701dbc806e1 | [
"Apache-2.0"
] | null | null | null | libcloud/utils/py3.py | vanclevstik/libcloud | 2d58fa9ed4defec7f44ce0b83aede701dbc806e1 | [
"Apache-2.0"
] | 1 | 2015-08-05T10:28:40.000Z | 2015-08-05T15:20:33.000Z | libcloud/utils/py3.py | ferewuz/libcloud | 2d58fa9ed4defec7f44ce0b83aede701dbc806e1 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 27.940594 | 78 | 0.653437 |
074adff4c43d36ce6a4e86783bdb968e32aff98e | 5,032 | py | Python | utility.py | Cadyshack/AIPND-Project-2-Create-Your-Own-Image-Classifier | 939d03f6a04d5983c409a707edbb1d773b146ca0 | [
"MIT"
] | null | null | null | utility.py | Cadyshack/AIPND-Project-2-Create-Your-Own-Image-Classifier | 939d03f6a04d5983c409a707edbb1d773b146ca0 | [
"MIT"
] | null | null | null | utility.py | Cadyshack/AIPND-Project-2-Create-Your-Own-Image-Classifier | 939d03f6a04d5983c409a707edbb1d773b146ca0 | [
"MIT"
] | null | null | null | import numpy as np
import torch
from torchvision import datasets, transforms
from PIL import Image
import json
def load_data(image_dir):
"""
Retrieve images from path given to image folder which will be used to train the model
images_dir:
relative path to the folder of images that are to be
... | 35.43662 | 95 | 0.575318 |
07201b67beeaf697ef36f79b77817d9b58e7ce68 | 1,022 | py | Python | data_processing/ddh5_Plotting/ddh5_freq_sweep_plotting.py | PITT-HATLAB/data_processing | ad49bb921e0fc90b90f0b696e2cbb662019f5f40 | [
"MIT"
] | null | null | null | data_processing/ddh5_Plotting/ddh5_freq_sweep_plotting.py | PITT-HATLAB/data_processing | ad49bb921e0fc90b90f0b696e2cbb662019f5f40 | [
"MIT"
] | null | null | null | data_processing/ddh5_Plotting/ddh5_freq_sweep_plotting.py | PITT-HATLAB/data_processing | ad49bb921e0fc90b90f0b696e2cbb662019f5f40 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 1 14:02:03 2021
@author: Hatlab_3
for getting many files out of a particular directory with Wolfie's directory structure'
"""
import easygui
import os
from plottr.apps.autoplot import autoplotDDH5, script, main
from plottr.data.datadict_storage import all_datadicts_fro... | 28.388889 | 87 | 0.588063 |
63507e6d9d794ca159e3efee3d2cf66f41c91ef9 | 8,398 | py | Python | khmer/__init__.py | Dmarch28/khmer | 86ce40a6619fc6f6e9c4ce18ce1e89de93ba2f83 | [
"CNRI-Python"
] | null | null | null | khmer/__init__.py | Dmarch28/khmer | 86ce40a6619fc6f6e9c4ce18ce1e89de93ba2f83 | [
"CNRI-Python"
] | 4 | 2021-03-19T08:45:22.000Z | 2022-02-18T21:25:42.000Z | khmer/__init__.py | Dmarch28/khmer | 86ce40a6619fc6f6e9c4ce18ce1e89de93ba2f83 | [
"CNRI-Python"
] | 1 | 2021-03-16T12:01:37.000Z | 2021-03-16T12:01:37.000Z | # This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) 2010-2015, Michigan State University.
# Copyright (C) 2015-2016, The Regents of the University of California.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... | 37.491071 | 89 | 0.671946 |
0a63ee815c81e780f3db874597b7906f63973fc0 | 1,558 | py | Python | py34env/Scripts/enhancer.py | EKiefer/edge-starter | cc1bbac3fb7191b16eeca03b2a596d232b4ece7f | [
"MIT"
] | null | null | null | py34env/Scripts/enhancer.py | EKiefer/edge-starter | cc1bbac3fb7191b16eeca03b2a596d232b4ece7f | [
"MIT"
] | null | null | null | py34env/Scripts/enhancer.py | EKiefer/edge-starter | cc1bbac3fb7191b16eeca03b2a596d232b4ece7f | [
"MIT"
] | null | null | null | #!c:\users\ekiefer\projects\django\my_edge\py34env\scripts\python.exe
#
# The Python Imaging Library
# $Id$
#
# this demo script creates four windows containing an image and a slider.
# drag the slider to modify the image.
#
try:
from tkinter import Tk, Toplevel, Frame, Label, Scale, HORIZONTAL
except ImportError:... | 25.966667 | 80 | 0.65276 |
be949f877b35b00d9729eb61c88a04277376e5a8 | 1,238 | py | Python | src/pykeen/triples/stats.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | 1 | 2021-03-24T13:25:54.000Z | 2021-03-24T13:25:54.000Z | src/pykeen/triples/stats.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | src/pykeen/triples/stats.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Compute statistics of a KG to be able to interpret the performance of KGE models."""
from collections import Counter
from typing import Mapping
import numpy as np
def compute_number_tails_per_head_relation_tuples(triples: np.ndarray) -> Mapping[str, int]:
"""Compute number of tails p... | 33.459459 | 99 | 0.703554 |
b354cc57d2c4afd6b0567f412e20ff314f7a9e97 | 2,790 | py | Python | dataset.py | mtyhon/ckconv | 056ec93c039e8bcda89f07ff9fdece3e7373b0bf | [
"MIT"
] | null | null | null | dataset.py | mtyhon/ckconv | 056ec93c039e8bcda89f07ff9fdece3e7373b0bf | [
"MIT"
] | null | null | null | dataset.py | mtyhon/ckconv | 056ec93c039e8bcda89f07ff9fdece3e7373b0bf | [
"MIT"
] | null | null | null | import torch
from datasets import (
AdditionProblem,
CopyMemory,
MNIST,
CIFAR10,
SpeechCommands,
CharTrajectories,
)
import ml_collections
from typing import Tuple
def dataset_constructor(
config: ml_collections.ConfigDict,
) -> Tuple[
torch.utils.data.Dataset, torch.utils.data.Datase... | 27.352941 | 80 | 0.642652 |
463fe211b7350c7393eadabce0e2526f5f128d67 | 5,999 | py | Python | resotocore/tests/core/worker_task_queue_test.py | MrMarvin/cloudkeeper | cdca21c1a3b945da6e53a5dbb37a437e1d46f557 | [
"Apache-2.0"
] | null | null | null | resotocore/tests/core/worker_task_queue_test.py | MrMarvin/cloudkeeper | cdca21c1a3b945da6e53a5dbb37a437e1d46f557 | [
"Apache-2.0"
] | null | null | null | resotocore/tests/core/worker_task_queue_test.py | MrMarvin/cloudkeeper | cdca21c1a3b945da6e53a5dbb37a437e1d46f557 | [
"Apache-2.0"
] | null | null | null | import asyncio
from collections import defaultdict
from datetime import timedelta
from typing import AsyncGenerator, Dict, List, Tuple
from pytest import fixture, mark
from core.model.graph_access import Section
from core.model.resolve_in_graph import GraphResolver, NodePath
from core.util import group_by, identity, ... | 37.26087 | 108 | 0.63844 |
cfaac7fef9ce6ea7d02b702423841383d42601d2 | 37,032 | py | Python | tools/testbed/client.py | ghsecuritylab/Alios_SDK | edd416e7d2961db42c2100ac2d6237ee527d1aee | [
"Apache-2.0"
] | 2 | 2021-05-28T08:25:33.000Z | 2021-11-17T02:58:50.000Z | tools/testbed/client.py | ghsecuritylab/Alios_SDK | edd416e7d2961db42c2100ac2d6237ee527d1aee | [
"Apache-2.0"
] | null | null | null | tools/testbed/client.py | ghsecuritylab/Alios_SDK | edd416e7d2961db42c2100ac2d6237ee527d1aee | [
"Apache-2.0"
] | 5 | 2018-05-23T02:56:10.000Z | 2021-01-02T16:44:09.000Z | import os, sys, time, platform, json, traceback, random, re, glob, uuid
import socket, ssl, thread, threading, subprocess, signal, Queue, importlib
from os import path
import TBframe as pkt
MAX_MSG_LENGTH = 65536
ENCRYPT = True
DEBUG = True
EN_STATUS_POLL = False
LOCALLOG = False
def signal_handler(sig, frame):
p... | 45.775031 | 127 | 0.462654 |
729ad04f737c9758e63b5526b47c897a79382c17 | 83,708 | py | Python | xonsh/tools.py | Flimm/xonsh | 14fe0355d0ce203ffb998562891fa250d49642ce | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xonsh/tools.py | Flimm/xonsh | 14fe0355d0ce203ffb998562891fa250d49642ce | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xonsh/tools.py | Flimm/xonsh | 14fe0355d0ce203ffb998562891fa250d49642ce | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | """Misc. xonsh tools.
The following implementations were forked from the IPython project:
* Copyright (c) 2008-2014, IPython Development Team
* Copyright (C) 2001-2007 Fernando Perez <fperez@colorado.edu>
* Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
* Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
... | 30.263196 | 146 | 0.610157 |
972b6c8633b40d3b477a744183d33098ef9a63a7 | 3,019 | py | Python | pnc_cli/swagger_client/models/build_configuration_audited_singleton.py | SakuragawaAsaba/pnc-cli | 0e0c5976766f6d2e32980c39ebc30950fc02960e | [
"Apache-2.0"
] | null | null | null | pnc_cli/swagger_client/models/build_configuration_audited_singleton.py | SakuragawaAsaba/pnc-cli | 0e0c5976766f6d2e32980c39ebc30950fc02960e | [
"Apache-2.0"
] | 3 | 2015-06-01T22:12:27.000Z | 2015-10-11T16:20:11.000Z | pnc_cli/swagger_client/models/build_configuration_audited_singleton.py | SakuragawaAsaba/pnc-cli | 0e0c5976766f6d2e32980c39ebc30950fc02960e | [
"Apache-2.0"
] | 5 | 2015-05-28T18:14:36.000Z | 2018-07-20T07:38:21.000Z | # coding: utf-8
"""
Copyright 2015 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... | 28.752381 | 79 | 0.607817 |
00208c34797df70aed355f10c955869d32c642ce | 2,790 | py | Python | eval.py | Moeinzjg/r-pgcn | a2065aa76cb936037f6e0ddf8ff244a6b38ede90 | [
"MIT"
] | null | null | null | eval.py | Moeinzjg/r-pgcn | a2065aa76cb936037f6e0ddf8ff244a6b38ede90 | [
"MIT"
] | null | null | null | eval.py | Moeinzjg/r-pgcn | a2065aa76cb936037f6e0ddf8ff244a6b38ede90 | [
"MIT"
] | null | null | null | import argparse
import os
import time
import re
import math
import torch
import pytorch_mask_rcnn as pmr
def main(args):
device = torch.device("cuda" if torch.cuda.is_available() and args.use_cuda else "cpu")
cuda = device.type == "cuda"
if cuda:
pmr.get_gpu_prop(show=True)
print("\ndevice: ... | 37.702703 | 126 | 0.662007 |
7fe042908547f7eec5ffe10b7408dd548e0a58d8 | 471 | py | Python | mahjong/hand_calculating/yaku_list/yakuman/sashikomi.py | wardenlym/mahjong | 475da6360e24e70e6e0d1deada573c842a71f261 | [
"MIT"
] | 254 | 2017-09-20T15:02:20.000Z | 2022-03-28T11:33:28.000Z | mahjong/hand_calculating/yaku_list/yakuman/sashikomi.py | wardenlym/mahjong | 475da6360e24e70e6e0d1deada573c842a71f261 | [
"MIT"
] | 39 | 2017-09-23T14:28:36.000Z | 2022-01-06T08:41:57.000Z | mahjong/hand_calculating/yaku_list/yakuman/sashikomi.py | wardenlym/mahjong | 475da6360e24e70e6e0d1deada573c842a71f261 | [
"MIT"
] | 38 | 2017-10-19T09:06:53.000Z | 2022-03-15T05:08:22.000Z | from mahjong.hand_calculating.yaku import Yaku
class Sashikomi(Yaku):
"""
Yaku situation
"""
def __init__(self, yaku_id):
super(Sashikomi, self).__init__(yaku_id)
def set_attributes(self):
self.name = "Sashikomi"
self.han_open = None
self.han_closed = 13
... | 20.478261 | 60 | 0.630573 |
7b68c4aa61df2402f79bc3f2b63f9523480accc4 | 248 | py | Python | bullet-gym-primitive/showKerasNAFMotionExample.py | benelot/bullet-gym | 863cbc25c74e3fcecdc84f68bde0cbba1a65f070 | [
"MIT"
] | 55 | 2017-04-12T19:12:57.000Z | 2021-04-17T12:54:50.000Z | bullet-gym-primitive/showKerasNAFMotionExample.py | shipjobs/bullet-gym | 1e064b135175546172acd1a5a996863469759b6d | [
"MIT"
] | 10 | 2017-03-25T20:55:30.000Z | 2017-07-14T08:27:42.000Z | bullet-gym-primitive/showKerasNAFMotionExample.py | shipjobs/bullet-gym | 1e064b135175546172acd1a5a996863469759b6d | [
"MIT"
] | 9 | 2017-11-04T15:33:40.000Z | 2021-08-29T19:36:31.000Z | #!/usr/bin/python
import os
os.system('python runTrainer.py --agent=KerasNAFAgent --env=Motionv0Env --train-for=0 --test-for=10000000 --random-initial-position --delay=0.005 --gui --show-test --load-file=checkpoints/KerasNAF-Motionv0-chkpt-1.h5')
| 62 | 218 | 0.75 |
ee6873ec38dd1f287d40fbd6ad5a400193e1d7b7 | 360 | py | Python | benchmark.py | Cryptum169/RadioTextProcessing_NLP | e55aba766bc86012c56b60350f6490b70c705491 | [
"MIT"
] | 1 | 2018-06-22T20:18:23.000Z | 2018-06-22T20:18:23.000Z | benchmark.py | Cryptum169/RadioTextProcessing_NLP | e55aba766bc86012c56b60350f6490b70c705491 | [
"MIT"
] | null | null | null | benchmark.py | Cryptum169/RadioTextProcessing_NLP | e55aba766bc86012c56b60350f6490b70c705491 | [
"MIT"
] | null | null | null | import gensim
model_sogou = gensim.models.Word2Vec.load('data/Model/gensimWord2Vec.bin')
model_audio = gensim.models.Word2Vec.load('data/Model/gensimWord2Vec_audio.bin')
print('Benchmark:')
print('搜狗\t转写')
print(model_sogou.most_similar('车辆'))
print(model_audio.most_similar('车辆'))
print(model_sogou.most_similar('事故')... | 30 | 80 | 0.788889 |
5af06f04aac5bca47a9cb2df51b2af68666ab47e | 678 | py | Python | lib/robot/version.py | nbbull/RIDE | e6496f0b1b6dc454b9479de48b6949bce29b53df | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-11-25T03:22:52.000Z | 2017-11-25T03:22:52.000Z | lib/robot/version.py | nbbull/RIDE | e6496f0b1b6dc454b9479de48b6949bce29b53df | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | lib/robot/version.py | nbbull/RIDE | e6496f0b1b6dc454b9479de48b6949bce29b53df | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Automatically generated by 'package.py' script.
import sys
VERSION = 'trunk'
RELEASE = '20120314'
TIMESTAMP = '20120314-230805'
def get_version(sep=' '):
if RELEASE == 'final':
return VERSION
return VERSION + sep + RELEASE
def get_full_version(who=''):
sys_version = sys.version.split()[0]
... | 24.214286 | 77 | 0.631268 |
2d4fb7957566b5b19de7e1380ec8ca8c8343b323 | 8,240 | py | Python | arcgis_proxy/tests/test_image_service.py | gfw-api/arcgis-proxy | 007e6d8d36327c8edb602fba47b654dc4baac2b0 | [
"MIT"
] | null | null | null | arcgis_proxy/tests/test_image_service.py | gfw-api/arcgis-proxy | 007e6d8d36327c8edb602fba47b654dc4baac2b0 | [
"MIT"
] | null | null | null | arcgis_proxy/tests/test_image_service.py | gfw-api/arcgis-proxy | 007e6d8d36327c8edb602fba47b654dc4baac2b0 | [
"MIT"
] | null | null | null | import unittest
import json
from arcgis_proxy import app
from arcgis_proxy.config.servers import servers
from unittest import mock
from arcgis_proxy.routes.api.v1.image_router import compute_histograms
import logging
histogram_route = '/api/v1/arcgis-proxy/ImageServer/computeHistograms'
geostore_id = '204c6ff1dae38a1... | 34.767932 | 117 | 0.654126 |
d1f3bd8e064730bd42359d9e577f4cbaeaa13498 | 6,530 | py | Python | owtf/settings.py | Udbhavbisarya23/owtf | 27623937677caf975569f8de8af7983ca57611bc | [
"BSD-3-Clause"
] | 1 | 2021-02-03T10:03:35.000Z | 2021-02-03T10:03:35.000Z | owtf/settings.py | justdvnsh/owtf | 3a543b4eb2a7ad67155eb96dd2d99efbc181498d | [
"BSD-3-Clause"
] | 3 | 2021-03-26T00:33:28.000Z | 2022-02-13T21:08:52.000Z | owtf/settings.py | justdvnsh/owtf | 3a543b4eb2a7ad67155eb96dd2d99efbc181498d | [
"BSD-3-Clause"
] | null | null | null | """
owtf.settings
~~~~~~~~~~~~~
It contains all the owtf global configs.
"""
import os
import re
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError
import yaml
HOME_DIR = os.path.expanduser("~")
OWTF_CONF = os.path.join(HOME_DIR, ".owtf")
ROOT_DIR = os.path.dirname(os.path.realpath(__file_... | 29.954128 | 128 | 0.724655 |
671680a579ba3d5ff80d85af1ebc22abc38c7838 | 5,764 | py | Python | bibchex/checks/authors.py | tinloaf/bibchex | 3775f00903db560f40e6f86a656761e55ec4f15b | [
"MIT"
] | 5 | 2020-06-07T21:57:43.000Z | 2020-11-18T10:11:13.000Z | bibchex/checks/authors.py | tinloaf/bibchex | 3775f00903db560f40e6f86a656761e55ec4f15b | [
"MIT"
] | null | null | null | bibchex/checks/authors.py | tinloaf/bibchex | 3775f00903db560f40e6f86a656761e55ec4f15b | [
"MIT"
] | 1 | 2020-06-07T15:21:27.000Z | 2020-06-07T15:21:27.000Z | from bibchex.config import Config
class InitialDottedChecker(object):
NAME = 'author_initial_dotted'
def __init__(self):
self._cfg = Config()
async def check(self, entry):
authors = await self.check_one("authors", "Author", entry)
editors = await self.check_one("editors", "Editor... | 35.361963 | 77 | 0.520645 |
cadae3a325bc54fb37f1dfe69cc838a1acfa8345 | 3,418 | py | Python | python/packet_feature.py | nyu-tandon-hsn-ai/tcp-trace-feature-selection | 90126ffd37d7a000ca5f9266c5d0dea225d757a0 | [
"Apache-2.0"
] | 1 | 2019-11-29T14:07:46.000Z | 2019-11-29T14:07:46.000Z | python/packet_feature.py | nyu-tandon-hsn-ai/trace-feature-selection | 90126ffd37d7a000ca5f9266c5d0dea225d757a0 | [
"Apache-2.0"
] | 19 | 2018-04-06T00:34:46.000Z | 2018-07-19T17:40:29.000Z | python/packet_feature.py | jimmyahacker/tcp-trace-feature-selection | 90126ffd37d7a000ca5f9266c5d0dea225d757a0 | [
"Apache-2.0"
] | 1 | 2018-07-08T20:21:05.000Z | 2018-07-08T20:21:05.000Z | import subprocess
import os
import sys
import pandas as pd
import argparse
def _tshark_extract(tshark_query_str, trace_file_name, trace_feature_file_name, print_err):
tshark_command = subprocess.Popen(\
tshark_query_str.\
format(input=trace_file_name, output=trace_feature_file_name),\
shell... | 59.964912 | 462 | 0.721475 |
742c795549cac68864d6d67a78be2c2b8f4c8b23 | 21,075 | py | Python | python3-virtualenv/lib/python3.6/site-packages/pip/_vendor/requests/adapters.py | 1tracy/3.3.1.1-flask-blog | 05ba85340cf90109038492b81c670cba8829a375 | [
"MIT"
] | null | null | null | python3-virtualenv/lib/python3.6/site-packages/pip/_vendor/requests/adapters.py | 1tracy/3.3.1.1-flask-blog | 05ba85340cf90109038492b81c670cba8829a375 | [
"MIT"
] | null | null | null | python3-virtualenv/lib/python3.6/site-packages/pip/_vendor/requests/adapters.py | 1tracy/3.3.1.1-flask-blog | 05ba85340cf90109038492b81c670cba8829a375 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import os.path
import socket
from pip._vendor.urllib3.poolmanager import PoolManager, proxy_from_url
from pip._vendor.urllib3.response import HTTPRes... | 37.234982 | 97 | 0.615516 |
a5a24185f666762f0543ab75c30eab834a898abe | 5,957 | py | Python | pyshop/views/package.py | XeL64/pyshop | fcd94e88c6728d6430383c8d6b3e66f447035bbc | [
"BSD-3-Clause"
] | 94 | 2015-01-02T21:23:27.000Z | 2022-01-08T08:19:33.000Z | pyshop/views/package.py | XeL64/pyshop | fcd94e88c6728d6430383c8d6b3e66f447035bbc | [
"BSD-3-Clause"
] | 45 | 2015-01-14T22:23:43.000Z | 2019-04-15T23:23:08.000Z | pyshop/views/package.py | XeL64/pyshop | fcd94e88c6728d6430383c8d6b3e66f447035bbc | [
"BSD-3-Clause"
] | 38 | 2015-01-19T11:39:04.000Z | 2020-12-17T20:35:58.000Z | # -*- coding: utf-8 -*-
"""
PyShop Package Management Views.
"""
import math
import logging
import os
from sqlalchemy.sql.expression import func
from pyramid.httpexceptions import HTTPNotFound, HTTPForbidden
from pyshop.models import Package, Release, Classifier, User
from .base import View, RedirectView
log = log... | 33.466292 | 79 | 0.539701 |
b314ae12bc5b7aba6ec08c2949d6e7a2668baaba | 34,328 | py | Python | wingspipe/cull_photometry.py | benw1/WINGS | 32d4bfd073da0b86d2340cde25a5601d0a1ec95e | [
"RSA-MD"
] | 4 | 2022-01-04T18:24:56.000Z | 2022-01-27T08:23:37.000Z | wingspipe/cull_photometry.py | benw1/WINGS | 32d4bfd073da0b86d2340cde25a5601d0a1ec95e | [
"RSA-MD"
] | null | null | null | wingspipe/cull_photometry.py | benw1/WINGS | 32d4bfd073da0b86d2340cde25a5601d0a1ec95e | [
"RSA-MD"
] | null | null | null | #! /usr/bin/env python
import os
import graphviz
import pickle
import warnings
import numpy as np
import pandas as pd
import wpipe as wp
from astropy import units as u
from astropy import wcs
from astropy.coordinates import SkyCoord, match_coordinates_sky
from astropy.io import ascii, fits
from astropy.table import Ta... | 40.915375 | 119 | 0.57105 |
aca50f4c3b1c2c48b00af8c92a244a1c7001bee6 | 3,400 | py | Python | run_model.py | JustinLokHinWu/ACTGAN | d9e22f8fd499baaf5e647046eb3a214a57b5c201 | [
"MIT"
] | 1 | 2021-08-22T08:44:11.000Z | 2021-08-22T08:44:11.000Z | run_model.py | JustinLokHinWu/ACTGAN | d9e22f8fd499baaf5e647046eb3a214a57b5c201 | [
"MIT"
] | null | null | null | run_model.py | JustinLokHinWu/ACTGAN | d9e22f8fd499baaf5e647046eb3a214a57b5c201 | [
"MIT"
] | 1 | 2022-01-10T01:00:13.000Z | 2022-01-10T01:00:13.000Z | import argparse
from torchvision import transforms
from attrdict import AttrDict
import json
import torch
import glob
from models.generator import ACGAN_Generator
from utils.helpers import noise, label_to_onehot
class GeneratorRunner:
'''
cfg: AttrDict containing model parameters
'''
def __init__(self... | 27.642276 | 78 | 0.595882 |
b6974d68e940e918808c7be7a1ee49d0196aca0e | 1,713 | py | Python | CondTools/Ecal/python/EcalTPGPedfromFile_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CondTools/Ecal/python/EcalTPGPedfromFile_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CondTools/Ecal/python/EcalTPGPedfromFile_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("ProcessOne")
process.load("CondCore.DBCommon.CondDBCommon_cfi")
process.CondDBCommon.DBParameters.authenticationPath = '/afs/cern.ch/cms/DB/conddb/'
#
# Choose the output database
#
#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_311X_EC... | 28.081967 | 84 | 0.716871 |
0c4621c54f08a6050564a7e549c71cc2277bc7d2 | 8,891 | py | Python | test/test.py | ahupp/python-magic | 7f7542fcbc192fef6e4939f4eb748e941a720b2c | [
"MIT"
] | 1,803 | 2015-01-08T09:18:56.000Z | 2022-03-31T06:26:22.000Z | test/test.py | ahupp/python-magic | 7f7542fcbc192fef6e4939f4eb748e941a720b2c | [
"MIT"
] | 209 | 2015-01-06T18:15:35.000Z | 2022-03-23T20:41:50.000Z | test/test.py | ahupp/python-magic | 7f7542fcbc192fef6e4939f4eb748e941a720b2c | [
"MIT"
] | 232 | 2015-01-11T05:31:19.000Z | 2022-03-17T09:29:32.000Z | import os
# for output which reports a local time
os.environ['TZ'] = 'GMT'
if os.environ.get('LC_ALL', '') != 'en_US.UTF-8':
# this ensure we're in a utf-8 default filesystem encoding which is
# necessary for some tests
raise Exception("must run `export LC_ALL=en_US.UTF-8` before running test suite")
imp... | 38.158798 | 108 | 0.571589 |
2d3058a4aa532993bfcd7f92d15396b145222b8b | 4,020 | py | Python | gps_navigation/gps_nav.py | KingKorb/RobotNinjas | 5737483056198b80d324836319a841146333e0dd | [
"MIT"
] | null | null | null | gps_navigation/gps_nav.py | KingKorb/RobotNinjas | 5737483056198b80d324836319a841146333e0dd | [
"MIT"
] | 1 | 2022-02-11T04:22:57.000Z | 2022-02-21T23:40:59.000Z | gps_navigation/gps_nav.py | KingKorb/RobotNinjas | 5737483056198b80d324836319a841146333e0dd | [
"MIT"
] | 1 | 2022-03-17T22:00:18.000Z | 2022-03-17T22:00:18.000Z | import RPi.GPIO as GPIO
import pymap3d as pm
import numpy as np
import serial
import time
# setup PWM pins
Motor1PWM = 12
Motor1D = 24
Motor1E= 22
Motor2PWM = 13
Motor2D = 25
Motor2E= 23
GPIO.setmode(GPIO.BCM)
GPIO.setup(Motor1PWM, GPIO.OUT)
GPIO.setup(Motor1D, GPIO.OUT)
GPIO.setup(Motor1E, GPIO.OUT)
GPIO.setup(Motor... | 31.40625 | 107 | 0.625124 |
2cad29bb85d1265c0388bb5a258279e5a438b87b | 7,645 | py | Python | dap/tests/test_tf_utils.py | isabella232/differentiable-atomistic-potentials | f08c6e93aaf2706c0c5ac9b59eebd132d3e443fb | [
"Apache-2.0"
] | 53 | 2018-01-24T03:05:59.000Z | 2021-10-13T23:10:28.000Z | dap/tests/test_tf_utils.py | Senhongl/differentiable-atomistic-potentials | f08c6e93aaf2706c0c5ac9b59eebd132d3e443fb | [
"Apache-2.0"
] | 1 | 2021-09-05T21:00:00.000Z | 2021-09-05T21:00:00.000Z | dap/tests/test_tf_utils.py | Senhongl/differentiable-atomistic-potentials | f08c6e93aaf2706c0c5ac9b59eebd132d3e443fb | [
"Apache-2.0"
] | 15 | 2018-01-24T03:20:58.000Z | 2021-09-05T10:09:17.000Z | # Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 30.217391 | 77 | 0.632832 |
1665a34a2c00683166f525fe392ddae3019c8e44 | 2,739 | py | Python | test/acceptance/collision_test.py | seomoz/bloomfilter-py | 88b7f752c15a029c4bb86322496a74a6316e953a | [
"MIT"
] | 2 | 2017-03-06T08:28:49.000Z | 2017-08-07T18:22:09.000Z | test/acceptance/collision_test.py | seomoz/bloomfilter-py | 88b7f752c15a029c4bb86322496a74a6316e953a | [
"MIT"
] | 6 | 2016-12-16T20:38:07.000Z | 2019-11-14T22:37:50.000Z | test/acceptance/collision_test.py | seomoz/bloomfilter-py | 88b7f752c15a029c4bb86322496a74a6316e953a | [
"MIT"
] | 8 | 2016-12-16T19:18:37.000Z | 2020-06-15T18:41:35.000Z | #! /usr/bin/env python
"""Bloom filter collision tests"""
# pylint: disable=invalid-name
import os
import unittest
from bloomfilter import BloomFilter
class TestCollisions(unittest.TestCase):
"""Set of tests to ensure desirable collision rate"""
def test_non_randoms_at_all(self):
"""Ensure that sma... | 34.2375 | 71 | 0.60387 |
d7957020b1e61e25f3cc663f64817ba88884f448 | 1,496 | py | Python | maximum_depth_of_binary_tree.py | KevinLuo41/LeetCodeInPython | 051e1aab9bab17b0d63b4ca73473a7a00899a16a | [
"Apache-2.0"
] | 19 | 2015-01-19T19:36:09.000Z | 2020-03-18T03:10:12.000Z | maximum_depth_of_binary_tree.py | CodingVault/LeetCodeInPython | 051e1aab9bab17b0d63b4ca73473a7a00899a16a | [
"Apache-2.0"
] | null | null | null | maximum_depth_of_binary_tree.py | CodingVault/LeetCodeInPython | 051e1aab9bab17b0d63b4ca73473a7a00899a16a | [
"Apache-2.0"
] | 12 | 2015-04-25T14:20:38.000Z | 2020-09-27T04:59:59.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
maximum_depth_of_binary_tree.py
Created by Shengwei on 2014-07-15.
"""
# https://oj.leetcode.com/problems/maximum-depth-of-binary-tree/
# tags: easy, tree, dfs, bfs, level-order
"""
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes alon... | 23.746032 | 114 | 0.555481 |
1b1fac4e898868876a8ead4fe9ae813d7c4479af | 8,346 | py | Python | astropy/visualization/wcsaxes/tests/test_misc.py | jairideout/astropy | 2534a2dd747da3d50644812ce4faab6d909e7f36 | [
"BSD-3-Clause"
] | null | null | null | astropy/visualization/wcsaxes/tests/test_misc.py | jairideout/astropy | 2534a2dd747da3d50644812ce4faab6d909e7f36 | [
"BSD-3-Clause"
] | 1 | 2018-11-14T14:18:55.000Z | 2020-01-21T10:36:05.000Z | astropy/visualization/wcsaxes/tests/test_misc.py | jairideout/astropy | 2534a2dd747da3d50644812ce4faab6d909e7f36 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import warnings
import pytest
import numpy as np
import matplotlib.pyplot as plt
from .... import units as u
from ....wcs import WCS
from ....io import fits
from ....coordinates import SkyCoord
from ....tests.helper import catch_warnings
from ... | 29.701068 | 77 | 0.624251 |
cc6e34eb07b7196d10b4cbf77fe2c4b19f85e6e3 | 191 | py | Python | turtle/tkHex.py | shilpasayura/python | 8f3b2432f972c9aeb4b04e2141ea4abf2437762c | [
"MIT"
] | 1 | 2021-10-07T15:15:01.000Z | 2021-10-07T15:15:01.000Z | turtle/tkHex.py | shilpasayura/python | 8f3b2432f972c9aeb4b04e2141ea4abf2437762c | [
"MIT"
] | null | null | null | turtle/tkHex.py | shilpasayura/python | 8f3b2432f972c9aeb4b04e2141ea4abf2437762c | [
"MIT"
] | null | null | null | import tkinter as tk
import turtle
root = tk.Tk()
turtle.color("red")
turtle.shape("turtle")
for i in range(7):
turtle.forward(100) #pixels
turtle.left(60)
root.mainloop()
| 11.235294 | 31 | 0.659686 |
f418e26c552657a3eca3e2fee4daaf82f74a83ef | 8,145 | py | Python | cogs/botinfo.py | Code-Cecilia/botman-rewrite | 9d8baeebf267c62df975d2f209e85589b81934af | [
"MIT"
] | 2 | 2022-02-21T14:10:15.000Z | 2022-02-21T14:10:50.000Z | cogs/botinfo.py | Code-Cecilia/botman-rewrite | 9d8baeebf267c62df975d2f209e85589b81934af | [
"MIT"
] | null | null | null | cogs/botinfo.py | Code-Cecilia/botman-rewrite | 9d8baeebf267c62df975d2f209e85589b81934af | [
"MIT"
] | null | null | null | import os
import platform
import random
import subprocess
import time
import discord
import psutil
from discord.ext import commands
from assets import random_assets, time_assets
from assets.discord_funcs import get_color, get_avatar_url
from assets.file_handling import count_lines
class BotInfo(commands.Cog, descri... | 53.235294 | 120 | 0.621363 |
ab1a9cc300965dbf061346c7d20d6fec1d17b229 | 2,818 | py | Python | mars/learn/contrib/joblib/backend.py | HarshCasper/mars | 4c12c968414d666c7a10f497bc22de90376b1932 | [
"Apache-2.0"
] | 2 | 2019-03-29T04:11:10.000Z | 2020-07-08T10:19:54.000Z | mars/learn/contrib/joblib/backend.py | HarshCasper/mars | 4c12c968414d666c7a10f497bc22de90376b1932 | [
"Apache-2.0"
] | null | null | null | mars/learn/contrib/joblib/backend.py | HarshCasper/mars | 4c12c968414d666c7a10f497bc22de90376b1932 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 33.951807 | 82 | 0.681334 |
c63a0cc2ba4313e5ab5926fc894ede7b0d4f89f8 | 70 | py | Python | parking-lot/app.py | akshilv/parking-lot | d720fab769ae700f157bae979b94e6b906147ab8 | [
"Apache-2.0"
] | null | null | null | parking-lot/app.py | akshilv/parking-lot | d720fab769ae700f157bae979b94e6b906147ab8 | [
"Apache-2.0"
] | null | null | null | parking-lot/app.py | akshilv/parking-lot | d720fab769ae700f157bae979b94e6b906147ab8 | [
"Apache-2.0"
] | null | null | null | from parkinglot import ParkingLot
if __name__ == "__main__":
pass | 17.5 | 33 | 0.742857 |
84afab2f163d6f2d83a9d7686cf213e1c2dac5c2 | 114,271 | py | Python | kmip/tests/unit/core/objects/test_objects.py | openstack/deb-python-kmip | f86134878b5f558b39f51e67a6e6ba5a0b03e222 | [
"Apache-2.0"
] | 12 | 2016-09-14T21:59:10.000Z | 2020-03-11T07:37:25.000Z | kmip/tests/unit/core/objects/test_objects.py | openstack/deb-python-kmip | f86134878b5f558b39f51e67a6e6ba5a0b03e222 | [
"Apache-2.0"
] | null | null | null | kmip/tests/unit/core/objects/test_objects.py | openstack/deb-python-kmip | f86134878b5f558b39f51e67a6e6ba5a0b03e222 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | 37.125081 | 79 | 0.631324 |
86fa39539e36c12bdb6c7a3c09b5262d417e2db0 | 22,560 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_inbound_nat_rules_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_inbound_nat_rules_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_inbound_nat_rules_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"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 ... | 50.469799 | 232 | 0.669991 |
93ea3c74d639120f6b41d780a2a4ee76a64e0cf5 | 25,909 | py | Python | gn/gn_to_cmake.py | vaxpl/skia | 3a3d4573640a04fd2102be9565dac8c213545ef2 | [
"BSD-3-Clause"
] | null | null | null | gn/gn_to_cmake.py | vaxpl/skia | 3a3d4573640a04fd2102be9565dac8c213545ef2 | [
"BSD-3-Clause"
] | null | null | null | gn/gn_to_cmake.py | vaxpl/skia | 3a3d4573640a04fd2102be9565dac8c213545ef2 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Usage: gn_to_cmake.py <json_file_name>
gn gen out/config --ide=json --json-ide-script=../../gn/gn_to_cmake.py
or
gn gen out/config --ide=json
python gn/gn... | 35.154681 | 93 | 0.692964 |
c2d84cde413dd36bbec255f0d1646c38fa14e338 | 16,053 | py | Python | strategy/scripts/expired_task.py | uptopia/timda_dual_arm | 4f4a0135a4c2aa5f7f8ab7644d548a61baf3337e | [
"MIT"
] | 1 | 2022-03-09T10:53:15.000Z | 2022-03-09T10:53:15.000Z | strategy/scripts/expired_task.py | uptopia/timda_dual_arm | 4f4a0135a4c2aa5f7f8ab7644d548a61baf3337e | [
"MIT"
] | 2 | 2021-06-23T17:06:41.000Z | 2021-06-30T09:44:41.000Z | strategy/scripts/expired_task.py | uptopia/timda_dual_arm | 4f4a0135a4c2aa5f7f8ab7644d548a61baf3337e | [
"MIT"
] | 9 | 2021-02-01T08:20:53.000Z | 2021-09-17T05:52:35.000Z | #!/usr/bin/env python
from enum import IntEnum
# from Queue import Queue
import rospy
#import queue
import Queue as queue
import copy
import numpy as np
from std_msgs.msg import Bool, Int32
from arm_control import DualArmTask
from arm_control import ArmTask, SuctionTask, Command, Status
from get_image_info import Get... | 41.373711 | 130 | 0.465645 |
4bd866629b3ec61586fe9568d9c3ea4fddc73602 | 2,925 | py | Python | aliyun-python-sdk-r-kvstore/aliyunsdkr_kvstore/request/v20150101/TagResourcesRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-r-kvstore/aliyunsdkr_kvstore/request/v20150101/TagResourcesRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2020-05-31T14:51:47.000Z | 2020-05-31T14:51:47.000Z | aliyun-python-sdk-r-kvstore/aliyunsdkr_kvstore/request/v20150101/TagResourcesRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.5625 | 89 | 0.74906 |
776c51df0abcc3d12c1440cc4be31da316261516 | 1,937 | py | Python | journey11/src/lib/state.py | parrisma/AI-intuition | 3b081696b1d226815e029cbb536fac5e4d3de9a7 | [
"MIT"
] | null | null | null | journey11/src/lib/state.py | parrisma/AI-intuition | 3b081696b1d226815e029cbb536fac5e4d3de9a7 | [
"MIT"
] | 4 | 2020-04-26T18:18:22.000Z | 2020-05-16T14:47:32.000Z | journey11/src/lib/state.py | parrisma/AI-intuition | 3b081696b1d226815e029cbb536fac5e4d3de9a7 | [
"MIT"
] | null | null | null | import logging
from typing import List
from enum import EnumMeta, Enum, unique
class DefaultStateEnumMeta(EnumMeta):
default = object()
def __call__(cls, value=default, *args, **kwargs):
if value is DefaultStateEnumMeta.default:
return next(iter(cls))
return super().__call__(value... | 23.337349 | 55 | 0.494063 |
214c1e7773dcecd405c305ef1bf4bbdeec0bd01a | 726 | py | Python | ParaViewCore/ServerManager/Default/Testing/Python/GhostCellsInMergeBlocks.py | brown-ccv/paraview-scalable | 64b221a540737d2ac94a120039bd8d1e661bdc8f | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2019-09-27T08:04:34.000Z | 2019-10-16T22:30:54.000Z | ParaViewCore/ServerManager/Default/Testing/Python/GhostCellsInMergeBlocks.py | sakjain92/paraview | f3af0cd9f6750e24ad038eac573b870c88d6b7dd | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | ParaViewCore/ServerManager/Default/Testing/Python/GhostCellsInMergeBlocks.py | sakjain92/paraview | f3af0cd9f6750e24ad038eac573b870c88d6b7dd | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | from paraview.simple import *
from paraview import smtesting
import sys
import os
import os.path
smtesting.ProcessCommandLineArguments()
xmf_file = os.path.join(smtesting.DataDir, "poisson_3dall_2.xmf")
XDMFReader(FileNames=xmf_file)
MergeBlocks()
Show()
view = Render()
view.CameraViewUp = [0.40869219753099151, 0.7... | 27.923077 | 87 | 0.800275 |
2f0aca9e72e088b9155fb29157e67993611eb359 | 131 | py | Python | django_private_chat/apps.py | MattBrown88/django-private-chat | 4e7d71c82ecbc5b206f684353be9269d48a2b947 | [
"ISC"
] | 1 | 2019-04-07T23:14:21.000Z | 2019-04-07T23:14:21.000Z | django_private_chat/apps.py | MattBrown88/django-private-chat | 4e7d71c82ecbc5b206f684353be9269d48a2b947 | [
"ISC"
] | 4 | 2020-06-05T21:50:11.000Z | 2021-06-10T21:43:28.000Z | django_private_chat/apps.py | MattBrown88/django-private-chat | 4e7d71c82ecbc5b206f684353be9269d48a2b947 | [
"ISC"
] | null | null | null | # -*- coding: utf-8
from django.apps import AppConfig
class DjangoPrivateChatConfig(AppConfig):
name = 'django_private_chat'
| 18.714286 | 41 | 0.755725 |
a3b6d9a956d2679e81fce09c200ed5977a028282 | 3,672 | py | Python | homeassistant/components/zwave/util.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 4 | 2019-07-03T22:36:57.000Z | 2019-08-10T15:33:25.000Z | homeassistant/components/zwave/util.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 7 | 2019-08-23T05:26:02.000Z | 2022-03-11T23:57:18.000Z | homeassistant/components/zwave/util.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | null | null | null | """Zwave util methods."""
import asyncio
import logging
import homeassistant.util.dt as dt_util
from . import const
_LOGGER = logging.getLogger(__name__)
def check_node_schema(node, schema):
"""Check if node matches the passed node schema."""
if (const.DISC_NODE_ID in schema and
node.node_id no... | 38.652632 | 79 | 0.651688 |
36f6067a48d943ab8e97b75fe65a13a5e2245c79 | 7,862 | py | Python | 2016/arkansas_pp/ar_locality.py | democracyworks/hand-collection-to-vip | 0b6e90f6055c1325930b53905bba2d1bfc111457 | [
"BSD-3-Clause"
] | null | null | null | 2016/arkansas_pp/ar_locality.py | democracyworks/hand-collection-to-vip | 0b6e90f6055c1325930b53905bba2d1bfc111457 | [
"BSD-3-Clause"
] | 2 | 2016-08-12T20:52:24.000Z | 2021-02-08T20:24:27.000Z | 2016/arkansas_pp/ar_locality.py | democracyworks/hand-collection-to-vip | 0b6e90f6055c1325930b53905bba2d1bfc111457 | [
"BSD-3-Clause"
] | 1 | 2018-08-17T21:16:30.000Z | 2018-08-17T21:16:30.000Z | """
Contains class that generates the 'locality.txt' file for any state.
locality.txt contains the following columns:
election_administration_id,
external_identifier_type,
external_identifier_othertype,
external_identifier_value,
name,
polling_location_ids,
state_id,
type,
other_type,
id
"""
impor... | 36.230415 | 127 | 0.626685 |
d31842f7e9615b8585c6355979c567c341aa2daa | 181 | py | Python | test_output/nested_if.py | roshangol/executed-path-visualize | 1759c12b0048fe117205990b151d2f5f57ad9616 | [
"MIT"
] | null | null | null | test_output/nested_if.py | roshangol/executed-path-visualize | 1759c12b0048fe117205990b151d2f5f57ad9616 | [
"MIT"
] | null | null | null | test_output/nested_if.py | roshangol/executed-path-visualize | 1759c12b0048fe117205990b151d2f5f57ad9616 | [
"MIT"
] | null | null | null | a = 5
b = 10
c = 15
if a > b:
if a > c:
print("a value is big")
else:
print("c value is big")
elif b > c:
print("b value is big")
else:
print("c is big") | 15.083333 | 30 | 0.491713 |
f1066ce327bf680448ccfdeb7a6d5768a9f43e55 | 1,635 | py | Python | filter.py | hulto/hackpack | 39fb5b031ae9b0bce8a8fd5fdbdf1e7724e5f99b | [
"MIT"
] | 15 | 2017-03-14T23:12:57.000Z | 2022-03-15T16:05:49.000Z | filter.py | hulto/hackpack | 39fb5b031ae9b0bce8a8fd5fdbdf1e7724e5f99b | [
"MIT"
] | 51 | 2015-08-28T00:36:56.000Z | 2016-02-12T21:54:19.000Z | filter.py | hulto/hackpack | 39fb5b031ae9b0bce8a8fd5fdbdf1e7724e5f99b | [
"MIT"
] | 10 | 2017-02-15T02:21:49.000Z | 2022-03-09T16:34:14.000Z | #!/usr/bin/env python3
import io
import json
import sys
from pandocfilters import walk, Header, Link, Para, Str
# record how many headers deep we are
depth = 0
# create node that is a block paragraph with a link that says 'Jump to Top' and hrefs '#top'
jump = Para([Link(['', [], []], [Str('Jump to Top')], ('#top', '... | 29.727273 | 188 | 0.6263 |
1b0f1d9f6dacd9f5fdbb9131abee3545bb49b04c | 6,139 | py | Python | tests/test_converters.py | conglei/graphene-pydantic | d4df6af2313dc7451b1d2bb159dada4a7a94c44d | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/test_converters.py | conglei/graphene-pydantic | d4df6af2313dc7451b1d2bb159dada4a7a94c44d | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/test_converters.py | conglei/graphene-pydantic | d4df6af2313dc7451b1d2bb159dada4a7a94c44d | [
"Apache-2.0",
"MIT"
] | null | null | null | import sys
import datetime
import decimal
import enum
import typing as T
import uuid
import graphene
import graphene.types
import pydantic
import pytest
from pydantic import BaseModel, create_model
import graphene_pydantic.converters as converters
from graphene_pydantic.converters import ConversionError, convert_pyda... | 31.973958 | 87 | 0.690829 |
54e4ce0f8310b8f17023817582141fcc8b7f1247 | 1,204 | py | Python | jj/matchers/logical_matchers/_all_matcher.py | TeoDV/jj | a58d91ad7b37ba3115daea4890190abede8f3353 | [
"Apache-2.0"
] | 4 | 2020-09-08T08:14:21.000Z | 2022-01-27T19:22:53.000Z | jj/matchers/logical_matchers/_all_matcher.py | TeoDV/jj | a58d91ad7b37ba3115daea4890190abede8f3353 | [
"Apache-2.0"
] | 19 | 2018-02-13T05:51:25.000Z | 2022-03-27T22:48:11.000Z | jj/matchers/logical_matchers/_all_matcher.py | TeoDV/jj | a58d91ad7b37ba3115daea4890190abede8f3353 | [
"Apache-2.0"
] | 3 | 2017-11-17T13:25:23.000Z | 2022-02-03T12:57:00.000Z | from typing import Any, Dict, List
from packed import packable
from ...requests import Request
from ...resolvers import Resolver
from .._resolvable_matcher import ResolvableMatcher
from ._logical_matcher import LogicalMatcher
__all__ = ("AllMatcher",)
@packable("jj.matchers.AllMatcher")
class AllMatcher(LogicalMat... | 30.871795 | 89 | 0.641196 |
b0792051a73fcc80fbaf3b17428d83cf81096960 | 19,977 | py | Python | Cartwheel/lib/Python26/Lib/site-packages/wx-2.8-msw-unicode/wx/lib/agw/pyprogress.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/wx-2.8-msw-unicode/wx/lib/agw/pyprogress.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/wx-2.8-msw-unicode/wx/lib/agw/pyprogress.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------- #
# PYPROGRESS wxPython IMPLEMENTATION
#
# Andrea Gavana, @ 03 Nov 2006
# Latest Revision: 12 May 2009, 15.00 GMT
#
#
# TODO List
#
# 1. Do we support all the styles of wx.ProgressDialog in indeterminated mode?
#
# 2. Other ideas?
#
#
#... | 30.22239 | 93 | 0.575061 |
6d00da56a6429fea45f0ae77ce119f88815e576b | 1,561 | py | Python | saveAmebloContents/main.py | sassy/saveAmebloContents | 94a8b85144441dda40e18d63ea5a64df4548f46d | [
"MIT"
] | 1 | 2020-07-06T17:58:22.000Z | 2020-07-06T17:58:22.000Z | saveAmebloContents/main.py | sassy/saveAmebloContents | 94a8b85144441dda40e18d63ea5a64df4548f46d | [
"MIT"
] | 1 | 2021-10-18T20:49:19.000Z | 2021-10-18T20:49:19.000Z | saveAmebloContents/main.py | sassy/saveAmebloContents | 94a8b85144441dda40e18d63ea5a64df4548f46d | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from urllib.request import urlopen
from bs4 import BeautifulSoup
from voluptuous import Schema, Url
import os
import time
import sys
links = []
def createIndexPage():
f = open("contents/index.html", 'w')
for link in links:
f.write('<a href="' + link + '">' + ... | 25.590164 | 76 | 0.593209 |
16a97eea5a8af7abf496073f7387485a5a3c7905 | 328 | py | Python | foilaundering/apps/foi_requests/views.py | foilaundering/foi_laundering | 786b986d0ca55ba13a17a2a943412615fa780682 | [
"CC0-1.0"
] | null | null | null | foilaundering/apps/foi_requests/views.py | foilaundering/foi_laundering | 786b986d0ca55ba13a17a2a943412615fa780682 | [
"CC0-1.0"
] | null | null | null | foilaundering/apps/foi_requests/views.py | foilaundering/foi_laundering | 786b986d0ca55ba13a17a2a943412615fa780682 | [
"CC0-1.0"
] | null | null | null | from django.views.generic import CreateView, ListView
from .forms import ArticleForm
from .models import FOIRequest
class SubmitView(CreateView):
form_class = ArticleForm
template_name = "submit_form.html"
success_url = "/request/thanks/"
class RequestsListView(ListView):
queryset = FOIRequest.object... | 25.230769 | 53 | 0.771341 |
55c0195c8eccd2ae4c238f0f1c0d54e2067e91c2 | 456 | py | Python | test/json_rpc_client.py | Vadman97/HawkProxy | ed2e2a59dd6f369756cfc459f2a5ec466615593e | [
"MIT"
] | null | null | null | test/json_rpc_client.py | Vadman97/HawkProxy | ed2e2a59dd6f369756cfc459f2a5ec466615593e | [
"MIT"
] | null | null | null | test/json_rpc_client.py | Vadman97/HawkProxy | ed2e2a59dd6f369756cfc459f2a5ec466615593e | [
"MIT"
] | 1 | 2020-07-24T00:31:05.000Z | 2020-07-24T00:31:05.000Z | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
import xmlrpclib
import json
import sys
import time
import datetime
import jsonrpclib
server = jsonrpclib.Server('http://localhost:8080')
retry = 1000
t1 = datetime.datetime.now()
for i in xrange(retry):
server.echo_rpc()
t2 = datetime.datetime.no... | 21.714286 | 68 | 0.690789 |
d2bc5e0979446bd716d2eabc3339e9089e72b76d | 1,990 | py | Python | examples/05-mag/plot_analytic.py | kimjaed/simpeg | b8d716f86a4ea07ba3085fabb24c2bc974788040 | [
"MIT"
] | 3 | 2020-11-27T03:18:28.000Z | 2022-03-18T01:29:58.000Z | examples/05-mag/plot_analytic.py | kimjaed/simpeg | b8d716f86a4ea07ba3085fabb24c2bc974788040 | [
"MIT"
] | null | null | null | examples/05-mag/plot_analytic.py | kimjaed/simpeg | b8d716f86a4ea07ba3085fabb24c2bc974788040 | [
"MIT"
] | 1 | 2020-05-26T17:00:53.000Z | 2020-05-26T17:00:53.000Z | """
PF: Magnetics: Analytics
========================
Comparing the magnetics field in Vancouver to Seoul
"""
import numpy as np
from SimPEG import PF
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
def run(plotIt=True):
xr = np.linspace(-300, 300, 41)
yr = np.linspa... | 29.701493 | 76 | 0.588945 |
d4a39acd0940fb6ef4a74f5142350177d973933d | 5,644 | py | Python | core/dbt/task/list.py | vogt4nick/dbt | 1bd82d4914fd80fcc6fe17140e46554ad677eab0 | [
"Apache-2.0"
] | null | null | null | core/dbt/task/list.py | vogt4nick/dbt | 1bd82d4914fd80fcc6fe17140e46554ad677eab0 | [
"Apache-2.0"
] | null | null | null | core/dbt/task/list.py | vogt4nick/dbt | 1bd82d4914fd80fcc6fe17140e46554ad677eab0 | [
"Apache-2.0"
] | null | null | null | import json
from typing import Type
from dbt.graph import (
parse_difference,
ResourceTypeSelector,
SelectionSpec,
)
from dbt.task.runnable import GraphRunnableTask, ManifestTask
from dbt.task.test import TestSelector
from dbt.node_types import NodeType
from dbt.exceptions import RuntimeException, Internal... | 31.707865 | 78 | 0.579554 |
b57584bc33e9e73e75014bb226846741e5060b28 | 285 | py | Python | adler/siteconfig/admin.py | Yura-D/adler-congress | bbdedb7dbada4f6246f2a880204e7dd4bb8c8466 | [
"MIT"
] | null | null | null | adler/siteconfig/admin.py | Yura-D/adler-congress | bbdedb7dbada4f6246f2a880204e7dd4bb8c8466 | [
"MIT"
] | 10 | 2020-03-01T23:00:54.000Z | 2022-03-12T00:17:11.000Z | adler/siteconfig/admin.py | Yura-D/adler-congress | bbdedb7dbada4f6246f2a880204e7dd4bb8c8466 | [
"MIT"
] | null | null | null | # from solo.admin import SingletonModelAdmin
from django.contrib import admin
from .models import SiteSettings
admin.site.register(SiteSettings)
# class SiteSettingAdmin(SingletonModelAdmin):
# fields = [
# 'ticket_counter_name',
# 'ticket_counter_date',
# ]
| 23.75 | 46 | 0.726316 |
f59845b2096663a9e7e291bcd03f475dda6b8d35 | 485 | py | Python | openpyxl/styles/tests/conftest.py | dangqhuy/openpyxl | 42e929b69b0938b081a62fed529ce470054249fb | [
"MIT"
] | 12 | 2019-08-07T16:48:21.000Z | 2021-12-13T02:47:22.000Z | openpyxl/styles/tests/conftest.py | dangqhuy/openpyxl | 42e929b69b0938b081a62fed529ce470054249fb | [
"MIT"
] | 19 | 2019-12-29T05:07:36.000Z | 2021-04-22T18:09:49.000Z | openpyxl/styles/tests/conftest.py | dangqhuy/openpyxl | 42e929b69b0938b081a62fed529ce470054249fb | [
"MIT"
] | 1 | 2020-05-26T20:33:10.000Z | 2020-05-26T20:33:10.000Z | from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyxl
import pytest
@pytest.fixture
def datadir():
"""DATADIR as a LocalPath"""
import os
here = os.path.split(__file__)[0]
DATADIR = os.path.join(here, "data")
from py._path.local import LocalPath
return LocalPath(DATADIR)
... | 19.4 | 52 | 0.71134 |
831e47829427d1cbd148de39568df7f02a7958e9 | 3,462 | py | Python | shamir/code/shamir_gen.py | sellenth/crow | 1a693825baca035e5d3f056c25875b9f60ca7882 | [
"MIT"
] | 2 | 2020-06-05T17:53:44.000Z | 2020-06-05T18:40:55.000Z | shamir/code/shamir_gen.py | sellenth/crow | 1a693825baca035e5d3f056c25875b9f60ca7882 | [
"MIT"
] | 4 | 2020-02-11T07:29:27.000Z | 2020-05-16T01:47:07.000Z | shamir/code/shamir_gen.py | TheREK3R/crow | 9e0ef90bf2fbd3900f5eb7e9ad94a9737d515a22 | [
"MIT"
] | 5 | 2019-12-07T00:10:52.000Z | 2020-05-01T16:58:09.000Z | #!/usr/bin/python3
import shamir
import sqlite3
import rsa_encrypt
import time
import base64
import settings
#Class to hold the database
class db:
name = ""
key = ""
def __init__(self):
self.name = ""
self.key = ""
#add user secret to the secrets database
def add_secret(username, name,... | 28.61157 | 100 | 0.645003 |
06ada39afb5e3d37155554e29a091f1cde64f563 | 217 | py | Python | lec_05/voted_hash_map.py | diable201/Grokking_Algorithms | 2597b93a91ec5aabc06f9791b42de03f7d01656b | [
"MIT"
] | 1 | 2020-09-11T10:25:32.000Z | 2020-09-11T10:25:32.000Z | lec_05/voted_hash_map.py | diable201/Grokking_Algorithms | 2597b93a91ec5aabc06f9791b42de03f7d01656b | [
"MIT"
] | null | null | null | lec_05/voted_hash_map.py | diable201/Grokking_Algorithms | 2597b93a91ec5aabc06f9791b42de03f7d01656b | [
"MIT"
] | null | null | null | voted = {}
def check_voter(name):
if voted.get(name):
print("Already voted!")
else:
voted[name] = True
print("Let them vote!")
check_voter("Tom")
check_voter("Bob")
check_voter("Bob")
| 18.083333 | 31 | 0.59447 |
0aa303964ab805d0e0a86e2b67c51e0790c2b045 | 56,580 | py | Python | testplan/testing/multitest/result.py | ymn1k/testplan | b1bde8495c449d75a74a7fe4e7c6501b0476f833 | [
"Apache-2.0"
] | null | null | null | testplan/testing/multitest/result.py | ymn1k/testplan | b1bde8495c449d75a74a7fe4e7c6501b0476f833 | [
"Apache-2.0"
] | null | null | null | testplan/testing/multitest/result.py | ymn1k/testplan | b1bde8495c449d75a74a7fe4e7c6501b0476f833 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:13:18.000Z | 2019-09-11T09:13:18.000Z | """TODO."""
import functools
import inspect
import os
import re
import uuid
from testplan import defaults
from testplan.defaults import STDOUT_STYLE
from .entries import assertions, base
from .entries.schemas.base import registry as schema_registry
from .entries.stdout.base import registry as stdout_registry
class E... | 35.012376 | 80 | 0.562531 |
81e322e8d893d8218c1965e7ccd01759c5836966 | 6,610 | py | Python | bisque/test_queuer.py | MattShannon/armspeech | d9259d1b64fa2e785d34877c6014788f3e16a377 | [
"BSD-3-Clause"
] | 34 | 2015-02-12T15:16:44.000Z | 2020-09-27T17:07:35.000Z | bisque/test_queuer.py | nd1511/armspeech | d9259d1b64fa2e785d34877c6014788f3e16a377 | [
"BSD-3-Clause"
] | null | null | null | bisque/test_queuer.py | nd1511/armspeech | d9259d1b64fa2e785d34877c6014788f3e16a377 | [
"BSD-3-Clause"
] | 9 | 2015-02-06T18:32:20.000Z | 2018-10-27T20:11:08.000Z | """Unit tests for distributed computation execution."""
# Copyright 2011, 2012, 2013, 2014, 2015 Matt Shannon
# This file is part of armspeech.
# See `License` for details of license and warranty.
import unittest
import logging
import time
from codedep import codeDeps
from bisque import distribute
import bisque.qu... | 46.549296 | 79 | 0.545234 |
36f94a42b6a8d778563a0b0e599879d6e1e73301 | 273 | py | Python | src/multidirmap/__init__.py | janrg/multidirmap | d056607f1e5aeb59ba8447361315748dca80c4f0 | [
"MIT"
] | 3 | 2019-10-11T14:16:59.000Z | 2019-10-16T15:40:48.000Z | src/multidirmap/__init__.py | janrg/multidirmap | d056607f1e5aeb59ba8447361315748dca80c4f0 | [
"MIT"
] | 5 | 2018-07-28T16:20:50.000Z | 2019-09-27T13:47:50.000Z | src/multidirmap/__init__.py | janrg/multidirmap | d056607f1e5aeb59ba8447361315748dca80c4f0 | [
"MIT"
] | 1 | 2021-05-20T14:35:49.000Z | 2021-05-20T14:35:49.000Z | """A multidirectional mapping with an arbitrary number of key columns."""
from .multidirmap import DuplicateKeyError
from .multidirmap import MultiDirMap
from .multidirmap import Overwrite
__version__ = "0.3.0"
__all__ = ["MultiDirMap", "DuplicateKeyError", "Overwrite"]
| 30.333333 | 73 | 0.787546 |
af6ad457bc70f3a0249949b495db7a1707b9bdfa | 3,586 | py | Python | pytorch_toolbelt/losses/jaccard.py | malk271828/pytorch-toolbelt | d5fa695b7267ab2c968447391853207e2bedbef5 | [
"MIT"
] | 1 | 2020-07-02T00:22:16.000Z | 2020-07-02T00:22:16.000Z | pytorch_toolbelt/losses/jaccard.py | preheatedKD/pytorch-toolbelt | d8a7d25c887c5f1c9a6c8e07e8b887bc6fc4617c | [
"MIT"
] | null | null | null | pytorch_toolbelt/losses/jaccard.py | preheatedKD/pytorch-toolbelt | d8a7d25c887c5f1c9a6c8e07e8b887bc6fc4617c | [
"MIT"
] | null | null | null | from typing import List
import torch
import torch.nn.functional as F
from pytorch_toolbelt.utils.torch_utils import to_tensor
from torch import Tensor
from torch.nn.modules.loss import _Loss
from .functional import soft_jaccard_score
__all__ = ["JaccardLoss", "BINARY_MODE", "MULTICLASS_MODE", "MULTILABEL_MODE"]
BIN... | 34.480769 | 115 | 0.618516 |
837aa2384af3f7574399afc49e1a0b87f8bcd828 | 455 | py | Python | Python/binary-search.py | coolryze/LeetCode | 03876232521a20d32f8fa4e7d6d19cf208739a79 | [
"MIT"
] | 2 | 2018-07-18T01:33:07.000Z | 2018-11-16T03:17:03.000Z | Python/binary-search.py | coolryze/LeetCode | 03876232521a20d32f8fa4e7d6d19cf208739a79 | [
"MIT"
] | null | null | null | Python/binary-search.py | coolryze/LeetCode | 03876232521a20d32f8fa4e7d6d19cf208739a79 | [
"MIT"
] | null | null | null | class Solution:
def search(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
left, right = 0, len(nums)-1
while left <= right:
mid = left + (right-left)//2
if nums[mid] > target:
right = m... | 22.75 | 40 | 0.417582 |
f2476af00cbf6b3894ed9f5de481da9325724cb4 | 650 | py | Python | check/forms.py | debajyotiroyc/CrispyForm_Django | 847d3a6a2d9c2ac419d3da39ed17d1ced3bd92af | [
"MIT"
] | null | null | null | check/forms.py | debajyotiroyc/CrispyForm_Django | 847d3a6a2d9c2ac419d3da39ed17d1ced3bd92af | [
"MIT"
] | null | null | null | check/forms.py | debajyotiroyc/CrispyForm_Django | 847d3a6a2d9c2ac419d3da39ed17d1ced3bd92af | [
"MIT"
] | null | null | null | from django import forms
from check.models import info,Gen
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit,Layout,Row,Column
class StudentForm(forms.ModelForm):
gender=forms.ChoiceField(choices=Gen,widget=forms.RadioSelect,initial="male")
class Meta:
model=info... | 29.545455 | 82 | 0.676923 |
da0cb6df0ecfb7bbb9663819c636ed4861a79bda | 5,042 | py | Python | fexm/docker_scripts/docker_image.py | fgsect/fexm | cf213c9dea3778c09c1d475e6a16b9db78a6f1e6 | [
"Apache-2.0"
] | 105 | 2018-08-09T22:13:59.000Z | 2022-03-26T23:24:20.000Z | fexm/docker_scripts/docker_image.py | DeadManINDIA/fexm | ca6629bbcbf79639871d3ec52bc2a7de9ae453a4 | [
"Apache-2.0"
] | 13 | 2018-08-23T13:40:04.000Z | 2022-03-11T23:28:00.000Z | fexm/docker_scripts/docker_image.py | DeadManINDIA/fexm | ca6629bbcbf79639871d3ec52bc2a7de9ae453a4 | [
"Apache-2.0"
] | 25 | 2018-08-09T21:56:12.000Z | 2022-03-22T22:08:12.000Z | import uuid
import os
import sh
from sh import docker
def process_output(line):
print(line)
class DockerImage(object):
"""
An object of this class represents a dockerimage.
"""
BASE_IMAGE_NAME = "githubfuzzerbase"
SEED_IMAGE_NAME = "githubfuzzer"
def __init__(self, dockerfile_path: str... | 43.094017 | 117 | 0.656287 |
138218ff0eb0ff4ba8dc1e464a1fd62ba1dd05b0 | 1,144 | py | Python | tests/test_fastchardet.py | mstriemer/app-validator | ceaa373965192e3e08e7b38476cca09d44b345e7 | [
"BSD-3-Clause"
] | 20 | 2015-01-16T21:35:27.000Z | 2021-11-11T00:22:43.000Z | tests/test_fastchardet.py | mattbasta/amo-validator | f4d9612c15508b991cad637be9062a10d5e38e53 | [
"BSD-3-Clause"
] | 14 | 2015-01-15T21:26:33.000Z | 2016-01-18T16:47:15.000Z | tests/test_fastchardet.py | mattbasta/amo-validator | f4d9612c15508b991cad637be9062a10d5e38e53 | [
"BSD-3-Clause"
] | 14 | 2015-02-14T22:42:40.000Z | 2021-11-11T00:22:33.000Z | import fastchardet
def test_ascii():
"""Determines that fastchardet detects ASCII properly."""
assert fastchardet.detect("This is plain ASCII")["encoding"] == "ascii"
def test_utf8():
"""Determine that fastchardet properly detects UTF-8."""
assert fastchardet.detect("""\xEF\xBB\xBF
Hald... | 24.340426 | 75 | 0.616259 |
6c9f5d2cf299d3f1b3dbea0f0ee0e9119dbe1b4e | 4,972 | py | Python | chinese_administration_division_service.py | zihengCat/chinese-administration-division-service | 08e1a4b6d1361262caf5ba91f2ad5f6ee369986c | [
"MIT"
] | null | null | null | chinese_administration_division_service.py | zihengCat/chinese-administration-division-service | 08e1a4b6d1361262caf5ba91f2ad5f6ee369986c | [
"MIT"
] | null | null | null | chinese_administration_division_service.py | zihengCat/chinese-administration-division-service | 08e1a4b6d1361262caf5ba91f2ad5f6ee369986c | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# `OS`模块 => 文件路径
import os
# `json`模块 => JSON 数据解析
import json
# 行政区划信息服务类
class AdministrationDivisionService(object):
# 类初始化函数(无参)
def __init__(self):
# JSON数据 => Dict
f1_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), \
'db/location.mi... | 38.542636 | 100 | 0.494167 |
ecefb514303453daa4148b2d8a3d3c32c6b7265f | 13,886 | py | Python | ferenda/sources/legal/se/fixedlayoutsource.py | redhog/ferenda | 6935e26fdc63adc68b8e852292456b8d9155b1f7 | [
"BSD-2-Clause"
] | 18 | 2015-03-12T17:42:44.000Z | 2021-12-27T10:32:22.000Z | ferenda/sources/legal/se/fixedlayoutsource.py | redhog/ferenda | 6935e26fdc63adc68b8e852292456b8d9155b1f7 | [
"BSD-2-Clause"
] | 13 | 2016-01-27T10:19:07.000Z | 2021-12-13T20:24:36.000Z | ferenda/sources/legal/se/fixedlayoutsource.py | redhog/ferenda | 6935e26fdc63adc68b8e852292456b8d9155b1f7 | [
"BSD-2-Clause"
] | 6 | 2016-11-28T15:41:29.000Z | 2022-01-08T11:16:48.000Z | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from collections import OrderedDict
import os
import re
import json
from io import BytesIO
from rdflib import URIRef
from rdflib.namespace import DCTERMS
from lxm... | 45.379085 | 140 | 0.580009 |
0a77fb69439ea5e42cd66ac29548329771a5455e | 7,387 | py | Python | lib/scan/joomla_version/engine.py | hklcf/OWASP-Nettacker | 7c31cdd7e5e817031d317fa29e01409fccca7c19 | [
"Apache-2.0"
] | null | null | null | lib/scan/joomla_version/engine.py | hklcf/OWASP-Nettacker | 7c31cdd7e5e817031d317fa29e01409fccca7c19 | [
"Apache-2.0"
] | null | null | null | lib/scan/joomla_version/engine.py | hklcf/OWASP-Nettacker | 7c31cdd7e5e817031d317fa29e01409fccca7c19 | [
"Apache-2.0"
] | 1 | 2019-06-03T08:44:51.000Z | 2019-06-03T08:44:51.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Pradeep Jairamani , github.com/pradeepjairamani
import socket
import socks
import time
import json
import threading
import string
import random
import sys
import struct
import re
import os
from OpenSSL import crypto
import ssl
from core.alert import *
from core.t... | 41.734463 | 132 | 0.576824 |
16a5d42d61c18f64b9904b3b6459f184043220c0 | 144 | py | Python | Python/Math/Find Angle MBC mbc.py | jaswal72/hacker-rank | 95aaa71b4636928664341dc9c6f75d69af5f26ac | [
"MIT"
] | 1 | 2017-03-27T18:21:38.000Z | 2017-03-27T18:21:38.000Z | Python/Math/Find Angle MBC mbc.py | jaswal72/hacker-rank | 95aaa71b4636928664341dc9c6f75d69af5f26ac | [
"MIT"
] | null | null | null | Python/Math/Find Angle MBC mbc.py | jaswal72/hacker-rank | 95aaa71b4636928664341dc9c6f75d69af5f26ac | [
"MIT"
] | null | null | null | import math
AB=input()
BC=input()
AC=math.sqrt(pow(AB,2)+pow(BC,2))
MBC=float(math.degrees(math.asin(AB/AC)))
print(str(int(round(MBC,0)))+"°")
| 20.571429 | 41 | 0.673611 |
4f89e465257e5b108052547e81d4d04bab7af745 | 830 | py | Python | source/synchronization/package/NPDBF.py | kevinwhere/Bleeding-Pineapple | 017b2abd3947ea58722550e06a177ace8f4e6a87 | [
"MIT"
] | null | null | null | source/synchronization/package/NPDBF.py | kevinwhere/Bleeding-Pineapple | 017b2abd3947ea58722550e06a177ace8f4e6a87 | [
"MIT"
] | null | null | null | source/synchronization/package/NPDBF.py | kevinwhere/Bleeding-Pineapple | 017b2abd3947ea58722550e06a177ace8f4e6a87 | [
"MIT"
] | null | null | null | import heapq
def NPDBF(tasks,M,scheme,numQ):
sortedTasks=sorted(tasks, key=lambda item:item['period'])
for i in range(len(sortedTasks)):
HPTasks=sortedTasks[:i]
LPTasks=sortedTasks[i+1:]
task=sortedTasks[i]
for j in range(len(task['resGraph'])):
if task['resGraph'][j]['totacc']==0:
continue
... | 25.151515 | 77 | 0.610843 |
c1a8a064be23dd6cced90086a4d54112e2b67808 | 4,367 | py | Python | uos3/configUp/migrations/0001_initial.py | Axpere/telecommand-server | aa9bb61b127d914bd77a3bbe7ec39ef0dfc9f9ff | [
"MIT"
] | null | null | null | uos3/configUp/migrations/0001_initial.py | Axpere/telecommand-server | aa9bb61b127d914bd77a3bbe7ec39ef0dfc9f9ff | [
"MIT"
] | 1 | 2019-06-19T17:20:47.000Z | 2019-06-19T17:20:47.000Z | uos3/configUp/migrations/0001_initial.py | MNahad/telecommand-server | 96d2f1e59cb4de581f6f1bbb3a61ed1b7062f91f | [
"MIT"
] | null | null | null | # Generated by Django 2.0.7 on 2018-07-20 13:16
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='config',
fields=[
('id', models.AutoField(a... | 69.31746 | 219 | 0.579345 |
f9bf7ca8c42956bca0b041f922640e492045ab9d | 6,681 | py | Python | lib/bbox/bbox_transform.py | jeremy43/FCIS | 0ed234c14d064b615d6c2553edca24031b8c7c84 | [
"Apache-2.0"
] | null | null | null | lib/bbox/bbox_transform.py | jeremy43/FCIS | 0ed234c14d064b615d6c2553edca24031b8c7c84 | [
"Apache-2.0"
] | null | null | null | lib/bbox/bbox_transform.py | jeremy43/FCIS | 0ed234c14d064b615d6c2553edca24031b8c7c84 | [
"Apache-2.0"
] | null | null | null | # --------------------------------------------------------
# Fully Convolutional Instance-aware Semantic Segmentation
# Copyright (c) 2016 by Contributors
# Copyright (c) 2017 Microsoft
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Modified by Yuwen Xiong, Haozhi Qi, Guodong Zhang
# --------... | 33.238806 | 115 | 0.563239 |
c5a9c9e841fb6a6d371f4c16245c00a4861443f4 | 9,029 | py | Python | lbry/dht/peer.py | robd003/lbry-sdk | 3fc538104d46c8d83ce1ce9e684b1c602f43f60c | [
"MIT"
] | 4,703 | 2015-09-10T20:49:05.000Z | 2019-06-20T01:34:38.000Z | lbry/dht/peer.py | robd003/lbry-sdk | 3fc538104d46c8d83ce1ce9e684b1c602f43f60c | [
"MIT"
] | 1,934 | 2015-11-25T20:40:45.000Z | 2019-06-21T00:50:03.000Z | lbry/dht/peer.py | robd003/lbry-sdk | 3fc538104d46c8d83ce1ce9e684b1c602f43f60c | [
"MIT"
] | 369 | 2015-12-05T21:18:07.000Z | 2019-06-10T12:40:50.000Z | import typing
import asyncio
import logging
from dataclasses import dataclass, field
from functools import lru_cache
from prometheus_client import Gauge
from lbry.utils import is_valid_public_ipv4 as _is_valid_public_ipv4, LRUCache
from lbry.dht import constants
from lbry.dht.serialization.datagram import make_compac... | 46.066327 | 128 | 0.684129 |
4b70edb5958b5efe3ef928948b58740378f9a010 | 864 | py | Python | Statistics/Pop_corr_coeff.py | SAMIA-CLOUD/sql_assignment | ba3fca67e739b48eac8ecfc0b90f8e5e8643ff25 | [
"MIT"
] | null | null | null | Statistics/Pop_corr_coeff.py | SAMIA-CLOUD/sql_assignment | ba3fca67e739b48eac8ecfc0b90f8e5e8643ff25 | [
"MIT"
] | null | null | null | Statistics/Pop_corr_coeff.py | SAMIA-CLOUD/sql_assignment | ba3fca67e739b48eac8ecfc0b90f8e5e8643ff25 | [
"MIT"
] | null | null | null | from Statistics.Mean import mean
from Statistics.Psd import psd
from Calculator.Multiplication import multiplication
from Calculator.Subtraction import subtraction
from Calculator.Division import division
from Calculator.Addition import addition
def Pop_correlation_coefficient(data1, data2):
data1_mean = mean(dat... | 25.411765 | 59 | 0.664352 |
8e30dfa9296028d7759bd86f7528f875a716bb97 | 4,249 | py | Python | QUANTAXIS/QAUtil/QABar.py | 416104443/QUANTAXIS | 791e7d6d368ab2581b6c32f5ad9918f44cd4065f | [
"MIT"
] | 2 | 2017-10-26T12:42:04.000Z | 2021-04-14T05:22:43.000Z | QUANTAXIS/QAUtil/QABar.py | paracats/QUANTAXIS | 23907d5e1398bb57f3e8d9d50c21d9fb5bfe3e86 | [
"MIT"
] | null | null | null | QUANTAXIS/QAUtil/QABar.py | paracats/QUANTAXIS | 23907d5e1398bb57f3e8d9d50c21d9fb5bfe3e86 | [
"MIT"
] | null | null | null | # coding=utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2017 yutiansut/QUANTAXIS
#
# 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 th... | 51.192771 | 164 | 0.66651 |
5f8c1baff7b07f77aa4e85d1325f4b735935210e | 11,057 | py | Python | mapbox_vector_tile/encoder.py | tilezen/mapbox-vector-tile | 4e3a65a6f98c317048266260b8e7aac705e31e6f | [
"MIT"
] | 121 | 2016-07-14T00:44:54.000Z | 2022-03-19T00:49:14.000Z | mapbox_vector_tile/encoder.py | tilezen/mapbox-vector-tile | 4e3a65a6f98c317048266260b8e7aac705e31e6f | [
"MIT"
] | 53 | 2016-07-05T14:35:06.000Z | 2021-05-20T22:31:02.000Z | mapbox_vector_tile/encoder.py | tilezen/mapbox-vector-tile | 4e3a65a6f98c317048266260b8e7aac705e31e6f | [
"MIT"
] | 34 | 2016-07-27T23:45:05.000Z | 2022-01-02T20:37:58.000Z | from mapbox_vector_tile.polygon import make_it_valid
from numbers import Number
from past.builtins import long
from past.builtins import unicode
from past.builtins import xrange
from shapely.geometry.base import BaseGeometry
from shapely.geometry.multipolygon import MultiPolygon
from shapely.geometry.polygon import ori... | 35.325879 | 77 | 0.584878 |
6080b53c22ec723b7ffb55e6f4fe47b9ee3ced1b | 744 | py | Python | Chapter 06/Chap06_Example6.12.py | bpbpublications/Programming-Techniques-using-Python | 49b785f37e95a3aad1d36cef51e219ac56e5e9f0 | [
"MIT"
] | null | null | null | Chapter 06/Chap06_Example6.12.py | bpbpublications/Programming-Techniques-using-Python | 49b785f37e95a3aad1d36cef51e219ac56e5e9f0 | [
"MIT"
] | null | null | null | Chapter 06/Chap06_Example6.12.py | bpbpublications/Programming-Techniques-using-Python | 49b785f37e95a3aad1d36cef51e219ac56e5e9f0 | [
"MIT"
] | null | null | null | import re
mytxt = '123 \n123 gfh'
mypattern = '\s'
myreplace = ''
mystr = re.subn(mypattern, myreplace, mytxt)
print(mystr) # SUBN1
print(type(mystr))
print(mystr[0])
print(mystr[1])
print("-------------")
mystr = re.subn(mypattern, myreplace, mytxt,count =1)
print(mystr) # SUBN2
print("-------------")
p... | 37.2 | 104 | 0.568548 |
0dd43a0dac3438ed0448e0a0d3c1a5b59de2c16e | 718 | py | Python | thirdpartyauth/twitch_auth.py | secretisdead/thirdpartyauth | 4e8a367d23899693ecebc056de409ca93646d80d | [
"MIT"
] | null | null | null | thirdpartyauth/twitch_auth.py | secretisdead/thirdpartyauth | 4e8a367d23899693ecebc056de409ca93646d80d | [
"MIT"
] | null | null | null | thirdpartyauth/twitch_auth.py | secretisdead/thirdpartyauth | 4e8a367d23899693ecebc056de409ca93646d80d | [
"MIT"
] | 1 | 2021-09-05T06:18:08.000Z | 2021-09-05T06:18:08.000Z | import urllib
from . import add_state
from . oauth2 import OAuth2
class TwitchAuth(OAuth2):
def authentication_uri(self, redirect_uri, state):
uri = (
'https://api.twitch.tv/kraken/oauth2/authorize'
+ '?response_type=code'
+ '&client_id=' + self.credentials['client_id']
+ '&redirect_uri=' + urllib.p... | 32.636364 | 69 | 0.724234 |
0ee2f61617158a409d718710f6bb397d8647e36e | 8,689 | py | Python | src/dropbot_chip_qc/ui/execute.py | cfobel/dropbot-chip-qc | e5944b88c0d423163f55a3f49ebf84bb27e229bc | [
"BSD-3-Clause"
] | null | null | null | src/dropbot_chip_qc/ui/execute.py | cfobel/dropbot-chip-qc | e5944b88c0d423163f55a3f49ebf84bb27e229bc | [
"BSD-3-Clause"
] | 5 | 2019-04-02T11:10:45.000Z | 2019-07-17T20:31:18.000Z | src/dropbot_chip_qc/ui/execute.py | cfobel/dropbot-chip-qc | e5944b88c0d423163f55a3f49ebf84bb27e229bc | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
'''
.. versionadded:: v0.12.0
'''
import functools as ft
import itertools as it
import threading
from dropbot_chip_qc.ui.render import get_summary_dict, render_summary
from logging_helpers import _L, caller_name
import asyncio_helpers as aioh
import dropbot_chip_qc as qc
import dropbot_chip_q... | 41.37619 | 91 | 0.590747 |
dc7b24a85bd14d1ef412cbaf48cab40344cb8abb | 6,919 | py | Python | biosteam/units/_balance.py | sarangbhagwat/biosteam | fc2d227d3fce9d5f4ccb873a6d41edb535347412 | [
"MIT"
] | null | null | null | biosteam/units/_balance.py | sarangbhagwat/biosteam | fc2d227d3fce9d5f4ccb873a6d41edb535347412 | [
"MIT"
] | null | null | null | biosteam/units/_balance.py | sarangbhagwat/biosteam | fc2d227d3fce9d5f4ccb873a6d41edb535347412 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules
# Copyright (C) 2020, Yoel Cortes-Pena <yoelcortes@gmail.com>
#
# This module is under the UIUC open-source license. See
# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt
# for license details.
"""... | 36.225131 | 122 | 0.572626 |
a64cb1ad0a9d1639dbd76c8cb96733da4d1a11e2 | 14,437 | py | Python | xcube/util/cache.py | SabineEmbacher/xcube | 25863c713a27f1ecf6efb25ee0de8d322ab295bc | [
"MIT"
] | 97 | 2018-06-26T13:02:55.000Z | 2022-03-26T21:03:13.000Z | xcube/util/cache.py | SabineEmbacher/xcube | 25863c713a27f1ecf6efb25ee0de8d322ab295bc | [
"MIT"
] | 524 | 2018-11-09T12:00:08.000Z | 2022-03-31T17:00:13.000Z | xcube/util/cache.py | SabineEmbacher/xcube | 25863c713a27f1ecf6efb25ee0de8d322ab295bc | [
"MIT"
] | 15 | 2019-07-09T08:46:03.000Z | 2022-02-07T18:47:34.000Z | # The MIT License (MIT)
# Copyright (c) 2019 by the xcube development team and contributors
#
# 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... | 32.011086 | 118 | 0.603172 |
ed61a9ec54aa118c7144b7a5095afc6d6cac3efc | 5,376 | py | Python | code/abbreviate.py | jemand2001/knausj_talon | 0b95e5c0a9c3af489d4e7f3e78b25be84be2e65b | [
"Unlicense"
] | null | null | null | code/abbreviate.py | jemand2001/knausj_talon | 0b95e5c0a9c3af489d4e7f3e78b25be84be2e65b | [
"Unlicense"
] | null | null | null | code/abbreviate.py | jemand2001/knausj_talon | 0b95e5c0a9c3af489d4e7f3e78b25be84be2e65b | [
"Unlicense"
] | null | null | null | # XXX - would be nice to be able pipe these through formatters
from talon import Context, Module
mod = Module()
mod.list("abbreviation", desc="Common abbreviation")
@mod.capture
def abbreviation(m) -> str:
"One abbreviation"
ctx = Context()
ctx.lists["user.abbreviation"] = {
"address": "addr",
"admini... | 23.578947 | 62 | 0.510045 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.