hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c12b5754c734daabe04be21fb189a26b595bb688 | 452 | py | Python | test/run/t300.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 2,671 | 2015-01-03T08:23:25.000Z | 2022-03-31T06:15:48.000Z | test/run/t300.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 972 | 2015-01-05T08:11:00.000Z | 2022-03-29T13:47:15.000Z | test/run/t300.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 845 | 2015-01-03T19:53:36.000Z | 2022-03-29T18:34:22.000Z | # Test the comparison of sets
l = [1,2,3,4,1,1]
print l
s = set(l)
print s
print '# equal'
eq = set(l)
print eq
print '# forwards'
print s.isdisjoint(eq)
print s > eq
print s.issuperset(eq)
print s >= eq
print s == eq
print s != eq
print s.issubset(eq)
print s <= eq
print s < eq
print '# backwards'
print eq.isdisjoi... | 14.125 | 29 | 0.65708 | # Test the comparison of sets
l = [1,2,3,4,1,1]
print l
s = set(l)
print s
print '# equal'
eq = set(l)
print eq
print '# forwards'
print s.isdisjoint(eq)
print s > eq
print s.issuperset(eq)
print s >= eq
print s == eq
print s != eq
print s.issubset(eq)
print s <= eq
print s < eq
print '# backwards'
print eq.isdisjoi... | 0 | 0 | 0 |
5a391e283681d1ccf2aa930e34881f302215cfb4 | 324 | py | Python | try2.py | krishna-prasath/My_programs | 96bac29eb448beda2dda439ac7adea7a5343c066 | [
"bzip2-1.0.6"
] | null | null | null | try2.py | krishna-prasath/My_programs | 96bac29eb448beda2dda439ac7adea7a5343c066 | [
"bzip2-1.0.6"
] | null | null | null | try2.py | krishna-prasath/My_programs | 96bac29eb448beda2dda439ac7adea7a5343c066 | [
"bzip2-1.0.6"
] | null | null | null | import socket
# create a socket object
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# get local machine name
host = socket.gethostname()
port = 9999
# connection to hostname on the port.
s.connect((host, port))
# Receive no more than 1024 bytes
msg = s.recv(1024)
s.close()
print (msg.decode('ascii')... | 24.923077 | 54 | 0.709877 | import socket
# create a socket object
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# get local machine name
host = socket.gethostname()
port = 9999
# connection to hostname on the port.
s.connect((host, port))
# Receive no more than 1024 bytes
msg = s.recv(1024)
s.close()
print (msg.decode('ascii')... | 0 | 0 | 0 |
fb46f913f73f634fab5f357f86e72550900b35ca | 5,355 | py | Python | BusFinderServer/busparser.py | CampusHackTeamMeme/WheresTheBus | 27e4d0a76c174be277c00269ae2c5175b16c4a83 | [
"MIT"
] | null | null | null | BusFinderServer/busparser.py | CampusHackTeamMeme/WheresTheBus | 27e4d0a76c174be277c00269ae2c5175b16c4a83 | [
"MIT"
] | null | null | null | BusFinderServer/busparser.py | CampusHackTeamMeme/WheresTheBus | 27e4d0a76c174be277c00269ae2c5175b16c4a83 | [
"MIT"
] | null | null | null | import argparse
import os
import sqlite3
import requests
ROUTES_URL = 'http://api.bus.southampton.ac.uk/dump/routes'
STOPS_URL = 'http://api.bus.southampton.ac.uk/dump/stops'
OPERATORS_URL = 'http://api.bus.southampton.ac.uk/dump/operators'
if __name__ == "__main__":
parser = argparse.ArgumentParser(... | 28.484043 | 124 | 0.613072 | import argparse
import os
import sqlite3
import requests
ROUTES_URL = 'http://api.bus.southampton.ac.uk/dump/routes'
STOPS_URL = 'http://api.bus.southampton.ac.uk/dump/stops'
OPERATORS_URL = 'http://api.bus.southampton.ac.uk/dump/operators'
def create_stops_and_routes(conn):
c = conn.cursor()
# Create hist... | 4,580 | 0 | 253 |
11cb2903072574df07e408c796300c4e5afeff07 | 2,461 | py | Python | example_project/django_mptt_example/tests/test_util.py | JMSoler7/django-mptt-admin | c0755a025e0337bb5a3873e560de522054e5278e | [
"Apache-2.0"
] | null | null | null | example_project/django_mptt_example/tests/test_util.py | JMSoler7/django-mptt-admin | c0755a025e0337bb5a3873e560de522054e5278e | [
"Apache-2.0"
] | null | null | null | example_project/django_mptt_example/tests/test_util.py | JMSoler7/django-mptt-admin | c0755a025e0337bb5a3873e560de522054e5278e | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
from uuid import UUID
from django.test import TestCase
from django_mptt_admin.util import get_tree_queryset, get_tree_from_queryset, get_javascript_value, serialize_id
from ..models import Country
from .utils import read_testdata
| 31.551282 | 112 | 0.659488 | # coding=utf-8
from uuid import UUID
from django.test import TestCase
from django_mptt_admin.util import get_tree_queryset, get_tree_from_queryset, get_javascript_value, serialize_id
from ..models import Country
from .utils import read_testdata
class UtilTestCase(TestCase):
def setUp(self):
super(Util... | 2,046 | 8 | 157 |
7570e4fdc68c8e7f80c8b49961d78a1885748fd8 | 1,444 | py | Python | watch_n_learn/authentication/main.py | aaritp-search/watch-n-learn-4 | af1d3df18c3e2bb5841cd01d3c65333d0f197436 | [
"MIT"
] | null | null | null | watch_n_learn/authentication/main.py | aaritp-search/watch-n-learn-4 | af1d3df18c3e2bb5841cd01d3c65333d0f197436 | [
"MIT"
] | null | null | null | watch_n_learn/authentication/main.py | aaritp-search/watch-n-learn-4 | af1d3df18c3e2bb5841cd01d3c65333d0f197436 | [
"MIT"
] | null | null | null | from contextlib import contextmanager
from typing import Optional, TypeVar
from fastapi.concurrency import contextmanager_in_threadpool
from fastapi.exceptions import HTTPException
from fastapi.requests import Request
from fastapi.responses import Response
from fastapi_login.fastapi_login import LoginManager
from wat... | 28.88 | 72 | 0.792244 | from contextlib import contextmanager
from typing import Optional, TypeVar
from fastapi.concurrency import contextmanager_in_threadpool
from fastapi.exceptions import HTTPException
from fastapi.requests import Request
from fastapi.responses import Response
from fastapi_login.fastapi_login import LoginManager
from wat... | 610 | 0 | 68 |
f372766907a314175e0c6e20c07b3757f1e953bd | 18,189 | py | Python | src/autogluon_contrib_nlp/models/roberta.py | zhilongli/autogluon-contrib-nlp | d5b2bb0da7cd860f746fd6bd837210a051988fc8 | [
"Apache-2.0"
] | 3 | 2020-07-31T02:49:15.000Z | 2021-11-19T00:10:58.000Z | src/autogluon_contrib_nlp/models/roberta.py | zhilongli/autogluon-contrib-nlp | d5b2bb0da7cd860f746fd6bd837210a051988fc8 | [
"Apache-2.0"
] | null | null | null | src/autogluon_contrib_nlp/models/roberta.py | zhilongli/autogluon-contrib-nlp | d5b2bb0da7cd860f746fd6bd837210a051988fc8 | [
"Apache-2.0"
] | 2 | 2022-01-14T01:29:44.000Z | 2022-01-14T15:54:28.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... | 38.052301 | 93 | 0.580296 | # 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... | 7,583 | 5,781 | 186 |
5ed1f184181fa92eab56efdc3aa41f1b511c5965 | 5,994 | py | Python | generators/generators_weights.py | SheldonTsui/GOF_NeurIPS2021 | 79a9f45c86b2c21dcaea08b4a98875dc5aca4d3a | [
"Apache-2.0"
] | 93 | 2021-10-30T03:58:28.000Z | 2022-03-21T08:29:59.000Z | generators/generators_weights.py | SheldonTsui/GOF_NeurIPS2021 | 79a9f45c86b2c21dcaea08b4a98875dc5aca4d3a | [
"Apache-2.0"
] | 5 | 2021-11-18T08:50:55.000Z | 2022-02-22T13:50:20.000Z | generators/generators_weights.py | SheldonTsui/GOF_NeurIPS2021 | 79a9f45c86b2c21dcaea08b4a98875dc5aca4d3a | [
"Apache-2.0"
] | 3 | 2021-11-15T05:52:06.000Z | 2022-03-23T04:06:54.000Z | import torch
from .volumetric_rendering import *
from .generators import ImplicitGenerator3d
| 51.230769 | 231 | 0.632966 | import torch
from .volumetric_rendering import *
from .generators import ImplicitGenerator3d
def calc_depth_var(rgb_sigma, z_vals, device, noise_std=0.5, last_back=False, white_back=False, clamp_mode=None, pred_occ=False, pred_depth=None):
sigmas = rgb_sigma[..., 3:]
if pred_occ: # use occupancy representati... | 5,775 | 23 | 103 |
984689ffb19cea3028e10e9678bb64509f64308e | 6,318 | py | Python | vm_supervisor/storage.py | cpascariello/aleph-vm | 1b4920bec211ef3bd379e9359f57f06b9308c1a1 | [
"MIT"
] | null | null | null | vm_supervisor/storage.py | cpascariello/aleph-vm | 1b4920bec211ef3bd379e9359f57f06b9308c1a1 | [
"MIT"
] | null | null | null | vm_supervisor/storage.py | cpascariello/aleph-vm | 1b4920bec211ef3bd379e9359f57f06b9308c1a1 | [
"MIT"
] | null | null | null | """
This module is in charge of providing the source code corresponding to a 'code id'.
In this prototype, it returns a hardcoded example.
In the future, it should connect to an Aleph node and retrieve the code from there.
"""
import asyncio
import json
import hashlib
import logging
import os
import re
from os.path im... | 35.296089 | 87 | 0.639126 | """
This module is in charge of providing the source code corresponding to a 'code id'.
In this prototype, it returns a hardcoded example.
In the future, it should connect to an Aleph node and retrieve the code from there.
"""
import asyncio
import json
import hashlib
import logging
import os
import re
from os.path im... | 5,433 | 0 | 184 |
0ba1ca83fbd0f468dfaedc7a9ebc7edf67125d40 | 607 | py | Python | src/brewlog/tasting/forms.py | zgoda/brewlog | 13a930b328f81d01a2be9aca07d3b14703b80faa | [
"BSD-3-Clause"
] | 3 | 2019-03-11T04:30:06.000Z | 2020-01-26T03:21:52.000Z | src/brewlog/tasting/forms.py | zgoda/brewlog | 13a930b328f81d01a2be9aca07d3b14703b80faa | [
"BSD-3-Clause"
] | 23 | 2019-02-06T20:37:37.000Z | 2020-06-01T07:08:35.000Z | src/brewlog/tasting/forms.py | zgoda/brewlog | 13a930b328f81d01a2be9aca07d3b14703b80faa | [
"BSD-3-Clause"
] | null | null | null | from flask_babel import lazy_gettext as _
from flask_login import current_user
from wtforms.fields import TextAreaField
from wtforms.fields.html5 import DateField
from wtforms.validators import InputRequired
from ..forms.base import BaseObjectForm
from ..models import TastingNote
| 33.722222 | 65 | 0.76771 | from flask_babel import lazy_gettext as _
from flask_login import current_user
from wtforms.fields import TextAreaField
from wtforms.fields.html5 import DateField
from wtforms.validators import InputRequired
from ..forms.base import BaseObjectForm
from ..models import TastingNote
class TastingNoteForm(BaseObjectForm... | 129 | 172 | 23 |
134ee79c2e0317d5373a32dd2da5b6690a1cb8db | 2,450 | py | Python | exl_env/lib/python3.6/site-packages/imblearn/utils/tests/test_estimator_checks.py | verma-varsha/fraud-detection | 13c5b0c274dfa2b68e82a4ee317e09223b5b663f | [
"MIT"
] | null | null | null | exl_env/lib/python3.6/site-packages/imblearn/utils/tests/test_estimator_checks.py | verma-varsha/fraud-detection | 13c5b0c274dfa2b68e82a4ee317e09223b5b663f | [
"MIT"
] | null | null | null | exl_env/lib/python3.6/site-packages/imblearn/utils/tests/test_estimator_checks.py | verma-varsha/fraud-detection | 13c5b0c274dfa2b68e82a4ee317e09223b5b663f | [
"MIT"
] | null | null | null | import pytest
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils import check_X_y
from imblearn.base import BaseSampler
from imblearn.utils.estimator_checks import check_estimator
from imblearn.utils import check_target_type
class BaseBadSampler(BaseEstimator):
"""Sampler without input... | 30.246914 | 78 | 0.691837 | import pytest
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils import check_X_y
from imblearn.base import BaseSampler
from imblearn.utils.estimator_checks import check_estimator
from imblearn.utils import check_target_type
class BaseBadSampler(BaseEstimator):
"""Sampler without input... | 892 | 81 | 258 |
5af27663891ba0a526f50469f07c4e6524810ab5 | 358 | py | Python | lib/motion_utils/helper_layers.py | alonshoa/GP-VAE | a168e5d3d4ce1d2893bf455bea4d2010d4b00e61 | [
"MIT"
] | null | null | null | lib/motion_utils/helper_layers.py | alonshoa/GP-VAE | a168e5d3d4ce1d2893bf455bea4d2010d4b00e61 | [
"MIT"
] | null | null | null | lib/motion_utils/helper_layers.py | alonshoa/GP-VAE | a168e5d3d4ce1d2893bf455bea4d2010d4b00e61 | [
"MIT"
] | null | null | null | import tensorflow as tf
| 23.866667 | 73 | 0.695531 | import tensorflow as tf
class MyUnSqueezeLayer(tf.keras.layers.Layer):
def __init__(self, do_unsqueeze=True):
super(MyUnSqueezeLayer, self).__init__()
self.do_unsqueeze = do_unsqueeze
def build(self, input_shape):
pass
def call(self, inputs):
return tf.expand_dims(inputs,... | 204 | 25 | 103 |
d4be32270116b8f3f5d19098a5fe4b1e7d4f3f58 | 181 | py | Python | osbot_aws/tmp_utils/Temp_Files.py | artem7902/OSBot-AWS | 4b676b8323f18d3d9809d41263f3a71745ec2828 | [
"Apache-2.0"
] | null | null | null | osbot_aws/tmp_utils/Temp_Files.py | artem7902/OSBot-AWS | 4b676b8323f18d3d9809d41263f3a71745ec2828 | [
"Apache-2.0"
] | null | null | null | osbot_aws/tmp_utils/Temp_Files.py | artem7902/OSBot-AWS | 4b676b8323f18d3d9809d41263f3a71745ec2828 | [
"Apache-2.0"
] | null | null | null | import shutil
| 22.625 | 74 | 0.745856 | import shutil
class Temp_Files:
@staticmethod
def folder_copy(source, destination,ignore=None):
return shutil.copytree(src=source, dst=destination, ignore=ignore) | 103 | 41 | 23 |
a4b95f11d8d0cf48477805e93a163e136fed05ea | 1,047 | py | Python | moviebot/nlu/annotation/operator.py | benebjoern/XAI_MovieBot | fbf47aba22081dd2efe9b89d5797da2dc143f15e | [
"MIT"
] | 2 | 2021-05-27T09:48:04.000Z | 2021-12-01T11:05:12.000Z | moviebot/nlu/annotation/operator.py | benebjoern/XAI_MovieBot | fbf47aba22081dd2efe9b89d5797da2dc143f15e | [
"MIT"
] | 20 | 2020-09-18T17:59:32.000Z | 2021-04-12T11:09:29.000Z | moviebot/nlu/annotation/operator.py | benebjoern/XAI_MovieBot | fbf47aba22081dd2efe9b89d5797da2dc143f15e | [
"MIT"
] | 5 | 2020-09-10T19:49:25.000Z | 2021-07-30T05:46:29.000Z | """The Operator class defines acceptable operators.
It will be used to identify dialogue act item operator
"""
__author__ = 'Javeria Habib'
from enum import Enum
class Operator(Enum):
"""The Operator class defines acceptable operators.
It will be used to identify dialogue act item operator"""
EQ = 1
... | 20.529412 | 64 | 0.48042 | """The Operator class defines acceptable operators.
It will be used to identify dialogue act item operator
"""
__author__ = 'Javeria Habib'
from enum import Enum
class Operator(Enum):
"""The Operator class defines acceptable operators.
It will be used to identify dialogue act item operator"""
EQ = 1
... | 0 | 0 | 0 |
dfaad3fcd8832c6483f0ae5d7fb9bdad89380b7b | 7,786 | py | Python | sebs/openwhisk/config.py | mcopik/serverless-benchmarks | 3b57688873853a1ea74e10b02a9d89f3a4d679ac | [
"BSD-3-Clause"
] | null | null | null | sebs/openwhisk/config.py | mcopik/serverless-benchmarks | 3b57688873853a1ea74e10b02a9d89f3a4d679ac | [
"BSD-3-Clause"
] | null | null | null | sebs/openwhisk/config.py | mcopik/serverless-benchmarks | 3b57688873853a1ea74e10b02a9d89f3a4d679ac | [
"BSD-3-Clause"
] | null | null | null | from sebs.cache import Cache
from sebs.faas.config import Credentials, Resources, Config
from sebs.utils import LoggingHandlers
from sebs.storage.config import MinioConfig
from typing import cast, Optional
| 35.715596 | 100 | 0.625867 | from sebs.cache import Cache
from sebs.faas.config import Credentials, Resources, Config
from sebs.utils import LoggingHandlers
from sebs.storage.config import MinioConfig
from typing import cast, Optional
class OpenWhiskCredentials(Credentials):
@staticmethod
def deserialize(config: dict, cache: Cache, hand... | 6,622 | 885 | 69 |
c362cf8baed3b231565c981936f60c2f3c3ee748 | 13,443 | py | Python | datumaro/plugins/coco_format/extractor.py | the-linh-ai/datumaro | 88584da4391d25ecede96169a9640cd9010bb47c | [
"MIT"
] | null | null | null | datumaro/plugins/coco_format/extractor.py | the-linh-ai/datumaro | 88584da4391d25ecede96169a9640cd9010bb47c | [
"MIT"
] | null | null | null | datumaro/plugins/coco_format/extractor.py | the-linh-ai/datumaro | 88584da4391d25ecede96169a9640cd9010bb47c | [
"MIT"
] | null | null | null | # Copyright (C) 2019-2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
from typing import Any
import logging as log
import os.path as osp
from attrs import define
import pycocotools.mask as mask_utils
from datumaro.components.annotation import (
AnnotationType, Bbox, Caption, CompiledMask, Label, LabelCate... | 37.974576 | 83 | 0.568846 | # Copyright (C) 2019-2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
from typing import Any
import logging as log
import os.path as osp
from attrs import define
import pycocotools.mask as mask_utils
from datumaro.components.annotation import (
AnnotationType, Bbox, Caption, CompiledMask, Label, LabelCate... | 11,565 | 255 | 638 |
82c7596fec61f4c24d15fd89c481684b0f87e398 | 2,084 | py | Python | src/generate_new_site/site_data_structs/references.py | aychen99/Excavating-Occaneechi-Town | 6e864ca69ff1881554eb4c88aebed236bafbeaf4 | [
"MIT"
] | 1 | 2020-10-01T01:07:11.000Z | 2020-10-01T01:07:11.000Z | src/generate_new_site/site_data_structs/references.py | aychen99/Excavating-Occaneechi-Town | 6e864ca69ff1881554eb4c88aebed236bafbeaf4 | [
"MIT"
] | null | null | null | src/generate_new_site/site_data_structs/references.py | aychen99/Excavating-Occaneechi-Town | 6e864ca69ff1881554eb4c88aebed236bafbeaf4 | [
"MIT"
] | null | null | null | import json
from pathlib import Path
| 32.061538 | 78 | 0.619482 | import json
from pathlib import Path
class References:
def __init__(self, parent):
self.references = {}
self.old_reference_letters = {}
self.parent = parent
def register_author(self, author, references):
self.references[author] = references
def register_old_letters... | 745 | 1,279 | 23 |
ed49c514a197b16b3a8cfc497957ea2ff90492ba | 218 | py | Python | python/unit-test/py/PascalTriangle.py | dacozai/algorithm-diary | 8ed5e119e4450e92e63276047ef19bbf422c2770 | [
"MIT"
] | 1 | 2019-10-17T08:34:55.000Z | 2019-10-17T08:34:55.000Z | python/unit-test/py/PascalTriangle.py | dacozai/algorithm-diary | 8ed5e119e4450e92e63276047ef19bbf422c2770 | [
"MIT"
] | 1 | 2020-05-24T08:32:13.000Z | 2020-05-24T08:32:13.000Z | python/unit-test/py/PascalTriangle.py | dacozai/algorithm-diary | 8ed5e119e4450e92e63276047ef19bbf422c2770 | [
"MIT"
] | null | null | null | import sys
sys.path.append('../..')
from typing import Set, Dict, Tuple, Sequence, List, Any
from src.array._118_Pascal import *
num = 5
print(pascalTriangle(num))
assert(2 == pascalTriangle(num))
print("All pass") | 19.818182 | 56 | 0.715596 | import sys
sys.path.append('../..')
from typing import Set, Dict, Tuple, Sequence, List, Any
from src.array._118_Pascal import *
num = 5
print(pascalTriangle(num))
assert(2 == pascalTriangle(num))
print("All pass") | 0 | 0 | 0 |
64e6c42b82836f975db585989185b3d83e1045d4 | 5,231 | py | Python | cell_tools/_RNA/_funcs/_filter_static_genes.py | mvinyard/cell-tools | 2482ccbe13c7a5cc06d575adefe0158026c8e03b | [
"MIT"
] | 1 | 2022-01-11T20:00:44.000Z | 2022-01-11T20:00:44.000Z | cell_tools/_RNA/_funcs/_filter_static_genes.py | mvinyard/cell-tools | 2482ccbe13c7a5cc06d575adefe0158026c8e03b | [
"MIT"
] | null | null | null | cell_tools/_RNA/_funcs/_filter_static_genes.py | mvinyard/cell-tools | 2482ccbe13c7a5cc06d575adefe0158026c8e03b | [
"MIT"
] | null | null | null |
# _filter_static_genes.py
__module_name__ = "_filter_static_genes.py"
__author__ = ", ".join(["Michael E. Vinyard"])
__email__ = ", ".join(["vinyard@g.harvard.edu",])
# package imports #
# --------------- #
import licorice
import scipy.optimize
import matplotlib.pyplot as plt
import numpy as np
import vinplots
fro... | 25.89604 | 97 | 0.636398 |
# _filter_static_genes.py
__module_name__ = "_filter_static_genes.py"
__author__ = ", ".join(["Michael E. Vinyard"])
__email__ = ", ".join(["vinyard@g.harvard.edu",])
# package imports #
# --------------- #
import licorice
import scipy.optimize
import matplotlib.pyplot as plt
import numpy as np
import vinplots
fro... | 2,097 | 0 | 146 |
ae4c462ba74a0705ad6b88b01ed3ce395d3f25fe | 1,318 | py | Python | example/main.py | Euraxluo/fast_job | e396b4990bdb99b5fa2f7aabe3995ca396e1d58c | [
"MIT"
] | 1 | 2022-03-10T12:21:21.000Z | 2022-03-10T12:21:21.000Z | example/main.py | Euraxluo/fast_job | e396b4990bdb99b5fa2f7aabe3995ca396e1d58c | [
"MIT"
] | null | null | null | example/main.py | Euraxluo/fast_job | e396b4990bdb99b5fa2f7aabe3995ca396e1d58c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Time: 2021-10-20 11:17
# Copyright (c) 2021
# author: Euraxluo
import unittest
from loguru import logger
import logging
import HTMLReport.src.tools.result as test_result # type:ignore
import HTMLReport.src.test_runner as test_runner # type:ignore
logger.getLogger = logging.getLogger # ty... | 31.380952 | 98 | 0.544765 | # -*- coding: utf-8 -*-
# Time: 2021-10-20 11:17
# Copyright (c) 2021
# author: Euraxluo
import unittest
from loguru import logger
import logging
import HTMLReport.src.tools.result as test_result # type:ignore
import HTMLReport.src.test_runner as test_runner # type:ignore
logger.getLogger = logging.getLogger # ty... | 0 | 844 | 23 |
38b86302119dc770ad8efa1359e7c146b86d0aee | 49,671 | py | Python | ding/model/common/head.py | kxzxvbk/DI-engine | ce286cdec3d7c991c21888608313b16dd7abe872 | [
"Apache-2.0"
] | 1 | 2022-03-21T16:15:39.000Z | 2022-03-21T16:15:39.000Z | ding/model/common/head.py | jiaruonan/DI-engine | 268d77db3cb54401b2cfc83e2bc3ec87c31e7b83 | [
"Apache-2.0"
] | null | null | null | ding/model/common/head.py | jiaruonan/DI-engine | 268d77db3cb54401b2cfc83e2bc3ec87c31e7b83 | [
"Apache-2.0"
] | null | null | null | from typing import Optional, Dict
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal, Independent
from ding.torch_utils import fc_block, noise_block, NoiseLinearLayer, MLP
from ding.rl_utils import beta_function_map
from ding.utils import lists_to_dic... | 43.995571 | 120 | 0.557871 | from typing import Optional, Dict
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal, Independent
from ding.torch_utils import fc_block, noise_block, NoiseLinearLayer, MLP
from ding.rl_utils import beta_function_map
from ding.utils import lists_to_dic... | 0 | 0 | 0 |
48188b382ae011b2aa2f451c013cfd43367599fe | 767 | py | Python | libs/urllibs/BloomFilter.py | Evelca1N/K-Spider | 46819bf93a9337cdf8adc410c6ddc4be29ee3b52 | [
"MIT"
] | 3 | 2015-06-18T08:13:49.000Z | 2015-07-06T06:06:20.000Z | libs/urllibs/BloomFilter.py | Evelca1N/K-Spider | 46819bf93a9337cdf8adc410c6ddc4be29ee3b52 | [
"MIT"
] | null | null | null | libs/urllibs/BloomFilter.py | Evelca1N/K-Spider | 46819bf93a9337cdf8adc410c6ddc4be29ee3b52 | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# -*- coding:utf-8 -*-
import mmh3
from bitarray import bitarray
from random import randint
| 24.741935 | 61 | 0.603651 | # !/usr/bin/env python
# -*- coding:utf-8 -*-
import mmh3
from bitarray import bitarray
from random import randint
class BloomFilter(object):
def __init__(self, size, hash_count=10):
self.size = size
self.hash_count = hash_count
self.bit_array = bitarray(size)
self.bit_array.set... | 539 | 5 | 104 |
6fd30eab7e53ff6e36257e7826cf9968c01b460b | 643 | py | Python | blog/admin.py | merveealpay/django-blog-project | 329c98e27878f0935079dd678e22d52934bbd5fa | [
"MIT"
] | null | null | null | blog/admin.py | merveealpay/django-blog-project | 329c98e27878f0935079dd678e22d52934bbd5fa | [
"MIT"
] | null | null | null | blog/admin.py | merveealpay/django-blog-project | 329c98e27878f0935079dd678e22d52934bbd5fa | [
"MIT"
] | null | null | null | from django.contrib import admin
from blog.models import Category, Article, Comment, Contact
admin.site.register(Category)
@admin.register(Article)
@admin.register(Comment)
@admin.register(Contact)
| 21.433333 | 59 | 0.685848 | from django.contrib import admin
from blog.models import Category, Article, Comment, Contact
admin.site.register(Category)
@admin.register(Article)
class ArticleAdmin(admin.ModelAdmin):
search_fields = ('title', 'detail')
list_display = (
'title', 'created_date', 'updated_date'
)
@admin.regist... | 0 | 371 | 66 |
38f3b118b2b2654ddc2dbaaf8212132874bca3ba | 326 | py | Python | Server/model/account.py | Nerd-Bear/My-Own-Flask-Baseline | f7b6cb8b055e193ed59359a50e9c060a7bc06961 | [
"MIT"
] | 3 | 2018-11-23T16:53:31.000Z | 2019-07-15T07:36:50.000Z | Server/model/account.py | Nerd-Bear/My-Own-Flask-Baseline | f7b6cb8b055e193ed59359a50e9c060a7bc06961 | [
"MIT"
] | null | null | null | Server/model/account.py | Nerd-Bear/My-Own-Flask-Baseline | f7b6cb8b055e193ed59359a50e9c060a7bc06961 | [
"MIT"
] | null | null | null | from model import *
| 17.157895 | 63 | 0.51227 | from model import *
class AccountModel(Document):
id = StringField(
primary_key=True,
min_length=5,
max_length=20
)
password = StringField(
required=True
)
email = StringField(
required=True,
regex='^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$'
... | 0 | 282 | 23 |
863ef8ba5469921007e2897540124b46f724bbee | 6,881 | py | Python | src/openprocurement/tender/belowthreshold/views/complaint.py | scrubele/prozorro-testing | 42b93ea2f25d8cc40e66c596f582c7c05e2a9d76 | [
"Apache-2.0"
] | null | null | null | src/openprocurement/tender/belowthreshold/views/complaint.py | scrubele/prozorro-testing | 42b93ea2f25d8cc40e66c596f582c7c05e2a9d76 | [
"Apache-2.0"
] | 2 | 2021-03-25T23:27:04.000Z | 2022-03-21T22:18:15.000Z | src/openprocurement/tender/belowthreshold/views/complaint.py | scrubele/prozorro-testing | 42b93ea2f25d8cc40e66c596f582c7c05e2a9d76 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from openprocurement.api.utils import (
get_now,
context_unpack,
json_view,
set_ownership,
APIResource,
raise_operation_error,
)
from openprocurement.tender.core.utils import save_tender, optendersresource, apply_patch
from openprocurement.tender.core.validation import ... | 42.475309 | 120 | 0.630868 | # -*- coding: utf-8 -*-
from openprocurement.api.utils import (
get_now,
context_unpack,
json_view,
set_ownership,
APIResource,
raise_operation_error,
)
from openprocurement.tender.core.utils import save_tender, optendersresource, apply_patch
from openprocurement.tender.core.validation import ... | 0 | 5,907 | 22 |
dc14991dde177550bbf73612330296c1bd379e72 | 1,222 | py | Python | experiment_materials/makekanaforsoundfiles.py | BonnieMcLean/IconicityMeasuresJaponic | 6ce51a940f9e35e9566852931a9912895a0620fd | [
"MIT"
] | null | null | null | experiment_materials/makekanaforsoundfiles.py | BonnieMcLean/IconicityMeasuresJaponic | 6ce51a940f9e35e9566852931a9912895a0620fd | [
"MIT"
] | 1 | 2022-03-07T14:41:25.000Z | 2022-03-07T14:41:25.000Z | experiment_materials/makekanaforsoundfiles.py | BonnieMcLean/IconicityMeasuresJaponic | 6ce51a940f9e35e9566852931a9912895a0620fd | [
"MIT"
] | null | null | null | import wanakana
import csv
| 29.095238 | 75 | 0.546645 | import wanakana
import csv
def add_kana(file,column):
romaji_dict={}
with open("romajimappings.csv","r",encoding="UTF-8") as infile:
reader=csv.DictReader(infile)
for row in reader:
letter=row["letter"]
romaji=row["romaji"]
romaji_dict[letter]=romaji
... | 1,160 | 0 | 23 |
38513c7f6fd3fe420244a1fa9cb8c63ec78dcfe0 | 626 | py | Python | src/Prototype/Model/Powerups.py | qw33ha/T-Rex_Acceleration | 491de89a6e532ac0cbda611a0ed3dd18fd858d11 | [
"BSD-3-Clause"
] | 2 | 2021-06-02T05:52:23.000Z | 2021-07-12T05:56:49.000Z | src/Prototype/Model/Powerups.py | qw33ha/T-Rex_Acceleration | 491de89a6e532ac0cbda611a0ed3dd18fd858d11 | [
"BSD-3-Clause"
] | null | null | null | src/Prototype/Model/Powerups.py | qw33ha/T-Rex_Acceleration | 491de89a6e532ac0cbda611a0ed3dd18fd858d11 | [
"BSD-3-Clause"
] | null | null | null | import pygame
| 36.823529 | 95 | 0.640575 | import pygame
class Powerups(pygame.sprite.Sprite):
def __init__(self, screen):
pygame.sprite.Sprite.__init__(self)
self.screen = screen
self.image = pygame.transform.scale(pygame.image.load('../images/Power.png'), (50, 50))
self.rect = self.image.get_rect()
self.screen_rec... | 494 | 16 | 102 |
fa1b454254d0e70f5214b69b38bbe0b2508f6432 | 3,064 | py | Python | tests/tests.py | CetusGroup/csiface-css | 337c12c36518cb0f299981fcf8c2eff5ea2c40f2 | [
"MIT"
] | null | null | null | tests/tests.py | CetusGroup/csiface-css | 337c12c36518cb0f299981fcf8c2eff5ea2c40f2 | [
"MIT"
] | null | null | null | tests/tests.py | CetusGroup/csiface-css | 337c12c36518cb0f299981fcf8c2eff5ea2c40f2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from css import style
sm = style.CsStyleManager()
rules = sm.link(open('test.css').read())
p1 = P('paragraph1')
p2 = P('p2', p1, 'note')
a1 = A('a1', p2)
h2 = H2('caption', p1)
assert sm.calc(p1, rules) == {'color': 'red', 'font-family': None, u'margin': u'0'}
assert sm.calc(p2, rules) =... | 40.315789 | 163 | 0.710183 | # -*- coding: utf-8 -*-
from css import style
class Widget:
def __init__(self, name, parent=None, styleClass=None):
self._name = name
self._parent = parent
self._styleClass = styleClass
self._styles = {
'color': 'red'
}
self._children = {}
if self._parent is not None:
self._parent._children[sel... | 619 | -22 | 192 |
425be3376840f22add453a8e8e6abef0a4bd7256 | 3,532 | py | Python | tests/unit/extended_datastore_adapter/base.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | tests/unit/extended_datastore_adapter/base.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | tests/unit/extended_datastore_adapter/base.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | from collections import defaultdict
from typing import Any, Dict, List, Optional
from unittest import TestCase
from unittest.mock import MagicMock, patch
from openslides_backend.services.datastore.commands import GetManyRequest
from openslides_backend.services.datastore.extended_adapter import (
ExtendedDatastoreA... | 37.978495 | 96 | 0.64949 | from collections import defaultdict
from typing import Any, Dict, List, Optional
from unittest import TestCase
from unittest.mock import MagicMock, patch
from openslides_backend.services.datastore.commands import GetManyRequest
from openslides_backend.services.datastore.extended_adapter import (
ExtendedDatastoreA... | 1,879 | 1,151 | 23 |
6159e286e0a96a17bf880feed836071f19f88ad0 | 4,911 | py | Python | Bidirectional_interface/Haptics/API_Calls/main.py | medioman22/Bidirectional_Interface | e69f0c48f32ea122dec3a84db058a33786c666c5 | [
"MIT"
] | null | null | null | Bidirectional_interface/Haptics/API_Calls/main.py | medioman22/Bidirectional_Interface | e69f0c48f32ea122dec3a84db058a33786c666c5 | [
"MIT"
] | null | null | null | Bidirectional_interface/Haptics/API_Calls/main.py | medioman22/Bidirectional_Interface | e69f0c48f32ea122dec3a84db058a33786c666c5 | [
"MIT"
] | 1 | 2019-10-15T11:45:29.000Z | 2019-10-15T11:45:29.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import socket, struct
import select
import time
import json
import sys
import os
DISTANCE_THRESHOLD = 0.5
MAXIMUM_MOTOR_INPUT = 99
with_connection = True
if with_connection:
print("Establishing the connection to the BBG device...")
else:
print("Ignoring the conne... | 38.669291 | 149 | 0.580941 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import socket, struct
import select
import time
import json
import sys
import os
DISTANCE_THRESHOLD = 0.5
MAXIMUM_MOTOR_INPUT = 99
with_connection = True
if with_connection:
print("Establishing the connection to the BBG device...")
else:
print("Ignoring the conne... | 681 | 0 | 45 |
c499abc16299e6fad13f23666b92c1d0e117cdc4 | 2,693 | py | Python | ImageTracker/ImageTracker.py | Engin-Boot/transfer-images-s1b13 | 22e62c72669dc40d47854e7c6a01f2922fb1dc44 | [
"MIT"
] | null | null | null | ImageTracker/ImageTracker.py | Engin-Boot/transfer-images-s1b13 | 22e62c72669dc40d47854e7c6a01f2922fb1dc44 | [
"MIT"
] | null | null | null | ImageTracker/ImageTracker.py | Engin-Boot/transfer-images-s1b13 | 22e62c72669dc40d47854e7c6a01f2922fb1dc44 | [
"MIT"
] | null | null | null | import pandas as pd
import sys
import os
import csv
DiagnosisTrackerfilename="DiagnosisTracker.csv"
if __name__ == "__main__":
images_path=sys.argv[1] #Path of all images folder
check_new_file_and_update_in_csv(images_path) #check new image file and update in CSV
print("CSV File che... | 40.19403 | 121 | 0.715188 | import pandas as pd
import sys
import os
import csv
DiagnosisTrackerfilename="DiagnosisTracker.csv"
def addNewFileNameToCsv(DiagnosisTrackerfilename,new_file): #add new row(new Image File) to CSV
diagnosis_data=pd.read_csv(DiagnosisTrackerfilename)
new_row = {'ImageFileName': new_file, 'Status':'Diagnosis... | 2,097 | 0 | 115 |
abae56be0eebeedec60cc46207513515f49a0e80 | 222 | py | Python | pydash/apps.py | xx-tone/django-app-pydash | 4bd77dc263f68524e747e7e4954d5cfed2a87b77 | [
"MIT"
] | null | null | null | pydash/apps.py | xx-tone/django-app-pydash | 4bd77dc263f68524e747e7e4954d5cfed2a87b77 | [
"MIT"
] | 2 | 2020-06-05T21:36:23.000Z | 2021-06-10T21:37:18.000Z | pydash/apps.py | xx-tone/django-app-pydash | 4bd77dc263f68524e747e7e4954d5cfed2a87b77 | [
"MIT"
] | 1 | 2019-06-27T01:27:26.000Z | 2019-06-27T01:27:26.000Z | from __future__ import unicode_literals
from django.apps import AppConfig
| 20.181818 | 39 | 0.702703 | from __future__ import unicode_literals
from django.apps import AppConfig
class LocalAppConfig(AppConfig):
name = 'pydash'
def ready(self):
# from . import signals_handler
return super().ready()
| 66 | 58 | 23 |
50278fa7d5807066d0f84bbfd446836beb36cf8a | 8,474 | py | Python | tests/test_eshop.py | custom-components/sensor.nintendo_wishlis | 6709a5c1b6e323494e7449fa1ac24e61100fc302 | [
"Apache-2.0"
] | 13 | 2020-05-07T21:31:51.000Z | 2022-02-09T01:53:53.000Z | tests/test_eshop.py | custom-components/sensor.nintendo_wishlis | 6709a5c1b6e323494e7449fa1ac24e61100fc302 | [
"Apache-2.0"
] | 19 | 2019-07-24T08:10:06.000Z | 2022-02-05T04:09:34.000Z | tests/test_eshop.py | custom-components/sensor.nintendo_wishlis | 6709a5c1b6e323494e7449fa1ac24e61100fc302 | [
"Apache-2.0"
] | 5 | 2019-12-13T17:48:52.000Z | 2020-07-06T07:45:31.000Z | """Test the Eshop class."""
import pytest
from pytest_homeassistant_custom_component.async_mock import AsyncMock, Mock, patch
from custom_components.nintendo_wishlist.eshop import (
NO_BOX_ART_URL,
EShop,
get_percent_off,
)
@pytest.fixture
def client_mock():
"""Pytest fixture to mock the algoliasearc... | 29.22069 | 83 | 0.547439 | """Test the Eshop class."""
import pytest
from pytest_homeassistant_custom_component.async_mock import AsyncMock, Mock, patch
from custom_components.nintendo_wishlist.eshop import (
NO_BOX_ART_URL,
EShop,
get_percent_off,
)
@pytest.fixture
def client_mock():
"""Pytest fixture to mock the algoliasearc... | 0 | 0 | 0 |
e5062fbc947307a665c06082159a8fe9625082c4 | 250 | py | Python | src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedSwitchActivePtpDomain/cli/equal/golden_output2_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedSwitchActivePtpDomain/cli/equal/golden_output2_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedSwitchActivePtpDomain/cli/equal/golden_output2_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | expected_output = {
"domain_number":{
0:{
"message_event_ip_dscp":59,
"message_general_ip_dscp":47,
"profile_state":"disabled",
"profile_type":"DEFAULT",
"transport_method":"802.3"
}
}
}
| 20.833333 | 38 | 0.548 | expected_output = {
"domain_number":{
0:{
"message_event_ip_dscp":59,
"message_general_ip_dscp":47,
"profile_state":"disabled",
"profile_type":"DEFAULT",
"transport_method":"802.3"
}
}
}
| 0 | 0 | 0 |
6a8447b7bedbf2834f92c566ec43b25fea3dd9bc | 1,903 | py | Python | tests/test_PowerSpectrum.py | sambit-giri/21cmtools | 5a5977f918abdc80e8fa9470a58667b58441c20b | [
"MIT"
] | 11 | 2018-05-05T12:39:26.000Z | 2022-01-20T20:10:18.000Z | tests/test_PowerSpectrum.py | sambit-giri/21cmtools | 5a5977f918abdc80e8fa9470a58667b58441c20b | [
"MIT"
] | 11 | 2019-12-23T19:17:01.000Z | 2022-02-08T15:26:13.000Z | tests/test_PowerSpectrum.py | garrelt/tools21cm | ba6aa185ced0cd73263e5750df02d6a54a545a98 | [
"MIT"
] | 9 | 2018-03-20T07:24:30.000Z | 2022-03-22T07:22:12.000Z | import numpy as np
import tools21cm as t2c
box_dims = 200
dims = [128,128,128]
gauss = np.random.normal(loc=0., scale=1., size=dims)
kbins = 10
mubins = 2
def test_cross_power_spectrum_1d():
'''
With this test, cross_power_spectrum_nd and radial_average are also test.
'''
pp, kk = t2c.cross_power_spectrum_1... | 36.596154 | 133 | 0.686285 | import numpy as np
import tools21cm as t2c
box_dims = 200
dims = [128,128,128]
gauss = np.random.normal(loc=0., scale=1., size=dims)
kbins = 10
mubins = 2
def test_cross_power_spectrum_1d():
'''
With this test, cross_power_spectrum_nd and radial_average are also test.
'''
pp, kk = t2c.cross_power_spectrum_1... | 0 | 0 | 0 |
c36a63d30ae4a47f4f2b5a1b7a2a3f170c61ad20 | 4,286 | py | Python | python/graphics.py | msimms/LibMath | 21bfb3937fb88a0791abe233be23af53452e601d | [
"MIT"
] | 2 | 2019-03-19T15:02:01.000Z | 2020-11-21T00:37:54.000Z | python/graphics.py | msimms/LibMath | 21bfb3937fb88a0791abe233be23af53452e601d | [
"MIT"
] | null | null | null | python/graphics.py | msimms/LibMath | 21bfb3937fb88a0791abe233be23af53452e601d | [
"MIT"
] | 1 | 2019-05-10T07:15:04.000Z | 2019-05-10T07:15:04.000Z | # MIT License
#
# Copyright (c) 2019 Michael J Simms. 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 the rights
... | 41.211538 | 177 | 0.65189 | # MIT License
#
# Copyright (c) 2019 Michael J Simms. 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 the rights
... | 0 | 0 | 0 |
1edb498d62f0674425fa97e479ba4c580578d464 | 5,179 | py | Python | src/ocgis/test/test_360.py | doutriaux1/ocgis | 989573258e6fcbeeb8b92d66bf5f6a43a34c2662 | [
"BSD-3-Clause"
] | 1 | 2016-09-08T14:35:44.000Z | 2016-09-08T14:35:44.000Z | src/ocgis/test/test_360.py | doutriaux1/ocgis | 989573258e6fcbeeb8b92d66bf5f6a43a34c2662 | [
"BSD-3-Clause"
] | null | null | null | src/ocgis/test/test_360.py | doutriaux1/ocgis | 989573258e6fcbeeb8b92d66bf5f6a43a34c2662 | [
"BSD-3-Clause"
] | null | null | null | import unittest
from datetime import datetime
import numpy as np
import netCDF4 as nc
from ocgis.api.operations import OcgOperations
from ocgis.util.shp_cabinet import ShpCabinet
from shapely.geometry.polygon import Polygon
from ocgis import env
from ocgis.api.interpreter import OcgInterpreter
from ocgis.util.inspect i... | 34.072368 | 117 | 0.609577 | import unittest
from datetime import datetime
import numpy as np
import netCDF4 as nc
from ocgis.api.operations import OcgOperations
from ocgis.util.shp_cabinet import ShpCabinet
from shapely.geometry.polygon import Polygon
from ocgis import env
from ocgis.api.interpreter import OcgInterpreter
from ocgis.util.inspect i... | 4,151 | 541 | 46 |
541d67c02ef185c6f0b1dcfe69e55e727b375a73 | 9,837 | py | Python | comma/comma.py | zbanks/comma | 75f77d659a47a777b6790b2e47114a0355bbf0cc | [
"MIT"
] | 1 | 2020-06-15T02:22:14.000Z | 2020-06-15T02:22:14.000Z | comma/comma.py | zbanks/comma | 75f77d659a47a777b6790b2e47114a0355bbf0cc | [
"MIT"
] | null | null | null | comma/comma.py | zbanks/comma | 75f77d659a47a777b6790b2e47114a0355bbf0cc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import csv
import datetime
import os
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
__all__ = ("CommaDialect", "CommaRow", "Comma", "make_backup")
#__slots__ = ("row", "header", "header_dict", "parsers", "serializers")
| 36.568773 | 145 | 0.600183 | #!/usr/bin/env python
import csv
import datetime
import os
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
__all__ = ("CommaDialect", "CommaRow", "Comma", "make_backup")
class CommaDialect(csv.Dialect):
delimiter = ","
doublequote = True
escapechar = None
line... | 8,672 | 542 | 334 |
536e69b7f446e2d85d7b4c89a09698724694f79e | 965 | py | Python | logger.py | andyts93/plex-coming-soon | f7d83f2bf6d41675af4e772dcb2cecf545d9e3ba | [
"MIT"
] | 1 | 2020-03-17T22:54:43.000Z | 2020-03-17T22:54:43.000Z | logger.py | andyts93/plex-coming-soon | f7d83f2bf6d41675af4e772dcb2cecf545d9e3ba | [
"MIT"
] | 1 | 2020-05-05T21:38:38.000Z | 2020-05-18T10:43:27.000Z | logger.py | andyts93/plex-coming-soon | f7d83f2bf6d41675af4e772dcb2cecf545d9e3ba | [
"MIT"
] | null | null | null | import logging
import sys
import os
from logging.handlers import TimedRotatingFileHandler
LOG_FILE_NAME = os.path.dirname(__file__)+'/logs/log.log'
# set up formatting
formatter = logging.Formatter('[%(asctime)s] %(levelname)s (%(process)d) %(module)s:%(lineno)d %(message)s')
# set up logging to STDOUT for... | 29.242424 | 109 | 0.75544 | import logging
import sys
import os
from logging.handlers import TimedRotatingFileHandler
LOG_FILE_NAME = os.path.dirname(__file__)+'/logs/log.log'
# set up formatting
formatter = logging.Formatter('[%(asctime)s] %(levelname)s (%(process)d) %(module)s:%(lineno)d %(message)s')
# set up logging to STDOUT for... | 0 | 0 | 0 |
50be1ef4606cc232b810a0ddef2863b57c98abfa | 8,832 | py | Python | turbo_patreon.py | ffsit/turbo-sticks | 7914ae115e46cc714322fee3334febed2b8406ed | [
"BSD-2-Clause"
] | null | null | null | turbo_patreon.py | ffsit/turbo-sticks | 7914ae115e46cc714322fee3334febed2b8406ed | [
"BSD-2-Clause"
] | null | null | null | turbo_patreon.py | ffsit/turbo-sticks | 7914ae115e46cc714322fee3334febed2b8406ed | [
"BSD-2-Clause"
] | 1 | 2020-06-05T19:02:06.000Z | 2020-06-05T19:02:06.000Z | import sys
import json
from time import time
from requests_oauthlib import OAuth2Session
from collections import OrderedDict
# Local Imports
import turbo_config as config
import turbo_util as util
from turbo_db import DBSession
this = sys.modules[__name__]
# TODO: change this into a TempSessionClerk that gets shared... | 33.581749 | 79 | 0.543591 | import sys
import json
from time import time
from requests_oauthlib import OAuth2Session
from collections import OrderedDict
# Local Imports
import turbo_config as config
import turbo_util as util
from turbo_db import DBSession
this = sys.modules[__name__]
# TODO: change this into a TempSessionClerk that gets shared... | 7,658 | 0 | 246 |
b7561fa0056e56ce010b9ea1bb66620bbaaae11f | 2,971 | py | Python | tests/test_checks.py | peara/cert-verifier | 5f9428732a5c662a7e5b3fe4d62975f5ea49dfd6 | [
"MIT"
] | 46 | 2016-10-12T22:27:06.000Z | 2022-01-18T23:06:06.000Z | tests/test_checks.py | BlockCertsSmartContract/cert-verifier | ead034183cde31e34890bdd883668749c56c2351 | [
"MIT"
] | 11 | 2016-09-28T04:55:32.000Z | 2021-01-30T13:07:23.000Z | tests/test_checks.py | BlockCertsSmartContract/cert-verifier | ead034183cde31e34890bdd883668749c56c2351 | [
"MIT"
] | 63 | 2016-11-14T20:29:22.000Z | 2021-12-15T07:47:47.000Z | import unittest
from cert_core import to_certificate_model
from mock import Mock
from cert_verifier.checks import *
if __name__ == '__main__':
unittest.main()
| 36.679012 | 103 | 0.708179 | import unittest
from cert_core import to_certificate_model
from mock import Mock
from cert_verifier.checks import *
class TestVerify(unittest.TestCase):
def test_compare_hashes_v1_1(self):
content_to_verify = '{"abc123": true}'.encode('utf-8')
mock_transaction = Mock()
mock_transaction.... | 2,522 | 15 | 266 |
304daaea4e0fa0929d162b799df320ca30bff23c | 87 | py | Python | weather/admin.py | BurhanH/weather-app | 9c523db9603f84e3760e020e4464f752fd27dd58 | [
"MIT"
] | null | null | null | weather/admin.py | BurhanH/weather-app | 9c523db9603f84e3760e020e4464f752fd27dd58 | [
"MIT"
] | null | null | null | weather/admin.py | BurhanH/weather-app | 9c523db9603f84e3760e020e4464f752fd27dd58 | [
"MIT"
] | 2 | 2019-06-16T23:35:17.000Z | 2020-07-13T20:07:34.000Z | from django.contrib import admin
from . models import City
admin.site.register(City)
| 14.5 | 32 | 0.793103 | from django.contrib import admin
from . models import City
admin.site.register(City)
| 0 | 0 | 0 |
64508448d2a65ed05c71e29420557e78cb644ef8 | 5,045 | py | Python | sw/python-wrapper/main.py | JakubAndrysek/E-paper-board-ESP32 | 538febf9775d31835b9f2fa61cd37ae120238fce | [
"MIT"
] | null | null | null | sw/python-wrapper/main.py | JakubAndrysek/E-paper-board-ESP32 | 538febf9775d31835b9f2fa61cd37ae120238fce | [
"MIT"
] | null | null | null | sw/python-wrapper/main.py | JakubAndrysek/E-paper-board-ESP32 | 538febf9775d31835b9f2fa61cd37ae120238fce | [
"MIT"
] | null | null | null | import json
from flask import Flask, request, abort
from dotenv import dotenv_values
from skola_online import SkolaOnline
from fablab import Fablab
from salina import Salina
from alojz import Alojz
from functools import wraps
import datetime
import time
from pprint import *
app = Flask(__name__)
# file .env
# USERNAM... | 28.027778 | 116 | 0.650545 | import json
from flask import Flask, request, abort
from dotenv import dotenv_values
from skola_online import SkolaOnline
from fablab import Fablab
from salina import Salina
from alojz import Alojz
from functools import wraps
import datetime
import time
from pprint import *
app = Flask(__name__)
# file .env
# USERNAM... | 1,478 | 0 | 111 |
697d38f2b023ea3a7919b7118d68ade373d8ec7f | 521 | py | Python | linux_syscallmd/model.py | shdnx/linux-syscallmd | ef95bbe9111cf13c11497b3e8d600d50d79646fd | [
"BSD-3-Clause"
] | null | null | null | linux_syscallmd/model.py | shdnx/linux-syscallmd | ef95bbe9111cf13c11497b3e8d600d50d79646fd | [
"BSD-3-Clause"
] | null | null | null | linux_syscallmd/model.py | shdnx/linux-syscallmd | ef95bbe9111cf13c11497b3e8d600d50d79646fd | [
"BSD-3-Clause"
] | null | null | null | from typing import List, NamedTuple
| 18.607143 | 41 | 0.696737 | from typing import List, NamedTuple
class SystemCallParameter(NamedTuple):
name: str
type: str
@property
def is_anonymous(self) -> bool:
return self.name is None
@property
def is_user_pointer(self) -> bool:
return self.type.endswith("__user *")
class SystemCall(NamedTuple):
name: str
return... | 169 | 269 | 46 |
4b2d42d6679543a895f48efa4b6af7356faffb48 | 2,298 | py | Python | epytope/Data/pssms/smmpmbec/mat/A_26_02_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/smmpmbec/mat/A_26_02_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/smmpmbec/mat/A_26_02_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | A_26_02_9 = {0: {'A': 0.109, 'C': -0.186, 'E': -0.694, 'D': -0.616, 'G': 0.238, 'F': -0.231, 'I': 0.156, 'H': -0.098, 'K': 0.739, 'M': -0.153, 'L': 0.27, 'N': -0.117, 'Q': 0.048, 'P': 0.109, 'S': -0.019, 'R': 0.694, 'T': -0.034, 'W': -0.351, 'V': 0.229, 'Y': -0.093}, 1: {'A': -0.866, 'C': 0.214, 'E': 0.5, 'D': 0.294, '... | 2,298 | 2,298 | 0.394691 | A_26_02_9 = {0: {'A': 0.109, 'C': -0.186, 'E': -0.694, 'D': -0.616, 'G': 0.238, 'F': -0.231, 'I': 0.156, 'H': -0.098, 'K': 0.739, 'M': -0.153, 'L': 0.27, 'N': -0.117, 'Q': 0.048, 'P': 0.109, 'S': -0.019, 'R': 0.694, 'T': -0.034, 'W': -0.351, 'V': 0.229, 'Y': -0.093}, 1: {'A': -0.866, 'C': 0.214, 'E': 0.5, 'D': 0.294, '... | 0 | 0 | 0 |
1f88283e3c5cc65506bbed46a83762a847d33d81 | 7,531 | py | Python | lib/model/repn/relpn_target_layer.py | brbzjl/my_graph_rcnn | a758ca9ab837df70ff5a6c1ce0ac901afcbef24e | [
"MIT"
] | 4 | 2019-06-04T11:03:39.000Z | 2019-12-24T08:46:41.000Z | lib/model/repn/relpn_target_layer.py | brbzjl/my_graph_rcnn | a758ca9ab837df70ff5a6c1ce0ac901afcbef24e | [
"MIT"
] | 2 | 2019-06-11T12:21:43.000Z | 2020-09-01T04:08:12.000Z | lib/model/repn/relpn_target_layer.py | brbzjl/my_graph_rcnn | a758ca9ab837df70ff5a6c1ce0ac901afcbef24e | [
"MIT"
] | 1 | 2019-12-24T08:46:44.000Z | 2019-12-24T08:46:44.000Z | # --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Sean Bell
# --------------------------------------------------------
# ------------------------------------------------------... | 44.827381 | 126 | 0.609481 | # --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Sean Bell
# --------------------------------------------------------
# ------------------------------------------------------... | 1,967 | 0 | 54 |
73ce5db01b6dfade0f9838137e60fbeb7db3fad4 | 19,966 | py | Python | pli/objutils.py | flynx/pli | 805234daba05d21698123883fabf4a877f2af8c1 | [
"BSD-3-Clause"
] | 1 | 2016-05-08T06:29:25.000Z | 2016-05-08T06:29:25.000Z | pli/objutils.py | flynx/pli | 805234daba05d21698123883fabf4a877f2af8c1 | [
"BSD-3-Clause"
] | null | null | null | pli/objutils.py | flynx/pli | 805234daba05d21698123883fabf4a877f2af8c1 | [
"BSD-3-Clause"
] | null | null | null | #=======================================================================
__version__ = '''0.0.22'''
__sub_version__ = '''20120704184132'''
__copyright__ = '''(c) Alex A. Naanou 2003-2008'''
#-----------------------------------------------------------------------
import types
import new
import sys
#---------------... | 31.641838 | 146 | 0.630221 | #=======================================================================
__version__ = '''0.0.22'''
__sub_version__ = '''20120704184132'''
__copyright__ = '''(c) Alex A. Naanou 2003-2008'''
#-----------------------------------------------------------------------
import types
import new
import sys
#---------------... | 3,757 | 0 | 256 |
e70ee3dd32583e25714a280f91b4da7f0dce0f08 | 9,887 | py | Python | sdks/python/.tox/py27gcp/lib/python2.7/site-packages/google/oauth2/flow.py | YYTVicky/kafka | b0f3eb276fa034b215570cd4f837851d9fb9166a | [
"Apache-2.0"
] | 35 | 2016-09-22T22:53:14.000Z | 2020-02-13T15:12:21.000Z | sdks/python/.tox/py27gcp/lib/python2.7/site-packages/google/oauth2/flow.py | axbaretto/presto | f137d2709db42b5c3e4d43a631832a8f74853065 | [
"Apache-2.0"
] | 28 | 2020-03-04T22:01:48.000Z | 2022-03-12T00:59:47.000Z | sdks/python/.tox/py27gcp/lib/python2.7/site-packages/google/oauth2/flow.py | axbaretto/presto | f137d2709db42b5c3e4d43a631832a8f74853065 | [
"Apache-2.0"
] | 88 | 2016-11-27T02:16:11.000Z | 2020-02-28T05:10:26.000Z | # Copyright 2016 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,... | 38.173745 | 79 | 0.658238 | # Copyright 2016 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,... | 57 | 0 | 26 |
03b7001fe0f5ae5469adaaa86f3e9d4ac2b49d88 | 2,429 | py | Python | Day 48 - Cookie Clicker Game/main.py | atulmkamble/100DaysOfCode | ccfb6cb8582be69c63c666a3b097e0130585e4c9 | [
"MIT"
] | 2 | 2021-12-07T00:39:57.000Z | 2021-12-07T01:44:21.000Z | Day 48 - Cookie Clicker Game/main.py | atulmkamble/100DaysOfCode | ccfb6cb8582be69c63c666a3b097e0130585e4c9 | [
"MIT"
] | null | null | null | Day 48 - Cookie Clicker Game/main.py | atulmkamble/100DaysOfCode | ccfb6cb8582be69c63c666a3b097e0130585e4c9 | [
"MIT"
] | 1 | 2021-09-12T14:02:27.000Z | 2021-09-12T14:02:27.000Z | """
This program plays the cookie clicker game in an aoutmated way using the Selenium Webdriver Browser
"""
# Import required libraries
from selenium import webdriver
from time import time
if __name__ == '__main__':
main()
| 33.273973 | 112 | 0.61548 | """
This program plays the cookie clicker game in an aoutmated way using the Selenium Webdriver Browser
"""
# Import required libraries
from selenium import webdriver
from time import time
def main():
chrome_driver_path = 'C:/Development/chromedriver.exe' # TODO: Download the driver and use your folder path
... | 2,175 | 0 | 23 |
4d427057d4a5cf2d3900052cee6fe7eec179a12c | 1,166 | py | Python | c2dh_nerd/ner/spacy.py | C2DH/c2dh_nerd | b0ff7649aa3d1e98c217c518d8f9a3d75870f6c0 | [
"MIT"
] | null | null | null | c2dh_nerd/ner/spacy.py | C2DH/c2dh_nerd | b0ff7649aa3d1e98c217c518d8f9a3d75870f6c0 | [
"MIT"
] | null | null | null | c2dh_nerd/ner/spacy.py | C2DH/c2dh_nerd | b0ff7649aa3d1e98c217c518d8f9a3d75870f6c0 | [
"MIT"
] | null | null | null |
from .ner import NER, TextOrSentences, text_to_sentences, sentences_to_text
from .result import NerResult, NerResultEntity
from .mapping import ONTONOTES_TO_WIKIPEDIA_LABEL_MAPPING
MODELS_MAPPING = {
'small_en': 'en_core_web_sm',
'small_multi': 'xx_ent_wiki_sm',
# 'large_en': 'en_core_web_lg'
}
| 31.513514 | 107 | 0.72813 |
from .ner import NER, TextOrSentences, text_to_sentences, sentences_to_text
from .result import NerResult, NerResultEntity
from .mapping import ONTONOTES_TO_WIKIPEDIA_LABEL_MAPPING
MODELS_MAPPING = {
'small_en': 'en_core_web_sm',
'small_multi': 'xx_ent_wiki_sm',
# 'large_en': 'en_core_web_lg'
}
def as_ner_resu... | 742 | -1 | 120 |
33dcc4c47a3ca0f7d702a7d664fcf915b5370e6f | 2,976 | py | Python | pythonExcelReader/opencv-people-counter-master/raspberry.py | amirsaleh-salehzadeh/BehaveNet | 1dcdfa3d9efd022f29f37495be15f9657c5e7374 | [
"MIT"
] | 1 | 2019-03-06T13:45:23.000Z | 2019-03-06T13:45:23.000Z | pythonExcelReader/opencv-people-counter-master/raspberry.py | amirsaleh-salehzadeh/BehaveNet | 1dcdfa3d9efd022f29f37495be15f9657c5e7374 | [
"MIT"
] | null | null | null | pythonExcelReader/opencv-people-counter-master/raspberry.py | amirsaleh-salehzadeh/BehaveNet | 1dcdfa3d9efd022f29f37495be15f9657c5e7374 | [
"MIT"
] | 1 | 2019-12-19T15:12:53.000Z | 2019-12-19T15:12:53.000Z | import numpy as np
import time
import imutils
import cv2
from picamera.array import PiRGBArray
from picamera import PiCamera
avg = None
xvalues = list()
motion = list()
count1 = 0
count2 = 0
with PiCamera(resolution=(640,480), framerate=30) as camera:
with PiRGBArray(camera, size=(640,480)) as rawCapture:
... | 35.855422 | 113 | 0.510081 | import numpy as np
import time
import imutils
import cv2
from picamera.array import PiRGBArray
from picamera import PiCamera
avg = None
xvalues = list()
motion = list()
count1 = 0
count2 = 0
def find_majority(k):
myMap = {}
maximum = ( '', 0 ) # (occurring element, occurrences)
for n in k:
if n in ... | 274 | 0 | 22 |
88a8511449d166aa00e31f502f264b20d8a22a86 | 5,735 | py | Python | LeeftijdsgroepenLandelijk.py | Corona-Locator-Nederland/corona-locator-nederland | 82727736a38894644843c548265fec3df6b52643 | [
"MIT"
] | null | null | null | LeeftijdsgroepenLandelijk.py | Corona-Locator-Nederland/corona-locator-nederland | 82727736a38894644843c548265fec3df6b52643 | [
"MIT"
] | null | null | null | LeeftijdsgroepenLandelijk.py | Corona-Locator-Nederland/corona-locator-nederland | 82727736a38894644843c548265fec3df6b52643 | [
"MIT"
] | null | null | null | # %%
from IPython import get_ipython
from IPython.core.display import display
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
get_ipython().run_line_magic('run', 'setup')
# %% leeftijdsgroepen: download RIVM data
#leeftijdsgroepen = SimpleNamespace()
@run
# %% Do... | 40.964286 | 176 | 0.632781 | # %%
from IPython import get_ipython
from IPython.core.display import display
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
get_ipython().run_line_magic('run', 'setup')
# %% leeftijdsgroepen: download RIVM data
#leeftijdsgroepen = SimpleNamespace()
@run
def cell... | 4,840 | 0 | 66 |
2e625dee9eec0c360140b723a75d86df73abac32 | 4,005 | py | Python | code/login.py | MelMacD/CS_476_Project | d02ad06f449346c8ae0052961173ebc21592404a | [
"MIT"
] | null | null | null | code/login.py | MelMacD/CS_476_Project | d02ad06f449346c8ae0052961173ebc21592404a | [
"MIT"
] | null | null | null | code/login.py | MelMacD/CS_476_Project | d02ad06f449346c8ae0052961173ebc21592404a | [
"MIT"
] | null | null | null | from code import app
from flask import request, make_response, redirect
from code.database import Database as database
@app.route("/login", methods=['GET', 'POST'])
| 30.807692 | 202 | 0.611236 | from code import app
from flask import request, make_response, redirect
from code.database import Database as database
class Login:
def __init__(self):
self.html = ""
def getHTML(self):
return self.html
def setHTML(self, message):
self.html = """
<!DOCTYPE html>
<html ... | 3,710 | -9 | 138 |
bd52b8ca37efd0230e66a9a874bd7d3e4d4b4e83 | 6,422 | py | Python | etcd_watcher/etcd_client.py | tony-yin/etcd_watcher | 452a68d15ca38b7a572870cfef7a25c5035808b7 | [
"MIT"
] | 4 | 2019-08-23T11:30:00.000Z | 2020-06-15T00:44:00.000Z | etcd_watcher/etcd_client.py | aland-zhang/etcd_watcher | 452a68d15ca38b7a572870cfef7a25c5035808b7 | [
"MIT"
] | 1 | 2021-11-15T17:48:58.000Z | 2021-11-15T17:48:58.000Z | etcd_watcher/etcd_client.py | aland-zhang/etcd_watcher | 452a68d15ca38b7a572870cfef7a25c5035808b7 | [
"MIT"
] | 1 | 2020-07-10T03:46:01.000Z | 2020-07-10T03:46:01.000Z | import sys
import etcd
import traceback
from log import get_logger
logger = get_logger(__name__, '/var/log/etcd_watcher.log')
if __name__ == "__main__":
try:
args = sys.argv
logger.info("etcd client args: {}".format(str(args)))
if len(args) < 2:
logger.error("Invalid parame... | 32.933333 | 77 | 0.541732 | import sys
import etcd
import traceback
from log import get_logger
logger = get_logger(__name__, '/var/log/etcd_watcher.log')
class EtcdClient(object):
def __init__(self):
self.hostname = get_hostname()
self.connect()
self.ttl = 60
self.store_dir = '/etcd_watcher'
self.mas... | 4,199 | 4 | 369 |
bc1ce66b367f6a0de981e7f173abc81e14af0dc1 | 482 | py | Python | ocha/libs/scp_utils.py | Blesproject/GENERATOR | a56c6ee6086dcd268bd021355131f0c23508b12d | [
"MIT"
] | 1 | 2019-01-27T16:32:24.000Z | 2019-01-27T16:32:24.000Z | ocha/libs/scp_utils.py | Blesproject/GENERATOR | a56c6ee6086dcd268bd021355131f0c23508b12d | [
"MIT"
] | 5 | 2020-03-24T16:41:48.000Z | 2021-04-30T20:45:32.000Z | ocha/libs/scp_utils.py | hammer-code/ocha-cli | bd066318ddebfaaa7c30d8bff997e2b111400001 | [
"MIT"
] | null | null | null | import paramiko
import os
from ocha.libs import utils
CURR_DIR = os.getcwd()
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
| 21.909091 | 71 | 0.724066 | import paramiko
import os
from ocha.libs import utils
CURR_DIR = os.getcwd()
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
def ssh_connect(host, username, key_filename=None):
try:
ssh.connect(host, username=username, key_filename=key_filename)
except Exception ... | 271 | 0 | 46 |
d0acb10e66ad224fd4c8a1fa5346abef03cc290e | 2,348 | py | Python | model_training/04_clean_others.py | linsalrob/PhANNs | ba96a57226ea811fd5a284170367547cd35f9c03 | [
"MIT"
] | 10 | 2020-07-16T16:26:23.000Z | 2022-02-25T13:59:16.000Z | model_training/04_clean_others.py | linsalrob/PhANNs | ba96a57226ea811fd5a284170367547cd35f9c03 | [
"MIT"
] | 8 | 2020-08-26T16:08:39.000Z | 2022-02-23T20:36:25.000Z | model_training/04_clean_others.py | linsalrob/PhANNs | ba96a57226ea811fd5a284170367547cd35f9c03 | [
"MIT"
] | 3 | 2019-12-11T00:36:57.000Z | 2021-07-23T01:00:45.000Z | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# --... | 35.044776 | 314 | 0.704003 | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# --... | 0 | 0 | 0 |
b10915282524ed32b82e2a2ce9dc5e9938f27e41 | 3,845 | py | Python | Blender/RT_ParticleExporter/ParticleExporter_UI.py | rectdev/BlenderToUnityParticleTransfer | 134536d9997c5e7a16a64ce98f0e559667fe1be3 | [
"MIT"
] | null | null | null | Blender/RT_ParticleExporter/ParticleExporter_UI.py | rectdev/BlenderToUnityParticleTransfer | 134536d9997c5e7a16a64ce98f0e559667fe1be3 | [
"MIT"
] | null | null | null | Blender/RT_ParticleExporter/ParticleExporter_UI.py | rectdev/BlenderToUnityParticleTransfer | 134536d9997c5e7a16a64ce98f0e559667fe1be3 | [
"MIT"
] | null | null | null | import bpy
import sys
import os
dir = os.path.dirname(bpy.data.filepath)
if not dir in sys.path:
sys.path.append(dir)
from RT_ParticleExporter.ParticleExporter import ParticleExporter
classes = [
PEProperties,
PEXPORT_PT_main_panel,
PEXPORT_OT_Export,
PEXPORT_OT_GetParticles,
]
if __name_... | 29.806202 | 108 | 0.677503 | import bpy
import sys
import os
dir = os.path.dirname(bpy.data.filepath)
if not dir in sys.path:
sys.path.append(dir)
from RT_ParticleExporter.ParticleExporter import ParticleExporter
class PEProperties(bpy.types.PropertyGroup):
ps_container: bpy.props.PointerProperty(name="Particle System", type=bpy.types.O... | 2,173 | 1,183 | 138 |
a4251c914a7e28aea0e91ee1dcd72b9af8e4b7d1 | 5,393 | py | Python | pyjiffy/jiffy/storage/replica_chain_client.py | charles-typ/jiffy | 21803d74af8fff3c4d001e7533ba264dc531e792 | [
"Apache-2.0"
] | 10 | 2021-03-04T07:23:24.000Z | 2022-03-26T07:36:00.000Z | pyjiffy/jiffy/storage/replica_chain_client.py | charles-typ/jiffy | 21803d74af8fff3c4d001e7533ba264dc531e792 | [
"Apache-2.0"
] | 1 | 2021-03-12T15:20:03.000Z | 2021-03-12T15:20:03.000Z | pyjiffy/jiffy/storage/replica_chain_client.py | charles-typ/jiffy | 21803d74af8fff3c4d001e7533ba264dc531e792 | [
"Apache-2.0"
] | 7 | 2021-03-12T05:46:15.000Z | 2022-02-14T07:08:01.000Z | import logging
import socket
from thrift.transport.TTransport import TTransportException
from jiffy.directory.directory_client import ReplicaChain
from jiffy.directory.ttypes import rpc_replica_chain
from jiffy.storage import block_request_service
from jiffy.storage.block_client import BlockClient
from jiffy.storage.... | 39.07971 | 110 | 0.586316 | import logging
import socket
from thrift.transport.TTransport import TTransportException
from jiffy.directory.directory_client import ReplicaChain
from jiffy.directory.ttypes import rpc_replica_chain
from jiffy.storage import block_request_service
from jiffy.storage.block_client import BlockClient
from jiffy.storage.... | 4,605 | 4 | 400 |
42e4f948a7de361821a41895fb05cdaab2a378c9 | 1,349 | py | Python | src/booze/util_test.py | slobberchops/booze | e7d5fc8f61ce0431d7a7180c7e62724c3b5fc39d | [
"Apache-2.0"
] | null | null | null | src/booze/util_test.py | slobberchops/booze | e7d5fc8f61ce0431d7a7180c7e62724c3b5fc39d | [
"Apache-2.0"
] | null | null | null | src/booze/util_test.py | slobberchops/booze | e7d5fc8f61ce0431d7a7180c7e62724c3b5fc39d | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Rafe Kaplan
#
# 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, soft... | 26.45098 | 74 | 0.684952 | # Copyright 2015 Rafe Kaplan
#
# 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, soft... | 533 | 53 | 100 |
f2539ff16147d9eb15dae25f80b5d0a85fe560f8 | 1,209 | py | Python | setup.py | ankitaliya/csv_db_package | 4c61a26132c7ce1de4440c1fc0ca6cf1ee39c0a3 | [
"MIT"
] | null | null | null | setup.py | ankitaliya/csv_db_package | 4c61a26132c7ce1de4440c1fc0ca6cf1ee39c0a3 | [
"MIT"
] | null | null | null | setup.py | ankitaliya/csv_db_package | 4c61a26132c7ce1de4440c1fc0ca6cf1ee39c0a3 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r", encoding="utf-8") as file:
long_description = file.read()
setuptools.setup(
name="csv_db_package",
version="0.0.3",
author="Ankita Liya",
author_email="ankitaliya321@gmail.com",
description="This package is found useful for those who wants to modif... | 39 | 115 | 0.661704 | import setuptools
with open("README.md", "r", encoding="utf-8") as file:
long_description = file.read()
setuptools.setup(
name="csv_db_package",
version="0.0.3",
author="Ankita Liya",
author_email="ankitaliya321@gmail.com",
description="This package is found useful for those who wants to modif... | 0 | 0 | 0 |
bde6a40044f20673c0be26b98b6cac3adc58bc61 | 2,429 | py | Python | Script.py | DAWOODSKYM/PYQT5 | c61f5f822ef464a9c56a0c6f3f516deff02b0078 | [
"MIT"
] | null | null | null | Script.py | DAWOODSKYM/PYQT5 | c61f5f822ef464a9c56a0c6f3f516deff02b0078 | [
"MIT"
] | null | null | null | Script.py | DAWOODSKYM/PYQT5 | c61f5f822ef464a9c56a0c6f3f516deff02b0078 | [
"MIT"
] | null | null | null | import PyQt5
from PyQt5 import QtWidgets, uic
from PyQt5.uic import loadUi
from PyQt5.QtWidgets import QApplication,QMainWindow,QDialog,QWidget
import arcpy
import os
import sys
app = QtWidgets.QApplication([])
win = MainPage()
win.show()
try:
sys.exit(app.exec())
except:
print("EXITING") | 47.627451 | 234 | 0.714286 | import PyQt5
from PyQt5 import QtWidgets, uic
from PyQt5.uic import loadUi
from PyQt5.QtWidgets import QApplication,QMainWindow,QDialog,QWidget
import arcpy
import os
import sys
class MainPage(QMainWindow):
def __init__(self):
super(MainPage,self).__init__()
loadUi("GUI_file.ui",self)
self.... | 1,985 | 7 | 122 |
67a3b50bacd054935a4c7e881b37392ffc85a9d8 | 1,506 | py | Python | quarrel/types/emoji.py | mrvillage/quarrel | 6a8ea9cbf714daedd1f2d84d7c84f3aad0e3b63d | [
"MIT"
] | 2 | 2022-01-26T02:30:29.000Z | 2022-01-26T03:24:10.000Z | quarrel/types/emoji.py | mrvillage/quarrel | 6a8ea9cbf714daedd1f2d84d7c84f3aad0e3b63d | [
"MIT"
] | null | null | null | quarrel/types/emoji.py | mrvillage/quarrel | 6a8ea9cbf714daedd1f2d84d7c84f3aad0e3b63d | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2021-present Village
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, mer... | 32.042553 | 75 | 0.77822 | """
The MIT License (MIT)
Copyright (c) 2021-present Village
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, mer... | 0 | 207 | 46 |
1459379a24d6cf8e20f46a9ab46fdb08276f7ae2 | 774 | py | Python | yoda_say/yoda_say.py | aenon/red | cb65b75f648698f63913b8b38ed7bafa33df6f4c | [
"BSD-3-Clause"
] | 1 | 2017-10-25T19:39:44.000Z | 2017-10-25T19:39:44.000Z | yoda_say/yoda_say.py | aenon/red | cb65b75f648698f63913b8b38ed7bafa33df6f4c | [
"BSD-3-Clause"
] | null | null | null | yoda_say/yoda_say.py | aenon/red | cb65b75f648698f63913b8b38ed7bafa33df6f4c | [
"BSD-3-Clause"
] | null | null | null | import discord
from discord.ext import commands
class yoda_say:
"""May the force be with you"""
@commands.command()
async def yoda_say(self, sentence):
""" Credit to Zenadix and muddyfish
source: https://codegolf.stackexchange.com/questions/68559/
a-yoda-speaking-challenge-this-is
... | 27.642857 | 67 | 0.516796 | import discord
from discord.ext import commands
class yoda_say:
"""May the force be with you"""
def __init__(self, bot):
self.bot = bot
@commands.command()
async def yoda_say(self, sentence):
""" Credit to Zenadix and muddyfish
source: https://codegolf.stackexchange.com/questi... | 51 | 0 | 50 |
10546e4fcc8399ee68a64c25bfd10e7e464e06f6 | 3,718 | py | Python | opencv_project_python-master/opencv_project_python-master/10.apdx/face_swap.py | dongrami0425/Python_OpenCV-Study | c7faee4f63720659280c3222ba5abfe27740d1f4 | [
"MIT"
] | null | null | null | opencv_project_python-master/opencv_project_python-master/10.apdx/face_swap.py | dongrami0425/Python_OpenCV-Study | c7faee4f63720659280c3222ba5abfe27740d1f4 | [
"MIT"
] | null | null | null | opencv_project_python-master/opencv_project_python-master/10.apdx/face_swap.py | dongrami0425/Python_OpenCV-Study | c7faee4f63720659280c3222ba5abfe27740d1f4 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import dlib
import sys
# 얼굴 검출기와 랜드마크 검출기 생성 --- ①
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor('./shape_predictor_68_face_landmarks.dat')
# 얼굴 및 랜드마크 검출해서 좌표 반환하는 함수 ---②
# 랜드마크 좌표로 들로네 삼각형 반환 ---③
# 삼각형 어핀 변환 함수 ---④
if __name__ == '__main__' :
# ... | 36.811881 | 80 | 0.561592 | import cv2
import numpy as np
import dlib
import sys
# 얼굴 검출기와 랜드마크 검출기 생성 --- ①
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor('./shape_predictor_68_face_landmarks.dat')
# 얼굴 및 랜드마크 검출해서 좌표 반환하는 함수 ---②
def getPoints(img):
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
rects = de... | 2,051 | 0 | 70 |
3969219adc6146502fe0b09f4f21e232407d2343 | 173 | py | Python | reddit_credentials.py | ablimdev/wsb-sentiment-analysis | fb0ac5ff27afd36db3644fb5dc366cf37e985cd3 | [
"MIT"
] | null | null | null | reddit_credentials.py | ablimdev/wsb-sentiment-analysis | fb0ac5ff27afd36db3644fb5dc366cf37e985cd3 | [
"MIT"
] | null | null | null | reddit_credentials.py | ablimdev/wsb-sentiment-analysis | fb0ac5ff27afd36db3644fb5dc366cf37e985cd3 | [
"MIT"
] | null | null | null | #input your own client info from
#reddit>user settings>privacy &security>manage third-party app authorization
CLIENT_ID = ""
CLIENT_SECRETS = ""
USER_AGENT = "" # any input | 34.6 | 76 | 0.763006 | #input your own client info from
#reddit>user settings>privacy &security>manage third-party app authorization
CLIENT_ID = ""
CLIENT_SECRETS = ""
USER_AGENT = "" # any input | 0 | 0 | 0 |
bf998bba6bef57b6f159ec1123d0433a4eca879b | 13,740 | py | Python | class-21-3-24/common/models/model.py | ZZh2333/PublicOpinionAnalysisandSocialComputing | cea79370183c3e0c2fdda4641f79309bd40ddb93 | [
"MIT"
] | 1 | 2021-03-28T05:57:30.000Z | 2021-03-28T05:57:30.000Z | class-21-3-24/common/models/model.py | ZZh2333/PublicOpinionAnalysisandSocialComputing | cea79370183c3e0c2fdda4641f79309bd40ddb93 | [
"MIT"
] | null | null | null | class-21-3-24/common/models/model.py | ZZh2333/PublicOpinionAnalysisandSocialComputing | cea79370183c3e0c2fdda4641f79309bd40ddb93 | [
"MIT"
] | null | null | null | # coding: utf-8
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
t_4sdian = db.Table(
'4sdian',
db.Column('id', db.Integer),
db.Column('loyalty', db.Float(asdecimal=True)),
db.Column('frequency', db.Integer),
db.Column('money', db.Float(asdecimal=True)),
db.Column('L', db.Text),
... | 35.688312 | 111 | 0.652183 | # coding: utf-8
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
t_4sdian = db.Table(
'4sdian',
db.Column('id', db.Integer),
db.Column('loyalty', db.Float(asdecimal=True)),
db.Column('frequency', db.Integer),
db.Column('money', db.Float(asdecimal=True)),
db.Column('L', db.Text),
... | 0 | 3,067 | 138 |
b70b69c228607bfe89975afa799dc396a96fd171 | 627 | py | Python | djaimes/machine-learning/discover.py | alexisperumal/ucsd_data_science_final_project | 91dbd79379e7e48bb35493bc8877f39ca17ed897 | [
"MIT"
] | 1 | 2020-05-03T04:44:01.000Z | 2020-05-03T04:44:01.000Z | djaimes/machine-learning/discover.py | gthompsonku/predicting_covid_with_bloodtest | b3590479eb341c6128976e95fd94aeb31dc4e7c9 | [
"MIT"
] | null | null | null | djaimes/machine-learning/discover.py | gthompsonku/predicting_covid_with_bloodtest | b3590479eb341c6128976e95fd94aeb31dc4e7c9 | [
"MIT"
] | 1 | 2021-09-29T23:27:26.000Z | 2021-09-29T23:27:26.000Z | import glob as gl
import pandas as pd
# Read original data
fname = 'diagnosis-of-covid-19-and-its-clinical-spectrum.csv'
path = gl.glob(f'../../**//**/{fname}')
df = pd.read_csv(path[0])
# Choose interesting columns and remove missing data
with open('data-columns.txt', 'r') as f:
colnames = f.read().splitlines()
df... | 28.5 | 62 | 0.695375 | import glob as gl
import pandas as pd
# Read original data
fname = 'diagnosis-of-covid-19-and-its-clinical-spectrum.csv'
path = gl.glob(f'../../**//**/{fname}')
df = pd.read_csv(path[0])
# Choose interesting columns and remove missing data
with open('data-columns.txt', 'r') as f:
colnames = f.read().splitlines()
df... | 0 | 0 | 0 |
93c40741eacb28fbc8a8e60f4c9b551e1a031bd7 | 885 | py | Python | vendor/iphone-dataprotection/python_scripts/crypto/aes.py | trailofbits/ios-integrity-validator | 2090e6321cd313493c6f3746866411d865cde6ab | [
"BSD-2-Clause"
] | 19 | 2019-04-27T15:09:22.000Z | 2022-03-27T14:06:15.000Z | vendor/iphone-dataprotection/python_scripts/crypto/aes.py | trailofbits/ios-integrity-validator | 2090e6321cd313493c6f3746866411d865cde6ab | [
"BSD-2-Clause"
] | null | null | null | vendor/iphone-dataprotection/python_scripts/crypto/aes.py | trailofbits/ios-integrity-validator | 2090e6321cd313493c6f3746866411d865cde6ab | [
"BSD-2-Clause"
] | 4 | 2020-11-10T19:23:01.000Z | 2022-02-25T02:10:19.000Z | from Crypto.Cipher import AES
ZEROIV = "\x00"*16
def removePadding(blocksize, s):
'Remove rfc 1423 padding from string.'
n = ord(s[-1]) # last byte contains number of padding bytes
if n > blocksize or n > len(s):
raise Exception('invalid padding')
return s[:-n]
| 32.777778 | 64 | 0.622599 | from Crypto.Cipher import AES
ZEROIV = "\x00"*16
def removePadding(blocksize, s):
'Remove rfc 1423 padding from string.'
n = ord(s[-1]) # last byte contains number of padding bytes
if n > blocksize or n > len(s):
raise Exception('invalid padding')
return s[:-n]
def AESdecryptCBC(da... | 537 | 0 | 50 |
820768b33f2100415e1aa5af7ba098a6637b64d8 | 292 | py | Python | setup.py | wizath/pysett | 6a9a4d3c5ae118e5bfcd1b5996e85a12b989138a | [
"MIT"
] | null | null | null | setup.py | wizath/pysett | 6a9a4d3c5ae118e5bfcd1b5996e85a12b989138a | [
"MIT"
] | null | null | null | setup.py | wizath/pysett | 6a9a4d3c5ae118e5bfcd1b5996e85a12b989138a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
setup(name='pysett',
version='0.1',
description='python xml setting parser',
author='wizath',
author_email='wm.goldio@gmail.com',
url='https://github.com/wizath/pysett',
packages=['pysett'],
)
| 22.461538 | 46 | 0.626712 | #!/usr/bin/env python
from distutils.core import setup
setup(name='pysett',
version='0.1',
description='python xml setting parser',
author='wizath',
author_email='wm.goldio@gmail.com',
url='https://github.com/wizath/pysett',
packages=['pysett'],
)
| 0 | 0 | 0 |
ba82cfd5430a825239e308f844fd0c8c20a80f0e | 201 | py | Python | metrics.py | shahrukhqasim/mlhep2018-starterkit | 67dd6c0426adf7cfa8a9fc8fce00c2098c11ebb2 | [
"Apache-2.0"
] | 6 | 2018-08-07T08:56:44.000Z | 2019-08-21T07:13:41.000Z | metrics.py | shahrukhqasim/mlhep2018-starterkit | 67dd6c0426adf7cfa8a9fc8fce00c2098c11ebb2 | [
"Apache-2.0"
] | null | null | null | metrics.py | shahrukhqasim/mlhep2018-starterkit | 67dd6c0426adf7cfa8a9fc8fce00c2098c11ebb2 | [
"Apache-2.0"
] | 10 | 2018-08-07T08:03:50.000Z | 2020-01-15T14:44:46.000Z | import numpy as np
| 18.272727 | 39 | 0.746269 | import numpy as np
def acc_at_80(accuraces):
return np.percentile(accuraces, 80)
def acc_at_50(accuraces):
return np.median(accuraces)
def acc_mean(accuraces):
return np.mean(accuraces)
| 113 | 0 | 69 |
2124b710d6ed0734ee590c8a84339148be1f5cec | 11,478 | py | Python | logpli.py | ghkonrad/logpli | 7ef7def5d01dac733855fbda1190ea2b85dbfe3d | [
"Apache-2.0"
] | null | null | null | logpli.py | ghkonrad/logpli | 7ef7def5d01dac733855fbda1190ea2b85dbfe3d | [
"Apache-2.0"
] | null | null | null | logpli.py | ghkonrad/logpli | 7ef7def5d01dac733855fbda1190ea2b85dbfe3d | [
"Apache-2.0"
] | 1 | 2020-10-07T09:38:17.000Z | 2020-10-07T09:38:17.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#############################################################################
# Copyright 2018 Konrad Sakowski, Stanislaw Krukowski, Pawel Strak
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | 31.105691 | 215 | 0.625545 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#############################################################################
# Copyright 2018 Konrad Sakowski, Stanislaw Krukowski, Pawel Strak
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | 7,871 | 0 | 206 |
bb376023cae707cb955c09c9084d7432877d7637 | 1,055 | py | Python | Packs/ML/Scripts/ImportMLModel/ImportMLModel_test.py | ddi-danielsantander/content | 67e2edc404f50c332d928dbdbce00a447bb5532f | [
"MIT"
] | 1 | 2021-08-07T00:21:58.000Z | 2021-08-07T00:21:58.000Z | Packs/ML/Scripts/ImportMLModel/ImportMLModel_test.py | ddi-danielsantander/content | 67e2edc404f50c332d928dbdbce00a447bb5532f | [
"MIT"
] | 14 | 2019-08-29T12:38:34.000Z | 2020-10-28T11:46:49.000Z | Packs/ML/Scripts/ImportMLModel/ImportMLModel_test.py | ddi-danielsantander/content | 67e2edc404f50c332d928dbdbce00a447bb5532f | [
"MIT"
] | 2 | 2020-10-11T18:01:32.000Z | 2020-10-14T03:21:23.000Z | from ImportMLModel import main
import demistomock as demisto
done = False
| 29.305556 | 81 | 0.647393 | from ImportMLModel import main
import demistomock as demisto
done = False
def test_main(mocker):
mocker.patch.object(demisto, 'args', return_value={
"entryID": 'id',
"modelName": 'model'
})
def get_file_path(entry_id):
return {'path': './TestData/entry_file'}
def execute_co... | 955 | 0 | 23 |
cf2f17aa286b83419fdc901a8bfd64ee01353fc8 | 4,049 | py | Python | tick.py | Mause/tuya_graphing | 8fa92b81ea01ca4253001179088054164e683b97 | [
"MIT"
] | null | null | null | tick.py | Mause/tuya_graphing | 8fa92b81ea01ca4253001179088054164e683b97 | [
"MIT"
] | null | null | null | tick.py | Mause/tuya_graphing | 8fa92b81ea01ca4253001179088054164e683b97 | [
"MIT"
] | null | null | null | import json
from datetime import date, datetime, timedelta
from typing import Any, Generator, Generic, List, Optional, TypeVar
import pandas as pd
import plotly.express as px
import tinytuya
from pydantic import BaseModel
from pydantic.generics import GenericModel
from pytemperature import f2c
from pytz import timezon... | 22.747191 | 80 | 0.568535 | import json
from datetime import date, datetime, timedelta
from typing import Any, Generator, Generic, List, Optional, TypeVar
import pandas as pd
import plotly.express as px
import tinytuya
from pydantic import BaseModel
from pydantic.generics import GenericModel
from pytemperature import f2c
from pytz import timezon... | 2,945 | 362 | 253 |
0a7d26b261e998232d98217b45d11837b1f00517 | 1,852 | py | Python | agilkia/__init__.py | PHILAE-PROJECT/agilkia | d54741fd7e4b1c965db9a9f87ffcbeec1c9a68ef | [
"MIT"
] | 1 | 2022-02-08T08:14:56.000Z | 2022-02-08T08:14:56.000Z | agilkia/__init__.py | PHILAE-PROJECT/agilkia | d54741fd7e4b1c965db9a9f87ffcbeec1c9a68ef | [
"MIT"
] | null | null | null | agilkia/__init__.py | PHILAE-PROJECT/agilkia | d54741fd7e4b1c965db9a9f87ffcbeec1c9a68ef | [
"MIT"
] | null | null | null | """Automated smart testing strategies for web services.
This 'agilkia' package is for testing web services and managing set of traces.
Traces may come from user interactions, or from automated test suites, etc.
The main data structure for traces is the ``TraceSet``:
* class TraceSet supports loading/saving traces as ... | 47.487179 | 88 | 0.739201 | """Automated smart testing strategies for web services.
This 'agilkia' package is for testing web services and managing set of traces.
Traces may come from user interactions, or from automated test suites, etc.
The main data structure for traces is the ``TraceSet``:
* class TraceSet supports loading/saving traces as ... | 0 | 0 | 0 |
0b684951bff3d1b0e1366910fe0bf5ea3653c67e | 170 | py | Python | simplecep/providers/default/__init__.py | cauethenorio/django-simplecep | acab8a99fe3df8c6a2f01909c07fa36b1ea2d922 | [
"MIT"
] | 3 | 2020-10-18T16:29:32.000Z | 2021-09-22T12:10:19.000Z | simplecep/providers/default/__init__.py | cauethenorio/django-simplecep | acab8a99fe3df8c6a2f01909c07fa36b1ea2d922 | [
"MIT"
] | 6 | 2019-11-26T01:18:43.000Z | 2022-02-10T12:50:16.000Z | simplecep/providers/default/__init__.py | cauethenorio/django-simplecep | acab8a99fe3df8c6a2f01909c07fa36b1ea2d922 | [
"MIT"
] | 1 | 2020-03-31T03:52:13.000Z | 2020-03-31T03:52:13.000Z | from .correios_sigep import CorreiosSIGEPCEPProvider # noqa
from .republicavirtual import RepublicaVirtualCEPProvider # noqa
from .viacep import ViaCEPProvider # noqa
| 42.5 | 65 | 0.841176 | from .correios_sigep import CorreiosSIGEPCEPProvider # noqa
from .republicavirtual import RepublicaVirtualCEPProvider # noqa
from .viacep import ViaCEPProvider # noqa
| 0 | 0 | 0 |
fe41c527540ce9dde0d5ef60d0ab0daf8852cebc | 22,419 | py | Python | api_tests/institutions/views/test_institution_relationship_nodes.py | laurenrevere/osf.io | f08daebf6ff280375ef966fdce4d3b6602c2236e | [
"Apache-2.0"
] | null | null | null | api_tests/institutions/views/test_institution_relationship_nodes.py | laurenrevere/osf.io | f08daebf6ff280375ef966fdce4d3b6602c2236e | [
"Apache-2.0"
] | 18 | 2020-03-24T16:16:14.000Z | 2022-03-03T22:37:48.000Z | api_tests/institutions/views/test_institution_relationship_nodes.py | kounoAkihiro/SV-RDM-OSF | 76fb0c739f4cdabf03b5bfd2bc63d83b1c2d4796 | [
"Apache-2.0"
] | 1 | 2021-10-04T21:16:56.000Z | 2021-10-04T21:16:56.000Z | import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
WithdrawnRegistrationFactory,
RegistrationFactory,
InstitutionFactory,
AuthUserFactory,
NodeFactory,
)
from website.util import permissions
@pytest.mark.django_db
@pytest.mark.django_db
| 33.262611 | 91 | 0.6511 | import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
WithdrawnRegistrationFactory,
RegistrationFactory,
InstitutionFactory,
AuthUserFactory,
NodeFactory,
)
from website.util import permissions
def make_payload(*node_ids):
data = [
{'type': 'n... | 20,360 | 1,660 | 90 |
5b97aeace18bf670fdbce20903c1639711b6c378 | 395 | py | Python | django_rq_dashboard/urls.py | BureauxLocaux/django-rq-dashboard | 2fd78d37130f90e0fe5bd34014177a5bb219eb6b | [
"BSD-3-Clause"
] | 53 | 2015-01-24T19:38:57.000Z | 2022-02-08T11:22:17.000Z | django_rq_dashboard/urls.py | domengorjup/django-rq-dashboard | 2fd78d37130f90e0fe5bd34014177a5bb219eb6b | [
"BSD-3-Clause"
] | 19 | 2015-09-16T16:46:06.000Z | 2020-07-27T22:46:01.000Z | django_rq_dashboard/urls.py | domengorjup/django-rq-dashboard | 2fd78d37130f90e0fe5bd34014177a5bb219eb6b | [
"BSD-3-Clause"
] | 37 | 2015-01-21T05:21:49.000Z | 2020-09-15T14:33:51.000Z | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.stats, name='rq_stats'),
url(r'^queues/(?P<queue>.+)/$', views.queue, name='rq_queue'),
url(r'^workers/(?P<worker>.+)/$', views.worker, name='rq_worker'),
url(r'^jobs/(?P<job>.+)/$', views.job, name='rq_job'),
u... | 30.384615 | 77 | 0.602532 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.stats, name='rq_stats'),
url(r'^queues/(?P<queue>.+)/$', views.queue, name='rq_queue'),
url(r'^workers/(?P<worker>.+)/$', views.worker, name='rq_worker'),
url(r'^jobs/(?P<job>.+)/$', views.job, name='rq_job'),
u... | 0 | 0 | 0 |
55adcf0a4ba882a11d46a202edbd2b2319c17bd4 | 7,160 | py | Python | ihec/ihec_data_hub.py | ENCODE-DCC/pyencoded-tools | bcaf9994d69a80a2eda8455399fe34e8f25c436a | [
"MIT"
] | 9 | 2016-08-23T15:59:12.000Z | 2021-07-16T00:54:54.000Z | ihec/ihec_data_hub.py | ENCODE-DCC/pyencoded-tools | bcaf9994d69a80a2eda8455399fe34e8f25c436a | [
"MIT"
] | 12 | 2016-11-18T18:56:42.000Z | 2021-03-11T20:25:14.000Z | ihec/ihec_data_hub.py | ENCODE-DCC/pyencoded-tools | bcaf9994d69a80a2eda8455399fe34e8f25c436a | [
"MIT"
] | 14 | 2016-02-17T04:24:07.000Z | 2020-02-28T21:36:19.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Print experiment.xml
# https://github.com/IHEC/ihec-metadata/blob/master/specs/Ihec_metadata_specification.md
# Ihec_metadata_specification.md:
# Chromatin Accessibility, WGBS, MeDIP-Seq, MRE-Seq, ChIP-Seq, RNA-Seq
# I added ATAC-seq, RRBS following existing data for... | 33.148148 | 127 | 0.523184 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Print experiment.xml
# https://github.com/IHEC/ihec-metadata/blob/master/specs/Ihec_metadata_specification.md
# Ihec_metadata_specification.md:
# Chromatin Accessibility, WGBS, MeDIP-Seq, MRE-Seq, ChIP-Seq, RNA-Seq
# I added ATAC-seq, RRBS following existing data for... | 4,151 | 0 | 23 |
11a26023d8cb8f36aac49e798c74a814265f62b9 | 6,385 | py | Python | spaceplanner/models.py | prznoc/osplanner | c58ff129fde3f1513738cf27f9d3692fb7d549ea | [
"MIT"
] | null | null | null | spaceplanner/models.py | prznoc/osplanner | c58ff129fde3f1513738cf27f9d3692fb7d549ea | [
"MIT"
] | null | null | null | spaceplanner/models.py | prznoc/osplanner | c58ff129fde3f1513738cf27f9d3692fb7d549ea | [
"MIT"
] | null | null | null | from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
from .app_logic import calendar_functions
| 54.110169 | 152 | 0.708379 | from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
from .app_logic import calendar_functions
c... | 558 | 5,392 | 115 |
c252be054b6b6f382cd8d93859206a6a437a1d61 | 7,337 | py | Python | fee/embedding/loader.py | FEE-Fair-Embedding-Engine/FEE | 013a540069ef433d579e4ea2e5f21aa2a3f86815 | [
"MIT"
] | 8 | 2020-09-26T13:27:25.000Z | 2020-12-15T04:00:53.000Z | fee/embedding/loader.py | FEE-Fair-Embedding-Engine/FEE | 013a540069ef433d579e4ea2e5f21aa2a3f86815 | [
"MIT"
] | null | null | null | fee/embedding/loader.py | FEE-Fair-Embedding-Engine/FEE | 013a540069ef433d579e4ea2e5f21aa2a3f86815 | [
"MIT"
] | 2 | 2020-11-24T13:47:10.000Z | 2021-09-15T12:35:57.000Z | import zipfile
import os
# from tqdl import download
from tqdm import tqdm
import re
import gc
import numpy as np
import codecs
import gensim.downloader as api
from gensim.test.utils import get_tmpfile
class WE():
"""The Word embedding class.
The main class that facilitates the word embedding struct... | 31.625 | 94 | 0.507428 | import zipfile
import os
# from tqdl import download
from tqdm import tqdm
import re
import gc
import numpy as np
import codecs
import gensim.downloader as api
from gensim.test.utils import get_tmpfile
class WE():
"""The Word embedding class.
The main class that facilitates the word embedding struct... | 0 | 0 | 0 |
6c12f88bb477400ceca80b74e1b2f790582c0e79 | 6,818 | py | Python | alvadescpy/wrapper.py | ECRL/alvaDescPy | f90178ccdfe70fbf9c3982eeb6759beb60b33f78 | [
"MIT"
] | 3 | 2021-05-28T07:52:35.000Z | 2022-01-03T21:29:01.000Z | alvadescpy/wrapper.py | ECRL/alvaDescPy | f90178ccdfe70fbf9c3982eeb6759beb60b33f78 | [
"MIT"
] | null | null | null | alvadescpy/wrapper.py | ECRL/alvaDescPy | f90178ccdfe70fbf9c3982eeb6759beb60b33f78 | [
"MIT"
] | 2 | 2020-07-06T01:54:55.000Z | 2020-10-07T11:43:21.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# alvadescpy/wrapper.py
# v.0.1.2
# Developed in 2019 by Travis Kessler <travis.j.kessler@gmail.com>
#
# contains `alvadesc` function, a wrapper for alvaDesc software
#
# stdlib. imports
from subprocess import check_output, PIPE, Popen, call
from csv import writer, QUOTE... | 36.459893 | 89 | 0.623057 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# alvadescpy/wrapper.py
# v.0.1.2
# Developed in 2019 by Travis Kessler <travis.j.kessler@gmail.com>
#
# contains `alvadesc` function, a wrapper for alvaDesc software
#
# stdlib. imports
from subprocess import check_output, PIPE, Popen, call
from csv import writer, QUOTE... | 0 | 0 | 0 |
dbac8b15d5543ed521b5fb0994d6f5126f07164a | 1,646 | py | Python | python/fancontrol/communicate/bridgehead.py | Bengt/FanControl | 6b3958230e5eacf175e84d9a5927d74cd3f6b83a | [
"MIT"
] | 9 | 2015-11-25T13:39:22.000Z | 2018-10-16T21:09:10.000Z | python/fancontrol/communicate/bridgehead.py | Bengt/FanControl | 6b3958230e5eacf175e84d9a5927d74cd3f6b83a | [
"MIT"
] | 6 | 2019-07-04T13:45:08.000Z | 2022-01-15T18:30:10.000Z | python/fancontrol/communicate/bridgehead.py | Bengt/FanControl | 6b3958230e5eacf175e84d9a5927d74cd3f6b83a | [
"MIT"
] | 3 | 2020-08-12T13:31:50.000Z | 2021-06-16T22:12:20.000Z | """Python side of the Python to Arduino bridge."""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from contextlib import contextmanager
from multiprocessing import Process, Queue
import serial
from serial.serialutil import SerialException
from communicat... | 25.323077 | 72 | 0.650668 | """Python side of the Python to Arduino bridge."""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from contextlib import contextmanager
from multiprocessing import Process, Queue
import serial
from serial.serialutil import SerialException
from communicat... | 1,180 | 0 | 68 |
86c6f4b4564dbd2cb53a3a53b39395137a044e02 | 4,784 | py | Python | tests/advection_1d_example1/setplot.py | navravi/amrclaw | 727d98d243c521267c927f6fe107ba6f1155597b | [
"BSD-3-Clause"
] | 16 | 2015-05-27T08:16:09.000Z | 2022-01-21T06:36:24.000Z | tests/advection_1d_example1/setplot.py | navravi/amrclaw | 727d98d243c521267c927f6fe107ba6f1155597b | [
"BSD-3-Clause"
] | 107 | 2015-01-02T19:51:43.000Z | 2021-11-24T03:35:32.000Z | tests/advection_1d_example1/setplot.py | BrisaDavis/amrclaw | c5cacdf00f1959e160ea5616cdf6ea7b6cd374f3 | [
"BSD-3-Clause"
] | 28 | 2015-01-10T00:03:56.000Z | 2022-02-11T23:52:34.000Z |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
from clawpack.clawutil.data import ClawData
from numpy import linspace
probdata = ClawData()
probdata.read('setprob.d... | 33.690141 | 78 | 0.585911 |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
from clawpack.clawutil.data import ClawData
from numpy import linspace
probdata = ClawData()
probdata.read('setprob.d... | 737 | 0 | 57 |
360f9294b5e03344b6f8b8e4604f0964041d205d | 4,070 | py | Python | src/metrics.py | tobiasvanderwerff/full-page-handwriting-recognition | 66780119247a73189f3838c1c0525f6896d1e377 | [
"MIT"
] | 7 | 2021-11-27T00:38:35.000Z | 2022-03-31T13:48:27.000Z | src/metrics.py | tobiasvanderwerff/full-page-handwriting-recognition | 66780119247a73189f3838c1c0525f6896d1e377 | [
"MIT"
] | null | null | null | src/metrics.py | tobiasvanderwerff/full-page-handwriting-recognition | 66780119247a73189f3838c1c0525f6896d1e377 | [
"MIT"
] | null | null | null | from util import LabelEncoder
import editdistance
from torch import Tensor
from torchmetrics import Metric
class CharacterErrorRate(Metric):
"""
Calculates Character Error Rate, calculated as Levenshtein edit distance divided
by length of the target. Roughly speaking, this indicates the percentage or
... | 37.33945 | 84 | 0.623096 | from util import LabelEncoder
import editdistance
from torch import Tensor
from torchmetrics import Metric
class CharacterErrorRate(Metric):
"""
Calculates Character Error Rate, calculated as Levenshtein edit distance divided
by length of the target. Roughly speaking, this indicates the percentage or
... | 574 | 0 | 77 |
11476c731d6dc233cfffda896300fc1a39f67790 | 1,420 | py | Python | venus_dashboard/api/venus_rest_api.py | openstack/venus-dashboard | 8c53ac83eaf80326c91cb92c34bbb43e04938e1c | [
"Apache-2.0"
] | null | null | null | venus_dashboard/api/venus_rest_api.py | openstack/venus-dashboard | 8c53ac83eaf80326c91cb92c34bbb43e04938e1c | [
"Apache-2.0"
] | null | null | null | venus_dashboard/api/venus_rest_api.py | openstack/venus-dashboard | 8c53ac83eaf80326c91cb92c34bbb43e04938e1c | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Inspur
#
# 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, soft... | 31.555556 | 77 | 0.734507 | # Copyright 2021 Inspur
#
# 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, soft... | 336 | 194 | 44 |
87c2f3196cb8b542c3ea1904a5e4897abde3e8d4 | 2,642 | py | Python | tests/test_Results.py | grahamgower/moments | 54d2c58d91a231303fb361258e24b41b23f50661 | [
"BSD-3-Clause"
] | null | null | null | tests/test_Results.py | grahamgower/moments | 54d2c58d91a231303fb361258e24b41b23f50661 | [
"BSD-3-Clause"
] | null | null | null | tests/test_Results.py | grahamgower/moments | 54d2c58d91a231303fb361258e24b41b23f50661 | [
"BSD-3-Clause"
] | null | null | null | import os
import unittest
import numpy
import moments
import time
suite = unittest.TestLoader().loadTestsFromTestCase(ResultsTestCase)
if __name__ == '__main__':
unittest.main()
| 34.311688 | 81 | 0.584406 | import os
import unittest
import numpy
import moments
import time
class ResultsTestCase(unittest.TestCase):
def setUp(self):
self.startTime = time.time()
def tearDown(self):
t = time.time() - self.startTime
print("%s: %.3f seconds" % (self.id(), t))
def test_1d_ic(self):
... | 2,187 | 20 | 250 |
757eb95fa81094a542d11466f8b953bb11b2054d | 1,194 | py | Python | timer.py | minhduccao/PomoBot | f412ca053b39448410c22c28476cc8a97043aa1f | [
"MIT"
] | 2 | 2021-02-15T15:16:40.000Z | 2022-01-03T20:16:11.000Z | timer.py | minhduccao/PomoBot | f412ca053b39448410c22c28476cc8a97043aa1f | [
"MIT"
] | 1 | 2021-02-16T08:07:08.000Z | 2021-02-16T08:07:08.000Z | timer.py | minhduccao/PomoBot | f412ca053b39448410c22c28476cc8a97043aa1f | [
"MIT"
] | null | null | null | from enum import Enum
| 22.528302 | 46 | 0.58459 | from enum import Enum
class TimerStatus(Enum):
STOPPED = -1
PAUSED = 0
RUNNING = 1
class Timer:
def __init__(self):
self.status = TimerStatus.STOPPED
self.time_left = 0
def start(self, duration: int):
if self.status != TimerStatus.RUNNING:
self.time_left = du... | 865 | 42 | 261 |
21fbf3af94d58f4ea44cb8d9142572c8f309aaa2 | 10,555 | py | Python | CLI.py | KaiGH/Topological | 3ed3f581ec7cd70e60a0542d9e4d406954d69994 | [
"MIT"
] | null | null | null | CLI.py | KaiGH/Topological | 3ed3f581ec7cd70e60a0542d9e4d406954d69994 | [
"MIT"
] | 3 | 2021-06-08T21:04:07.000Z | 2022-01-13T02:21:35.000Z | CLI.py | KaiGH/Topological | 3ed3f581ec7cd70e60a0542d9e4d406954d69994 | [
"MIT"
] | 1 | 2020-04-20T09:35:48.000Z | 2020-04-20T09:35:48.000Z | import yaml
import copy
import os.path
from PIL import Image as PILImage,ImageTk
from tkinter import Canvas, Tk, NW, mainloop
#Opening the Yaml File to Print out the Contents
#Name all Nodes
#Generates all Numbers Attached to Waypoints, Finds the Next Unused Number
#Editing Existing Node Data in the Yaml File
#Del... | 38.381818 | 153 | 0.594221 | import yaml
import copy
import os.path
from PIL import Image as PILImage,ImageTk
from tkinter import Canvas, Tk, NW, mainloop
#Opening the Yaml File to Print out the Contents
def readYaml(filename):
with open(filename) as fileReader:
node_coords = yaml.load(fileReader, Loader=yaml.FullLoader)
retu... | 9,385 | 0 | 372 |
0b992b72737dd28dc8a1f6a65f359823d248a7f1 | 213 | py | Python | erlei/__init__.py | Thunsir/erlei | cf3342047f3dcf9a66cbe46f3d4fc66ee6fdc415 | [
"MIT"
] | null | null | null | erlei/__init__.py | Thunsir/erlei | cf3342047f3dcf9a66cbe46f3d4fc66ee6fdc415 | [
"MIT"
] | null | null | null | erlei/__init__.py | Thunsir/erlei | cf3342047f3dcf9a66cbe46f3d4fc66ee6fdc415 | [
"MIT"
] | null | null | null | from erlei.underscore import underscore as _
from erlei.underscore import uunderscore as __
from erlei.pipe import pipe
__all__ = [
'_',
'__',
'pipe'
]
__version__ = "1.0.0"
name = "erlei" | 17.75 | 47 | 0.647887 | from erlei.underscore import underscore as _
from erlei.underscore import uunderscore as __
from erlei.pipe import pipe
__all__ = [
'_',
'__',
'pipe'
]
__version__ = "1.0.0"
name = "erlei" | 0 | 0 | 0 |
3d50d70c313ef21a98f930c294464892c9d21390 | 18,920 | py | Python | scrub_test.py | dineshjoshi/cassandra-dtest-1 | 18ccbb4d308c27b67a8d81a2c849dc27fc3e2b5c | [
"Apache-2.0"
] | 44 | 2017-07-13T14:20:42.000Z | 2022-03-27T23:55:27.000Z | scrub_test.py | dineshjoshi/cassandra-dtest-1 | 18ccbb4d308c27b67a8d81a2c849dc27fc3e2b5c | [
"Apache-2.0"
] | 64 | 2017-07-26T16:06:01.000Z | 2022-03-17T22:57:03.000Z | scrub_test.py | dineshjoshi/cassandra-dtest-1 | 18ccbb4d308c27b67a8d81a2c849dc27fc3e2b5c | [
"Apache-2.0"
] | 105 | 2017-07-13T14:28:14.000Z | 2022-03-23T04:22:46.000Z | import glob
import os
import re
import subprocess
import time
import uuid
import pytest
import parse
import logging
from ccmlib import common
from dtest import Tester, create_ks, create_cf
from tools.assertions import assert_length_equal, assert_stderr_clean
since = pytest.mark.since
logger = logging.getLogger(__nam... | 39.915612 | 145 | 0.643288 | import glob
import os
import re
import subprocess
import time
import uuid
import pytest
import parse
import logging
from ccmlib import common
from dtest import Tester, create_ks, create_cf
from tools.assertions import assert_length_equal, assert_stderr_clean
since = pytest.mark.since
logger = logging.getLogger(__nam... | 10,563 | 6,773 | 347 |
99038a0c1a568c0d86b4e12351346ffc45eb7e5a | 39,768 | py | Python | anibot/plugins/anilist.py | JesterZilla/ani_bot | dc27fac49344b90d5e3c6ad8536c0d5b7f330491 | [
"MIT"
] | null | null | null | anibot/plugins/anilist.py | JesterZilla/ani_bot | dc27fac49344b90d5e3c6ad8536c0d5b7f330491 | [
"MIT"
] | null | null | null | anibot/plugins/anilist.py | JesterZilla/ani_bot | dc27fac49344b90d5e3c6ad8536c0d5b7f330491 | [
"MIT"
] | null | null | null | # base code was taken from @DeletedUser420's Userge-Plugins repo
# originally authored by Phyco-Ninja (https://github.com/Phyco-Ninja) (@PhycoNinja13b)
# I've just tweaked his file a bit (maybe a lot)
# But i sticked to the format he used which looked cool
""" Search for Anime related Info using Anilist API """
... | 44.884876 | 173 | 0.625126 | # base code was taken from @DeletedUser420's Userge-Plugins repo
# originally authored by Phyco-Ninja (https://github.com/Phyco-Ninja) (@PhycoNinja13b)
# I've just tweaked his file a bit (maybe a lot)
# But i sticked to the format he used which looked cool
""" Search for Anime related Info using Anilist API """
... | 28,380 | 0 | 599 |
ecf8768578d2a78e53f17e9ef619b0ab0e5e3ea4 | 1,062 | py | Python | troposphere/validators/backup.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | null | null | null | troposphere/validators/backup.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | null | null | null | troposphere/validators/backup.py | compose-x/troposphere | 9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2012-2022, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
import re
from .. import If
from . import exactly_one, json_checker
def validate_json_checker(x):
"""
Property: BackupVault.AccessPolicy
"""
return json_checker(x)
def backup_vault_n... | 21.24 | 75 | 0.635593 | # Copyright (c) 2012-2022, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
import re
from .. import If
from . import exactly_one, json_checker
def validate_json_checker(x):
"""
Property: BackupVault.AccessPolicy
"""
return json_checker(x)
def backup_vault_n... | 162 | 0 | 27 |
eabbf93816a67807884b41951de89e98b11591e8 | 17,008 | py | Python | anpy/dossier_like_senapy.py | MalcolmMielle/anpy | b0eac68ed860d8a909a065c1d500ddc3f442bee7 | [
"MIT"
] | 11 | 2016-04-02T18:06:15.000Z | 2022-03-04T10:18:57.000Z | anpy/dossier_like_senapy.py | MalcolmMielle/anpy | b0eac68ed860d8a909a065c1d500ddc3f442bee7 | [
"MIT"
] | 24 | 2016-09-11T19:34:02.000Z | 2020-11-23T15:58:27.000Z | anpy/dossier_like_senapy.py | MalcolmMielle/anpy | b0eac68ed860d8a909a065c1d500ddc3f442bee7 | [
"MIT"
] | 6 | 2016-05-31T12:25:50.000Z | 2021-10-03T09:24:18.000Z | # re-write of the dosleg parser to have
# the same output as senapy
import sys
import re
from urllib.parse import urljoin
import dateparser
from bs4 import BeautifulSoup
from lawfactory_utils.urls import clean_url, download, parse_national_assembly_url, AN_OLD_URL_TEMPLATE
from anpy.dossier_from_opendata import par... | 41.082126 | 143 | 0.589017 | # re-write of the dosleg parser to have
# the same output as senapy
import sys
import re
from urllib.parse import urljoin
import dateparser
from bs4 import BeautifulSoup
from lawfactory_utils.urls import clean_url, download, parse_national_assembly_url, AN_OLD_URL_TEMPLATE
from anpy.dossier_from_opendata import par... | 2,605 | 0 | 261 |
36cc9c5877f104f392dcd87ca1669bb6327d254d | 12,978 | py | Python | ppp_questionparsing_ml_standalone/dataset.py | ProjetPP/PPP-QuestionParsing-ML-Standalone | 486dea1ae7a42baf8ccc361051c7368850040923 | [
"MIT"
] | 2 | 2015-06-08T16:14:26.000Z | 2015-08-16T03:16:33.000Z | ppp_questionparsing_ml_standalone/dataset.py | ProjetPP/PPP-QuestionParsing-ML-Standalone | 486dea1ae7a42baf8ccc361051c7368850040923 | [
"MIT"
] | null | null | null | ppp_questionparsing_ml_standalone/dataset.py | ProjetPP/PPP-QuestionParsing-ML-Standalone | 486dea1ae7a42baf8ccc361051c7368850040923 | [
"MIT"
] | null | null | null | import os
import re
import numpy
import itertools
from . import config, dataset_generation, preprocessing
class FormatSentence:
"""
Take a sentence, annotated or not, and generate the vectors associated
"""
sentence = ''
words = []
__size_vector = 26+11
__dictionary = None
__vectoriz... | 36.764873 | 120 | 0.594776 | import os
import re
import numpy
import itertools
from . import config, dataset_generation, preprocessing
class FormatSentence:
"""
Take a sentence, annotated or not, and generate the vectors associated
"""
sentence = ''
words = []
__size_vector = 26+11
__dictionary = None
__vectoriz... | 9,479 | 0 | 696 |
d269d7c9e9945897023ca15d2c5a37ca8f38a0c9 | 16,712 | py | Python | builders/layers/transformer.py | leosampaio/scene-designer | 8a7276067acfde1997d386942aabc44d92436a1a | [
"MIT"
] | 9 | 2021-08-18T17:49:42.000Z | 2022-02-22T02:15:07.000Z | builders/layers/transformer.py | leosampaio/scene-designer | 8a7276067acfde1997d386942aabc44d92436a1a | [
"MIT"
] | null | null | null | builders/layers/transformer.py | leosampaio/scene-designer | 8a7276067acfde1997d386942aabc44d92436a1a | [
"MIT"
] | 1 | 2021-10-02T19:53:03.000Z | 2021-10-02T19:53:03.000Z | # -*- coding: utf-8 -*-
"""
builders/layers/transformer.py
Created on 01/05/19
@author: Tu Bui tb00083@surrey.ac.uk
"""
import tensorflow as tf
from tensorflow.keras import backend as K
from ..utils import scaled_dot_product_attention, positional_encoding
class SelfAttnV1(tf.keras.layers.Layer):
"""
Keras at... | 37.470852 | 113 | 0.607528 | # -*- coding: utf-8 -*-
"""
builders/layers/transformer.py
Created on 01/05/19
@author: Tu Bui tb00083@surrey.ac.uk
"""
import tensorflow as tf
from tensorflow.keras import backend as K
from ..utils import scaled_dot_product_attention, positional_encoding
class SelfAttnV1(tf.keras.layers.Layer):
"""
Keras at... | 12,150 | 74 | 763 |
0b9a19a42a79cbf5a45774709ce2367d39565864 | 357 | py | Python | 09_list_explained.py | SourceLastBenchCoder/Python_Programming | 4c4281252ab657cbb781f98fe5c945738a2c618e | [
"MIT"
] | null | null | null | 09_list_explained.py | SourceLastBenchCoder/Python_Programming | 4c4281252ab657cbb781f98fe5c945738a2c618e | [
"MIT"
] | null | null | null | 09_list_explained.py | SourceLastBenchCoder/Python_Programming | 4c4281252ab657cbb781f98fe5c945738a2c618e | [
"MIT"
] | null | null | null | names = ['appu','chakrapani','upadhyaya',23,'TRUE']
for name in names:
print(name)
print(names[0])
print(names[2:4])
names.insert(2,"Shraddha")
print(names)
names.append("Shreshta")
print(names)
names.append("Shreshta")
print(names)
names[2]="Updated"
print(names)
names.remove("Updated")
print(names)
rec =... | 13.222222 | 51 | 0.697479 | names = ['appu','chakrapani','upadhyaya',23,'TRUE']
for name in names:
print(name)
print(names[0])
print(names[2:4])
names.insert(2,"Shraddha")
print(names)
names.append("Shreshta")
print(names)
names.append("Shreshta")
print(names)
names[2]="Updated"
print(names)
names.remove("Updated")
print(names)
rec =... | 0 | 0 | 0 |
1b5b2c766be45304dcc9827c0780c2d4a00740aa | 3,209 | py | Python | broker.py | amitsadafule/light-broker | eec5deda420e66ce1730a4454564772ab2c007d1 | [
"MIT"
] | null | null | null | broker.py | amitsadafule/light-broker | eec5deda420e66ce1730a4454564772ab2c007d1 | [
"MIT"
] | null | null | null | broker.py | amitsadafule/light-broker | eec5deda420e66ce1730a4454564772ab2c007d1 | [
"MIT"
] | null | null | null | import selectors
import socket
import types
import queue
import threading
from message_handler import MessageHandler
from datetime import datetime | 30.561905 | 79 | 0.73699 | import selectors
import socket
import types
import queue
import threading
from message_handler import MessageHandler
from datetime import datetime
class Broker():
_BINDING_IP = '127.0.0.1'
_BINDING_PORT = 65432
_consumerSelector = None
_QUEUE_SIZE = 2
_messageQueue = None
_messageHandler = None
_MAX_BUFFER_SIZ... | 2,640 | 400 | 23 |
459724158dea735d7f9efb61757a228a40c8333c | 835 | py | Python | machine-learning/QiWei-Python-Chinese/class/class_04.py | yw-fang/MLreadingnotes | 3522497e6fb97427c54f4267d9c410064818c357 | [
"Apache-2.0"
] | 2 | 2020-07-09T22:21:57.000Z | 2021-03-20T15:30:31.000Z | machine-learning/QiWei-Python-Chinese/class/class_04.py | yw-fang/MLreadingnotes | 3522497e6fb97427c54f4267d9c410064818c357 | [
"Apache-2.0"
] | 37 | 2018-04-17T06:40:54.000Z | 2022-03-22T09:06:01.000Z | machine-learning/QiWei-Python-Chinese/class/class_04.py | yw-fang/MLreadingnotes | 3522497e6fb97427c54f4267d9c410064818c357 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Yue-Wen FANG'
__maintainer__ = "Yue-Wen FANG"
__email__ = 'fyuewen@gmail.com'
__license__ = 'Apache License 2.0'
__creation_date__= 'Dec. 26, 2018'
"""
single inheritance
"""
class Person:
"""
define a CLASS Person with three methods
"""
clas... | 17.765957 | 50 | 0.598802 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Yue-Wen FANG'
__maintainer__ = "Yue-Wen FANG"
__email__ = 'fyuewen@gmail.com'
__license__ = 'Apache License 2.0'
__creation_date__= 'Dec. 26, 2018'
"""
single inheritance
"""
class Person:
"""
define a CLASS Person with three methods
"""
de... | 92 | 0 | 80 |
1fb8865710a6705d96dc909a10f714a1c5599ad0 | 5,515 | py | Python | app.py | capital-one-hackathon/backend | f4f216aa77fe8b6930c3c0f47107f806b7b86e5b | [
"MIT"
] | null | null | null | app.py | capital-one-hackathon/backend | f4f216aa77fe8b6930c3c0f47107f806b7b86e5b | [
"MIT"
] | null | null | null | app.py | capital-one-hackathon/backend | f4f216aa77fe8b6930c3c0f47107f806b7b86e5b | [
"MIT"
] | 4 | 2017-11-11T03:37:13.000Z | 2017-11-11T20:33:50.000Z | '''
assumptions:
- credit one, the leading provider of identity management is a division of capital one (e.g. https://capitalone.com/creditone)
- user already has an account with capital one (they've been verified id, passport, credit, ...)
- participating banks, institutions, ... realize credit one the leading
... | 35.352564 | 128 | 0.670354 | '''
assumptions:
- credit one, the leading provider of identity management is a division of capital one (e.g. https://capitalone.com/creditone)
- user already has an account with capital one (they've been verified id, passport, credit, ...)
- participating banks, institutions, ... realize credit one the leading
... | 3,038 | 0 | 133 |
fcabfb4a6ec3d6667d4e1a147a0c2e667595c1e6 | 6,237 | py | Python | src/environment.py | srome/ExPyDQN | df75b47960500b3e54df00d65e32d845ae600bac | [
"MIT"
] | 6 | 2017-10-06T08:28:21.000Z | 2022-01-21T13:43:41.000Z | src/environment.py | srome/ExPyDQN | df75b47960500b3e54df00d65e32d845ae600bac | [
"MIT"
] | 1 | 2018-04-25T18:50:53.000Z | 2018-04-25T18:50:53.000Z | src/environment.py | srome/ExPyDQN | df75b47960500b3e54df00d65e32d845ae600bac | [
"MIT"
] | 3 | 2018-07-02T06:09:26.000Z | 2019-10-23T22:14:25.000Z | import numpy as np
import logging
import time
class TrainingEnvironment:
""" Class to handle the processing of the game loop."""
def run_epoch(self, num_steps, training=True):
""" Run a training epoch for a giving number of steps.
Return the average reward, and number of episodes."""
... | 36.052023 | 215 | 0.591951 | import numpy as np
import logging
import time
class TrainingEnvironment:
""" Class to handle the processing of the game loop."""
def __init__(self,
env,
model,
replay_memory,
input_processor,
phi_length,
frame... | 4,420 | 0 | 296 |
e6415236b516d96c6728083dc50dfa22c5db9eac | 3,085 | py | Python | nlptk/mining/utils.py | GarryGaller/nlp_toolkit | df98ee25f8a1f4379e751fdd4fd9f5389ffbfd1b | [
"MIT"
] | null | null | null | nlptk/mining/utils.py | GarryGaller/nlp_toolkit | df98ee25f8a1f4379e751fdd4fd9f5389ffbfd1b | [
"MIT"
] | null | null | null | nlptk/mining/utils.py | GarryGaller/nlp_toolkit | df98ee25f8a1f4379e751fdd4fd9f5389ffbfd1b | [
"MIT"
] | null | null | null |
import os,sys
import heapq
from chardet.universaldetector import UniversalDetector
#train_pos, test_pos = create_sample(’pos’, 0.75)
#train_neg, test_neg = create_sample(’neg’, 0.75)
#train = train_pos + train_neg
#test = test_pos + test_neg
| 27.061404 | 76 | 0.552026 |
import os,sys
import heapq
from chardet.universaldetector import UniversalDetector
def _sort(obj, typ):
if typ == 1:
res = sorted(obj.items(),key=lambda t:t[1])
elif typ == -1:
res = sorted(obj.items(),key=lambda t:-t[1])
else:
res = obj
return res
def _top(obj, n):
... | 2,604 | -4 | 210 |