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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
405ec366d2ae10466e3404c3d71b6788f3e189ba | 929 | py | Python | mycobot_320_moveit/scripts/sync_plan.py | dirksavage88/mycobot_ros | b4203056a8a0c494172c60542010dcc1b0a52df5 | [
"BSD-2-Clause"
] | null | null | null | mycobot_320_moveit/scripts/sync_plan.py | dirksavage88/mycobot_ros | b4203056a8a0c494172c60542010dcc1b0a52df5 | [
"BSD-2-Clause"
] | null | null | null | mycobot_320_moveit/scripts/sync_plan.py | dirksavage88/mycobot_ros | b4203056a8a0c494172c60542010dcc1b0a52df5 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python2
import time
import subprocess
import rospy
from sensor_msgs.msg import JointState
from pymycobot.mycobot import MyCobot
mc = None
def callback(data):
rospy.loginfo(rospy.get_caller_id() + "%s", data)
data_list = []
for index, value in enumerate(data.position):
# if index ... | 22.119048 | 72 | 0.64155 |
4f2c95eb27c7025cf61f8afee18f344ffb6438be | 19,555 | py | Python | gcn_lib/dense/torch_vertex2d.py | guochengqian/KPConv-PyTorch | 4138c12d276b0d9a765d41b93f2b9fd6e5eb2baa | [
"MIT"
] | 2 | 2021-08-04T17:15:04.000Z | 2021-12-06T14:37:46.000Z | gcn_lib/dense/torch_vertex2d.py | guochengqian/KPConv-PyTorch-DeepGCN | 4138c12d276b0d9a765d41b93f2b9fd6e5eb2baa | [
"MIT"
] | null | null | null | gcn_lib/dense/torch_vertex2d.py | guochengqian/KPConv-PyTorch-DeepGCN | 4138c12d276b0d9a765d41b93f2b9fd6e5eb2baa | [
"MIT"
] | null | null | null | import torch
from torch import nn
from .torch_nn import MLP2dLayer, get_center_feature, batched_index_select, act_layer, norm_layer2d, glorot
from .torch_edge import DilatedKNN2d, add_self_loops, remove_self_loops
import torch.nn.functional as F
class MRConv2d(nn.Module):
r"""Revised Max-Relative Graph Convolutio... | 39.031936 | 117 | 0.588392 |
5169af1b81e58c002bf8f5618574ca6b0a639170 | 3,185 | py | Python | mlni/adml_regression.py | AbdulkadirA/mlni | f58d53cd70d700289063ce3ca4ad475607806729 | [
"MIT"
] | null | null | null | mlni/adml_regression.py | AbdulkadirA/mlni | f58d53cd70d700289063ce3ca4ad475607806729 | [
"MIT"
] | null | null | null | mlni/adml_regression.py | AbdulkadirA/mlni | f58d53cd70d700289063ce3ca4ad475607806729 | [
"MIT"
] | null | null | null | from mlni.regression import RB_RepeatedHoldOut_DualSVM_Regression, RB_KFold_DualSVM_Regression
from mlni.base import RB_Input
import os, pickle
from mlni.utils import make_cv_partition
__author__ = "Junhao Wen"
__copyright__ = "Copyright 2019-2020 The CBICA & SBIA Lab"
__credits__ = ["Junhao Wen"]
__license__ = "See L... | 53.083333 | 135 | 0.684458 |
a7cb868179148bf68aa95c23784f1a279af82ac8 | 4,993 | py | Python | homeassistant/components/switch/xiaomi_miio.py | olskar/home-assistant | 5986d9ff5b068b221e9d2c675f388b80070e8d87 | [
"Apache-2.0"
] | 1 | 2020-08-06T00:03:02.000Z | 2020-08-06T00:03:02.000Z | homeassistant/components/switch/xiaomi_miio.py | olskar/home-assistant | 5986d9ff5b068b221e9d2c675f388b80070e8d87 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/switch/xiaomi_miio.py | olskar/home-assistant | 5986d9ff5b068b221e9d2c675f388b80070e8d87 | [
"Apache-2.0"
] | null | null | null | """
Support for Xiaomi Smart WiFi Socket and Smart Power Strip.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/switch.xiaomi_miio/
"""
import asyncio
from functools import partial
import logging
import voluptuous as vol
import homeassistant.helpers.config... | 29.544379 | 79 | 0.636291 |
42db8fbb0972849ef4d33999c6b7d04c6a29a4dd | 817 | py | Python | fairseq/models/roberta_updated/layer_norm.py | he1ght/BiBERT_CE | 466e6b50f0c038a331cb9c2cc5e52e697526855d | [
"MIT"
] | 21 | 2021-09-09T00:18:42.000Z | 2022-03-29T08:54:25.000Z | fairseq/models/roberta_updated/layer_norm.py | TokisakiKurumi2001/BiBERT | 2d006100dd1b2f1ff5755575e3d185a858541232 | [
"MIT"
] | null | null | null | fairseq/models/roberta_updated/layer_norm.py | TokisakiKurumi2001/BiBERT | 2d006100dd1b2f1ff5755575e3d185a858541232 | [
"MIT"
] | 2 | 2021-12-16T11:32:23.000Z | 2022-01-04T04:57:29.000Z | import torch
try:
from apex.normalization import FusedLayerNorm as _FusedLayerNorm
has_fused_layernorm = True
class FusedLayerNorm(_FusedLayerNorm):
@torch.jit.unused
def forward(self, x):
if not x.is_cuda:
return super().forward(x)
else:
... | 30.259259 | 81 | 0.675643 |
39ccdf61c1f15d00a8867f200e55c62123918f3c | 547 | py | Python | wagtail/wagtailcore/migrations/0025_collection_initial_data.py | patphongs/wagtail | 32555f7a1c599c139e0f26c22907c9612af2e015 | [
"BSD-3-Clause"
] | 3 | 2016-08-17T13:56:36.000Z | 2019-04-23T19:59:25.000Z | wagtail/wagtailcore/migrations/0025_collection_initial_data.py | patphongs/wagtail | 32555f7a1c599c139e0f26c22907c9612af2e015 | [
"BSD-3-Clause"
] | 11 | 2016-08-05T15:43:06.000Z | 2016-12-16T13:32:23.000Z | wagtail/wagtailcore/migrations/0025_collection_initial_data.py | patphongs/wagtail | 32555f7a1c599c139e0f26c22907c9612af2e015 | [
"BSD-3-Clause"
] | 2 | 2017-08-08T01:39:02.000Z | 2018-05-06T06:16:10.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def initial_data(apps, schema_editor):
Collection = apps.get_model('wagtailcore.Collection')
# Create root page
Collection.objects.create(
name="Root",
path='0001',
depth=1,
n... | 19.535714 | 70 | 0.645338 |
0e2a6aa49098275f9864f86545fbb45853a143de | 781 | py | Python | src/number_scaffold_gap.py | ifiddes/mus_strain_cactus | b56863f835892616d645f44476f5d7503acc9d7d | [
"MIT"
] | null | null | null | src/number_scaffold_gap.py | ifiddes/mus_strain_cactus | b56863f835892616d645f44476f5d7503acc9d7d | [
"MIT"
] | null | null | null | src/number_scaffold_gap.py | ifiddes/mus_strain_cactus | b56863f835892616d645f44476f5d7503acc9d7d | [
"MIT"
] | null | null | null | from collections import defaultdict
import re
from src.abstract_classifier import AbstractClassifier
import lib.sequence_lib as seq_lib
class NumberScaffoldGap(AbstractClassifier):
"""
How many 100bp N runs are there in the alignment?
100bp N runs are markers of scaffold gaps.
"""
@staticmethod... | 25.193548 | 78 | 0.649168 |
32a63c5a1f28f95f970e14671c37837a5d560d7d | 132 | py | Python | chainladder/development/clark.py | Aborah30/chainladder-python | c7d3f4f0a5333b6bd34922cc406f252ab9c47e10 | [
"MIT"
] | 1 | 2019-03-03T06:01:26.000Z | 2019-03-03T06:01:26.000Z | chainladder/development/clark.py | Aborah30/chainladder-python | c7d3f4f0a5333b6bd34922cc406f252ab9c47e10 | [
"MIT"
] | null | null | null | chainladder/development/clark.py | Aborah30/chainladder-python | c7d3f4f0a5333b6bd34922cc406f252ab9c47e10 | [
"MIT"
] | null | null | null | """
Clark Development
=================
"""
from sklearn.base import BaseEstimator
class ClarkDevelopment(BaseEstimator):
pass
| 14.666667 | 38 | 0.666667 |
bfb0ab9f8b96cbdc0d07c6e54729e61daa868146 | 448 | py | Python | users/forms.py | Ab1gor/cardsite | 3da8b998d093fd2b788a28bf8bc0cf09a43023c3 | [
"BSD-3-Clause"
] | 1 | 2019-03-12T06:33:21.000Z | 2019-03-12T06:33:21.000Z | users/forms.py | Ab1gor/cardsite | 3da8b998d093fd2b788a28bf8bc0cf09a43023c3 | [
"BSD-3-Clause"
] | 4 | 2021-03-18T20:48:41.000Z | 2022-01-13T00:49:58.000Z | users/forms.py | Ab1gor/cardsite | 3da8b998d093fd2b788a28bf8bc0cf09a43023c3 | [
"BSD-3-Clause"
] | null | null | null | from django import forms
from .models import userdetails
from django.contrib.auth.models import User
class userdetailsForm(forms.Form):
about = forms.CharField(max_length= 100,
widget=forms.TextInput(
attrs ={'placeholder' : ''}))
url = forms.CharField(max_length= 100,
widget=forms.TextInput(
attrs ={'... | 24.888889 | 44 | 0.709821 |
c9b5052da908b997016068786e3de0e642d465b0 | 673 | py | Python | tests/add_table_column_test.py | aescwork/sqlitemgr | 6cf64761c64e64da7c8cb44aeec16a27459df24b | [
"BSD-2-Clause"
] | 1 | 2020-01-31T11:38:18.000Z | 2020-01-31T11:38:18.000Z | tests/add_table_column_test.py | aescwork/sqlitemgr | 6cf64761c64e64da7c8cb44aeec16a27459df24b | [
"BSD-2-Clause"
] | null | null | null | tests/add_table_column_test.py | aescwork/sqlitemgr | 6cf64761c64e64da7c8cb44aeec16a27459df24b | [
"BSD-2-Clause"
] | null | null | null |
import unittest
import os
import sys
sys.path.append("../sqlitemgr/")
import sqlitemgr as sqm
class AddTableColumnTest(unittest.TestCase):
def setUp(self):
self.sm = sqm.SQLiteMgr()
self.sm.new_table("nuts")
self.final_statement = 'CREATE TABLE IF NOT EXISTS nuts(Nmbr INT PRIMARY KEY, Called TEXT UNIQUE, De... | 24.035714 | 141 | 0.738484 |
2942fa37fa513b567d40934aee43f30bde6ba3c1 | 189 | py | Python | beir/retrieval/search/dense/__init__.py | joshdevins/beir | f86950d166b5f6576ca6b8a1e6d8b4f2266ed60e | [
"Apache-2.0"
] | null | null | null | beir/retrieval/search/dense/__init__.py | joshdevins/beir | f86950d166b5f6576ca6b8a1e6d8b4f2266ed60e | [
"Apache-2.0"
] | null | null | null | beir/retrieval/search/dense/__init__.py | joshdevins/beir | f86950d166b5f6576ca6b8a1e6d8b4f2266ed60e | [
"Apache-2.0"
] | null | null | null | from .exact_search import DenseRetrievalExactSearch
from .faiss_search import DenseRetrievalFaissSearch, BinaryFaissSearch, PQFaissSearch, HNSWFaissSearch, FlatIPFaissSearch, PCAFaissSearch | 94.5 | 137 | 0.899471 |
47354290fcab42d0e6d3c406b595bb57c1e6559a | 4,874 | py | Python | test/CPPDEFINES/scan.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | 1 | 2019-09-18T06:37:02.000Z | 2019-09-18T06:37:02.000Z | test/CPPDEFINES/scan.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | null | null | null | test/CPPDEFINES/scan.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... | 25.925532 | 97 | 0.657981 |
d48a30fc8d1631b32ece4dbb036d4de4bc3d6551 | 8,501 | py | Python | digraphillion/setset.py | ComputerAlgorithmsGroupAtKyotoU/digraphillion | 44eaa37d142d9b74b34973aac5341a88b315ff64 | [
"MIT"
] | 1 | 2021-12-14T13:26:47.000Z | 2021-12-14T13:26:47.000Z | digraphillion/setset.py | ComputerAlgorithmsGroupAtKyotoU/digraphillion | 44eaa37d142d9b74b34973aac5341a88b315ff64 | [
"MIT"
] | 1 | 2021-09-05T06:47:58.000Z | 2021-09-07T05:56:57.000Z | digraphillion/setset.py | ComputerAlgorithmsGroupAtKyotoU/digraphillion | 44eaa37d142d9b74b34973aac5341a88b315ff64 | [
"MIT"
] | null | null | null | # 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,
# distribute, sublicense, and/or sell copi... | 33.868526 | 100 | 0.596636 |
92873920b31d96f24c374ec29fcca24af8386823 | 20,704 | py | Python | venv/lib/python3.6/site-packages/jinja2/utils.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/jinja2/utils.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | 1 | 2021-06-01T23:32:38.000Z | 2021-06-01T23:32:38.000Z | venv/lib/python3.6/site-packages/jinja2/utils.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
jinja2.utils
~~~~~~~~~~~~
Utility functions.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import json
import errno
from collections import deque
from threading import Lock
from jinja2._compat import text_type, string... | 30.901493 | 87 | 0.595827 |
ce5dc5af7ab8c6e6dce85bca36e70cf804664942 | 7,686 | py | Python | scripts/torture_test.py | SkynetRTN/afterglow-access-server | 3d8d62f622577fdd1ae7b0076cb536251f7bf0cd | [
"Apache-2.0"
] | null | null | null | scripts/torture_test.py | SkynetRTN/afterglow-access-server | 3d8d62f622577fdd1ae7b0076cb536251f7bf0cd | [
"Apache-2.0"
] | null | null | null | scripts/torture_test.py | SkynetRTN/afterglow-access-server | 3d8d62f622577fdd1ae7b0076cb536251f7bf0cd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Torture-test Afterglow Core API
"""
import argparse
import base64
import json
import random
import requests
import time
import traceback
import warnings
from multiprocessing import Process
from typing import Any, Dict, Optional, Union
def api_call(host, port, https, root, api_version, toke... | 34.16 | 79 | 0.532397 |
9b7c1dfdbbd8f3527c2874386524e8935acc86f9 | 8,243 | py | Python | static/classes/User.py | avirois/ProjectManagement | 9e05d1302336ca4ef32bef93e28bcc69fdad7d4f | [
"WTFPL"
] | null | null | null | static/classes/User.py | avirois/ProjectManagement | 9e05d1302336ca4ef32bef93e28bcc69fdad7d4f | [
"WTFPL"
] | 3 | 2021-03-24T11:53:18.000Z | 2021-04-05T10:20:58.000Z | static/classes/User.py | avirois/ProjectManagement | 9e05d1302336ca4ef32bef93e28bcc69fdad7d4f | [
"WTFPL"
] | null | null | null | import re
import sqlite3
from cryptography.fernet import Fernet
from static.classes.Institution import Institution
from static.classes.Faculty import Faculty
from flask import current_app
# Secret key for passwords
sec_key = b'pRmgMa8T0INjEAfksaq2aafzoZXEuwKI7wDe4c1F8AY='
def encryptPassword(password):
"""Functio... | 31.826255 | 122 | 0.596021 |
1a08c9d75b3066882b6c7ae46f65df9afacb191c | 488 | py | Python | env/Lib/site-packages/plotly/validators/isosurface/colorbar/tickformatstop/_templateitemname.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/isosurface/colorbar/tickformatstop/_templateitemname.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/isosurface/colorbar/tickformatstop/_templateitemname.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class TemplateitemnameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="templateitemname",
parent_name="isosurface.colorbar.tickformatstop",
**kwargs
):
super(TemplateitemnameValidator, self).__... | 28.705882 | 78 | 0.653689 |
eb5c9d13b0b1ffd722750c38568454296d526163 | 1,742 | py | Python | examples/visualization/topo_compare_conditions.py | lokinou/mne-python | f4aa12bc9118d0739ca05c5ed5a4fba7ae71138b | [
"BSD-3-Clause"
] | null | null | null | examples/visualization/topo_compare_conditions.py | lokinou/mne-python | f4aa12bc9118d0739ca05c5ed5a4fba7ae71138b | [
"BSD-3-Clause"
] | null | null | null | examples/visualization/topo_compare_conditions.py | lokinou/mne-python | f4aa12bc9118d0739ca05c5ed5a4fba7ae71138b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
.. _ex-topo-compare:
=================================================
Compare evoked responses for different conditions
=================================================
In this example, an Epochs object for visual and auditory responses is created.
Both conditions are then accessed by th... | 26.393939 | 79 | 0.677956 |
2fdd61d838b580c2fb63d670801e1913addbacdd | 4,050 | py | Python | sdk/python/pulumi_azure_nextgen/devices/v20170821preview/list_iot_dps_resource_keys_for_key_name.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/devices/v20170821preview/list_iot_dps_resource_keys_for_key_name.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/devices/v20170821preview/list_iot_dps_resource_keys_for_key_name.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 37.850467 | 181 | 0.670864 |
3e88c6106bd43aaa0c630d621b899998cffbe17f | 14,739 | py | Python | scripts/neural_machine_translation/filter_langs_nmt.py | hamjam/NeMo | b3484d32e1317666151f931bfa39867d88ed8658 | [
"Apache-2.0"
] | 4,145 | 2019-09-13T08:29:43.000Z | 2022-03-31T18:31:44.000Z | scripts/neural_machine_translation/filter_langs_nmt.py | hamjam/NeMo | b3484d32e1317666151f931bfa39867d88ed8658 | [
"Apache-2.0"
] | 2,031 | 2019-09-17T16:51:39.000Z | 2022-03-31T23:52:41.000Z | scripts/neural_machine_translation/filter_langs_nmt.py | hamjam/NeMo | b3484d32e1317666151f931bfa39867d88ed8658 | [
"Apache-2.0"
] | 1,041 | 2019-09-13T10:08:21.000Z | 2022-03-30T06:37:38.000Z | # Copyright (c) 2020, NVIDIA CORPORATION. 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... | 36.302956 | 160 | 0.605536 |
842c7bea0c4ad83223347f5e241a18288964a95d | 4,115 | py | Python | tools/train_extend.py | undeadyequ/PaddleOCR | 7e31d064ba3054f87fa27cff84784f706248c61e | [
"Apache-2.0"
] | null | null | null | tools/train_extend.py | undeadyequ/PaddleOCR | 7e31d064ba3054f87fa27cff84784f706248c61e | [
"Apache-2.0"
] | null | null | null | tools/train_extend.py | undeadyequ/PaddleOCR | 7e31d064ba3054f87fa27cff84784f706248c61e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 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 appli... | 31.899225 | 105 | 0.70401 |
95a233a4d13372f7b66badd660a0053d2535a62e | 773 | py | Python | var/spack/repos/builtin/packages/dtcmp/package.py | RemoteConnectionManager/spack | f2967b6c16effd26ce007cf86cadbb645c574f50 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-06-27T13:26:50.000Z | 2019-07-01T16:24:54.000Z | var/spack/repos/builtin/packages/dtcmp/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 75 | 2016-07-27T11:43:00.000Z | 2020-12-08T15:56:53.000Z | var/spack/repos/builtin/packages/dtcmp/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 8 | 2015-10-16T13:51:49.000Z | 2021-10-18T13:58:03.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Dtcmp(AutotoolsPackage):
"""The Datatype Comparison Library provides comparison operations... | 32.208333 | 89 | 0.71022 |
d99f702c45ed984147aacd9b60be3ef5cc4c2570 | 33,078 | py | Python | tests/support/case.py | bgridley/salt | 8af9765d4a4a02fa6168ae2617a72009996ea7a1 | [
"Apache-2.0"
] | 1 | 2021-07-15T18:11:51.000Z | 2021-07-15T18:11:51.000Z | tests/support/case.py | bgridley/salt | 8af9765d4a4a02fa6168ae2617a72009996ea7a1 | [
"Apache-2.0"
] | null | null | null | tests/support/case.py | bgridley/salt | 8af9765d4a4a02fa6168ae2617a72009996ea7a1 | [
"Apache-2.0"
] | 1 | 2020-04-10T20:18:40.000Z | 2020-04-10T20:18:40.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
====================================
Custom Salt TestCase Implementations
====================================
Custom reusable :class:`TestCase<python2:unittest.TestCase>`
implementations.
'''
# pylint: disable=repr-f... | 37.334086 | 118 | 0.526725 |
bfd0e40cf7897cde2e63f9a15c9a11da5a7a6966 | 5,904 | py | Python | RNA_PDX/bin/read_group_from_fastq.py | TheJacksonLaboratory/PDX-Analysis-Workflows | 4660d4923a689840b755df169c71ef8edad57ecd | [
"RSA-MD"
] | 7 | 2018-09-13T02:17:44.000Z | 2021-01-30T09:59:49.000Z | RNA_PDX/bin/read_group_from_fastq.py | TheJacksonLaboratory/PDX-Analysis-Workflows | 4660d4923a689840b755df169c71ef8edad57ecd | [
"RSA-MD"
] | 1 | 2020-03-13T10:38:56.000Z | 2020-03-20T03:43:15.000Z | RNA_PDX/bin/read_group_from_fastq.py | TheJacksonLaboratory/PDX-Analysis-Workflows | 4660d4923a689840b755df169c71ef8edad57ecd | [
"RSA-MD"
] | 9 | 2019-02-08T13:21:59.000Z | 2021-05-16T20:56:19.000Z | #! /usr/bin/env python
"""
read_group_from_fastq.py
Input: the fastq file specified as argv[1], the first command line argument.
Handles compressed or uncompressed fastqs.
Output: the second command line argument, if specified, else, sys.stdout.
Notes:
We will usually be handling standard Illumina C... | 29.373134 | 77 | 0.588923 |
ee03655992403ccc56e79011910921d3147a7ac1 | 7,447 | py | Python | processing/stft.py | SAKEverse/sake-plot | a08973222109981b36d204a754d0bf34d95be192 | [
"Apache-2.0"
] | null | null | null | processing/stft.py | SAKEverse/sake-plot | a08973222109981b36d204a754d0bf34d95be192 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:21:18.000Z | 2021-11-30T16:21:18.000Z | processing/stft.py | SAKEverse/sake-plot | a08973222109981b36d204a754d0bf34d95be192 | [
"Apache-2.0"
] | null | null | null | ########## ------------------------------- IMPORTS ------------------------ ##########
import numpy as np
import pandas as pd
from typing import Union#, List
from beartype import beartype
from scipy.signal import stft as scipy_stft
########## ---------------------------------------------------------------- ##########
... | 27.278388 | 116 | 0.542366 |
cae684431e79b7a0e8adb103bfd75fbd29946e23 | 23,810 | py | Python | demisto_sdk/commands/upload/tests/uploader_test.py | cyrengmbh/demisto-sdk | 4d05532efd627a32b1af659e010540cf7ed3ebf3 | [
"MIT"
] | null | null | null | demisto_sdk/commands/upload/tests/uploader_test.py | cyrengmbh/demisto-sdk | 4d05532efd627a32b1af659e010540cf7ed3ebf3 | [
"MIT"
] | null | null | null | demisto_sdk/commands/upload/tests/uploader_test.py | cyrengmbh/demisto-sdk | 4d05532efd627a32b1af659e010540cf7ed3ebf3 | [
"MIT"
] | null | null | null | import inspect
import json
from functools import wraps
from unittest.mock import MagicMock, patch
import demisto_client
import pytest
from demisto_client.demisto_api.rest import ApiException
from demisto_sdk.commands.common.constants import (CLASSIFIERS_DIR,
INTEGRATI... | 37.914013 | 127 | 0.700882 |
206159303a3b50d48fc8284fd2ba82ab702c4638 | 3,500 | py | Python | utils.py | fatyoge/hive_flask_restful | 5746d33beab5577c112b1b3e6e2b036c164cc3e2 | [
"MIT"
] | 3 | 2019-07-16T14:03:39.000Z | 2021-02-15T04:57:55.000Z | utils.py | fatyoge/hive_flask_restful | 5746d33beab5577c112b1b3e6e2b036c164cc3e2 | [
"MIT"
] | null | null | null | utils.py | fatyoge/hive_flask_restful | 5746d33beab5577c112b1b3e6e2b036c164cc3e2 | [
"MIT"
] | null | null | null | import re
from sqlalchemy import *
from sqlalchemy.sql import sqltypes
from sqlalchemy import desc, asc
from flask_restful import fields
from collections import OrderedDict
import logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s: %(message)s')
def singleton(cls):
instance = cls... | 32.407407 | 149 | 0.559714 |
47e529929bc628ec196326f12126c735dcd0b6e9 | 285 | py | Python | src/allennlp_utils/data/tokenizer.py | wj-Mcat/allennlp-utils | 817132fca5bf358c95c1b340658e1a1925ac45c3 | [
"Apache-2.0"
] | null | null | null | src/allennlp_utils/data/tokenizer.py | wj-Mcat/allennlp-utils | 817132fca5bf358c95c1b340658e1a1925ac45c3 | [
"Apache-2.0"
] | null | null | null | src/allennlp_utils/data/tokenizer.py | wj-Mcat/allennlp-utils | 817132fca5bf358c95c1b340658e1a1925ac45c3 | [
"Apache-2.0"
] | null | null | null | from typing import List
import jieba
from allennlp.data import Tokenizer, Token
@Tokenizer.register("utils-jieba")
class JiebaTokenizer(Tokenizer):
def tokenize(self, text: str) -> List[Token]:
tokens = [Token(token) for token in jieba.lcut(text)]
return tokens
| 23.75 | 61 | 0.715789 |
10c264b60c571abe3f0e823bdd415473fae0bad1 | 4,165 | py | Python | game/server/server.py | AntonYermilov/progue | 7f382208c9efc904cff9d8df4750606039801d45 | [
"MIT"
] | null | null | null | game/server/server.py | AntonYermilov/progue | 7f382208c9efc904cff9d8df4750606039801d45 | [
"MIT"
] | 6 | 2019-03-25T21:11:28.000Z | 2019-06-21T16:21:47.000Z | game/server/server.py | AntonYermilov/progue | 7f382208c9efc904cff9d8df4750606039801d45 | [
"MIT"
] | 1 | 2021-12-22T22:03:47.000Z | 2021-12-22T22:03:47.000Z | import threading
import time
from concurrent import futures
import numpy as np
import grpc
from game.client.model.action import *
from game.server.game import Game
from game.util import serialize_object
from .generated import progue_pb2_grpc, progue_pb2
class ProgueServer(progue_pb2_grpc.ProgueServerServicer):
... | 36.217391 | 105 | 0.605282 |
b11ef5bedc44f7bbf117ed48fbdedf7c36de3c23 | 1,719 | py | Python | tempest/api/compute/floating_ips/test_list_floating_ips_negative.py | rcbops-qe/tempest | 88960aa32c473b64072671541a136dbae41b1d4c | [
"Apache-2.0"
] | 3 | 2015-03-03T15:43:06.000Z | 2016-10-24T06:12:40.000Z | tempest/api/compute/floating_ips/test_list_floating_ips_negative.py | rcbops-qe/tempest | 88960aa32c473b64072671541a136dbae41b1d4c | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/floating_ips/test_list_floating_ips_negative.py | rcbops-qe/tempest | 88960aa32c473b64072671541a136dbae41b1d4c | [
"Apache-2.0"
] | 1 | 2021-11-10T07:21:02.000Z | 2021-11-10T07:21:02.000Z | # Copyright 2012 OpenStack Foundation
# 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 requ... | 34.38 | 78 | 0.724258 |
f6323885b087c5475387cc0345e3a659d3527fe7 | 16,785 | py | Python | src/flake8/processor.py | thijskramer/flake8 | bcb88c4c3e24cb75d71da1796ae2e5023b59b282 | [
"MIT"
] | 2,013 | 2015-01-02T20:46:49.000Z | 2022-03-31T20:10:41.000Z | src/flake8/processor.py | thijskramer/flake8 | bcb88c4c3e24cb75d71da1796ae2e5023b59b282 | [
"MIT"
] | 1,413 | 2015-02-07T07:34:40.000Z | 2022-03-23T16:27:14.000Z | src/flake8/processor.py | thijskramer/flake8 | bcb88c4c3e24cb75d71da1796ae2e5023b59b282 | [
"MIT"
] | 241 | 2015-03-23T17:04:45.000Z | 2022-03-30T21:51:02.000Z | """Module containing our file processor that tokenizes a file for checks."""
import argparse
import ast
import contextlib
import logging
import tokenize
from typing import Any
from typing import Dict
from typing import Generator
from typing import List
from typing import Optional
from typing import Tuple
import flake8... | 35.865385 | 79 | 0.589812 |
303b55998666bbb4742c48e0a045997ebd3f85f9 | 1,389 | py | Python | tests/python/test_printers.py | yoni206/pono | 0b8223bfff70932555aa3eda12e2ee3ca04a0462 | [
"BSD-3-Clause"
] | null | null | null | tests/python/test_printers.py | yoni206/pono | 0b8223bfff70932555aa3eda12e2ee3ca04a0462 | [
"BSD-3-Clause"
] | null | null | null | tests/python/test_printers.py | yoni206/pono | 0b8223bfff70932555aa3eda12e2ee3ca04a0462 | [
"BSD-3-Clause"
] | null | null | null | import pytest
import smt_switch as ss
import pono
import os
import tempfile
@pytest.mark.parametrize("create_solver", ss.solvers.values())
def test_vcd_trace(create_solver):
solver = create_solver(False)
solver.set_opt("incremental", "true")
solver.set_opt("produce-models", "true")
bvsort8 = solver.m... | 35.615385 | 84 | 0.62275 |
7c5f54d89982e30411db761644d402fc5a3d54e0 | 3,752 | py | Python | djangoecommerce/settings.py | Ikigaii/djangoecommerce | 5871f256b1a5d23dc2332a88f3a60256c44ab123 | [
"CC0-1.0"
] | null | null | null | djangoecommerce/settings.py | Ikigaii/djangoecommerce | 5871f256b1a5d23dc2332a88f3a60256c44ab123 | [
"CC0-1.0"
] | null | null | null | djangoecommerce/settings.py | Ikigaii/djangoecommerce | 5871f256b1a5d23dc2332a88f3a60256c44ab123 | [
"CC0-1.0"
] | null | null | null | """
Django settings for djangoecommerce project.
Generated by 'django-admin startproject' using Django 1.9.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
impo... | 26.237762 | 91 | 0.704424 |
524afe764c0ee294c51d8dfb7bea168c0fb02b45 | 8,775 | py | Python | TextFromHtmlExtractor.py | vasily-khodyrev/python_mini_readability | 74c9aa95a04ee8136432aa2c60016dee928f9c30 | [
"Apache-2.0"
] | null | null | null | TextFromHtmlExtractor.py | vasily-khodyrev/python_mini_readability | 74c9aa95a04ee8136432aa2c60016dee928f9c30 | [
"Apache-2.0"
] | null | null | null | TextFromHtmlExtractor.py | vasily-khodyrev/python_mini_readability | 74c9aa95a04ee8136432aa2c60016dee928f9c30 | [
"Apache-2.0"
] | null | null | null | """
HTML <-> array of texts.
1. Can extract from HTML string
texts = getTextArrayFromHtml(html_str)
2. Can extract text by html url
texts = getTextArrayFromUrl(url)
"""
from HTMLParser import HTMLParser, HTMLParseError
from htmlentitydefs import name2codepoint
#from BeautifulSoup import BeautifulSoup
import re... | 36.260331 | 149 | 0.584729 |
d9378588b03687efff6d3e7c1ec8861aa57b9608 | 6,333 | py | Python | homeassistant/components/onvif/camera.py | fanta759/core | fcdb54d8780900fb85e6c20d5382cfd13b69a0b3 | [
"Apache-2.0"
] | 1 | 2021-04-08T11:37:15.000Z | 2021-04-08T11:37:15.000Z | homeassistant/components/onvif/camera.py | axellebot/core | 5694e4190cddcab365cb0eb10201e5e1e193a9f0 | [
"Apache-2.0"
] | 56 | 2020-08-03T07:30:54.000Z | 2022-03-31T06:02:04.000Z | homeassistant/components/onvif/camera.py | axellebot/core | 5694e4190cddcab365cb0eb10201e5e1e193a9f0 | [
"Apache-2.0"
] | 1 | 2021-07-02T14:43:59.000Z | 2021-07-02T14:43:59.000Z | """Support for ONVIF Cameras with FFmpeg as decoder."""
import asyncio
from haffmpeg.camera import CameraMjpeg
from haffmpeg.tools import IMAGE_JPEG, ImageFrame
from onvif.exceptions import ONVIFError
import voluptuous as vol
from homeassistant.components.camera import SUPPORT_STREAM, Camera
from homeassistant.compon... | 31.984848 | 99 | 0.621822 |
172a914476cb4a4ae568e5dee602651e451f8c13 | 2,557 | py | Python | OscopeBootstrap/SyntheticPlotResults.py | alexisboukouvalas/OscoNet | f100d1ccfe8f7dad050a3082773a4b6383a4994a | [
"MIT"
] | 1 | 2020-09-03T10:00:44.000Z | 2020-09-03T10:00:44.000Z | OscopeBootstrap/SyntheticPlotResults.py | alexisboukouvalas/OscoNet | f100d1ccfe8f7dad050a3082773a4b6383a4994a | [
"MIT"
] | 1 | 2022-02-10T02:22:05.000Z | 2022-02-10T02:22:05.000Z | OscopeBootstrap/SyntheticPlotResults.py | alexisboukouvalas/OscoNet | f100d1ccfe8f7dad050a3082773a4b6383a4994a | [
"MIT"
] | 1 | 2019-09-25T16:44:30.000Z | 2019-09-25T16:44:30.000Z | from matplotlib import pyplot as plt
import pickle as pickle
def plot(i, strTitle, strExperiment):
plt.figure()
plt.title(strTitle + ' ' + strExperiment)
linList = []
lgl = []
for ip in range(pairwiseMetrics.shape[1]):
if ip == pairwiseMetrics.shape[1]-1:
leg = 'Oscope'
... | 38.742424 | 111 | 0.626907 |
52b1b10f7c980b938aaae45df6984d371c3417b1 | 4,758 | py | Python | tools/osm-streets.py | rgreinho/bna-tools | ea1d13de42c7e93d89d4ffbbdb8a8c131d7a38e5 | [
"MIT"
] | null | null | null | tools/osm-streets.py | rgreinho/bna-tools | ea1d13de42c7e93d89d4ffbbdb8a8c131d7a38e5 | [
"MIT"
] | null | null | null | tools/osm-streets.py | rgreinho/bna-tools | ea1d13de42c7e93d89d4ffbbdb8a8c131d7a38e5 | [
"MIT"
] | null | null | null | import asyncio
import multiprocessing
import pathlib
import shlex
import subprocess
import sys
import aiohttp
from halo import Halo
import pandas as pd
CITY = "austin"
STATE = "texas"
CITY_NAME_STATE = f"{CITY}_{STATE}"
CITY_NAME_STATE_CSV = f"{CITY_NAME_STATE}-streets.csv"
CITY_NAME_STATE_FILTERED = f"{CITY_NAME_STA... | 34.230216 | 137 | 0.626314 |
2c126949de2716e446112a33fce267a4afa01644 | 3,584 | py | Python | sfg2d/io/ntb.py | deisi/SFG2D | 48232b64556164ae28907735144f11e12facecd2 | [
"MIT"
] | null | null | null | sfg2d/io/ntb.py | deisi/SFG2D | 48232b64556164ae28907735144f11e12facecd2 | [
"MIT"
] | null | null | null | sfg2d/io/ntb.py | deisi/SFG2D | 48232b64556164ae28907735144f11e12facecd2 | [
"MIT"
] | null | null | null | from numpy import loadtxt
from pandas import DataFrame, to_timedelta
from datetime import datetime, timedelta
import io
class NtbFile():
def __init__(self, fname):
"""Read .ntb file, as they are exported by the FilmWaterX Tensiometer Software
Tested with version: 3.62
Properties
-... | 36.948454 | 123 | 0.530134 |
6eacf11ee841cef86bc9e9d84b4a1772f67ae375 | 1,729 | py | Python | smarts/core/utils/string.py | zbzhu99/SMARTS | 652aa23e71bd4e2732e2742140cfcd0ec082a7da | [
"MIT"
] | 2 | 2021-12-13T12:41:54.000Z | 2021-12-16T03:10:24.000Z | smarts/core/utils/string.py | zbzhu99/SMARTS | 652aa23e71bd4e2732e2742140cfcd0ec082a7da | [
"MIT"
] | null | null | null | smarts/core/utils/string.py | zbzhu99/SMARTS | 652aa23e71bd4e2732e2742140cfcd0ec082a7da | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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... | 42.170732 | 79 | 0.718913 |
d4cbd26983581204f8cf772fa7e0ee4e8b9d7b75 | 15,567 | py | Python | gen/pb_python/flyteidl/plugins/sagemaker/hyperparameter_tuning_job_pb2.py | SmritiSatyanV/flyteidl | e8a29e0deb437d9e7086f9e90b72362cd26000a2 | [
"Apache-2.0"
] | 13 | 2019-08-05T22:02:36.000Z | 2020-07-05T06:21:14.000Z | gen/pb_python/flyteidl/plugins/sagemaker/hyperparameter_tuning_job_pb2.py | SmritiSatyanV/flyteidl | e8a29e0deb437d9e7086f9e90b72362cd26000a2 | [
"Apache-2.0"
] | 70 | 2021-02-01T22:14:27.000Z | 2022-03-29T12:56:06.000Z | gen/pb_python/flyteidl/plugins/sagemaker/hyperparameter_tuning_job_pb2.py | SmritiSatyanV/flyteidl | e8a29e0deb437d9e7086f9e90b72362cd26000a2 | [
"Apache-2.0"
] | 22 | 2021-02-01T16:13:28.000Z | 2022-02-25T08:15:29.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: flyteidl/plugins/sagemaker/hyperparameter_tuning_job.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import... | 42.186992 | 1,564 | 0.802081 |
8012190bf4c4218bd0051a6155f29589c8b801dd | 54,947 | py | Python | tests/runner.py | gertvanhoey/emscripten | e2f7a32805f46f200c8db7165c4cd2932468ae43 | [
"MIT"
] | null | null | null | tests/runner.py | gertvanhoey/emscripten | e2f7a32805f46f200c8db7165c4cd2932468ae43 | [
"MIT"
] | null | null | null | tests/runner.py | gertvanhoey/emscripten | e2f7a32805f46f200c8db7165c4cd2932468ae43 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# This Python file uses the following encoding: utf-8
'''
Simple test runner.
'''
# XXX Use EM_ALL_ENGINES=1 in the env to test all engines!
from __future__ import print_function
from subprocess import Popen, PIPE, STDOUT
import os, unittest, tempfile, shutil, time, inspect, sys, math, glob, ... | 39.932413 | 196 | 0.655923 |
d565ce4a030fb49a412cc4cfd051d5b4c49474f9 | 6,593 | py | Python | gishaku/features/management.py | windowsboy111/jishaku | 870aef6ff674ed1b5e52c030ee21f235290391e8 | [
"MIT"
] | null | null | null | gishaku/features/management.py | windowsboy111/jishaku | 870aef6ff674ed1b5e52c030ee21f235290391e8 | [
"MIT"
] | null | null | null | gishaku/features/management.py | windowsboy111/jishaku | 870aef6ff674ed1b5e52c030ee21f235290391e8 | [
"MIT"
] | 1 | 2021-09-01T14:36:02.000Z | 2021-09-01T14:36:02.000Z | # -*- coding: utf-8 -*-
"""
gishaku.features.management
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The gishaku extension and bot control commands.
:copyright: (c) 2021 Devon (Gorialis) R
:license: MIT, see LICENSE for more details.
"""
import itertools
import math
import time
import traceback
from urllib.parse import urlencode
... | 33.984536 | 129 | 0.582284 |
9bee8bed957e5e49f72918e3bcc00db3f53ef55d | 427 | py | Python | week2/fibonacci_last_digit.py | llulai/algorithms_coursera | 5406f7e336022d91cb84d0971cc1fa09ac1a2e6c | [
"MIT"
] | null | null | null | week2/fibonacci_last_digit.py | llulai/algorithms_coursera | 5406f7e336022d91cb84d0971cc1fa09ac1a2e6c | [
"MIT"
] | null | null | null | week2/fibonacci_last_digit.py | llulai/algorithms_coursera | 5406f7e336022d91cb84d0971cc1fa09ac1a2e6c | [
"MIT"
] | null | null | null | # Uses python3
import sys
def get_fibonacci_last_digit_naive(n):
if n <= 1:
return n
previous = 0
current = 1
for _ in range(n - 1):
previous, current = current, previous + current
previous = previous % 10
current = current % 10
return current % 10
if __name__ =... | 19.409091 | 55 | 0.611241 |
f1be34a701bffc3aff4117d4f7f5cf6a61de766c | 2,038 | py | Python | Others/ModelProject/app.py | safsoftwarellc/pyWorkspace | edcacb8cb9220fc6e98c3b02da308cfd0a0e3a28 | [
"MIT"
] | null | null | null | Others/ModelProject/app.py | safsoftwarellc/pyWorkspace | edcacb8cb9220fc6e98c3b02da308cfd0a0e3a28 | [
"MIT"
] | null | null | null | Others/ModelProject/app.py | safsoftwarellc/pyWorkspace | edcacb8cb9220fc6e98c3b02da308cfd0a0e3a28 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = 'True'
db = SQLAlchemy(app)
migrate = Migrate(app, db)
class xml_data(db.Model):
__tabl... | 35.137931 | 92 | 0.705594 |
e4cf3b981ecca0723175cd56f0f8765842fbbdfa | 1,066 | py | Python | src/lambda_codebase/account/handler.py | prakashar11/aws-deployment-framework | da7ac5fdf03faccc5146340895f92a0f91770a3e | [
"Apache-2.0"
] | null | null | null | src/lambda_codebase/account/handler.py | prakashar11/aws-deployment-framework | da7ac5fdf03faccc5146340895f92a0f91770a3e | [
"Apache-2.0"
] | 1 | 2021-11-15T17:52:44.000Z | 2021-11-15T17:52:44.000Z | src/lambda_codebase/account/handler.py | prakashar11/aws-deployment-framework | da7ac5fdf03faccc5146340895f92a0f91770a3e | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""
The Account handler that is called when ADF is installed to initially create the deployment account if required
"""
try:
from main import lambda_handler # pylint: disable=unused-import
except Exception ... | 32.30303 | 111 | 0.595685 |
fac9f062a2e85fe179ff1d5ac3e98d2765ebc7c0 | 3,289 | py | Python | tests/python/unittest/test_autotvm_common.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | 1 | 2021-03-20T02:03:00.000Z | 2021-03-20T02:03:00.000Z | tests/python/unittest/test_autotvm_common.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_autotvm_common.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"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... | 32.89 | 90 | 0.644269 |
b507e64a1f3a3c830b48c6dbcc8db5ae08bef881 | 103 | py | Python | pmdarima/preprocessing/exog/__init__.py | Saravji/pmdarima | 7f42e36beb888d9e1e7e41b0d9c9f7419c730a3a | [
"MIT"
] | 1 | 2020-11-22T00:41:47.000Z | 2020-11-22T00:41:47.000Z | pmdarima/preprocessing/exog/__init__.py | Saravji/pmdarima | 7f42e36beb888d9e1e7e41b0d9c9f7419c730a3a | [
"MIT"
] | null | null | null | pmdarima/preprocessing/exog/__init__.py | Saravji/pmdarima | 7f42e36beb888d9e1e7e41b0d9c9f7419c730a3a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .fourier import *
__all__ = [s for s in dir() if not s.startswith("_")]
| 17.166667 | 53 | 0.592233 |
baa442a24c4c50c24ca957865a009e0b84971c55 | 851 | py | Python | pyqt/1simple/4close.py | chenliangold4j/MyPyDictionnary | 3428333f42249f33732da71e420bdc41a412f594 | [
"Apache-2.0"
] | null | null | null | pyqt/1simple/4close.py | chenliangold4j/MyPyDictionnary | 3428333f42249f33732da71e420bdc41a412f594 | [
"Apache-2.0"
] | null | null | null | pyqt/1simple/4close.py | chenliangold4j/MyPyDictionnary | 3428333f42249f33732da71e420bdc41a412f594 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Py40 PyQt5 tutorial
This program creates a quit
button. When we press the button,
the application terminates.
author: Jan Bodnar
website: py40.com
last edited: January 2015
"""
import sys
from PyQt5.QtWidgets import QWidget, QPushButton, QApplication
from PyQt5.QtCore ... | 19.790698 | 62 | 0.661575 |
3c2d4f21f67d485a3eef03cf7f0a8ec16f6e7e75 | 162 | py | Python | quiz/admin.py | vparjunmohan/Django-Quiz-App | b625bc4fd87a42ea069ccd3ae7ca857aac344088 | [
"MIT"
] | 2 | 2022-02-10T09:45:55.000Z | 2022-02-17T07:26:26.000Z | quiz/admin.py | vparjunmohan/Django-Quiz-App | b625bc4fd87a42ea069ccd3ae7ca857aac344088 | [
"MIT"
] | null | null | null | quiz/admin.py | vparjunmohan/Django-Quiz-App | b625bc4fd87a42ea069ccd3ae7ca857aac344088 | [
"MIT"
] | 1 | 2022-02-18T21:47:43.000Z | 2022-02-18T21:47:43.000Z | from django.contrib import admin
from .models import Category, Question
# Register your models here.
admin.site.register(Category)
admin.site.register(Question) | 23.142857 | 38 | 0.814815 |
f01bfc5828b90437f4348303679736ce20f625b6 | 8,793 | py | Python | scalene/scalene_parseargs.py | edisga/scalene | d5c190a4a205071199398948e04edbfd07ca4071 | [
"Apache-2.0"
] | null | null | null | scalene/scalene_parseargs.py | edisga/scalene | d5c190a4a205071199398948e04edbfd07ca4071 | [
"Apache-2.0"
] | null | null | null | scalene/scalene_parseargs.py | edisga/scalene | d5c190a4a205071199398948e04edbfd07ca4071 | [
"Apache-2.0"
] | null | null | null | from scalene.scalene_arguments import ScaleneArguments
from scalene.scalene_version import scalene_version
from typing import (
Any,
List,
NoReturn,
Optional,
Tuple,
)
from textwrap import dedent
import argparse
import sys
class RichArgParser(argparse.ArgumentParser):
def __init__(self, *args... | 34.347656 | 139 | 0.565677 |
772169c9939f3245ec9795693daf70e661e306c2 | 1,357 | py | Python | src/course1/week4/rselect.py | manoldonev/algo1-assignments | 936ed30bab844d9ed9bbf14e9785174865aac4c3 | [
"MIT"
] | null | null | null | src/course1/week4/rselect.py | manoldonev/algo1-assignments | 936ed30bab844d9ed9bbf14e9785174865aac4c3 | [
"MIT"
] | null | null | null | src/course1/week4/rselect.py | manoldonev/algo1-assignments | 936ed30bab844d9ed9bbf14e9785174865aac4c3 | [
"MIT"
] | null | null | null |
"""Randomized Selection Implementation"""
from random import randint
def rselect(numbers: list[int], i: int) -> int:
"""Rselect public method"""
return _rselect(numbers, 0, len(numbers) - 1, i)
def _rselect(numbers: list[int], left: int, right: int, i: int) -> int:
"""Divide and conquer step"""
i... | 23.807018 | 77 | 0.615328 |
d9cb4c65c04607c5aa766867fa042f9e0b1d36f8 | 7,782 | py | Python | backend/server/tests/wrapper_test/test_tutorial_anchor_wrapper.py | FlickerSoul/Graphery | 8b1390e1ba96fd2867f0cd8e5fc1d4ad6108121e | [
"MIT"
] | 5 | 2020-08-26T00:15:01.000Z | 2021-01-11T17:24:51.000Z | backend/server/tests/wrapper_test/test_tutorial_anchor_wrapper.py | FlickerSoul/Graphery | 8b1390e1ba96fd2867f0cd8e5fc1d4ad6108121e | [
"MIT"
] | 69 | 2020-08-02T23:45:44.000Z | 2021-04-17T03:04:32.000Z | backend/server/tests/wrapper_test/test_tutorial_anchor_wrapper.py | FlickerSoul/Graphery | 8b1390e1ba96fd2867f0cd8e5fc1d4ad6108121e | [
"MIT"
] | 4 | 2020-09-10T05:40:49.000Z | 2020-12-20T11:44:16.000Z | from uuid import UUID
import pytest
from backend.intel_wrappers.intel_wrapper import TutorialAnchorWrapper
from backend.intel_wrappers.validators import ValidationError
from tests.wrapper_test.factories import category_wrappers_factory
from tests.wrapper_test.test_wrapper_helper import gen_wrapper_test_class
# for ... | 35.054054 | 109 | 0.514778 |
80ac82681579a1a7e4d83c2d50038a4de78cdfa6 | 3,386 | py | Python | implementation/src/model/core/earlystopping.py | gucci-j/negotiation-breakdown-detection | d4c2bf63b4da95b342fd952065f9ad3e97179134 | [
"MIT"
] | 4 | 2021-04-26T09:05:46.000Z | 2022-03-08T06:01:07.000Z | implementation/src/model/core/earlystopping.py | gucci-j/negotiation-breakdown-detection | d4c2bf63b4da95b342fd952065f9ad3e97179134 | [
"MIT"
] | null | null | null | implementation/src/model/core/earlystopping.py | gucci-j/negotiation-breakdown-detection | d4c2bf63b4da95b342fd952065f9ad3e97179134 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2018 Bjarte Mehus Sunde & 2019-2020 Atsuki Yamaguchi
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 ... | 39.372093 | 122 | 0.651211 |
05be25f6b690ee83ade9c81b409089cefe01d0fb | 212 | py | Python | robosuite/models/arenas/__init__.py | gy20073/robosuite | cb02dd64c02d7b3d76f6016c9d00dc9391776ef9 | [
"MIT"
] | 3 | 2020-02-25T07:52:21.000Z | 2021-11-29T13:28:24.000Z | robosuite/models/arenas/__init__.py | gy20073/robosuite | cb02dd64c02d7b3d76f6016c9d00dc9391776ef9 | [
"MIT"
] | null | null | null | robosuite/models/arenas/__init__.py | gy20073/robosuite | cb02dd64c02d7b3d76f6016c9d00dc9391776ef9 | [
"MIT"
] | null | null | null | from .arena import Arena
from .bins_arena import BinsArena
from .bin_packing_arena import BinPackingArena
from .empty_arena import EmptyArena
from .pegs_arena import PegsArena
from .table_arena import TableArena
| 30.285714 | 46 | 0.858491 |
104e84ada209661a76bb2b4e72ebba3377e2c737 | 301 | py | Python | orchestra/migrations/0021_merge.py | ksbek/orchestra | 07556717feb57efcf8fb29a1e2e98eebe2313b8c | [
"Apache-2.0"
] | null | null | null | orchestra/migrations/0021_merge.py | ksbek/orchestra | 07556717feb57efcf8fb29a1e2e98eebe2313b8c | [
"Apache-2.0"
] | null | null | null | orchestra/migrations/0021_merge.py | ksbek/orchestra | 07556717feb57efcf8fb29a1e2e98eebe2313b8c | [
"Apache-2.0"
] | 1 | 2021-12-15T01:10:35.000Z | 2021-12-15T01:10:35.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('orchestra', '0020_auto_20151028_1559'),
('orchestra', '0020_auto_20151022_1553'),
]
operations = [
]
| 18.8125 | 49 | 0.66113 |
dc8946afe0a92e2fbb310ec87b6b682d94703d9a | 428 | py | Python | issues/migrations/0001_initial.py | FIOpwK/django-issuetracker | 99e7cd97923af8cf2fe37f1380d0feab108d6bff | [
"MIT"
] | 1 | 2021-10-19T03:26:17.000Z | 2021-10-19T03:26:17.000Z | issues/migrations/0001_initial.py | FIOpwK/django-issuetracker | 99e7cd97923af8cf2fe37f1380d0feab108d6bff | [
"MIT"
] | null | null | null | issues/migrations/0001_initial.py | FIOpwK/django-issuetracker | 99e7cd97923af8cf2fe37f1380d0feab108d6bff | [
"MIT"
] | null | null | null | # Generated by Django 3.2.7 on 2021-09-12 16:38
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Issue',
fields=[
('id', models.BigAutoField... | 20.380952 | 117 | 0.581776 |
d8cb4a4a43db19f4703d77b794a6bc6e9195cb14 | 3,117 | py | Python | azure-batch/azure/batch/models/job_enable_options.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 1 | 2022-03-30T22:39:15.000Z | 2022-03-30T22:39:15.000Z | azure-batch/azure/batch/models/job_enable_options.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-batch/azure/batch/models/job_enable_options.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.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 ... | 49.47619 | 191 | 0.713507 |
a672d69cfb76529addd22f1b8a1d9268a85c5b56 | 1,705 | py | Python | python/scrapy/AdvancedScrapy/AdvancedScraping/AdvancedScraping/spiders/aspx_spider_xpath.py | RitamDey/My-Simple-Programs | 147b455a6a40c371ec894ce979e8a61d242e03bd | [
"Unlicense"
] | 2 | 2016-10-14T16:58:05.000Z | 2017-05-04T04:59:18.000Z | python/scrapy/AdvancedScrapy/AdvancedScraping/AdvancedScraping/spiders/aspx_spider_xpath.py | GreenJoey/My-Simple-Programs | 147b455a6a40c371ec894ce979e8a61d242e03bd | [
"Unlicense"
] | null | null | null | python/scrapy/AdvancedScrapy/AdvancedScraping/AdvancedScraping/spiders/aspx_spider_xpath.py | GreenJoey/My-Simple-Programs | 147b455a6a40c371ec894ce979e8a61d242e03bd | [
"Unlicense"
] | null | null | null | import scrapy
class SpidyQuotesViewStateSpider(scrapy.Spider):
name = "spidyquotesViewstateXpath"
start_urls = ["http://quotes.toscrape.com/search.aspx",]
download_delay = 1.5
def parse(self, response):
for author in response.xpath('//select[@id="author"]/option/@value').extract():
... | 40.595238 | 106 | 0.493255 |
bc0ed43c56307f40bf97449a5bef54653f493cd0 | 10,891 | py | Python | PIL/EpsImagePlugin.py | radicalgraphics/Pillow | 9d22c16d539f6e0356d64849b84f2feec6787179 | [
"Python-2.0"
] | 132 | 2021-02-24T12:14:35.000Z | 2022-03-28T13:06:22.000Z | PIL/EpsImagePlugin.py | radicalgraphics/Pillow | 9d22c16d539f6e0356d64849b84f2feec6787179 | [
"Python-2.0"
] | 9 | 2020-06-05T20:37:40.000Z | 2021-09-22T18:28:23.000Z | udacity-car/lib/python2.7/site-packages/PIL/EpsImagePlugin.py | 808brick/CarND-Capstone | f9e536b4a9d96322d7e971073602c8969dbd9369 | [
"MIT"
] | 3 | 2021-12-08T15:20:46.000Z | 2021-12-13T04:55:08.000Z | #
# The Python Imaging Library.
# $Id$
#
# EPS file handling
#
# History:
# 1995-09-01 fl Created (0.1)
# 1996-05-18 fl Don't choke on "atend" fields, Ghostscript interface (0.2)
# 1996-08-22 fl Don't choke on floating point BoundingBox values
# 1996-08-23 fl Handle files from Macintosh (0.3)
# 2001-02-17 fl ... | 27.925641 | 78 | 0.459921 |
4d4a7c82ecba5ba03a5742e1d811cc0bcf8586fa | 1,062 | py | Python | homeassistant/components/nfandroidtv/const.py | mib1185/core | b17d4ac65cde9a27ff6032d70b148792e5eba8df | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/nfandroidtv/const.py | mib1185/core | b17d4ac65cde9a27ff6032d70b148792e5eba8df | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/nfandroidtv/const.py | mib1185/core | b17d4ac65cde9a27ff6032d70b148792e5eba8df | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Constants for the NFAndroidTV integration."""
DOMAIN: str = "nfandroidtv"
CONF_DURATION = "duration"
CONF_FONTSIZE = "fontsize"
CONF_POSITION = "position"
CONF_TRANSPARENCY = "transparency"
CONF_COLOR = "color"
CONF_INTERRUPT = "interrupt"
DATA_HASS_CONFIG = "nfandroid_hass_config"
DEFAULT_NAME = "Android TV / Fir... | 27.230769 | 78 | 0.778719 |
f6e79d2afe5f691c194743aecb2abaeaaf6f0a0f | 4,686 | py | Python | monorail/koon/input.py | mic47/MysticMine | 2fc0a5eaa0ab299c3a23ce17ae1c56a98055a44c | [
"MIT"
] | 28 | 2015-05-28T13:29:02.000Z | 2018-07-29T04:03:19.000Z | monorail/koon/input.py | mic47/MysticMine | 2fc0a5eaa0ab299c3a23ce17ae1c56a98055a44c | [
"MIT"
] | 8 | 2015-06-28T10:29:14.000Z | 2016-08-03T22:09:36.000Z | monorail/koon/input.py | mic47/MysticMine | 2fc0a5eaa0ab299c3a23ce17ae1c56a98055a44c | [
"MIT"
] | 11 | 2015-06-17T18:23:31.000Z | 2018-09-07T20:06:36.000Z | """ Contains keyboard, mouse, joysticks, etc...
"""
from geo import Vec2D
import pygame
class ButtonLogger:
def __init__( self ):
self.went_down_buttons = []
self.went_up_buttons = []
self.down_buttons = []
def feed_down( self, key ):
self.went_down_buttons.append( key )
... | 24.925532 | 70 | 0.555484 |
47a04206dfe521ee4e80fac52d3694158c2a5fff | 362 | py | Python | streaming-python/ut_join/joinMapperTU.py | pratitidevelop/hadoop-framework-examples | 8f569fe41dbee648514f810865eea005053e9348 | [
"Apache-2.0"
] | 141 | 2015-01-02T18:09:02.000Z | 2022-01-29T15:57:10.000Z | streaming-python/ut_join/joinMapperTU.py | pratitidevelop/hadoop-framework-examples | 8f569fe41dbee648514f810865eea005053e9348 | [
"Apache-2.0"
] | 7 | 2015-10-05T22:08:43.000Z | 2020-03-11T07:28:39.000Z | streaming-python/ut_join/joinMapperTU.py | pratitidevelop/hadoop-framework-examples | 8f569fe41dbee648514f810865eea005053e9348 | [
"Apache-2.0"
] | 163 | 2015-03-21T13:11:20.000Z | 2022-01-07T05:59:16.000Z | #!/usr/bin/env python
import sys
for line in sys.stdin:
user_id = ""
product_id = "-"
location = "-"
line = line.strip()
splits = line.split("\t")
if len(splits) == 5:
user_id = splits[2]
product_id = splits[1]
else:
user_id = splits[0]
location = splits[3]
print '%s... | 22.625 | 51 | 0.569061 |
ee652e0139cb05a4cffa960de8900683923e9cd2 | 2,000 | py | Python | rabbitai/migrations/versions/42b4c9e01447_security_converge_databases.py | psbsgic/rabbitai | 769e120ba605d56ac076f810a549c38dac410c8e | [
"Apache-2.0"
] | null | null | null | rabbitai/migrations/versions/42b4c9e01447_security_converge_databases.py | psbsgic/rabbitai | 769e120ba605d56ac076f810a549c38dac410c8e | [
"Apache-2.0"
] | null | null | null | rabbitai/migrations/versions/42b4c9e01447_security_converge_databases.py | psbsgic/rabbitai | 769e120ba605d56ac076f810a549c38dac410c8e | [
"Apache-2.0"
] | 1 | 2021-07-09T16:29:50.000Z | 2021-07-09T16:29:50.000Z | """security converge databases
Revision ID: 42b4c9e01447
Revises: 5daced1f0e76
Create Date: 2020-12-14 10:49:36.110805
"""
# revision identifiers, used by Alembic.
revision = "42b4c9e01447"
down_revision = "1f6dca87d1a2"
import sqlalchemy as sa
from alembic import op
from sqlalchemy.exc import SQLAlchemyError
from ... | 29.850746 | 74 | 0.6785 |
567ad880faa15201baecbb33073514d712ac5ba7 | 15,865 | py | Python | tests/get_or_create/tests.py | metamatik/django | 415ae960bb9f1bdae798023fdce3247d2c938eec | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/get_or_create/tests.py | metamatik/django | 415ae960bb9f1bdae798023fdce3247d2c938eec | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/get_or_create/tests.py | metamatik/django | 415ae960bb9f1bdae798023fdce3247d2c938eec | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-09-16T07:19:02.000Z | 2020-09-16T07:19:02.000Z | from __future__ import unicode_literals
import traceback
from datetime import date
from django.db import DatabaseError, IntegrityError
from django.test import TestCase, TransactionTestCase, ignore_warnings
from django.utils.encoding import DjangoUnicodeDecodeError
from .models import (
Author, Book, DefaultPerso... | 38.414044 | 96 | 0.630192 |
2c2490f11a4bf135bb658ba257d1ad312c2836ca | 121 | py | Python | Cookies.py | LeszekBlazewski/SeleniumAutomationTests | 0503fd6ae6fe90ace79ffccd78e8bfca5c0434bd | [
"MIT"
] | null | null | null | Cookies.py | LeszekBlazewski/SeleniumAutomationTests | 0503fd6ae6fe90ace79ffccd78e8bfca5c0434bd | [
"MIT"
] | null | null | null | Cookies.py | LeszekBlazewski/SeleniumAutomationTests | 0503fd6ae6fe90ace79ffccd78e8bfca5c0434bd | [
"MIT"
] | null | null | null | cookies = [{"name": "zaleniumTestPassed", "value": "false"},
{"name": "zaleniumTestPassed", "value": "true"}]
| 40.333333 | 60 | 0.578512 |
8c5859e269b7a7a1e0eb99bb3907c74dfb7f3e6d | 3,910 | py | Python | skynet/misc_utils.py | aleksanw/skynet | 87083443a0ec108113d149f52f7bdf87445af18d | [
"Apache-2.0"
] | null | null | null | skynet/misc_utils.py | aleksanw/skynet | 87083443a0ec108113d149f52f7bdf87445af18d | [
"Apache-2.0"
] | 9 | 2020-01-28T22:21:58.000Z | 2022-02-09T23:49:57.000Z | skynet/misc_utils.py | aleksanw/skynet | 87083443a0ec108113d149f52f7bdf87445af18d | [
"Apache-2.0"
] | null | null | null | import numpy as np
def boolean_flag(parser, name, default=False, help=None):
"""Add a boolean flag to argparse parser.
Parameters
----------
parser: argparse.Parser
parser to add the flag to
name: str
--<name> will enable the flag, while --no-<name> will disable it
default: boo... | 36.886792 | 119 | 0.639386 |
68b98a56772771f5d8141ced8f68c918bebf5240 | 9,622 | py | Python | src/spn/structure/Base.py | Hugo101/SPFlow | daaeed819f3ef85e6632f2f7a3bf4f8bb663ff8c | [
"Apache-2.0"
] | 1 | 2021-09-01T16:26:20.000Z | 2021-09-01T16:26:20.000Z | src/spn/structure/Base.py | Hugo101/SPFlow | daaeed819f3ef85e6632f2f7a3bf4f8bb663ff8c | [
"Apache-2.0"
] | null | null | null | src/spn/structure/Base.py | Hugo101/SPFlow | daaeed819f3ef85e6632f2f7a3bf4f8bb663ff8c | [
"Apache-2.0"
] | null | null | null | '''
Created on March 20, 2018
@author: Alejandro Molina
'''
import numpy as np
import collections
class Node(object):
def __init__(self):
self.id = 0
self.scope = []
@property
def name(self):
return "%sNode_%s" % (self.__class__.__name__, self.id)
def __repr__(self):
... | 32.397306 | 323 | 0.63438 |
67c078862eae535920e34fbb278a8663e66f3bd9 | 13,783 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/subsection.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | null | null | null | pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/subsection.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | null | null | null | pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/subsection.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | null | null | null | # python
import logging
from copy import deepcopy
from operator import attrgetter
from json import dumps
# Genie Libs
from genie.libs import sdk
# ats
from ats import aetest
from ats.log.utils import banner
from ats.datastructures import AttrDict
# abstract
from genie.abstract import Lookup
# import pcall
import im... | 33.212048 | 117 | 0.601756 |
b56990fb634f7fb9dad5c4c7f0644ae9cedb859e | 17,257 | py | Python | tests/remote-gdb/runtest.py | leviathanch/NyuziProcessor | 9d205e30c147dbf1736082bb33ba97ca2a843c17 | [
"Apache-2.0"
] | 2 | 2020-01-06T23:15:00.000Z | 2021-05-19T18:41:35.000Z | tests/remote-gdb/runtest.py | PhdBoLi/NyuziProcessor | a820fe884c055e87f13078d428c0585e8670b43e | [
"Apache-2.0"
] | null | null | null | tests/remote-gdb/runtest.py | PhdBoLi/NyuziProcessor | a820fe884c055e87f13078d428c0585e8670b43e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2011-2015 Jeff Bush
#
# 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 l... | 32.016698 | 101 | 0.586603 |
e158b35760ff848ef74e936da4674fdd4c4a2ff5 | 6,242 | py | Python | core/confdb/syntax/interfaces/base.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | core/confdb/syntax/interfaces/base.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | core/confdb/syntax/interfaces/base.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ----------------------------------------------------------------------
# ConfDB interfaces syntax
# ----------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# NOC ... | 37.377246 | 100 | 0.214995 |
e6b40095f02ec8f60d6c2306673d054478953aba | 1,456 | py | Python | Scripts/compareOutputs.py | harmim/vut-avs-project1 | d36e6b5cdebce748d2bdf2afc43950968ecf0a91 | [
"MIT"
] | null | null | null | Scripts/compareOutputs.py | harmim/vut-avs-project1 | d36e6b5cdebce748d2bdf2afc43950968ecf0a91 | [
"MIT"
] | null | null | null | Scripts/compareOutputs.py | harmim/vut-avs-project1 | d36e6b5cdebce748d2bdf2afc43950968ecf0a91 | [
"MIT"
] | null | null | null | # Simple python3 script to compare output with a reference output.
# Usage: python3 compareOutputs.py testOutput.h5 testRefOutput.h5
import sys
import h5py
import numpy as np
if len(sys.argv) != 3:
print("Expected two arguments. Output and reference output file.")
sys.exit(1)
filename = sys.argv[1]
ref_filen... | 26.472727 | 89 | 0.666896 |
460b95f140e0d3b317d2cc708fa6bf82f999b63f | 3,120 | py | Python | joeynmt/loss.py | AmitMY/joeynmt | b30d1d53823ced56113def8fb5d5f7905d3c059f | [
"Apache-2.0"
] | 563 | 2018-10-17T11:51:16.000Z | 2022-03-31T19:30:37.000Z | joeynmt/loss.py | AmitMY/joeynmt | b30d1d53823ced56113def8fb5d5f7905d3c059f | [
"Apache-2.0"
] | 132 | 2018-11-23T14:39:42.000Z | 2022-03-22T17:07:27.000Z | joeynmt/loss.py | AmitMY/joeynmt | b30d1d53823ced56113def8fb5d5f7905d3c059f | [
"Apache-2.0"
] | 166 | 2018-11-08T11:35:16.000Z | 2022-03-21T13:39:02.000Z | # coding: utf-8
"""
Module to implement training loss
"""
import torch
from torch import nn, Tensor
from torch.autograd import Variable
class XentLoss(nn.Module):
"""
Cross-Entropy Loss with optional label smoothing
"""
def __init__(self, pad_index: int, smoothing: float = 0.0):
super().__in... | 39.493671 | 78 | 0.634936 |
bd75792f68b2a81462647479d65becdeee1cd3f2 | 15,556 | py | Python | neo/rawio/examplerawio.py | Warfley/python-neo | 875e23a417e1a65d5cb45403e6e3261155e2741d | [
"BSD-3-Clause"
] | 1 | 2020-06-08T14:00:03.000Z | 2020-06-08T14:00:03.000Z | neo/rawio/examplerawio.py | Warfley/python-neo | 875e23a417e1a65d5cb45403e6e3261155e2741d | [
"BSD-3-Clause"
] | 22 | 2016-09-13T13:31:25.000Z | 2019-05-14T17:07:16.000Z | neo/rawio/examplerawio.py | Warfley/python-neo | 875e23a417e1a65d5cb45403e6e3261155e2741d | [
"BSD-3-Clause"
] | null | null | null | """
ExampleRawIO is a class of a fake example.
This is to be used when coding a new RawIO.
Rules for creating a new class:
1. Step 1: Create the main class
* Create a file in **neo/rawio/** that endith with "rawio.py"
* Create the class that inherits BaseRawIO
* copy/paste all methods that need to be i... | 41.817204 | 98 | 0.622075 |
c300cca3dbc17379c032a2c70dc9374042ec00dd | 962 | py | Python | ironic_inspector/cmd/all.py | tyws/inspector | 7c27046906d0cf5eef099efab61ac0a97a091017 | [
"Apache-2.0"
] | null | null | null | ironic_inspector/cmd/all.py | tyws/inspector | 7c27046906d0cf5eef099efab61ac0a97a091017 | [
"Apache-2.0"
] | null | null | null | ironic_inspector/cmd/all.py | tyws/inspector | 7c27046906d0cf5eef099efab61ac0a97a091017 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 31.032258 | 78 | 0.730769 |
93c0968babadec5ccc78269314cc07f3cd4d1314 | 3,028 | py | Python | huaweicloud-sdk-rabbitmq/huaweicloudsdkrabbitmq/v2/model/show_rabbit_mq_tags_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-rabbitmq/huaweicloudsdkrabbitmq/v2/model/show_rabbit_mq_tags_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-rabbitmq/huaweicloudsdkrabbitmq/v2/model/show_rabbit_mq_tags_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ShowRabbitMqTagsRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): Th... | 26.561404 | 79 | 0.556473 |
0990dde2d5d83a23295fa278d07ff7119cedb7a8 | 497 | py | Python | tests/test_obofoundry.py | kkaris/bioregistry | e8cdaf8e8c5670873ce10a5a67d7850b76e5eff7 | [
"MIT"
] | null | null | null | tests/test_obofoundry.py | kkaris/bioregistry | e8cdaf8e8c5670873ce10a5a67d7850b76e5eff7 | [
"MIT"
] | null | null | null | tests/test_obofoundry.py | kkaris/bioregistry | e8cdaf8e8c5670873ce10a5a67d7850b76e5eff7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Tests for OBO Foundry data."""
import unittest
from bioregistry import get_obofoundry_prefix
class TestOBO(unittest.TestCase):
"""Tests for OBO Foundry data."""
def test_prefix(self):
"""Test looking up stylized prefixes."""
for expected, query in [
(... | 23.666667 | 72 | 0.593561 |
1e6663e36086af73dbf2eb89730ec8b0955c5699 | 5,674 | py | Python | test/functional/p2p_invalid_block.py | HashUnlimited/chaincoin | 9a035680d6d9b9a0524dc7524c55cfedd1a683ca | [
"MIT"
] | null | null | null | test/functional/p2p_invalid_block.py | HashUnlimited/chaincoin | 9a035680d6d9b9a0524dc7524c55cfedd1a683ca | [
"MIT"
] | null | null | null | test/functional/p2p_invalid_block.py | HashUnlimited/chaincoin | 9a035680d6d9b9a0524dc7524c55cfedd1a683ca | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node responses to invalid blocks.
In this test we connect to one node over p2p, and test block re... | 40.241135 | 115 | 0.679767 |
24aa26670b764932337edd5d8a172977e2fa982b | 1,436 | py | Python | setup.py | koudyk/NiMARE | 5bbc6bc2cbd2083bea450ce67047e69f75b70d28 | [
"MIT"
] | null | null | null | setup.py | koudyk/NiMARE | 5bbc6bc2cbd2083bea450ce67047e69f75b70d28 | [
"MIT"
] | 1 | 2020-12-20T18:44:03.000Z | 2020-12-20T18:44:03.000Z | setup.py | jdkent/NiMARE | 5bbc6bc2cbd2083bea450ce67047e69f75b70d28 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" NiMARE setup script """
import versioneer
from io import open
import os.path as op
from inspect import getfile, currentframe
from setuptools import setup, find_packages
def main():
""" Install entry-point """
ver_file = op.join('nimare', 'info.py')
with op... | 26.109091 | 62 | 0.603064 |
e35fbd41c27cf8df42fdcb47fa7871e51911f736 | 266 | py | Python | run.py | acatiadroid/captcha | 3e2777a503bb3d09e3eeff7308dd8dee7d0d5021 | [
"MIT"
] | null | null | null | run.py | acatiadroid/captcha | 3e2777a503bb3d09e3eeff7308dd8dee7d0d5021 | [
"MIT"
] | null | null | null | run.py | acatiadroid/captcha | 3e2777a503bb3d09e3eeff7308dd8dee7d0d5021 | [
"MIT"
] | null | null | null | from decouple import config
from utils.botinstance import Bot
extensions = [
"cogs.setup",
"cogs.captcha",
]
bot = Bot()
if __name__ == "__main__":
for ext in extensions:
bot.load_extension(ext)
bot.ipc.start()
bot.run(config("TOKEN")) | 17.733333 | 33 | 0.650376 |
a2cbf444a399f53063bc4321314894bf0721e1f0 | 803 | py | Python | chat/views.py | raybesiga/citychat | 66d7c3ffe5cd6804ef4193ce28455376f51f9164 | [
"MIT"
] | null | null | null | chat/views.py | raybesiga/citychat | 66d7c3ffe5cd6804ef4193ce28455376f51f9164 | [
"MIT"
] | null | null | null | chat/views.py | raybesiga/citychat | 66d7c3ffe5cd6804ef4193ce28455376f51f9164 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.conf import settings
from django.http import JsonResponse
from twilio.access_token import AccessToken, IpMessagingGrant
def chat(request):
return render(request, 'chat.html')
def token(request):
device_id = request.GET.get('device', 'unknown')
identity = re... | 40.15 | 115 | 0.753425 |
a3d7c223e1cc83f1082a810056d290bf66fc7d93 | 13,271 | py | Python | gamestonk_terminal/stocks/fundamental_analysis/av_model.py | minhhoang1023/GamestonkTerminal | 195dc19b491052df080178c0cc6a9d535a91a704 | [
"MIT"
] | null | null | null | gamestonk_terminal/stocks/fundamental_analysis/av_model.py | minhhoang1023/GamestonkTerminal | 195dc19b491052df080178c0cc6a9d535a91a704 | [
"MIT"
] | null | null | null | gamestonk_terminal/stocks/fundamental_analysis/av_model.py | minhhoang1023/GamestonkTerminal | 195dc19b491052df080178c0cc6a9d535a91a704 | [
"MIT"
] | null | null | null | """Alpha Vantage Model"""
__docformat__ = "numpy"
import logging
from typing import Dict, List, Tuple
import numpy as np
import pandas as pd
import requests
from alpha_vantage.fundamentaldata import FundamentalData
from gamestonk_terminal import config_terminal as cfg
from gamestonk_terminal.decorators import log_st... | 31.673031 | 122 | 0.574109 |
6ce4d566581d2ebf2a29918bc325229de0008819 | 2,263 | py | Python | docs/makers/make_reflected_regions.py | ischigal/gammapy | c56ca1bb237d9eb4a7a3aed8eaf359206bf0e628 | [
"BSD-3-Clause"
] | 155 | 2015-02-25T12:38:02.000Z | 2022-03-13T17:54:30.000Z | docs/makers/make_reflected_regions.py | ischigal/gammapy | c56ca1bb237d9eb4a7a3aed8eaf359206bf0e628 | [
"BSD-3-Clause"
] | 3,131 | 2015-01-06T15:36:23.000Z | 2022-03-31T17:30:57.000Z | docs/makers/make_reflected_regions.py | ischigal/gammapy | c56ca1bb237d9eb4a7a3aed8eaf359206bf0e628 | [
"BSD-3-Clause"
] | 158 | 2015-03-16T20:36:44.000Z | 2022-03-30T16:05:37.000Z | import matplotlib.pyplot as plt
from astropy.coordinates import Angle, SkyCoord
from regions import CircleSkyRegion
from gammapy.makers import ReflectedRegionsFinder
from gammapy.maps import WcsNDMap, RegionGeom
# Exclude a rectangular region
exclusion_mask = WcsNDMap.create(npix=(801, 701), binsz=0.01, skydir=(83.6, ... | 27.938272 | 82 | 0.739726 |
9570a3a871a3dd68f52df5ddaaed8eb5909f3ecf | 1,640 | py | Python | experiments/riemannian_example.py | utiasSTARS/GraphIK | c2d05386bf9f9baf8ad146125bfebc3b73fccd14 | [
"MIT"
] | 1 | 2020-11-08T23:26:03.000Z | 2020-11-08T23:26:03.000Z | experiments/riemannian_example.py | utiasSTARS/GraphIK | c2d05386bf9f9baf8ad146125bfebc3b73fccd14 | [
"MIT"
] | null | null | null | experiments/riemannian_example.py | utiasSTARS/GraphIK | c2d05386bf9f9baf8ad146125bfebc3b73fccd14 | [
"MIT"
] | null | null | null | from graphik.utils.utils import table_environment
from graphik.solvers.riemannian_solver import solve_with_riemannian
# Multiple robot models to try out, or you can implement your own
from graphik.utils.roboturdf import load_ur10
if __name__ == "__main__":
# Load an example robot
robot, graph = load_ur10()
... | 40 | 126 | 0.693293 |
570a6876e48bc4fdb1d0b41924f0ea831d7da6f1 | 1,762 | py | Python | aisenv/Scripts/rst2odt_prepstyles.py | claudiavr/AIS | 5a9b9db8377efbfba3e8bfc8bf126845ef6e9aea | [
"MIT"
] | null | null | null | aisenv/Scripts/rst2odt_prepstyles.py | claudiavr/AIS | 5a9b9db8377efbfba3e8bfc8bf126845ef6e9aea | [
"MIT"
] | null | null | null | aisenv/Scripts/rst2odt_prepstyles.py | claudiavr/AIS | 5a9b9db8377efbfba3e8bfc8bf126845ef6e9aea | [
"MIT"
] | null | null | null | #!c:\users\denis\desktop\ais\aisenv\scripts\python.exe
# $Id: rst2odt_prepstyles.py 8346 2019-08-26 12:11:32Z milde $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
Fix a word-processor-generated styles.odt for odtwriter use: Drop page size
specifications... | 25.911765 | 75 | 0.643587 |
727a5dab1ffb067a1d31edf7f93524706fb7e0a3 | 10,191 | py | Python | src/pydex_app/order_update_handler.py | DeFi-Coder-News-Letter/StormSurge-pydex | 735efe9a9c2f16290ddff2c565dab655278fbddf | [
"MIT"
] | 28 | 2019-02-09T12:48:21.000Z | 2022-02-10T02:35:43.000Z | src/pydex_app/order_update_handler.py | ccamateur/pydex | e6a0fdb81751a34df40d8563a4f33fdd39a91a70 | [
"MIT"
] | 20 | 2019-02-09T02:16:48.000Z | 2021-02-02T21:55:33.000Z | src/pydex_app/order_update_handler.py | ccamateur/pydex | e6a0fdb81751a34df40d8563a4f33fdd39a91a70 | [
"MIT"
] | 5 | 2019-02-09T11:58:39.000Z | 2021-08-24T15:14:17.000Z | """
Use an OrderWatcherClient to listen to order updates from
the order-watcher-server and take necessary actions to ensure
order statuses are kept up to date in the database
author: officialcryptomaster@gmail.com
"""
from time import sleep
from pydex_app.database import PYDEX_DB as db
from pydex_app.db_models import ... | 42.286307 | 96 | 0.644196 |
90a8b3e88fa092732125b7a135aedab63211c185 | 3,644 | py | Python | python/lib/Lib/site-packages/django/test/utils.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 27 | 2015-02-11T16:31:43.000Z | 2021-12-18T04:24:19.000Z | python/lib/Lib/site-packages/django/test/utils.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 1 | 2021-06-30T10:10:56.000Z | 2021-06-30T10:10:56.000Z | python/lib/Lib/site-packages/django/test/utils.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 14 | 2015-12-27T20:19:14.000Z | 2020-12-14T01:41:22.000Z | import sys
import time
import os
import warnings
from django.conf import settings
from django.core import mail
from django.core.mail.backends import locmem
from django.test import signals
from django.template import Template
from django.utils.translation import deactivate
__all__ = ('Approximate', 'ContextList', 'setu... | 28.46875 | 79 | 0.690999 |
4579a050a702caa6641f5a65ad70e56d7132d5b2 | 1,425 | py | Python | test_frame/best_simple_example/test_qps_consume.py | fakegit/distributed_framework | bb183729a9328d654242d7b01c345a7be8007394 | [
"Apache-2.0"
] | 333 | 2019-08-08T10:25:27.000Z | 2022-03-30T07:32:04.000Z | test_frame/best_simple_example/test_qps_consume.py | 975278060/distributed_framework | bb183729a9328d654242d7b01c345a7be8007394 | [
"Apache-2.0"
] | 38 | 2020-04-24T01:47:51.000Z | 2021-12-20T07:22:15.000Z | test_frame/best_simple_example/test_qps_consume.py | 975278060/distributed_framework | bb183729a9328d654242d7b01c345a7be8007394 | [
"Apache-2.0"
] | 84 | 2019-08-09T11:51:14.000Z | 2022-03-02T06:29:09.000Z | # -*- coding: utf-8 -*-
# @Author : ydf
# @Time : 2019/8/8 0008 14:57
import time
import threading
from function_scheduling_distributed_framework import task_deco, BrokerEnum,ConcurrentModeEnum
t_start = time.time()
@task_deco('queue_test2_qps', qps=2, broker_kind=BrokerEnum.PERSISTQUEUE,concurrent_mode=Concurren... | 34.756098 | 138 | 0.675789 |
34a56de3227ca06943c3525c8ba102a367f5accb | 5,409 | py | Python | chromatose/extraction.py | atisor73/chromatose | c7fba6da3854c57e757e450206bc65f438e212a5 | [
"MIT"
] | 10 | 2020-09-12T14:42:18.000Z | 2021-10-05T03:16:20.000Z | chromatose/extraction.py | atisor73/chromatose | c7fba6da3854c57e757e450206bc65f438e212a5 | [
"MIT"
] | null | null | null | chromatose/extraction.py | atisor73/chromatose | c7fba6da3854c57e757e450206bc65f438e212a5 | [
"MIT"
] | null | null | null | """
The following code was written by Ivar Stangeby (@qTipTip) in his package `Pylette`,
and modified by Rosita Fu (@atisor73).
Date: 25 March 2021
"""
import warnings
import numpy as np
import panel as pn
from PIL import Image
from sklearn.cluster import KMeans
from .utils import *
from .viz import *
pn.extension()
... | 33.184049 | 90 | 0.555925 |
3834cf3caf709fa05a8a890a69e5a0e4afb17a89 | 216 | py | Python | Python/NLP/nltk_book1.py | vbsteja/code | 0c8f4dc579f5de21b6c55fe6e65c3c8eb5473687 | [
"Apache-2.0"
] | null | null | null | Python/NLP/nltk_book1.py | vbsteja/code | 0c8f4dc579f5de21b6c55fe6e65c3c8eb5473687 | [
"Apache-2.0"
] | null | null | null | Python/NLP/nltk_book1.py | vbsteja/code | 0c8f4dc579f5de21b6c55fe6e65c3c8eb5473687 | [
"Apache-2.0"
] | null | null | null | import nltk
from nltk.book import *
nltk.corpus.gutenberg.fileids()
def lexical_diversity(text):
return len(set(text)) / len(text)
def percentage(count,total):
return 100 * count / total
percentage(12, 119)
| 16.615385 | 37 | 0.731481 |
e0a2a52c757f06dced8221d9a98c43539ed80b6b | 13,482 | py | Python | robosuite/controllers/joint_pos.py | wangcongrobot/robosuite | fb9220491607ead5f1cd5eb25d17626c9ae3756c | [
"MIT"
] | 3 | 2020-07-15T22:36:58.000Z | 2021-01-06T17:04:50.000Z | robosuite/controllers/joint_pos.py | wangcongrobot/robosuite | fb9220491607ead5f1cd5eb25d17626c9ae3756c | [
"MIT"
] | null | null | null | robosuite/controllers/joint_pos.py | wangcongrobot/robosuite | fb9220491607ead5f1cd5eb25d17626c9ae3756c | [
"MIT"
] | null | null | null | from robosuite.controllers.base_controller import Controller
from robosuite.utils.control_utils import *
import numpy as np
# Supported impedance modes
IMPEDANCE_MODES = {"fixed", "variable", "variable_kp"}
class JointPositionController(Controller):
"""
Controller for controlling robot arm via impedance con... | 46.489655 | 120 | 0.644637 |
980ce82614f5eb160088af74fca488b1f0fe6c00 | 1,903 | py | Python | Python/simplePortScan.py | frankcash/Misc | 18a8ac6032ba48f48c3c6402a0ec3fdd164b9e34 | [
"MIT"
] | null | null | null | Python/simplePortScan.py | frankcash/Misc | 18a8ac6032ba48f48c3c6402a0ec3fdd164b9e34 | [
"MIT"
] | null | null | null | Python/simplePortScan.py | frankcash/Misc | 18a8ac6032ba48f48c3c6402a0ec3fdd164b9e34 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import socket
import subprocess
import sys
from datetime import datetime
from optparse import OptionParser
# Check what time the scan started
# using the range function to specify ports (this will only go from 1 to 1024)
# also put in some error handling
def getHost(remoteServerIP):
try:
... | 25.716216 | 81 | 0.598003 |
2c35f736b1c156f965b3e390f57e3caa3441da8e | 2,652 | py | Python | aliyun-python-sdk-dts/aliyunsdkdts/request/v20200101/ConfigureSynchronizationJobReplicatorCompareRequest.py | jorsonzen/aliyun-openapi-python-sdk | 0afbfa8e5f9e19455695aa799f7dcc1cd853d827 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-dts/aliyunsdkdts/request/v20200101/ConfigureSynchronizationJobReplicatorCompareRequest.py | jorsonzen/aliyun-openapi-python-sdk | 0afbfa8e5f9e19455695aa799f7dcc1cd853d827 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-dts/aliyunsdkdts/request/v20200101/ConfigureSynchronizationJobReplicatorCompareRequest.py | jorsonzen/aliyun-openapi-python-sdk | 0afbfa8e5f9e19455695aa799f7dcc1cd853d827 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # 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... | 39 | 104 | 0.794872 |
c0c7ce7cc4188a6d029ca5ac9ac1efcb5aaaea93 | 162 | py | Python | test.py | chrisheckler/flask-basic | d9cae050466014f9b6da54f900eae2fa005c4944 | [
"MIT"
] | null | null | null | test.py | chrisheckler/flask-basic | d9cae050466014f9b6da54f900eae2fa005c4944 | [
"MIT"
] | null | null | null | test.py | chrisheckler/flask-basic | d9cae050466014f9b6da54f900eae2fa005c4944 | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World'>
if __name__ == '__main__':
app.run(DEBUG=True)
| 13.5 | 26 | 0.660494 |
2344c09634e64a351d7152c180344d661c6b41a9 | 8,922 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_hub_virtual_network_connections_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_hub_virtual_network_connections_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_hub_virtual_network_connections_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"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.
# Changes may ... | 49.292818 | 215 | 0.675633 |
7608640833267b1039aa4555ecd0199eac6409d2 | 16,286 | py | Python | bayesian_decision_tree/hyperplane_optimization.py | UBS-IB/bayesian_tree | 718aecc68e7ea527380b8e299b4f7d69e86f7400 | [
"Apache-2.0"
] | 29 | 2019-02-06T19:39:52.000Z | 2022-02-17T08:09:55.000Z | bayesian_decision_tree/hyperplane_optimization.py | UBS-IB/bayesian_tree | 718aecc68e7ea527380b8e299b4f7d69e86f7400 | [
"Apache-2.0"
] | 1 | 2022-01-27T01:31:50.000Z | 2022-01-27T01:31:50.000Z | bayesian_decision_tree/hyperplane_optimization.py | UBS-IB/bayesian_tree | 718aecc68e7ea527380b8e299b4f7d69e86f7400 | [
"Apache-2.0"
] | 13 | 2019-05-15T01:14:14.000Z | 2021-08-17T02:35:03.000Z | import numpy as np
from abc import ABC, abstractmethod
from numpy.random import RandomState
from scipy.sparse import csr_matrix, csc_matrix
from bayesian_decision_tree.utils import r2_series_generator, hypercube_to_hypersphere_surface
class HyperplaneOptimizationFunction:
"""
The function to optimize for hyp... | 36.76298 | 145 | 0.602542 |
141b249db0fc68c26de0c24e959729b99f51825f | 10,203 | py | Python | python/pyspark/sql/tests/test_catalog.py | lresende/spark | a0bd273bb04d9a5684e291ec44617972dcd4accd | [
"Apache-2.0"
] | 4 | 2020-01-17T06:23:43.000Z | 2022-02-05T18:01:45.000Z | python/pyspark/sql/tests/test_catalog.py | yangzan0816/spark | 812d0918a88ca5677c0bdbd8cffd765d53de50ca | [
"Apache-2.0"
] | 6 | 2020-10-21T13:44:10.000Z | 2022-03-31T05:04:46.000Z | python/pyspark/sql/tests/test_catalog.py | yangzan0816/spark | 812d0918a88ca5677c0bdbd8cffd765d53de50ca | [
"Apache-2.0"
] | 1 | 2020-07-16T03:50:14.000Z | 2020-07-16T03:50:14.000Z | #
# 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 us... | 47.67757 | 97 | 0.556013 |
7347d6f3b36ff7ff1ef66a9e80509602acef9a50 | 11,560 | py | Python | app/pubmed/sink_db.py | aaronnorrish/PubMedConnections | dc17e141d94afe6d26a9b49b2183c06f3630e561 | [
"CC-BY-4.0"
] | 4 | 2022-03-09T05:20:46.000Z | 2022-03-13T11:18:58.000Z | app/pubmed/sink_db.py | aaronnorrish/PubMedConnections | dc17e141d94afe6d26a9b49b2183c06f3630e561 | [
"CC-BY-4.0"
] | null | null | null | app/pubmed/sink_db.py | aaronnorrish/PubMedConnections | dc17e141d94afe6d26a9b49b2183c06f3630e561 | [
"CC-BY-4.0"
] | 1 | 2022-03-09T05:21:53.000Z | 2022-03-09T05:21:53.000Z | """
Allows dumping data into SQLite to speed up iteration
over the ~33 million records.
"""
from typing import Optional
import atomics
import neo4j
from app.pubmed.model import Article, DBMetadata, MeshHeading
from app.utils import or_else
from config import NEO4J_URI, NEO4J_USER, NEO4J_PASSWORD, NEO4J_DATABASE
clas... | 38.151815 | 114 | 0.571107 |
a404c9ce45a0079672e5115ad46008e541366b21 | 806 | py | Python | tests/request_hooks.py | shapiy/flask-graphite | 053274eb1a998e6bd9bd1a3ecd80c64195eaccf0 | [
"MIT"
] | 15 | 2018-03-30T14:35:28.000Z | 2020-07-31T17:14:29.000Z | tests/request_hooks.py | shapiy/flask-graphite | 053274eb1a998e6bd9bd1a3ecd80c64195eaccf0 | [
"MIT"
] | 15 | 2018-04-02T17:47:54.000Z | 2019-06-03T08:59:23.000Z | tests/request_hooks.py | shapiy/flask-graphite | 053274eb1a998e6bd9bd1a3ecd80c64195eaccf0 | [
"MIT"
] | 1 | 2019-06-01T13:55:14.000Z | 2019-06-01T13:55:14.000Z | import pytest
from flask import Response
from flask_graphite.request_hooks import default_hooks, request_status_type
@pytest.fixture(params=default_hooks, ids=[x.name for x in default_hooks])
def hook(mocker, request):
_hook = request.param
mocker.patch.object(_hook, "function")
_hook.function.return_val... | 24.424242 | 75 | 0.73201 |
d1b3083dedf5f40e7343f0dc0b1552432ed8508b | 4,235 | py | Python | cronjob/python/Loan_bak_-13122019_1118AM/importSibs.py | heodat234/worldfone4xs_ibm | 6b508c3d99c48c5b8c9f1d979c356fc573e999a2 | [
"MIT"
] | null | null | null | cronjob/python/Loan_bak_-13122019_1118AM/importSibs.py | heodat234/worldfone4xs_ibm | 6b508c3d99c48c5b8c9f1d979c356fc573e999a2 | [
"MIT"
] | null | null | null | cronjob/python/Loan_bak_-13122019_1118AM/importSibs.py | heodat234/worldfone4xs_ibm | 6b508c3d99c48c5b8c9f1d979c356fc573e999a2 | [
"MIT"
] | null | null | null | #!/usr/bin/python3.6
# -*- coding: utf-8 -*-
log = open("/var/www/html/worldfone4xs_ibm/cronjob/python/Telesales/importSibs.txt","a")
import ftplib
import calendar
import time
import sys
import os
sys.path.insert(1, '/var/www/html/worldfone4xs_ibm/cronjob/python')
from ftp import Ftp
from pprint import ppri... | 37.149123 | 159 | 0.56647 |
609102595eefe3c072f7d01390faf61bcf87426a | 8,528 | py | Python | girder/queues/queues/models/queue.py | bnmajor/mongochemserver | aa76ab6e7f749c3e893f27e208984b6ed2d4b2b5 | [
"BSD-3-Clause"
] | 14 | 2015-05-04T16:40:48.000Z | 2021-07-13T08:00:30.000Z | girder/queues/queues/models/queue.py | bnmajor/mongochemserver | aa76ab6e7f749c3e893f27e208984b6ed2d4b2b5 | [
"BSD-3-Clause"
] | 88 | 2015-07-24T07:58:43.000Z | 2021-02-23T19:37:13.000Z | girder/queues/queues/models/queue.py | bnmajor/mongochemserver | aa76ab6e7f749c3e893f27e208984b6ed2d4b2b5 | [
"BSD-3-Clause"
] | 8 | 2015-06-12T20:54:39.000Z | 2021-04-09T01:07:15.000Z | import sys
from bson.objectid import ObjectId, InvalidId
from girder import logger
from girder.constants import AccessType
from girder.models.model_base import AccessControlledModel
from girder.models.model_base import ValidationException
from girder.models.user import User as UserModel
from girder.utility.model_import... | 29.922807 | 122 | 0.544676 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.