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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
481b78ded2e2793a0661fb5abdf745246a317a74 | 46,084 | py | Python | plaso/proto/plaso_storage_pb2.py | Defense-Cyber-Crime-Center/plaso | 4f3a85fbea10637c1cdbf0cde9fc539fdcea9c47 | [
"Apache-2.0"
] | 2 | 2016-02-18T12:46:29.000Z | 2022-03-13T03:04:59.000Z | plaso/proto/plaso_storage_pb2.py | Defense-Cyber-Crime-Center/plaso | 4f3a85fbea10637c1cdbf0cde9fc539fdcea9c47 | [
"Apache-2.0"
] | null | null | null | plaso/proto/plaso_storage_pb2.py | Defense-Cyber-Crime-Center/plaso | 4f3a85fbea10637c1cdbf0cde9fc539fdcea9c47 | [
"Apache-2.0"
] | 6 | 2016-12-18T08:05:36.000Z | 2021-04-06T14:19:11.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='plaso/proto/plas... | 44.226488 | 4,916 | 0.726933 | # Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='plaso/proto/plas... | 0 | 1,933 | 207 |
56720c46692e1092bb40026f35c265f2e4708424 | 159 | py | Python | teste/models.py | mhiloca/TourismApi | b9904354f2d249e996d79f7a6ad58269c68363d7 | [
"MIT"
] | null | null | null | teste/models.py | mhiloca/TourismApi | b9904354f2d249e996d79f7a6ad58269c68363d7 | [
"MIT"
] | null | null | null | teste/models.py | mhiloca/TourismApi | b9904354f2d249e996d79f7a6ad58269c68363d7 | [
"MIT"
] | null | null | null | from django.db import models
| 17.666667 | 47 | 0.710692 | from django.db import models
class Teste(models.Model):
anything = models.CharField(max_length=100)
def __str__(self):
return self.anything
| 26 | 80 | 23 |
f102fe1a5ce4bbe60d24f984094cde7d41be5721 | 1,059 | py | Python | chapter101/postgres_elasticsearch.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | chapter101/postgres_elasticsearch.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | chapter101/postgres_elasticsearch.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | import psycopg
import elasticsearch
import psycopg.extras
from datetime import datetime
from elasticsearch import helpers, Elasticsearch
start = datetime.now()
postgres_client = psycopg.connect("postgres://username:password@127.0.0.1")
elasticsearch_client = Elasticsearch("http://username:password@127.0.0.1:9200")
c... | 23.021739 | 79 | 0.733711 | import psycopg
import elasticsearch
import psycopg.extras
from datetime import datetime
from elasticsearch import helpers, Elasticsearch
start = datetime.now()
postgres_client = psycopg.connect("postgres://username:password@127.0.0.1")
elasticsearch_client = Elasticsearch("http://username:password@127.0.0.1:9200")
c... | 74 | 0 | 23 |
9d212419983afbfcebd8cc8c0bb3e35220f6c9af | 1,206 | py | Python | obtain_kmeans_clusters_using_embeddings.py | francescoferretto/Investigating-relationships-between-Twitter-latent-topics-and-political-orientation | c6f1ff05ac8960885f26a153d7c0c8ecf1364a6a | [
"MIT"
] | null | null | null | obtain_kmeans_clusters_using_embeddings.py | francescoferretto/Investigating-relationships-between-Twitter-latent-topics-and-political-orientation | c6f1ff05ac8960885f26a153d7c0c8ecf1364a6a | [
"MIT"
] | null | null | null | obtain_kmeans_clusters_using_embeddings.py | francescoferretto/Investigating-relationships-between-Twitter-latent-topics-and-political-orientation | c6f1ff05ac8960885f26a153d7c0c8ecf1364a6a | [
"MIT"
] | null | null | null | import pandas as pd
import os
import logging
from pathlib import Path
import sys
#
# Configure the path
#FILE_PATH = Path(__file__).resolve().parent
FILE_PATH = '/home/emi/unipd/Sartori_CBSD/project/cbsdproject'
DATA_PATH = FILE_PATH + '/data'
DATA_FILE = DATA_PATH + '/tweets_cleaned.csv'
UTILS_PATH = FILE_PATH + '/u... | 26.217391 | 125 | 0.801824 | import pandas as pd
import os
import logging
from pathlib import Path
import sys
#
# Configure the path
#FILE_PATH = Path(__file__).resolve().parent
FILE_PATH = '/home/emi/unipd/Sartori_CBSD/project/cbsdproject'
DATA_PATH = FILE_PATH + '/data'
DATA_FILE = DATA_PATH + '/tweets_cleaned.csv'
UTILS_PATH = FILE_PATH + '/u... | 0 | 0 | 0 |
4bcb9d990edc40e5b558cf97562eaa19cb67c020 | 2,619 | py | Python | core/models.py | zeack/exchange_rate | 52868f5a1a3bf2dd0bd0624886939e0097677566 | [
"MIT"
] | null | null | null | core/models.py | zeack/exchange_rate | 52868f5a1a3bf2dd0bd0624886939e0097677566 | [
"MIT"
] | null | null | null | core/models.py | zeack/exchange_rate | 52868f5a1a3bf2dd0bd0624886939e0097677566 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from django.db import models
from django.utils.timezone import utc
from django.contrib.auth.models import AbstractUser
from django.conf import settings
| 29.426966 | 82 | 0.655212 | from datetime import datetime, timedelta
from django.db import models
from django.utils.timezone import utc
from django.contrib.auth.models import AbstractUser
from django.conf import settings
class User(AbstractUser):
usage_end_date = models.DateField(null=True)
usage = models.IntegerField(default=0)
c... | 112 | 2,241 | 69 |
0ce84069af4a81a6afa650fb724bf3bc8a25f2f4 | 2,162 | py | Python | scripts/filter_csv.py | sunlightlabs/hall-of-justice | 8c2ce47f792e0182c84d13dca808564a6ac376b4 | [
"BSD-3-Clause"
] | 7 | 2015-05-08T03:48:54.000Z | 2016-02-04T01:01:51.000Z | scripts/filter_csv.py | themarshallproject/hall-of-justice | 8c2ce47f792e0182c84d13dca808564a6ac376b4 | [
"BSD-3-Clause"
] | 44 | 2015-03-20T17:16:58.000Z | 2016-04-27T20:17:29.000Z | scripts/filter_csv.py | sunlightlabs/hall-of-justice | 8c2ce47f792e0182c84d13dca808564a6ac376b4 | [
"BSD-3-Clause"
] | 5 | 2015-06-22T13:49:08.000Z | 2016-01-30T23:19:16.000Z | #!/usr/bin/env python3
import os
import sys
import logging
import csv
import argparse
from signal import signal, SIGPIPE, SIG_DFL
logger = logging.getLogger()
signal(SIGPIPE, SIG_DFL)
FILTER_MAP = {
'ufo-states': unidentified_states,
'no-title': no_title,
'no-group': no_group,
'multi-cat': multi... | 29.216216 | 111 | 0.649861 | #!/usr/bin/env python3
import os
import sys
import logging
import csv
import argparse
from signal import signal, SIGPIPE, SIG_DFL
logger = logging.getLogger()
signal(SIGPIPE, SIG_DFL)
def unidentified_states(item):
value = item.get('State', None)
return (value is None or (len(value) > 2 and value.strip() !=... | 1,043 | 0 | 115 |
2b0b9acba04f75507fbd34e18fe773e63b51c37a | 4,840 | py | Python | src_para/eval_AHDE.py | david-yoon/detecting-incongruity | 2e121fdba0da3a6a0c63df0c46a101a789fe7565 | [
"MIT"
] | 36 | 2018-11-25T21:43:10.000Z | 2022-03-13T10:47:50.000Z | src_para/eval_AHDE.py | david-yoon/detecting-incongruity | 2e121fdba0da3a6a0c63df0c46a101a789fe7565 | [
"MIT"
] | 1 | 2019-06-16T07:45:47.000Z | 2019-10-14T06:00:29.000Z | src_para/eval_AHDE.py | david-yoon/detecting-incongruity | 2e121fdba0da3a6a0c63df0c46a101a789fe7565 | [
"MIT"
] | 5 | 2018-12-09T06:40:19.000Z | 2019-10-17T22:07:58.000Z | #-*- coding: utf-8 -*-
'''
evaluate AHDE
'''
import csv
from AHDE_Model import *
from AHDE_process_data import *
from AHDE_evaluation import *
import os
import time
import argparse
from random import shuffle
from params import Params
if __name__ == '__main__':
p = argparse.ArgumentParser()
p.... | 35.588235 | 129 | 0.572934 | #-*- coding: utf-8 -*-
'''
evaluate AHDE
'''
import csv
from AHDE_Model import *
from AHDE_process_data import *
from AHDE_evaluation import *
import os
import time
import argparse
from random import shuffle
from params import Params
def main(model_path, batch_size, encoder_size, context_size, encoderR_size, num_la... | 2,501 | 0 | 25 |
1235b03a76d72c18a9ff87d252bed46daae150d2 | 2,958 | py | Python | app/users.py | Rosk/flasqlite | 425dc71385e156e1339d8aa1b8d0623ec2ce6d16 | [
"MIT"
] | 1 | 2015-01-06T11:33:55.000Z | 2015-01-06T11:33:55.000Z | app/users.py | Rosk/flasqlite | 425dc71385e156e1339d8aa1b8d0623ec2ce6d16 | [
"MIT"
] | null | null | null | app/users.py | Rosk/flasqlite | 425dc71385e156e1339d8aa1b8d0623ec2ce6d16 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from app import *
from functools import wraps
from datetime import datetime
# Decorators
# ----------------------------------------------------------------------------------------------------------------------
# TODO: Müssen Decorators in jedem .py - File vorkommen - oder kann man die nicht zen... | 37.443038 | 135 | 0.605139 | # -*- coding: utf-8 -*-
from app import *
from functools import wraps
from datetime import datetime
# Decorators
# ----------------------------------------------------------------------------------------------------------------------
# TODO: Müssen Decorators in jedem .py - File vorkommen - oder kann man die nicht zen... | 1,033 | 0 | 96 |
883f08e1f9e67475497a30aa830d47b5d771521a | 54 | py | Python | src/basic_led_strip_proxy/__init__.py | willdickson/basic_led_strip_ros | 398a294f12acbabeb0f84699bb60564b940ca8fe | [
"MIT"
] | null | null | null | src/basic_led_strip_proxy/__init__.py | willdickson/basic_led_strip_ros | 398a294f12acbabeb0f84699bb60564b940ca8fe | [
"MIT"
] | null | null | null | src/basic_led_strip_proxy/__init__.py | willdickson/basic_led_strip_ros | 398a294f12acbabeb0f84699bb60564b940ca8fe | [
"MIT"
] | null | null | null | from .basic_led_strip_proxy import BasicLedStripProxy
| 27 | 53 | 0.907407 | from .basic_led_strip_proxy import BasicLedStripProxy
| 0 | 0 | 0 |
513a76d222c9bc88b2bd099fee1ccb01a6f2b44a | 1,000 | py | Python | MAIN_INTERFACE.py | rip3045/VisionSystem | a220b0f1b398ad31c69cb0f28711604511abe0ec | [
"MIT"
] | 6 | 2018-08-04T03:33:53.000Z | 2021-11-14T21:19:49.000Z | MAIN_INTERFACE.py | rip3045/VisionSystem | a220b0f1b398ad31c69cb0f28711604511abe0ec | [
"MIT"
] | null | null | null | MAIN_INTERFACE.py | rip3045/VisionSystem | a220b0f1b398ad31c69cb0f28711604511abe0ec | [
"MIT"
] | null | null | null | import image_sectioner
import video_capture
import video_feed_test
import pyueye_main
import video_capture_with_IDS
if __name__=="__main__":
main() | 25.641026 | 50 | 0.577 | import image_sectioner
import video_capture
import video_feed_test
import pyueye_main
import video_capture_with_IDS
def main():
user_input = None
while user_input != '0':
user_input = input("""
0 - Quit the program
1 - test video input feed
2 -test video input feed IDS camera
3 -... | 816 | 0 | 25 |
f18240ab5f65a48e41abdccaa86802edca0efb1d | 95 | py | Python | tests/utils/test_string_utils.py | SHikumo/py-image-dataset-generator | 8adf7004d9c63443ce17d0f01d27bd0f2c1dd3f9 | [
"MIT"
] | 216 | 2018-02-15T20:37:14.000Z | 2022-03-26T05:15:34.000Z | tests/utils/test_string_utils.py | SHikumo/py-image-dataset-generator | 8adf7004d9c63443ce17d0f01d27bd0f2c1dd3f9 | [
"MIT"
] | 16 | 2018-02-13T23:42:53.000Z | 2021-08-09T17:04:00.000Z | tests/utils/test_string_utils.py | SHikumo/py-image-dataset-generator | 8adf7004d9c63443ce17d0f01d27bd0f2c1dd3f9 | [
"MIT"
] | 45 | 2018-03-03T14:14:27.000Z | 2022-02-14T00:51:08.000Z | import unittest
| 11.875 | 41 | 0.694737 | import unittest
class TestStringUtils(unittest.TestCase):
def setUp(self):
pass
| 8 | 20 | 50 |
90709a7e93647713a3f8ac6a730fb759244d8f98 | 6,895 | py | Python | graphical.py | atif5/cuschess | e45ed0a2cf38c909dfcd0cddf94003a0a4a71242 | [
"Unlicense"
] | null | null | null | graphical.py | atif5/cuschess | e45ed0a2cf38c909dfcd0cddf94003a0a4a71242 | [
"Unlicense"
] | null | null | null | graphical.py | atif5/cuschess | e45ed0a2cf38c909dfcd0cddf94003a0a4a71242 | [
"Unlicense"
] | null | null | null |
from cuschess.logic import *
import pygame
import time
LIGHTPINK = "#FFC0CB"
PINK = "#FF69B4"
RED = "#FF0000"
WHITE = "#FFFFFF"
BLACK = "#000000"
| 37.677596 | 137 | 0.513561 |
from cuschess.logic import *
import pygame
import time
LIGHTPINK = "#FFC0CB"
PINK = "#FF69B4"
RED = "#FF0000"
WHITE = "#FFFFFF"
BLACK = "#000000"
class BoardGraphical:
sprites = {
10: pygame.image.load("cuschess/sprites/wpawn.png"),
11: pygame.image.load("cuschess/sprites/wrook.png"),
1... | 5,350 | 1,372 | 23 |
21b09862064a159c44da41169183e8e04725c303 | 13,748 | py | Python | 001_madeline.py | bigdatamatta/ChaLearn_Automatic_Machine_Learning_Challenge_2015 | a9acb6906ff141e7c24cff80f92efef7d7c3ff09 | [
"BSD-2-Clause"
] | 1 | 2019-06-12T19:55:35.000Z | 2019-06-12T19:55:35.000Z | 001_madeline.py | bigdatamatta/ChaLearn_Automatic_Machine_Learning_Challenge_2015 | a9acb6906ff141e7c24cff80f92efef7d7c3ff09 | [
"BSD-2-Clause"
] | null | null | null | 001_madeline.py | bigdatamatta/ChaLearn_Automatic_Machine_Learning_Challenge_2015 | a9acb6906ff141e7c24cff80f92efef7d7c3ff09 | [
"BSD-2-Clause"
] | null | null | null | import argparse
import os
import numpy as np
import autosklearn
import autosklearn.data
import autosklearn.data.data_manager
import autosklearn.models.evaluator
from ParamSklearn.classification import ParamSklearnClassifier
parser = argparse.ArgumentParser()
parser.add_argument('input')
parser.add_argument('output'... | 37.769231 | 77 | 0.643585 | import argparse
import os
import numpy as np
import autosklearn
import autosklearn.data
import autosklearn.data.data_manager
import autosklearn.models.evaluator
from ParamSklearn.classification import ParamSklearnClassifier
parser = argparse.ArgumentParser()
parser.add_argument('input')
parser.add_argument('output'... | 0 | 0 | 0 |
d8118cea63144b40121b86ebd76b91465e950f07 | 40 | py | Python | test/login.py | cjy3516/learn_git | 42a71a8420b0c47bce314dc6e8de0ce2c7686dc5 | [
"MIT"
] | 1 | 2019-05-12T09:16:41.000Z | 2019-05-12T09:16:41.000Z | test/login.py | cjy3516/learn_git | 42a71a8420b0c47bce314dc6e8de0ce2c7686dc5 | [
"MIT"
] | null | null | null | test/login.py | cjy3516/learn_git | 42a71a8420b0c47bce314dc6e8de0ce2c7686dc5 | [
"MIT"
] | null | null | null | print('登陆中...')
a = 0
b = 1
c = 2
d = 3
| 6.666667 | 15 | 0.4 | print('登陆中...')
a = 0
b = 1
c = 2
d = 3
| 0 | 0 | 0 |
1cc9332814c4468ad14745a3390f65fb6748d4bf | 8,944 | py | Python | detection/src/steps/yolomaml_training.py | artificially-ai/FewShotVision | 02c1132828bc9caba4cadd0b2f731bd63f66b826 | [
"MIT"
] | 90 | 2019-10-03T01:13:09.000Z | 2022-03-24T09:02:08.000Z | detection/src/steps/yolomaml_training.py | artificially-ai/FewShotVision | 02c1132828bc9caba4cadd0b2f731bd63f66b826 | [
"MIT"
] | 3 | 2020-04-07T13:03:43.000Z | 2020-09-03T08:06:45.000Z | detection/src/steps/yolomaml_training.py | ebennequin/FewShotVision | 909bc414ea27ef0300091e1dd6baba4fb063324b | [
"MIT"
] | 12 | 2019-12-25T05:49:56.000Z | 2021-05-22T11:58:19.000Z | import os
import torch
from torch.utils.tensorboard.writer import SummaryWriter
from detection.src.loaders.data_manager import DetectionSetDataManager
from detection.src.yolo_maml import YOLOMAML
from utils import configs
from utils.io_utils import set_and_print_random_seed
from detection.src.yolov3.model import Dar... | 39.056769 | 118 | 0.6411 | import os
import torch
from torch.utils.tensorboard.writer import SummaryWriter
from detection.src.loaders.data_manager import DetectionSetDataManager
from detection.src.yolo_maml import YOLOMAML
from utils import configs
from utils.io_utils import set_and_print_random_seed
from detection.src.yolov3.model import Dar... | 51 | 0 | 27 |
242afb1e0d6046ecb3beb8109113b8d0aaf8b3f6 | 2,167 | py | Python | tests/internals/utils/test_utils.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | tests/internals/utils/test_utils.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | tests/internals/utils/test_utils.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | from contextlib import contextmanager
import pytest
from typing_extensions import Annotated, Protocol, runtime_checkable
from antidote._internal.utils import enforce_subclass_if_possible, enforce_type_if_possible
@contextmanager
does_raise = pytest.raises(TypeError, match="(?i).*(isinstance|subclass|implement).*"... | 26.753086 | 91 | 0.673281 | from contextlib import contextmanager
import pytest
from typing_extensions import Annotated, Protocol, runtime_checkable
from antidote._internal.utils import enforce_subclass_if_possible, enforce_type_if_possible
@contextmanager
def does_not_raise():
yield
does_raise = pytest.raises(TypeError, match="(?i).*(i... | 243 | 43 | 258 |
5bd0f9ff5b90e31f43fecdedd94b0bbe5eacf7d3 | 7,855 | py | Python | nuro_arm/robot/base_controller.py | tw-ilson/nuro-arm | 48bbe244b814cf74c44af819b738c2349eb674b9 | [
"MIT"
] | 4 | 2021-12-29T20:34:39.000Z | 2022-01-30T22:41:33.000Z | nuro_arm/robot/base_controller.py | tw-ilson/nuro-arm | 48bbe244b814cf74c44af819b738c2349eb674b9 | [
"MIT"
] | 19 | 2021-05-02T00:34:18.000Z | 2021-07-16T21:19:51.000Z | nuro_arm/robot/base_controller.py | tw-ilson/nuro-arm | 48bbe244b814cf74c44af819b738c2349eb674b9 | [
"MIT"
] | 4 | 2021-08-24T18:25:04.000Z | 2022-02-27T19:54:16.000Z | import numpy as np
import time
from abc import abstractmethod
| 28.772894 | 90 | 0.58014 | import numpy as np
import time
from abc import abstractmethod
class BaseController:
def __init__(self):
'''Base class for controller to implement move and read commands
'''
self.joint_names = ('base', 'shoulder','elbow',
'wrist','wristRotation', 'gripper')
... | 0 | 7,769 | 23 |
5dc9f68356aa5dfaac46f4824e525645d1114957 | 1,197 | py | Python | scrapy_store_project/scraper/pipelines.py | MaksNech/pylab2018_ht_22 | 5c862b23203e93bf4cbdf5f1e5777f29052f2f69 | [
"MIT"
] | null | null | null | scrapy_store_project/scraper/pipelines.py | MaksNech/pylab2018_ht_22 | 5c862b23203e93bf4cbdf5f1e5777f29052f2f69 | [
"MIT"
] | 10 | 2020-02-11T23:54:49.000Z | 2022-03-11T23:42:36.000Z | scrapy_store_project/scraper/pipelines.py | MaksNech/pylab2018_ht_22 | 5c862b23203e93bf4cbdf5f1e5777f29052f2f69 | [
"MIT"
] | 1 | 2020-12-02T09:32:19.000Z | 2020-12-02T09:32:19.000Z | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import os
import sys
import django
from scrapy import signals
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.... | 25.468085 | 78 | 0.680033 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import os
import sys
import django
from scrapy import signals
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.... | 564 | 134 | 23 |
92dbc8f200a54ac55c94f1954e2ee4e7d3a1355d | 790 | py | Python | routes/links.py | rumourlens/rumourlens | 20dbf573b138d63d66bf14ab9a210e32e80bdbf3 | [
"MIT"
] | null | null | null | routes/links.py | rumourlens/rumourlens | 20dbf573b138d63d66bf14ab9a210e32e80bdbf3 | [
"MIT"
] | null | null | null | routes/links.py | rumourlens/rumourlens | 20dbf573b138d63d66bf14ab9a210e32e80bdbf3 | [
"MIT"
] | null | null | null | from app import app
from flask import jsonify,render_template,json, request
from services import LinksServices
@app.route("/links",methods=['GET'])
@app.route("/link/getTopLinks",methods=['GET'])
@app.route("/link/getTotalLinks",methods=['GET'])
@app.route("/link/getMentionHistory",methods=['GET']) | 32.916667 | 72 | 0.736709 | from app import app
from flask import jsonify,render_template,json, request
from services import LinksServices
@app.route("/links",methods=['GET'])
def getAllLinks():
links = LinksServices.getAllLinks()
return jsonify(links)
@app.route("/link/getTopLinks",methods=['GET'])
def getTopLinks():
links = LinksS... | 399 | 0 | 88 |
2ebcb304719c846a96b450a872767c09f6975bff | 311 | py | Python | rouge.py | googlx/lasertagger | 3c4ecad69fa9c45f934f83a0db534490da702679 | [
"Apache-2.0"
] | 1 | 2021-04-10T00:51:41.000Z | 2021-04-10T00:51:41.000Z | rouge.py | googlx/lasertagger | 3c4ecad69fa9c45f934f83a0db534490da702679 | [
"Apache-2.0"
] | 3 | 2020-11-13T18:56:44.000Z | 2022-02-10T01:59:32.000Z | rouge.py | googlx/lasertagger | 3c4ecad69fa9c45f934f83a0db534490da702679 | [
"Apache-2.0"
] | null | null | null | from utils_rouge import rouge_eval, rouge_log
rouge_ref_dir = './output/reference'
rouge_dec_dir = './output/decoded'
print("Decoder has finished reading dataset for single_pass.")
print("Now starting ROUGE eval...")
results_dict = rouge_eval(rouge_ref_dir, rouge_dec_dir)
rouge_log(results_dict, './output')
| 31.1 | 62 | 0.787781 | from utils_rouge import rouge_eval, rouge_log
rouge_ref_dir = './output/reference'
rouge_dec_dir = './output/decoded'
print("Decoder has finished reading dataset for single_pass.")
print("Now starting ROUGE eval...")
results_dict = rouge_eval(rouge_ref_dir, rouge_dec_dir)
rouge_log(results_dict, './output')
| 0 | 0 | 0 |
72726e3efa4ceff6e72a25841f7fa6e76f621db3 | 11,010 | py | Python | models/record.py | ourresearch/openalex-guts | f6c3e9992361e4bb1dbe76fbfb644c80f081319a | [
"MIT"
] | 48 | 2021-11-20T08:17:53.000Z | 2022-03-19T13:57:15.000Z | models/record.py | ourresearch/openalex-guts | f6c3e9992361e4bb1dbe76fbfb644c80f081319a | [
"MIT"
] | null | null | null | models/record.py | ourresearch/openalex-guts | f6c3e9992361e4bb1dbe76fbfb644c80f081319a | [
"MIT"
] | 2 | 2022-01-04T16:28:48.000Z | 2022-02-05T21:25:01.000Z | from cached_property import cached_property
from sqlalchemy import text
from sqlalchemy import orm
from sqlalchemy.orm import selectinload
from sqlalchemy.sql.expression import func
from sqlalchemy.orm import deferred
from sqlalchemy.orm import foreign, remote
from collections import defaultdict
from time import sleep
... | 36.456954 | 142 | 0.675114 | from cached_property import cached_property
from sqlalchemy import text
from sqlalchemy import orm
from sqlalchemy.orm import selectinload
from sqlalchemy.sql.expression import func
from sqlalchemy.orm import deferred
from sqlalchemy.orm import foreign, remote
from collections import defaultdict
from time import sleep
... | 4,905 | 2,239 | 23 |
b44e6ad1f6b98b54aff50079a3affbf13f219dbe | 77 | py | Python | vmaig_blog/uwsgi-2.0.14/plugins/ldap/uwsgiplugin.py | StanYaha/Blog | 3cb38918e14ebe6ce2e2952ef272de116849910d | [
"BSD-3-Clause"
] | 1 | 2018-11-24T16:10:49.000Z | 2018-11-24T16:10:49.000Z | vmaig_blog/uwsgi-2.0.14/plugins/ldap/uwsgiplugin.py | StanYaha/Blog | 3cb38918e14ebe6ce2e2952ef272de116849910d | [
"BSD-3-Clause"
] | null | null | null | vmaig_blog/uwsgi-2.0.14/plugins/ldap/uwsgiplugin.py | StanYaha/Blog | 3cb38918e14ebe6ce2e2952ef272de116849910d | [
"BSD-3-Clause"
] | null | null | null |
NAME='ldap'
CFLAGS = []
LDFLAGS = []
LIBS = ['-lldap']
GCC_LIST = ['ldap']
| 9.625 | 19 | 0.545455 |
NAME='ldap'
CFLAGS = []
LDFLAGS = []
LIBS = ['-lldap']
GCC_LIST = ['ldap']
| 0 | 0 | 0 |
1c046407244deb02d0099a3e7440668c299e7d9b | 10,677 | py | Python | wcxf/cli.py | peterstangl/wcxf-python | 20efadb04955a47672c36760d73d5ba74c5a662e | [
"MIT"
] | null | null | null | wcxf/cli.py | peterstangl/wcxf-python | 20efadb04955a47672c36760d73d5ba74c5a662e | [
"MIT"
] | null | null | null | wcxf/cli.py | peterstangl/wcxf-python | 20efadb04955a47672c36760d73d5ba74c5a662e | [
"MIT"
] | null | null | null | import argparse
import wcxf
import sys
import logging
import os
import yaml
import pylha
| 47.453333 | 205 | 0.612813 | import argparse
import wcxf
import sys
import logging
import os
import yaml
import pylha
def wcxf_cli():
parser = argparse.ArgumentParser(description="Command line interface to manipulate WCxf files.")
subparsers = parser.add_subparsers(title='subcommands')
# convert
parser_convert = subparsers.add_... | 10,372 | 0 | 207 |
d72fb4f4b08de98dc8f334b02950346f14ca7c43 | 9,548 | py | Python | meregistro/apps/registro/views/extension_aulica_matricula.py | MERegistro/meregistro | 6cde3cab2bd1a8e3084fa38147de377d229391e3 | [
"BSD-3-Clause"
] | null | null | null | meregistro/apps/registro/views/extension_aulica_matricula.py | MERegistro/meregistro | 6cde3cab2bd1a8e3084fa38147de377d229391e3 | [
"BSD-3-Clause"
] | null | null | null | meregistro/apps/registro/views/extension_aulica_matricula.py | MERegistro/meregistro | 6cde3cab2bd1a8e3084fa38147de377d229391e3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
from django.http import HttpResponseRedirect
from datetime import datetime
from django.core.urlresolvers import reverse
from django.core.paginator import Paginator
from meregistro.shortcuts import my_render
from apps.seguridad.decorators import login_required, credential_required
from apps.segu... | 39.949791 | 144 | 0.730519 | # -*- coding: UTF-8 -*-
from django.http import HttpResponseRedirect
from datetime import datetime
from django.core.urlresolvers import reverse
from django.core.paginator import Paginator
from meregistro.shortcuts import my_render
from apps.seguridad.decorators import login_required, credential_required
from apps.segu... | 5,926 | 0 | 110 |
3138f874a431daafafc80599313e8cd2516eb070 | 740 | py | Python | MoleculeACE/benchmark/models/load_model.py | molML/MoleculeACE | e831d2371a9b89f4853a03d5c04cc4bf59f64ee0 | [
"MIT"
] | 9 | 2022-03-26T17:36:03.000Z | 2022-03-29T19:50:26.000Z | MoleculeACE/benchmark/models/load_model.py | molML/MoleculeACE | e831d2371a9b89f4853a03d5c04cc4bf59f64ee0 | [
"MIT"
] | null | null | null | MoleculeACE/benchmark/models/load_model.py | molML/MoleculeACE | e831d2371a9b89f4853a03d5c04cc4bf59f64ee0 | [
"MIT"
] | null | null | null | """
Load a model
Derek van Tilborg, Eindhoven University of Technology, March 2022
"""
from MoleculeACE.benchmark.utils.const import Algorithms
from .model import Model
def load_model(data, algorithm: Algorithms, model_file: str):
""" Train a machine learning model
Args:
data: MoleculeACE.benchmark.... | 30.833333 | 119 | 0.739189 | """
Load a model
Derek van Tilborg, Eindhoven University of Technology, March 2022
"""
from MoleculeACE.benchmark.utils.const import Algorithms
from .model import Model
def load_model(data, algorithm: Algorithms, model_file: str):
""" Train a machine learning model
Args:
data: MoleculeACE.benchmark.... | 0 | 0 | 0 |
e19a008abc0f729a065a03a7a7ec3e045a8f7896 | 17,710 | py | Python | applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/xmcAlgorithm.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | null | null | null | applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/xmcAlgorithm.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | null | null | null | applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/xmcAlgorithm.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | null | null | null | import pickle
import pathlib as pl
from typing import List
# XMC imports
from xmc.tools import dynamicImport, splitOneListIntoTwo
from xmc.methodDefs_xmcAlgorithm import checkInitialisation
# Import ExaQUte API
from exaqute import get_value_from_remote
class XMCAlgorithm:
"""
This top-level class handles t... | 43.513514 | 189 | 0.636025 | import pickle
import pathlib as pl
from typing import List
# XMC imports
from xmc.tools import dynamicImport, splitOneListIntoTwo
from xmc.methodDefs_xmcAlgorithm import checkInitialisation
# Import ExaQUte API
from exaqute import get_value_from_remote
class XMCAlgorithm:
"""
This top-level class handles t... | 2,163 | 0 | 189 |
8b275c92ddd27f3d075cae19768279407b485228 | 27,985 | py | Python | examples/ex_trust_cognitive_architecture/ex_trust_cognitive_architecture_4yo.py | riccardobrue/SOM-example-1 | 8a977e73844f9206ee1704be577f8a7521d2b306 | [
"MIT"
] | null | null | null | examples/ex_trust_cognitive_architecture/ex_trust_cognitive_architecture_4yo.py | riccardobrue/SOM-example-1 | 8a977e73844f9206ee1704be577f8a7521d2b306 | [
"MIT"
] | null | null | null | examples/ex_trust_cognitive_architecture/ex_trust_cognitive_architecture_4yo.py | riccardobrue/SOM-example-1 | 8a977e73844f9206ee1704be577f8a7521d2b306 | [
"MIT"
] | 1 | 2021-03-16T16:02:16.000Z | 2021-03-16T16:02:16.000Z | #!/usr/bin/python
## Massimiliano Patacchiola, Plymouth University 2016
import numpy as np
import os
import time
from scipy import spatial
#Informant reputation is evaluated considering: agent_action, agent_confidence, informant_action
#If the confidence of the agent is high and the action suggested is different fr... | 66.002358 | 184 | 0.697802 | #!/usr/bin/python
## Massimiliano Patacchiola, Plymouth University 2016
import numpy as np
import os
import time
from scipy import spatial
#Informant reputation is evaluated considering: agent_action, agent_confidence, informant_action
#If the confidence of the agent is high and the action suggested is different fr... | 16,219 | 0 | 46 |
08abed566828c755c6dafae9abf66653c5f6ec0e | 4,352 | py | Python | aditiplot/aditiplot.py | lanery/aditiplot | 3a5ca99060e9628e590880e379795613f2d4164c | [
"CC-BY-4.0"
] | null | null | null | aditiplot/aditiplot.py | lanery/aditiplot | 3a5ca99060e9628e590880e379795613f2d4164c | [
"CC-BY-4.0"
] | null | null | null | aditiplot/aditiplot.py | lanery/aditiplot | 3a5ca99060e9628e590880e379795613f2d4164c | [
"CC-BY-4.0"
] | null | null | null | import seaborn as sns
def deorganize(data, x=None, y=None, hue=None, size=None, style=None, **kwargs):
"""Make some chaos
The idea is that we want to use as many plotting dimensions
(e.g. marker color, marker shape, etc.) as possible when
we plot our data. So given a multidimensional dataset,... | 32.237037 | 81 | 0.570083 | import seaborn as sns
def deorganize(data, x=None, y=None, hue=None, size=None, style=None, **kwargs):
"""Make some chaos
The idea is that we want to use as many plotting dimensions
(e.g. marker color, marker shape, etc.) as possible when
we plot our data. So given a multidimensional dataset,... | 0 | 0 | 0 |
a7cc991e8ac47a75b3836911d13cef1016b921af | 4,177 | py | Python | backend/app/widget/widget_routes.py | timmyjose-projects/learn | 57ef1d9282a367a35de67a951d6c7a7d91ee9a6a | [
"CC-BY-4.0"
] | null | null | null | backend/app/widget/widget_routes.py | timmyjose-projects/learn | 57ef1d9282a367a35de67a951d6c7a7d91ee9a6a | [
"CC-BY-4.0"
] | null | null | null | backend/app/widget/widget_routes.py | timmyjose-projects/learn | 57ef1d9282a367a35de67a951d6c7a7d91ee9a6a | [
"CC-BY-4.0"
] | null | null | null | from flask import Blueprint, make_response, request, send_file
from flask import current_app as app
from flask_cors import CORS
from queue import Empty
from kombu import Queue
import json
import sys
from . import tasks, celery
from .project import Project
widget_bp = Blueprint('widget_bp', __name__)
CORS(widget_bp)... | 32.379845 | 117 | 0.659804 | from flask import Blueprint, make_response, request, send_file
from flask import current_app as app
from flask_cors import CORS
from queue import Empty
from kombu import Queue
import json
import sys
from . import tasks, celery
from .project import Project
widget_bp = Blueprint('widget_bp', __name__)
CORS(widget_bp)... | 0 | 0 | 0 |
791c1e4b4625ee8f12eaea11c5edb36cf51710a8 | 1,186 | py | Python | gym/configuration.py | JialinMao/gym-ww | dad1b3313e5e5c767c189f2f43ace8097f2ff7bf | [
"MIT"
] | 6 | 2017-01-30T22:06:12.000Z | 2020-02-18T08:56:27.000Z | gym/configuration.py | JialinMao/gym-ww | dad1b3313e5e5c767c189f2f43ace8097f2ff7bf | [
"MIT"
] | null | null | null | gym/configuration.py | JialinMao/gym-ww | dad1b3313e5e5c767c189f2f43ace8097f2ff7bf | [
"MIT"
] | 9 | 2016-10-04T13:51:28.000Z | 2020-10-14T13:42:09.000Z | import logging
import sys
import gym
logger = logging.getLogger(__name__)
root_logger = logging.getLogger()
requests_logger = logging.getLogger('requests')
# Set up the default handler
formatter = logging.Formatter('[%(asctime)s] %(message)s')
handler = logging.StreamHandler(sys.stderr)
handler.setFormatter(formatt... | 31.210526 | 77 | 0.758853 | import logging
import sys
import gym
logger = logging.getLogger(__name__)
root_logger = logging.getLogger()
requests_logger = logging.getLogger('requests')
# Set up the default handler
formatter = logging.Formatter('[%(asctime)s] %(message)s')
handler = logging.StreamHandler(sys.stderr)
handler.setFormatter(formatt... | 220 | 0 | 22 |
2ca07aa75baba2d9f619917a32e68963b82b48a3 | 6,614 | py | Python | jpp_boosted_django/jpp_boosted/models/models.py | QualmandDriven/jpp_boosted | 895e2e85a7b0dd2fcfc6f2352fc318f2555e16df | [
"MIT"
] | 1 | 2020-07-28T19:36:51.000Z | 2020-07-28T19:36:51.000Z | jpp_boosted_django/jpp_boosted/models/models.py | QualmandDriven/jpp_boosted | 895e2e85a7b0dd2fcfc6f2352fc318f2555e16df | [
"MIT"
] | 11 | 2020-06-05T22:37:24.000Z | 2022-02-10T08:25:59.000Z | jpp_boosted_django/jpp_boosted/models/models.py | QualmandDriven/jpp_boosted | 895e2e85a7b0dd2fcfc6f2352fc318f2555e16df | [
"MIT"
] | null | null | null | from django.db import models
import re
# Create your models here.
| 32.106796 | 156 | 0.710916 | from django.db import models
import re
# Create your models here.
class YouTubeVideo(models.Model):
created = models.DateTimeField(auto_now_add=True)
url = models.URLField(max_length=100)
title = models.CharField(max_length=100)
city = models.CharField(max_length=100)
country = models.CharFie... | 1,566 | 4,627 | 345 |
58496e8aefc44d1f04acb865c600842d4da38e18 | 4,903 | py | Python | automol/reac/_rot.py | sjklipp/autochem | ac343a4bc5ff8c9a75e75d7ed717ea2db659b7a0 | [
"Apache-2.0"
] | 1 | 2021-03-01T14:21:08.000Z | 2021-03-01T14:21:08.000Z | automol/reac/_rot.py | avcopan/autochem | 19d9b0402568170ae5ca0adecb460d36f258a9bd | [
"Apache-2.0"
] | null | null | null | automol/reac/_rot.py | avcopan/autochem | 19d9b0402568170ae5ca0adecb460d36f258a9bd | [
"Apache-2.0"
] | null | null | null | """ rotational bond/torsion info for specific reaction classes
"""
from automol.par import ReactionClass
import automol.zmat
from automol.reac._util import hydrogen_abstraction_atom_keys
from automol.reac._util import substitution_atom_keys
# Bimolecular reactions
# 1. Hydrogen abstractions
def hydrogen_abstraction_l... | 34.528169 | 77 | 0.698756 | """ rotational bond/torsion info for specific reaction classes
"""
from automol.par import ReactionClass
import automol.zmat
from automol.reac._util import hydrogen_abstraction_atom_keys
from automol.reac._util import substitution_atom_keys
# Bimolecular reactions
# 1. Hydrogen abstractions
def hydrogen_abstraction_l... | 225 | 0 | 27 |
a18905de8d28998daeecfe3659f1fa4e2de8517f | 7,341 | py | Python | makeMKV/model/title.py | coolman565/blu_two | 5c7626145b3644570be99ff0267f88bd61b9806c | [
"MIT"
] | null | null | null | makeMKV/model/title.py | coolman565/blu_two | 5c7626145b3644570be99ff0267f88bd61b9806c | [
"MIT"
] | 1 | 2021-06-01T21:57:23.000Z | 2021-06-01T21:57:23.000Z | makeMKV/model/title.py | coolman565/blu_two | 5c7626145b3644570be99ff0267f88bd61b9806c | [
"MIT"
] | null | null | null | import logging
from typing import Dict
from makeMKV.model.enum.item_attribute_id import ItemAttributeId
from makeMKV.model.enum.item_info import ItemInfo
from makeMKV.model.enum.stream_type import StreamType
from makeMKV.model.stream import Stream, VideoStream, SubtitleStream, AudioStream
logger = logging.getLogger(_... | 37.454082 | 115 | 0.583572 | import logging
from typing import Dict
from makeMKV.model.enum.item_attribute_id import ItemAttributeId
from makeMKV.model.enum.item_info import ItemInfo
from makeMKV.model.enum.stream_type import StreamType
from makeMKV.model.stream import Stream, VideoStream, SubtitleStream, AudioStream
logger = logging.getLogger(_... | 1,978 | 5,010 | 23 |
40317c43fa10080de33cb6aa239d4efddfdd1a2d | 7,106 | py | Python | beatbrain/generator/cvae_keras.py | Emrys-Hong/BeatBrain | 68159d9cc46d85e73afdc5aa5341c45158dc1b28 | [
"MIT"
] | 1 | 2020-03-28T21:18:50.000Z | 2020-03-28T21:18:50.000Z | beatbrain/generator/cvae_keras.py | Emrys-Hong/BeatBrain | 68159d9cc46d85e73afdc5aa5341c45158dc1b28 | [
"MIT"
] | null | null | null | beatbrain/generator/cvae_keras.py | Emrys-Hong/BeatBrain | 68159d9cc46d85e73afdc5aa5341c45158dc1b28 | [
"MIT"
] | null | null | null | import os
import time
import numpy as np
import tensorflow as tf
from operator import mul
from functools import reduce
from pathlib import Path
from datetime import datetime
from tqdm import tqdm
from PIL import Image
from . import data_utils
from .. import settings
tf.compat.v1.enable_eager_execution()
@tf.functi... | 34.495146 | 111 | 0.684914 | import os
import time
import numpy as np
import tensorflow as tf
from operator import mul
from functools import reduce
from pathlib import Path
from datetime import datetime
from tqdm import tqdm
from PIL import Image
from . import data_utils
from .. import settings
tf.compat.v1.enable_eager_execution()
def log_nor... | 2,079 | 0 | 136 |
4bbfc96feb84bff49cd2671b5c01825ad4c226cf | 2,182 | py | Python | src/reformat-stanford-dataset.py | Diover/tell-the-dog-breed | 89581306dbc5d87d592bfd6f481310927053df42 | [
"MIT"
] | null | null | null | src/reformat-stanford-dataset.py | Diover/tell-the-dog-breed | 89581306dbc5d87d592bfd6f481310927053df42 | [
"MIT"
] | null | null | null | src/reformat-stanford-dataset.py | Diover/tell-the-dog-breed | 89581306dbc5d87d592bfd6f481310927053df42 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import os
import re
from os.path import join
from os import path, makedirs, rename
from tqdm import tqdm
#save_data_to_folders("../input")
| 34.634921 | 114 | 0.644363 | import numpy as np
import pandas as pd
import os
import re
from os.path import join
from os import path, makedirs, rename
from tqdm import tqdm
def get_new_name(folder_name, labels):
folder_name = folder_name.lower()
breed_name_regex = re.compile("[n\d]+-(?P<breed_name>[\w_]+)")
breed_name = breed_name_re... | 1,955 | 0 | 46 |
dc18b4ed104910515c5ef026a2a7a10acb908ced | 2,807 | py | Python | mak/libs/waflib/extras/slow_qt4.py | motor-dev/Motor | 98cb099fe1c2d31e455ed868cc2a25eae51e79f0 | [
"BSD-3-Clause"
] | 4 | 2015-05-13T16:28:36.000Z | 2017-05-24T15:34:14.000Z | mak/libs/waflib/extras/slow_qt4.py | motor-dev/Motor | 98cb099fe1c2d31e455ed868cc2a25eae51e79f0 | [
"BSD-3-Clause"
] | null | null | null | mak/libs/waflib/extras/slow_qt4.py | motor-dev/Motor | 98cb099fe1c2d31e455ed868cc2a25eae51e79f0 | [
"BSD-3-Clause"
] | 1 | 2017-03-21T08:28:07.000Z | 2017-03-21T08:28:07.000Z | #! /usr/bin/env python
# Thomas Nagy, 2011 (ita)
"""
Create _moc.cpp files
The builds are 30-40% faster when .moc files are included,
you should NOT use this tool. If you really
really want it:
def configure(conf):
conf.load('compiler_cxx qt4')
conf.load('slow_qt4')
See playground/slow_qt/wscript for a complete e... | 28.938144 | 107 | 0.666548 | #! /usr/bin/env python
# Thomas Nagy, 2011 (ita)
"""
Create _moc.cpp files
The builds are 30-40% faster when .moc files are included,
you should NOT use this tool. If you really
really want it:
def configure(conf):
conf.load('compiler_cxx qt4')
conf.load('slow_qt4')
See playground/slow_qt/wscript for a complete e... | 2,244 | 13 | 68 |
eca64f46b859dc9f0fbbfd0c3722289c89299a99 | 1,233 | py | Python | easyrepr/decorator.py | chrisbouchard/autorepr | 59946af44564db65639d468b30fcd3cfad282c49 | [
"MIT"
] | 2 | 2021-12-15T05:46:05.000Z | 2022-03-16T00:07:39.000Z | easyrepr/decorator.py | chrisbouchard/autorepr | 59946af44564db65639d468b30fcd3cfad282c49 | [
"MIT"
] | 11 | 2021-09-29T17:56:04.000Z | 2021-12-21T02:14:57.000Z | easyrepr/decorator.py | chrisbouchard/autorepr | 59946af44564db65639d468b30fcd3cfad282c49 | [
"MIT"
] | 1 | 2021-12-26T01:41:43.000Z | 2021-12-26T01:41:43.000Z | from .descriptor import EasyRepr
__all__ = ["easyrepr"]
def easyrepr(wrapped=None, **kwargs):
"""Decorator for an automatic `__repr__` method.
:param wrapped: the function to wrap
See `.descriptor.EasyRepr` for a full description of the accepted
keyword parameters.
This decorator wraps a func... | 24.66 | 78 | 0.621249 | from .descriptor import EasyRepr
__all__ = ["easyrepr"]
def easyrepr(wrapped=None, **kwargs):
"""Decorator for an automatic `__repr__` method.
:param wrapped: the function to wrap
See `.descriptor.EasyRepr` for a full description of the accepted
keyword parameters.
This decorator wraps a func... | 47 | 0 | 27 |
ddee3bcaf51c31126dfa9a4b6fb2c255d2036969 | 384 | py | Python | authors/apps/comments/migrations/0003_likes_liked.py | KabohaJeanMark/ah-backend-invictus | a9cf930934e8cbcb4ee370a088df57abe50ee6d6 | [
"BSD-3-Clause"
] | 7 | 2021-03-04T09:29:13.000Z | 2021-03-17T17:35:42.000Z | authors/apps/comments/migrations/0003_likes_liked.py | KabohaJeanMark/ah-backend-invictus | a9cf930934e8cbcb4ee370a088df57abe50ee6d6 | [
"BSD-3-Clause"
] | 25 | 2019-04-23T18:51:02.000Z | 2021-06-10T21:22:47.000Z | authors/apps/comments/migrations/0003_likes_liked.py | KabohaJeanMark/ah-backend-invictus | a9cf930934e8cbcb4ee370a088df57abe50ee6d6 | [
"BSD-3-Clause"
] | 7 | 2019-06-29T10:40:38.000Z | 2019-09-23T09:05:45.000Z | # Generated by Django 2.1 on 2019-05-07 15:15
from django.db import migrations, models
| 20.210526 | 53 | 0.598958 | # Generated by Django 2.1 on 2019-05-07 15:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comments', '0002_auto_20190506_0926'),
]
operations = [
migrations.AddField(
model_name='likes',
name='liked',
... | 0 | 272 | 23 |
5ef82217f4a6311a3d779e3237bb3b4d02f8267c | 1,066 | py | Python | tests/test_cli.py | tucked/isilon_hadoop_tools | 8fb5aa704109f4e8e07b79e65cb81acca0e3ec57 | [
"MIT"
] | 16 | 2016-07-14T17:27:11.000Z | 2020-09-22T22:45:43.000Z | tests/test_cli.py | tucked/isilon_hadoop_tools | 8fb5aa704109f4e8e07b79e65cb81acca0e3ec57 | [
"MIT"
] | 70 | 2016-07-29T04:59:27.000Z | 2022-03-30T22:12:44.000Z | tests/test_cli.py | tucked/isilon_hadoop_tools | 8fb5aa704109f4e8e07b79e65cb81acca0e3ec57 | [
"MIT"
] | 18 | 2016-07-29T04:28:09.000Z | 2022-03-29T07:41:55.000Z | """Verify the functionality of isilon_hadoop_tools.cli."""
from __future__ import absolute_import
from __future__ import unicode_literals
try:
from unittest.mock import Mock # Python 3
except ImportError:
from mock import Mock # Python 2
import pytest
from isilon_hadoop_tools import IsilonHadoopToolError... | 26.65 | 69 | 0.731707 | """Verify the functionality of isilon_hadoop_tools.cli."""
from __future__ import absolute_import
from __future__ import unicode_literals
try:
from unittest.mock import Mock # Python 3
except ImportError:
from mock import Mock # Python 2
import pytest
from isilon_hadoop_tools import IsilonHadoopToolError... | 0 | 0 | 0 |
1de1fefcfbae29c04dff8fa5872f692b3b8b4592 | 2,382 | py | Python | Ch2_Linked_Lists/test/test_CTCI_Ch2_Ex1.py | mtrdazzo/CTCI | 30a82aed96b05fe21b7d337a138e4ec19950eb9d | [
"MIT"
] | null | null | null | Ch2_Linked_Lists/test/test_CTCI_Ch2_Ex1.py | mtrdazzo/CTCI | 30a82aed96b05fe21b7d337a138e4ec19950eb9d | [
"MIT"
] | null | null | null | Ch2_Linked_Lists/test/test_CTCI_Ch2_Ex1.py | mtrdazzo/CTCI | 30a82aed96b05fe21b7d337a138e4ec19950eb9d | [
"MIT"
] | null | null | null | from unittest import TestCase
from CTCI.Ch2_Linked_Lists.common.SinglyLinkedList import Empty
from CTCI.Ch2_Linked_Lists.exercises.CTCI_Ch2_Ex1 import RemoveDupsSinglyLinkedList
| 25.891304 | 83 | 0.607893 | from unittest import TestCase
from CTCI.Ch2_Linked_Lists.common.SinglyLinkedList import Empty
from CTCI.Ch2_Linked_Lists.exercises.CTCI_Ch2_Ex1 import RemoveDupsSinglyLinkedList
class TestRemoveDupsSinglyLinkedList(TestCase):
def setUp(self):
self.sll = RemoveDupsSinglyLinkedList()
def test_remove_d... | 1,884 | 26 | 293 |
b2dfce2b855c3b3e611698d0f2997085b2a4e838 | 798 | py | Python | cloudmesh/pi/board/load.py | nitesh-jaswal/cloudmesh-pi-cluster | 804a7f0f93fb06161bccb4c9ff0fcecc93854747 | [
"Apache-2.0"
] | null | null | null | cloudmesh/pi/board/load.py | nitesh-jaswal/cloudmesh-pi-cluster | 804a7f0f93fb06161bccb4c9ff0fcecc93854747 | [
"Apache-2.0"
] | 1 | 2020-07-15T15:05:11.000Z | 2020-07-15T16:53:21.000Z | cloudmesh/pi/board/load.py | nitesh-jaswal/cloudmesh-pi-cluster | 804a7f0f93fb06161bccb4c9ff0fcecc93854747 | [
"Apache-2.0"
] | null | null | null | from cloudmesh.pi.board.monitor import Monitor
| 25.741935 | 87 | 0.441103 | from cloudmesh.pi.board.monitor import Monitor
class Load(Monitor):
def __init__(self):
self.title = "Load"
self.order = order = [
'host',
'1', '5', '10',
'proc.running', 'proc.total'
]
self.command = "cat /proc/loadavg"
self.display = [... | 674 | -1 | 77 |
38a4bc7f77a764d1ad0c2c9ab7b92edbd8bcb694 | 1,571 | py | Python | lc0647_palindromic_substrings.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | 8 | 2019-03-18T06:37:24.000Z | 2022-01-30T07:50:58.000Z | lc0647_palindromic_substrings.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | null | null | null | lc0647_palindromic_substrings.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | null | null | null | """Leetcode 647. Palindromic Substrings
Medium
URL: https://leetcode.com/problems/palindromic-substrings/
Given a string, your task is to count how many palindromic substrings in this string.
The substrings with different start indexes or end indexes are counted as different
substrings even they consist of same char... | 24.169231 | 85 | 0.623806 | """Leetcode 647. Palindromic Substrings
Medium
URL: https://leetcode.com/problems/palindromic-substrings/
Given a string, your task is to count how many palindromic substrings in this string.
The substrings with different start indexes or end indexes are counted as different
substrings even they consist of same char... | 407 | 548 | 46 |
d326a9b07b474852b322ea28e418922f966869c6 | 702 | py | Python | sources/tools.py | bmstu-iu8-g1-2019-project/road_signs_recognition | 72adbf7b08dc74c9b8a202275ac40d794f12d2dc | [
"MIT"
] | 1 | 2019-09-27T19:33:37.000Z | 2019-09-27T19:33:37.000Z | sources/tools.py | bmstu-iu8-g1-2019-project/road_signs_recognition | 72adbf7b08dc74c9b8a202275ac40d794f12d2dc | [
"MIT"
] | 1 | 2019-10-28T20:30:14.000Z | 2019-10-28T20:30:14.000Z | sources/tools.py | bmstu-iu8-g1-2019-project/road_signs_recognition | 72adbf7b08dc74c9b8a202275ac40d794f12d2dc | [
"MIT"
] | null | null | null | import os
import numpy as np
from keras.preprocessing.image import load_img
if __name__ == '__main__':
img = load_img('../dataset/validation/0000000.jpg', target_size=(1280, 720))
img.show() | 28.08 | 80 | 0.611111 | import os
import numpy as np
from keras.preprocessing.image import load_img
def versionize(versions_dir,
root,
insides=('configs', 'weights')):
versions = os.listdir(versions_dir)
if not versions:
version = 0
else:
version = max([int(ver[len(root) + 2:]) for v... | 478 | 0 | 23 |
927fbf32a39787eb7d2bcd4be43f67d8d71cd118 | 4,970 | py | Python | Same.py | Naomi-Hiebert/intersectional-same | 5ea42206b6ad416b40245420ce886301b57a9bbc | [
"MIT"
] | null | null | null | Same.py | Naomi-Hiebert/intersectional-same | 5ea42206b6ad416b40245420ce886301b57a9bbc | [
"MIT"
] | null | null | null | Same.py | Naomi-Hiebert/intersectional-same | 5ea42206b6ad416b40245420ce886301b57a9bbc | [
"MIT"
] | null | null | null | import pyglet
import Block
import BlockArray
import random
#magic numbers
blockSize = 24
pointSize = 6
halfBorder = 1.0
height = 24
width = 36
#ugly global variables for visual effects
hoverGroup = []
#initialize the most important data structure
blocks = BlockArray.BlockArray(width, height)
#initialize the graph... | 26.43617 | 86 | 0.694165 | import pyglet
import Block
import BlockArray
import random
#magic numbers
blockSize = 24
pointSize = 6
halfBorder = 1.0
height = 24
width = 36
#ugly global variables for visual effects
hoverGroup = []
#initialize the most important data structure
blocks = BlockArray.BlockArray(width, height)
#initialize the graph... | 2,658 | 0 | 178 |
4deaf032a0e878f01886779007c8e1a12aab8710 | 647 | py | Python | insta/migrations/0009_auto_20210713_0642.py | ndanu-josy/Instagram | e8b189b06e8c9326a680759b06fd85462c49d124 | [
"MIT"
] | null | null | null | insta/migrations/0009_auto_20210713_0642.py | ndanu-josy/Instagram | e8b189b06e8c9326a680759b06fd85462c49d124 | [
"MIT"
] | null | null | null | insta/migrations/0009_auto_20210713_0642.py | ndanu-josy/Instagram | e8b189b06e8c9326a680759b06fd85462c49d124 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-13 06:42
import cloudinary.models
from django.db import migrations
| 25.88 | 97 | 0.622875 | # Generated by Django 3.2.5 on 2021-07-13 06:42
import cloudinary.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('insta', '0008_auto_20210713_0636'),
]
operations = [
migrations.AlterField(
model_name='image',
nam... | 0 | 516 | 23 |
bc8067c0d0a0d0d36e472d88ed41e7fd71b84766 | 2,124 | py | Python | tests/benchmarks/test_onell_benchmark.py | ndangtt/LeadingOnesDAC | 953747d8702f179851d7973c65779a1f830e03a1 | [
"Apache-2.0"
] | 11 | 2020-11-09T10:50:31.000Z | 2022-02-19T09:23:44.000Z | tests/benchmarks/test_onell_benchmark.py | ndangtt/LeadingOnesDAC | 953747d8702f179851d7973c65779a1f830e03a1 | [
"Apache-2.0"
] | 95 | 2020-11-18T09:37:30.000Z | 2022-02-17T10:05:33.000Z | tests/benchmarks/test_onell_benchmark.py | ndangtt/LeadingOnesDAC | 953747d8702f179851d7973c65779a1f830e03a1 | [
"Apache-2.0"
] | 11 | 2020-11-15T15:24:27.000Z | 2022-03-14T14:51:43.000Z | import unittest
import json
import os
from dacbench.benchmarks import OneLLBenchmark
from dacbench.envs import OneLLEnv
# TestOneLLBenchmark().test_get_env()
# TestOneLLBenchmark().test_scenarios()
# TestOneLLBenchmark().test_read_instances()
# TestOneLLBenchmark().test_save_conf()
| 34.819672 | 111 | 0.637947 | import unittest
import json
import os
from dacbench.benchmarks import OneLLBenchmark
from dacbench.envs import OneLLEnv
class TestOneLLBenchmark(unittest.TestCase):
def test_get_env(self):
bench = OneLLBenchmark()
env = bench.get_environment()
self.assertTrue(issubclass(type(env), OneLLEn... | 1,684 | 23 | 130 |
bbfd3bead5c9d9bd42903cb5ed6f78c906e1ab4c | 4,160 | py | Python | tests/ut/test_data.py | konrad-kocik/pc-spec | 027fe7e831d500c4b8b73994ebb421d8bf5c8617 | [
"MIT"
] | null | null | null | tests/ut/test_data.py | konrad-kocik/pc-spec | 027fe7e831d500c4b8b73994ebb421d8bf5c8617 | [
"MIT"
] | 14 | 2022-02-19T14:53:37.000Z | 2022-03-02T19:32:42.000Z | tests/ut/test_data.py | konrad-kocik/pc-spec | 027fe7e831d500c4b8b73994ebb421d8bf5c8617 | [
"MIT"
] | null | null | null | from json import load, dump
from pathlib import Path
from shutil import rmtree
from unittest.mock import Mock
from pytest import fixture
from pc_spec.data import save_store, load_store
@fixture
@fixture
@fixture
@fixture
@fixture
@fixture
@fixture
@fixture
@fixture
@fixture
@fixture
@fixture
... | 28.108108 | 117 | 0.746875 | from json import load, dump
from pathlib import Path
from shutil import rmtree
from unittest.mock import Mock
from pytest import fixture
from pc_spec.data import save_store, load_store
@fixture
def empty_store():
store = Mock()
store.pcs = []
return store
@fixture
def store(pc_1_name, pc_1_components,... | 3,385 | 0 | 448 |
e2833a17ac9f2d4a8f52ce80f1176e4321d580fe | 846 | py | Python | flask-api/schema/user.py | PapamichMarios/Intranet | 65cd98d08a1a550d70e1afa4859a0b105c049817 | [
"MIT"
] | 1 | 2021-12-21T19:13:37.000Z | 2021-12-21T19:13:37.000Z | flask-api/schema/user.py | PapamichMarios/Intranet | 65cd98d08a1a550d70e1afa4859a0b105c049817 | [
"MIT"
] | null | null | null | flask-api/schema/user.py | PapamichMarios/Intranet | 65cd98d08a1a550d70e1afa4859a0b105c049817 | [
"MIT"
] | null | null | null | from marshmallow import Schema, fields, validate
from schema.rating_movie import RatingMovieSchema
from schema.role import RoleSchema
| 52.875 | 110 | 0.760047 | from marshmallow import Schema, fields, validate
from schema.rating_movie import RatingMovieSchema
from schema.role import RoleSchema
class UserSchema(Schema):
id = fields.Number(attribute="id")
firstName = fields.String(attribute="first_name", validate=validate.Length(min=3, max=256), required=True)
las... | 0 | 687 | 23 |
f20837dfb121c64fcbd0b514ab3bd6c8694c95da | 11,701 | py | Python | tests/test_blend_modes.py | facelessuser/coloraide | c273cb652f75941b95ad8ddc8becc9873b97f085 | [
"MIT"
] | 30 | 2020-10-11T05:47:51.000Z | 2022-03-22T06:05:33.000Z | tests/test_blend_modes.py | nisancigokmen/coloraide | 2707323cbd440e8e75fd58dd4092a5d036f07bd6 | [
"MIT"
] | 139 | 2020-10-20T15:28:57.000Z | 2022-03-31T23:44:18.000Z | tests/test_blend_modes.py | nisancigokmen/coloraide | 2707323cbd440e8e75fd58dd4092a5d036f07bd6 | [
"MIT"
] | 3 | 2021-08-29T13:25:12.000Z | 2021-12-22T19:58:11.000Z | """Test Blend modes."""
import unittest
from coloraide import Color
from . import util
# Colors that produce pretty distinct results
REDISH = '#fc3d99'
BLUISH = '#07c7ed'
YELLOWISH = '#f5d311'
class TestBlendModes(util.ColorAsserts, unittest.TestCase):
"""Test blend modes."""
def test_alpha(self):
"... | 55.719048 | 118 | 0.658576 | """Test Blend modes."""
import unittest
from coloraide import Color
from . import util
# Colors that produce pretty distinct results
REDISH = '#fc3d99'
BLUISH = '#07c7ed'
YELLOWISH = '#f5d311'
class TestBlendModes(util.ColorAsserts, unittest.TestCase):
"""Test blend modes."""
def test_alpha(self):
"... | 0 | 0 | 0 |
f850e367495ba1a2ce883b559c3209d80a125797 | 4,680 | py | Python | timeflux_brainflow/nodes/driver.py | timeflux/timeflux_brainflow | f93545c6400522f886d9770aa6688d8955bfd34c | [
"MIT"
] | 3 | 2020-03-22T01:20:59.000Z | 2021-09-02T19:03:03.000Z | timeflux_brainflow/nodes/driver.py | timeflux/timeflux_brainflow | f93545c6400522f886d9770aa6688d8955bfd34c | [
"MIT"
] | 1 | 2021-04-03T19:50:15.000Z | 2021-04-03T22:52:13.000Z | timeflux_brainflow/nodes/driver.py | timeflux/timeflux_brainflow | f93545c6400522f886d9770aa6688d8955bfd34c | [
"MIT"
] | 2 | 2020-09-24T16:56:01.000Z | 2021-11-27T15:45:30.000Z | import time
import pandas as pd
from brainflow.board_shim import (
BoardIds,
BoardShim,
BrainFlowInputParams,
BrainFlowError,
)
from timeflux.core.node import Node
class BrainFlow(Node):
"""Driver for BrainFlow.
This plugin provides a unified interface for all boards supported by BrainFlow.
... | 38.04878 | 101 | 0.620513 | import time
import pandas as pd
from brainflow.board_shim import (
BoardIds,
BoardShim,
BrainFlowInputParams,
BrainFlowError,
)
from timeflux.core.node import Node
class BrainFlow(Node):
"""Driver for BrainFlow.
This plugin provides a unified interface for all boards supported by BrainFlow.
... | 3,284 | 0 | 108 |
ffaa83bc476c29992c6bd0d1afe3b362bc913555 | 3,542 | py | Python | exercises/city_temperature_prediction.py | YaadLuria/IML.HUJI | d5cea7671009d14a37ebf9a308f16c2ca0087c92 | [
"MIT"
] | null | null | null | exercises/city_temperature_prediction.py | YaadLuria/IML.HUJI | d5cea7671009d14a37ebf9a308f16c2ca0087c92 | [
"MIT"
] | null | null | null | exercises/city_temperature_prediction.py | YaadLuria/IML.HUJI | d5cea7671009d14a37ebf9a308f16c2ca0087c92 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
import plotly.io as pio
from IMLearn.learners.regressors.polynomial_fitting import PolynomialFitting
from IMLearn.utils import utils
pio.templates.default = "simple_white"
def load_data(filename: str) -> pd.DataFram... | 34.057692 | 79 | 0.585827 | import numpy as np
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
import plotly.io as pio
from IMLearn.learners.regressors.polynomial_fitting import PolynomialFitting
from IMLearn.utils import utils
pio.templates.default = "simple_white"
def load_data(filename: str) -> pd.DataFram... | 2,073 | 0 | 69 |
6f1aab7ed5e79e2741e34abdc2904226123a279f | 539 | py | Python | phytorch/units/_si/_base_unit_map.py | emaballarin/phytorch | 68cf0a630e2fee9dd98f08639edcceb2389adf35 | [
"MIT"
] | 1 | 2022-01-21T06:59:20.000Z | 2022-01-21T06:59:20.000Z | phytorch/units/_si/_base_unit_map.py | emaballarin/phytorch | 68cf0a630e2fee9dd98f08639edcceb2389adf35 | [
"MIT"
] | null | null | null | phytorch/units/_si/_base_unit_map.py | emaballarin/phytorch | 68cf0a630e2fee9dd98f08639edcceb2389adf35 | [
"MIT"
] | 1 | 2021-04-27T00:45:47.000Z | 2021-04-27T00:45:47.000Z | from more_itertools import one
from .._utils import names_and_abbrevs
from ..unit import CURRENT, Dimension, LENGTH, MASS, TEMPERATURE, TIME, Unit
base_unit_map = {
(names, abbrevs): Unit(dim, name=one(abbrevs))
for (names, abbrevs), dim in {
names_and_abbrevs(item): {val: 1} if isinstance(val, Dimen... | 31.705882 | 80 | 0.619666 | from more_itertools import one
from .._utils import names_and_abbrevs
from ..unit import CURRENT, Dimension, LENGTH, MASS, TEMPERATURE, TIME, Unit
base_unit_map = {
(names, abbrevs): Unit(dim, name=one(abbrevs))
for (names, abbrevs), dim in {
names_and_abbrevs(item): {val: 1} if isinstance(val, Dimen... | 0 | 0 | 0 |
486aefbceec6a94c296613fb3b8e92c8ab9eb57c | 1,183 | py | Python | vitrageclient/v1/cli/service.py | openstack/python-vitrageclient | cb9d0ee604f96e59f5018b5a59e3be07f73214cd | [
"Apache-2.0"
] | 20 | 2015-12-08T09:31:45.000Z | 2021-04-30T03:57:10.000Z | vitrageclient/v1/cli/service.py | openstack/python-vitrageclient | cb9d0ee604f96e59f5018b5a59e3be07f73214cd | [
"Apache-2.0"
] | null | null | null | vitrageclient/v1/cli/service.py | openstack/python-vitrageclient | cb9d0ee604f96e59f5018b5a59e3be07f73214cd | [
"Apache-2.0"
] | 2 | 2018-03-18T07:42:22.000Z | 2018-08-22T12:30:26.000Z | # Copyright 2019 - Nokia Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 33.8 | 76 | 0.665258 | # Copyright 2019 - Nokia Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 411 | 0 | 54 |
58c5fe62872f6f69f501811886a37c9cfbb541e6 | 7,324 | py | Python | tests/rate_limit_test.py | FreCap/python-redis-rate-limit | 5d3856490b6e63edb1c24251421bc853c866f19e | [
"MIT"
] | 105 | 2016-07-25T20:42:55.000Z | 2022-02-01T10:45:39.000Z | tests/rate_limit_test.py | FreCap/python-redis-rate-limit | 5d3856490b6e63edb1c24251421bc853c866f19e | [
"MIT"
] | 19 | 2016-07-25T21:48:09.000Z | 2022-03-22T21:42:52.000Z | tests/rate_limit_test.py | FreCap/python-redis-rate-limit | 5d3856490b6e63edb1c24251421bc853c866f19e | [
"MIT"
] | 29 | 2016-07-25T13:41:18.000Z | 2022-03-22T21:32:16.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import time
from redis_rate_limit import RateLimit, RateLimiter, TooManyRequests
if __name__ == '__main__':
unittest.main()
| 35.043062 | 79 | 0.635582 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import time
from redis_rate_limit import RateLimit, RateLimiter, TooManyRequests
class TestRedisRateLimit(unittest.TestCase):
def setUp(self):
"""
Initialises Rate Limit class and delete all keys from Redis.
"""
self.rat... | 23 | 7,085 | 23 |
a3f366e58a23e3ea8a55ce612e9929578d7c582f | 5,064 | py | Python | conanfile.py | ilyakrasnovsky/conan-librdkafka | 2ead6d665a07587b8abd8d5b6d418d46fc6bc992 | [
"BSD-2-Clause"
] | null | null | null | conanfile.py | ilyakrasnovsky/conan-librdkafka | 2ead6d665a07587b8abd8d5b6d418d46fc6bc992 | [
"BSD-2-Clause"
] | null | null | null | conanfile.py | ilyakrasnovsky/conan-librdkafka | 2ead6d665a07587b8abd8d5b6d418d46fc6bc992 | [
"BSD-2-Clause"
] | null | null | null | import os
from conans import ConanFile, CMake, AutoToolsBuildEnvironment, tools
from conans.util import files
| 39.874016 | 92 | 0.546011 | import os
from conans import ConanFile, CMake, AutoToolsBuildEnvironment, tools
from conans.util import files
class LibrdkafkaConan(ConanFile):
name = "librdkafka"
sha256 = "9d8f1eb7b0e29e9ab1168347c939cb7ae5dff00a39cef99e7ef033fd8f92737c"
src_version = "0.11.4"
version = src_version
license = "B... | 4,154 | 776 | 23 |
119720a1795acdd93222a34d49d174daae25edf7 | 21,508 | py | Python | wepy/analysis/contig_tree.py | fabian-paul/wepy | 3a470f364a5ffbefcdb5d17a12cd08d90f4944e4 | [
"MIT"
] | null | null | null | wepy/analysis/contig_tree.py | fabian-paul/wepy | 3a470f364a5ffbefcdb5d17a12cd08d90f4944e4 | [
"MIT"
] | null | null | null | wepy/analysis/contig_tree.py | fabian-paul/wepy | 3a470f364a5ffbefcdb5d17a12cd08d90f4944e4 | [
"MIT"
] | null | null | null | import itertools as it
import networkx as nx
import numpy as np
from wepy.analysis.parents import DISCONTINUITY_VALUE, \
parent_panel, net_parent_table,\
ancestors, sliding_window
| 37.146805 | 94 | 0.619444 | import itertools as it
import networkx as nx
import numpy as np
from wepy.analysis.parents import DISCONTINUITY_VALUE, \
parent_panel, net_parent_table,\
ancestors, sliding_window
class ContigTree(nx.DiGraph):
RESAMPLING_PANEL_KEY = 'resampling... | 13,056 | 8,179 | 23 |
74bbbd470e9f1b4ed11c01549c308022ece77b31 | 6,749 | py | Python | elastic_import-oneletters.py | VaticanEmbassy/elastipass-importer | b68b3e7d1a28be0694d1aa25a2c114de68ca47fa | [
"Apache-2.0"
] | null | null | null | elastic_import-oneletters.py | VaticanEmbassy/elastipass-importer | b68b3e7d1a28be0694d1aa25a2c114de68ca47fa | [
"Apache-2.0"
] | null | null | null | elastic_import-oneletters.py | VaticanEmbassy/elastipass-importer | b68b3e7d1a28be0694d1aa25a2c114de68ca47fa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import time
import string
import itertools
from elasticsearch import Elasticsearch, helpers
INDEX = 'passwd'
INDEX_PREFIX = 'pwd_'
DOC_TYPE = 'account'
INDEX_CFG = {
"settings": {
"index": {
#"number_of_shards": 8,
"refresh... | 31.537383 | 116 | 0.361535 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import time
import string
import itertools
from elasticsearch import Elasticsearch, helpers
INDEX = 'passwd'
INDEX_PREFIX = 'pwd_'
DOC_TYPE = 'account'
INDEX_CFG = {
"settings": {
"index": {
#"number_of_shards": 8,
"refresh... | 2,415 | 0 | 46 |
c7c269b171233a25f78358c9589e001798132bf1 | 1,127 | py | Python | Evaluation/Plot_Boxplot_BestFrameworkDesigns.py | Lucciola111/stream_autoencoder_windowing | 5456b07bd20220c987598db2cdb832d8195e1575 | [
"MIT"
] | 4 | 2021-09-16T05:50:25.000Z | 2021-12-31T07:04:55.000Z | Evaluation/Plot_Boxplot_BestFrameworkDesigns.py | Lucciola111/stream_autoencoder_windowing | 5456b07bd20220c987598db2cdb832d8195e1575 | [
"MIT"
] | null | null | null | Evaluation/Plot_Boxplot_BestFrameworkDesigns.py | Lucciola111/stream_autoencoder_windowing | 5456b07bd20220c987598db2cdb832d8195e1575 | [
"MIT"
] | 1 | 2021-12-16T06:53:08.000Z | 2021-12-16T06:53:08.000Z | import seaborn as sns
import matplotlib.pyplot as plt
def plot_boxplot_best_framework_designs(data, plot_file_name=False, latex_font=True):
"""
Parameters
----------
data: Data for plot
plot_file_name: Optional name for plot
latex_font: Whether latex font should be used
Returns
-----... | 29.657895 | 98 | 0.655723 | import seaborn as sns
import matplotlib.pyplot as plt
def plot_boxplot_best_framework_designs(data, plot_file_name=False, latex_font=True):
"""
Parameters
----------
data: Data for plot
plot_file_name: Optional name for plot
latex_font: Whether latex font should be used
Returns
-----... | 0 | 0 | 0 |
ecc1c1b8ed492ca1611ccc73bc8165dcca92bb62 | 628 | py | Python | curso/migrations/0009_auto_20191212_2023.py | Miguelrom/EasyApproval | 14bc48086ca20a2830d0ff17961a7cec84ea42bc | [
"Apache-2.0"
] | null | null | null | curso/migrations/0009_auto_20191212_2023.py | Miguelrom/EasyApproval | 14bc48086ca20a2830d0ff17961a7cec84ea42bc | [
"Apache-2.0"
] | 3 | 2019-12-03T22:36:30.000Z | 2019-12-12T01:27:34.000Z | curso/migrations/0009_auto_20191212_2023.py | Miguelrom/EasyApproval | 14bc48086ca20a2830d0ff17961a7cec84ea42bc | [
"Apache-2.0"
] | 12 | 2019-12-03T22:36:12.000Z | 2019-12-12T05:52:15.000Z | # Generated by Django 2.2.7 on 2019-12-13 03:23
from django.db import migrations, models
| 26.166667 | 101 | 0.603503 | # Generated by Django 2.2.7 on 2019-12-13 03:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('curso', '0008_auto_20191212_1256'),
]
operations = [
migrations.AlterField(
model_name='curso',
name='departamento',... | 0 | 514 | 23 |
e1f9483e8e91ccf755f64600fd0c3b8c7a69dc41 | 682 | py | Python | Singleton/example_1.py | de-cryptor/Object-Oriented-Design-Python | 7e51b09b4481fc04f2833f7505c99f34708fbd02 | [
"MIT"
] | 1 | 2021-09-24T17:10:57.000Z | 2021-09-24T17:10:57.000Z | Singleton/example_1.py | de-cryptor/Object-Oriented-Design-Python | 7e51b09b4481fc04f2833f7505c99f34708fbd02 | [
"MIT"
] | null | null | null | Singleton/example_1.py | de-cryptor/Object-Oriented-Design-Python | 7e51b09b4481fc04f2833f7505c99f34708fbd02 | [
"MIT"
] | null | null | null | # classic implementation of Singleton Design pattern
# main method
if __name__ == "__main__":
# create object of Singleton Class
obj = Singleton()
print(obj)
# pick the instance of the class
obj = Singleton.getInstance()
print(obj)
| 21.3125 | 56 | 0.73607 | # classic implementation of Singleton Design pattern
class Singleton:
__shared_instance = 'GeeksforGeeks'
@staticmethod
def getInstance():
"""Static Access Method"""
if Singleton.__shared_instance == 'GeeksforGeeks':
Singleton()
return Singleton.__shared_instance
def __init__(self):
"""virtual priva... | 0 | 419 | 22 |
68fb4c62cc2a3d41f825e3d66f68f956cf6d02c7 | 4,140 | py | Python | lib/sigure.py | frozstone/concept | 359a386941d0752fd9ecf97edaa4e69c52952513 | [
"MIT"
] | null | null | null | lib/sigure.py | frozstone/concept | 359a386941d0752fd9ecf97edaa4e69c52952513 | [
"MIT"
] | null | null | null | lib/sigure.py | frozstone/concept | 359a386941d0752fd9ecf97edaa4e69c52952513 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
from xml.dom import minidom
from ctypes import c_longlong
from mathml import cut_nomeaning_text, parse_file
| 32.34375 | 109 | 0.635266 | #! /usr/bin/env python
from xml.dom import minidom
from ctypes import c_longlong
from mathml import cut_nomeaning_text, parse_file
class HashResult:
def __init__(self, value = 0, var_name = None):
assert type(value) == int
self.constant = value
if var_name:
self.coef = {var_nam... | 3,698 | -4 | 314 |
5fdd47d303bcd75d293ab3a806efcc4bb560d34e | 8,605 | py | Python | openstates/openstates-master/openstates/ar/bills.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | openstates/openstates-master/openstates/ar/bills.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | openstates/openstates-master/openstates/ar/bills.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | import re
import csv
import StringIO
import datetime
from billy.scrape.bills import BillScraper, Bill
from billy.scrape.votes import Vote
import lxml.html
import scrapelib
| 37.090517 | 81 | 0.552121 | import re
import csv
import StringIO
import datetime
from billy.scrape.bills import BillScraper, Bill
from billy.scrape.votes import Vote
import lxml.html
import scrapelib
def unicode_csv_reader(unicode_csv_data, dialect=csv.excel, **kwargs):
# csv.py doesn't do Unicode; encode temporarily as UTF-8:
csv_re... | 8,160 | 198 | 69 |
a3c8c908d647dceb699707d0463dc2d0401e5b16 | 6,497 | py | Python | openstack/utils.py | afontscd/openstacksdk | cb66a98f286dddabd1f593b45049c73192227186 | [
"Apache-2.0"
] | null | null | null | openstack/utils.py | afontscd/openstacksdk | cb66a98f286dddabd1f593b45049c73192227186 | [
"Apache-2.0"
] | null | null | null | openstack/utils.py | afontscd/openstacksdk | cb66a98f286dddabd1f593b45049c73192227186 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 34.015707 | 79 | 0.668616 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 73 | 5 | 99 |
d374764be9c2e17516901c51a66f19b6fb25a2ca | 549 | py | Python | tests/support/urls.py | armstrong/armstrong.apps.embeds | 6042f4ab39e752c4e78826e44f7c2aa82bc04e6a | [
"Apache-2.0"
] | 1 | 2016-08-02T09:33:35.000Z | 2016-08-02T09:33:35.000Z | tests/support/urls.py | armstrong/armstrong.apps.embeds | 6042f4ab39e752c4e78826e44f7c2aa82bc04e6a | [
"Apache-2.0"
] | null | null | null | tests/support/urls.py | armstrong/armstrong.apps.embeds | 6042f4ab39e752c4e78826e44f7c2aa82bc04e6a | [
"Apache-2.0"
] | 1 | 2018-03-04T20:30:15.000Z | 2018-03-04T20:30:15.000Z | from django.contrib import admin
try:
from django.conf.urls import patterns, include
except ImportError: # DROP_WITH_DJANGO13 pragma: no cover
from django.conf.urls.defaults import patterns, include
# DROP_WITH_DJANGO16
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.url... | 26.142857 | 73 | 0.761384 | from django.contrib import admin
try:
from django.conf.urls import patterns, include
except ImportError: # DROP_WITH_DJANGO13 pragma: no cover
from django.conf.urls.defaults import patterns, include
# DROP_WITH_DJANGO16
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.url... | 0 | 0 | 0 |
c6e8c5c512a736a3ee25779d4d9d5b16ab40f095 | 7,069 | py | Python | motion_arbiter/src/tag_generator.py | ehwa009/social_mind | 0507f47b29371ef167b30b60bdd446fde118b626 | [
"Apache-2.0"
] | null | null | null | motion_arbiter/src/tag_generator.py | ehwa009/social_mind | 0507f47b29371ef167b30b60bdd446fde118b626 | [
"Apache-2.0"
] | null | null | null | motion_arbiter/src/tag_generator.py | ehwa009/social_mind | 0507f47b29371ef167b30b60bdd446fde118b626 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*- encoding: utf8 -*-
import warnings
warnings.filterwarnings('ignore', category=RuntimeWarning)
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.stem.lancaster import LancasterStemmer
from nltk import classify, pos_tag, word_tokenize
from keras.preprocessin... | 34.99505 | 126 | 0.619324 | #!/usr/bin/env python
#-*- encoding: utf8 -*-
import warnings
warnings.filterwarnings('ignore', category=RuntimeWarning)
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.stem.lancaster import LancasterStemmer
from nltk import classify, pos_tag, word_tokenize
from keras.preprocessin... | 5,097 | -2 | 263 |
5a1078747a1f66a2ef17e47fc9adcfa98308e0b1 | 8,547 | py | Python | eoschar/charactersheet.py | fdfoneill/eoschar | 3feda15a40d324683918eb16fab59e72c1ec2da1 | [
"Unlicense"
] | null | null | null | eoschar/charactersheet.py | fdfoneill/eoschar | 3feda15a40d324683918eb16fab59e72c1ec2da1 | [
"Unlicense"
] | null | null | null | eoschar/charactersheet.py | fdfoneill/eoschar | 3feda15a40d324683918eb16fab59e72c1ec2da1 | [
"Unlicense"
] | null | null | null | import logging, os
logging.basicConfig(level=os.environ.get("LOGLEVEL","INFO"))
log = logging.getLogger(__name__)
import base64, json, pickle, sys
from ._version import __version__
from .choice import Choice,TextInput,PointBuy,AssignAbstractGear
from .dietype import DieType
from .sheetmaker import SheetMaker
from .fun... | 28.022951 | 165 | 0.684568 | import logging, os
logging.basicConfig(level=os.environ.get("LOGLEVEL","INFO"))
log = logging.getLogger(__name__)
import base64, json, pickle, sys
from ._version import __version__
from .choice import Choice,TextInput,PointBuy,AssignAbstractGear
from .dietype import DieType
from .sheetmaker import SheetMaker
from .fun... | 1,723 | 0 | 72 |
2a6ac762f22d1490e1e476969493bcad72d052a9 | 665 | py | Python | models/user.py | ArnolFokam/dna-gate-backend | 1501a3a1d1a18645a309c012c8210045c61274c9 | [
"Apache-2.0"
] | null | null | null | models/user.py | ArnolFokam/dna-gate-backend | 1501a3a1d1a18645a309c012c8210045c61274c9 | [
"Apache-2.0"
] | null | null | null | models/user.py | ArnolFokam/dna-gate-backend | 1501a3a1d1a18645a309c012c8210045c61274c9 | [
"Apache-2.0"
] | null | null | null | from pydantic import BaseModel, Field
from pydantic.networks import EmailStr
| 27.708333 | 45 | 0.479699 | from pydantic import BaseModel, Field
from pydantic.networks import EmailStr
class User(BaseModel):
first_name: str = Field(...,
min_length=2,
max_length=50)
last_name: str = Field(...,
min_length=2,
... | 0 | 564 | 23 |
158571b32a423969991381d1c6e745f5bbeeb038 | 2,094 | py | Python | googleapi.py | AkBKukU/DemonetizationDetection | d98eb651d377f78228ef20e7d47d8dd0b53e948f | [
"MIT"
] | 9 | 2018-02-06T20:09:48.000Z | 2021-07-23T14:46:08.000Z | googleapi.py | AkBKukU/DemonetizationDetection | d98eb651d377f78228ef20e7d47d8dd0b53e948f | [
"MIT"
] | null | null | null | googleapi.py | AkBKukU/DemonetizationDetection | d98eb651d377f78228ef20e7d47d8dd0b53e948f | [
"MIT"
] | 3 | 2018-02-16T01:55:32.000Z | 2019-05-26T12:05:18.000Z | #!/usr/bin/python3
# python
import http.client
import httplib2
import os
import random
import sys
import time
import webbrowser
import threading
import pprint
# google
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from googleapiclient.http import MediaFileUpload
from oauth2c... | 24.928571 | 70 | 0.668099 | #!/usr/bin/python3
# python
import http.client
import httplib2
import os
import random
import sys
import time
import webbrowser
import threading
import pprint
# google
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from googleapiclient.http import MediaFileUpload
from oauth2c... | 1,218 | 402 | 23 |
19389a8ffda5d2fe51847e8795a5cd01afb0710a | 7,108 | py | Python | batch_adapter_trim.py | alliemacleay/misc | d3429c07e85ca7234c8102e128888b7c3ee88e0d | [
"MIT"
] | null | null | null | batch_adapter_trim.py | alliemacleay/misc | d3429c07e85ca7234c8102e128888b7c3ee88e0d | [
"MIT"
] | null | null | null | batch_adapter_trim.py | alliemacleay/misc | d3429c07e85ca7234c8102e128888b7c3ee88e0d | [
"MIT"
] | null | null | null | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# There's no good way in cosmos to create a tag
# based on output or to conditionally run a process
# This is a wrapper to run the umi utilities.
#
# Run a program (SeqPrep) for a directory in batches
# This is a helper script for Martin Aryee's
# scripts to de... | 32.605505 | 162 | 0.522651 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# There's no good way in cosmos to create a tag
# based on output or to conditionally run a process
# This is a wrapper to run the umi utilities.
#
# Run a program (SeqPrep) for a directory in batches
# This is a helper script for Martin Aryee's
# scripts to de... | 3,185 | 0 | 111 |
522b7dac993beec57a3d1c6894e70ec79c5f911e | 809 | py | Python | tools/write_init.py | CodyKochmann/stock_info | 8de591b5a589aefebccab3650cb5dfea987ab4c8 | [
"MIT"
] | null | null | null | tools/write_init.py | CodyKochmann/stock_info | 8de591b5a589aefebccab3650cb5dfea987ab4c8 | [
"MIT"
] | null | null | null | tools/write_init.py | CodyKochmann/stock_info | 8de591b5a589aefebccab3650cb5dfea987ab4c8 | [
"MIT"
] | null | null | null | import os
from time import sleep
sleep(0.5)
targets=os.listdir('./')
targets.remove(file_name())
# remove __init__.py
if('__init__.py' in targets):
targets.remove('__init__.py')
# remove everything that isn't a python file
for i in list(targets):
if('.py' != i[-3:]):
targets.remove(i)
with open('./__init__.py... | 19.731707 | 89 | 0.652658 | import os
from time import sleep
sleep(0.5)
def file_name():
return(__file__.split('/')[-1])
targets=os.listdir('./')
targets.remove(file_name())
# remove __init__.py
if('__init__.py' in targets):
targets.remove('__init__.py')
# remove everything that isn't a python file
for i in list(targets):
if('.py' != i[-... | 114 | 0 | 46 |
d3dd88b25641094a26a2b76042b06441ee62950a | 822 | py | Python | tests/extension/src/test_project/__init__.py | felix-hilden/sphinx-codeautolink | cde00711e2359e30a76d6224a01da90104b06b19 | [
"MIT"
] | 21 | 2021-09-13T15:53:32.000Z | 2022-03-24T15:27:36.000Z | tests/extension/src/test_project/__init__.py | felix-hilden/sphinx-codeautolink | cde00711e2359e30a76d6224a01da90104b06b19 | [
"MIT"
] | 89 | 2021-09-19T21:42:38.000Z | 2022-03-25T09:09:39.000Z | tests/extension/src/test_project/__init__.py | felix-hilden/sphinx-codeautolink | cde00711e2359e30a76d6224a01da90104b06b19 | [
"MIT"
] | 5 | 2021-10-14T03:08:39.000Z | 2022-02-11T10:50:19.000Z | """Docstring."""
from typing import Optional, Union
from .sub import subfoo # NOQA
class Baz:
"""Baz test class."""
bute = 1
class Foo:
"""Foo test class."""
attr: str = 'test'
type_attr = Baz
def meth(self) -> Baz:
"""Test method."""
def selfref(self) -> "Foo":
"""... | 16.117647 | 60 | 0.577859 | """Docstring."""
from typing import Optional, Union
from .sub import subfoo # NOQA
class Baz:
"""Baz test class."""
bute = 1
class Foo:
"""Foo test class."""
attr: str = 'test'
type_attr = Baz
def meth(self) -> Baz:
"""Test method."""
def selfref(self) -> "Foo":
"""... | 0 | 0 | 0 |
c5073eebd806004c29583969d94d4614d992b4e1 | 381 | py | Python | helpers/python/key/generator.py | takeMyHands/helper-python | 5512ec97bcb09ed6027d9160fb7732427482af4c | [
"MIT"
] | null | null | null | helpers/python/key/generator.py | takeMyHands/helper-python | 5512ec97bcb09ed6027d9160fb7732427482af4c | [
"MIT"
] | null | null | null | helpers/python/key/generator.py | takeMyHands/helper-python | 5512ec97bcb09ed6027d9160fb7732427482af4c | [
"MIT"
] | 1 | 2021-01-28T06:14:47.000Z | 2021-01-28T06:14:47.000Z | import secrets
import random
import string
| 23.8125 | 69 | 0.713911 | import secrets
import random
import string
class Generator:
def generate_by_url(self, length):
return secrets.token_urlsafe(length)
def generate_by_hex(self, length):
return secrets.token_hex(length)
def generate_by_string(self, length):
letters = string.ascii_lowercase
r... | 239 | -5 | 103 |
d6fa8b0b97db79dc18f50e0f8e7774c46d71ed91 | 2,983 | py | Python | handlers/inline_handlers.py | dark0ghost/async_py_bot | ec79285e5fbf5fc67661025effe596439107f21f | [
"MIT"
] | 24 | 2019-08-30T20:00:07.000Z | 2022-03-20T17:58:21.000Z | handlers/inline_handlers.py | dark0ghost/async_py_bot | ec79285e5fbf5fc67661025effe596439107f21f | [
"MIT"
] | 3 | 2020-02-12T19:48:21.000Z | 2021-03-07T19:24:50.000Z | handlers/inline_handlers.py | dark0ghost/async_py_bot | ec79285e5fbf5fc67661025effe596439107f21f | [
"MIT"
] | 3 | 2021-04-19T18:38:07.000Z | 2022-02-10T07:04:27.000Z | # This Python file uses the following encoding: utf-8
import hashlib
from typing import List
from aiogram.types import InlineQuery, \
InputTextMessageContent, InlineQueryResultArticle
from core import dp, bot, lazy_get_text, cb as bank_api, crypto_price, Button
@dp.inline_handler()
async def inline_echo(inline_... | 42.614286 | 114 | 0.623533 | # This Python file uses the following encoding: utf-8
import hashlib
from typing import List
from aiogram.types import InlineQuery, \
InputTextMessageContent, InlineQueryResultArticle
from core import dp, bot, lazy_get_text, cb as bank_api, crypto_price, Button
@dp.inline_handler()
async def inline_echo(inline_... | 0 | 0 | 0 |
44a7c2ab27ee10fde74535c1c75a01d06f25fdf2 | 2,466 | py | Python | test/test_cluster_controller_api.py | coveooss/spinnaker_python_client | 6f5ae436798cb4985ada65cd8169fcc9494d048f | [
"Apache-2.0"
] | null | null | null | test/test_cluster_controller_api.py | coveooss/spinnaker_python_client | 6f5ae436798cb4985ada65cd8169fcc9494d048f | [
"Apache-2.0"
] | null | null | null | test/test_cluster_controller_api.py | coveooss/spinnaker_python_client | 6f5ae436798cb4985ada65cd8169fcc9494d048f | [
"Apache-2.0"
] | 2 | 2019-10-17T07:49:21.000Z | 2021-08-10T23:12:41.000Z | # coding: utf-8
"""
Spinnaker API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import ... | 27.098901 | 125 | 0.683293 | # coding: utf-8
"""
Spinnaker API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import ... | 113 | 0 | 54 |
4a566d08a881a42a3373ab5d76c53f590a49b20d | 5,103 | py | Python | modeltest/paradigms/base.py | ARASC/DeepTest | ea67faa84676fdd9d60d5c0e32ad925a356c7da7 | [
"Apache-2.0"
] | 1 | 2020-09-21T03:13:35.000Z | 2020-09-21T03:13:35.000Z | modeltest/paradigms/base.py | ARASC/ModelTest | ea67faa84676fdd9d60d5c0e32ad925a356c7da7 | [
"Apache-2.0"
] | null | null | null | modeltest/paradigms/base.py | ARASC/ModelTest | ea67faa84676fdd9d60d5c0e32ad925a356c7da7 | [
"Apache-2.0"
] | null | null | null | from abc import ABCMeta, abstractproperty, abstractmethod
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
from sklearn.model_selection import train_test_split
from ..dataset.utils import _get_nunique
class BaseParadigm(metaclass=ABCMeta):
"""
Base Paradigm... | 29.49711 | 77 | 0.591025 | from abc import ABCMeta, abstractproperty, abstractmethod
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
from sklearn.model_selection import train_test_split
from ..dataset.utils import _get_nunique
class BaseParadigm(metaclass=ABCMeta):
"""
Base Paradigm... | 227 | 0 | 53 |
18fc795f115713a000036efab5baa016dbdcda9c | 2,651 | py | Python | flask_assistant/response.py | stefb965/flask-assistant | 177d67279e52d5ffe32940696f178dd6f47d8fe1 | [
"Apache-2.0"
] | 7 | 2017-10-26T00:23:17.000Z | 2021-01-21T06:27:46.000Z | flask_assistant/response.py | stefb965/flask-assistant | 177d67279e52d5ffe32940696f178dd6f47d8fe1 | [
"Apache-2.0"
] | 12 | 2017-05-23T22:54:50.000Z | 2019-07-31T17:26:17.000Z | flask_assistant/response.py | stefb965/flask-assistant | 177d67279e52d5ffe32940696f178dd6f47d8fe1 | [
"Apache-2.0"
] | 5 | 2017-05-23T00:44:10.000Z | 2019-10-23T14:57:35.000Z | from flask_assistant import logger
from flask import json, Response, make_response
from xml.etree import ElementTree
class _Response(object):
"""docstring for _Response"""
class event(_Response):
"""Triggers an event to invoke it's respective intent.
When an event is triggered, speech, displayText a... | 27.905263 | 91 | 0.599396 | from flask_assistant import logger
from flask import json, Response, make_response
from xml.etree import ElementTree
class _Response(object):
"""docstring for _Response"""
def __init__(self, speech):
self._json_default = None
self._response = {
'speech': speech,
'disp... | 1,947 | 1 | 340 |
4217f7dc5437442ffcff16108ca2b818af48c163 | 10,650 | py | Python | src/healthnet/register/forms.py | blackpan2/HealthNet | 455402c4e437d3ef4136bfdfa8459fa31c06b069 | [
"MIT"
] | null | null | null | src/healthnet/register/forms.py | blackpan2/HealthNet | 455402c4e437d3ef4136bfdfa8459fa31c06b069 | [
"MIT"
] | null | null | null | src/healthnet/register/forms.py | blackpan2/HealthNet | 455402c4e437d3ef4136bfdfa8459fa31c06b069 | [
"MIT"
] | null | null | null | """
Application: HealthNet
File: /patientRegistration/forms.py
Authors:
- Nathan Stevens
- Phillip Bedward
- Daniel Herzig
- George Herde
- Samuel Launt
Description:
- This file contains all forms for Patient Registration.
"""
from django import forms
fro... | 44.008264 | 118 | 0.584601 | """
Application: HealthNet
File: /patientRegistration/forms.py
Authors:
- Nathan Stevens
- Phillip Bedward
- Daniel Herzig
- George Herde
- Samuel Launt
Description:
- This file contains all forms for Patient Registration.
"""
from django import forms
fro... | 1,302 | 3,277 | 408 |
51e7b1b65cebd1d1f581c45b357eda72cfbf41ca | 2,233 | py | Python | choose_granularity.py | YangJianyu-bupt/privmdr | c4b68c87aeeb811ae8c42db511704fd3cc258a3c | [
"Apache-2.0"
] | 5 | 2020-09-16T18:51:09.000Z | 2021-12-10T09:55:31.000Z | choose_granularity.py | YangJianyu-bupt/privmdr | c4b68c87aeeb811ae8c42db511704fd3cc258a3c | [
"Apache-2.0"
] | null | null | null | choose_granularity.py | YangJianyu-bupt/privmdr | c4b68c87aeeb811ae8c42db511704fd3cc258a3c | [
"Apache-2.0"
] | 2 | 2021-09-28T06:52:07.000Z | 2022-01-10T07:48:54.000Z | import math
| 32.362319 | 99 | 0.553068 | import math
class choose_granularity_beta:
def __init__(self, args = None):
self.args = args
self.flag_granularity_list = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048]
self.alpha_1 = 0.7
self.alpha_2 = 0.03
def get_1_way_granularity_for_HDG(self, ep = None):
n = s... | 2,049 | 9 | 157 |
c5637bd965405ae880b26d0ed437538fa2cdeffd | 2,344 | py | Python | preprocess/remove_tags.py | lilt/markup-transfer-scripts | 0b9c3552a5f40a89366124a29d36af2ca3e3b4fa | [
"MIT"
] | null | null | null | preprocess/remove_tags.py | lilt/markup-transfer-scripts | 0b9c3552a5f40a89366124a29d36af2ca3e3b4fa | [
"MIT"
] | null | null | null | preprocess/remove_tags.py | lilt/markup-transfer-scripts | 0b9c3552a5f40a89366124a29d36af2ca3e3b4fa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import json
import argparse
from typing import List, NamedTuple
if __name__ == '__main__':
args = parse_args()
with open(args.input, 'r') as fi, open(args.output, 'w') as fo:
for line in fi:
fo.write(extract_tags(line.strip()))
fo.write('\n')
| 30.441558 | 91 | 0.586177 | #!/usr/bin/env python3
import json
import argparse
from typing import List, NamedTuple
class Tag(NamedTuple):
content: str
opening_pos: int
closing_pos: int
def is_closing_tag(self) -> bool:
return self.content.startswith("</")
def is_self_closing_tag(self) -> bool:
return self.c... | 1,755 | 183 | 92 |
918e2c35e4588535dbf21714fdefd5c89b5b1baa | 1,225 | py | Python | models/siamese.py | chienlm297/Multi-label-for-volume-estimation | c14bf0a2b237e4ea580461524c280f85b8859ec9 | [
"MIT"
] | null | null | null | models/siamese.py | chienlm297/Multi-label-for-volume-estimation | c14bf0a2b237e4ea580461524c280f85b8859ec9 | [
"MIT"
] | null | null | null | models/siamese.py | chienlm297/Multi-label-for-volume-estimation | c14bf0a2b237e4ea580461524c280f85b8859ec9 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
# for test
if __name__ == "__main__":
net = Siamese()
print(net)
print(list(net.parameters()))
| 26.630435 | 71 | 0.514286 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Siamese(nn.Module):
def __init__(self):
super(Siamese, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(1, 64, 10), # 64@96*96
nn.ReLU(inplace=True),
nn.MaxPool2d(2), # 64@48*48
... | 941 | 4 | 103 |
f87a882b7913d0ff2b31fa7b88d39c95fa8f2e65 | 1,722 | py | Python | pysilcam/tests/test_config.py | Sondreab/PySilCam | a855f769fee8f86a364f9dc2c448c74a7a71c2a6 | [
"BSD-3-Clause"
] | 4 | 2018-08-28T19:05:21.000Z | 2019-01-15T18:01:49.000Z | pysilcam/tests/test_config.py | Sondreab/PySilCam | a855f769fee8f86a364f9dc2c448c74a7a71c2a6 | [
"BSD-3-Clause"
] | 5 | 2018-10-24T09:17:25.000Z | 2020-04-08T12:17:57.000Z | pysilcam/tests/test_config.py | Sondreab/PySilCam | a855f769fee8f86a364f9dc2c448c74a7a71c2a6 | [
"BSD-3-Clause"
] | 2 | 2019-11-18T12:20:04.000Z | 2020-04-06T05:46:31.000Z | # -*- coding: utf-8 -*-
import os
from pysilcam.config import load_config, PySilcamSettings, load_camera_config
| 31.309091 | 77 | 0.70151 | # -*- coding: utf-8 -*-
import os
from pysilcam.config import load_config, PySilcamSettings, load_camera_config
def test_config_parser():
path = os.path.dirname(__file__)
filename = os.path.join(path, '..', 'config_example.ini')
conf = load_config(filename)
assert 'General' in conf
assert conf... | 1,535 | 0 | 72 |
c258b36fa7fd0e79947549c2935d7b42691ee4f3 | 87 | py | Python | courses/algos/main_project/basics/calc/utest_basics_calc/ref_basics_calc.py | obs145628/ml-notebooks | 08a64962e106ec569039ab204a7ae4c900783b6b | [
"MIT"
] | 1 | 2020-10-29T11:26:00.000Z | 2020-10-29T11:26:00.000Z | courses/algos/main_project/basics/calc/utest_basics_calc/ref_basics_calc.py | obs145628/ml-notebooks | 08a64962e106ec569039ab204a7ae4c900783b6b | [
"MIT"
] | 5 | 2021-03-18T21:33:45.000Z | 2022-03-11T23:34:50.000Z | courses/algos/main_project/basics/calc/utest_basics_calc/ref_basics_calc.py | obs145628/ml-notebooks | 08a64962e106ec569039ab204a7ae4c900783b6b | [
"MIT"
] | 1 | 2019-12-23T21:50:02.000Z | 2019-12-23T21:50:02.000Z | import sys
in_str = sys.stdin.read().replace('/', '//')
res = eval(in_str)
print(res)
| 14.5 | 44 | 0.632184 | import sys
in_str = sys.stdin.read().replace('/', '//')
res = eval(in_str)
print(res)
| 0 | 0 | 0 |
42cac7f242d8e7eec30d694a93201ca48780ea77 | 7,261 | py | Python | payit/gateways/parsian.py | meyt/pyment | 56fda0deb3f19146348edfe829fb01a50d2fff27 | [
"MIT"
] | null | null | null | payit/gateways/parsian.py | meyt/pyment | 56fda0deb3f19146348edfe829fb01a50d2fff27 | [
"MIT"
] | 1 | 2017-11-16T10:02:16.000Z | 2017-11-16T14:57:09.000Z | payit/gateways/parsian.py | meyt/pyment | 56fda0deb3f19146348edfe829fb01a50d2fff27 | [
"MIT"
] | null | null | null | from zeep import Client, exceptions as zeep_exceptions
from payit import (
Gateway,
Transaction,
Redirection,
GatewayNetworkError,
TransactionError,
TransactionAlreadyPaidError,
)
class ParsianGateway(Gateway):
"""
Parsian Bank Gateway (PECCO)
Home: https://pec.ir
Documentati... | 35.768473 | 78 | 0.573199 | from zeep import Client, exceptions as zeep_exceptions
from payit import (
Gateway,
Transaction,
Redirection,
GatewayNetworkError,
TransactionError,
TransactionAlreadyPaidError,
)
class ParsianGateway(Gateway):
"""
Parsian Bank Gateway (PECCO)
Home: https://pec.ir
Documentati... | 2,538 | 0 | 108 |
4e51a5f7c04597377ac9064b2c0566a4faa748e0 | 1,605 | py | Python | inference/dataset/__init__.py | DSincerity/CALM | 619a55abf1b91693ed698356e55077714ca50bb2 | [
"BSD-2-Clause"
] | null | null | null | inference/dataset/__init__.py | DSincerity/CALM | 619a55abf1b91693ed698356e55077714ca50bb2 | [
"BSD-2-Clause"
] | null | null | null | inference/dataset/__init__.py | DSincerity/CALM | 619a55abf1b91693ed698356e55077714ca50bb2 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from .rte_dataset import RTEAutoInferenceDataset, RTEAutoInferenceReverseDataset, RTEAutoInferenceSignalDataset, \
RTET5InferenceDataset, RTET5InferenceReverseDataset, RTET5InferenceSignalDataset
from .mnli_dataset import MNLIAutoInferenceDataset, MNLIAutoInferenceReverseDataset, MNLIAutoInf... | 76.428571 | 118 | 0.885358 | # -*- coding: utf-8 -*-
from .rte_dataset import RTEAutoInferenceDataset, RTEAutoInferenceReverseDataset, RTEAutoInferenceSignalDataset, \
RTET5InferenceDataset, RTET5InferenceReverseDataset, RTET5InferenceSignalDataset
from .mnli_dataset import MNLIAutoInferenceDataset, MNLIAutoInferenceReverseDataset, MNLIAutoInf... | 0 | 0 | 0 |
8a6c1d3903bfd9a286042475643f7f89c2cad44a | 1,681 | py | Python | setup.py | Altinity/altinity-datasets | 9a48ef5d24b7f07c0a28ed9e17b55be22a6ae554 | [
"Apache-2.0"
] | 15 | 2019-06-17T07:46:17.000Z | 2021-01-25T18:28:30.000Z | setup.py | Altinity/altinity-datasets | 9a48ef5d24b7f07c0a28ed9e17b55be22a6ae554 | [
"Apache-2.0"
] | null | null | null | setup.py | Altinity/altinity-datasets | 9a48ef5d24b7f07c0a28ed9e17b55be22a6ae554 | [
"Apache-2.0"
] | 3 | 2019-08-08T07:41:49.000Z | 2020-10-27T07:07:17.000Z | # Copyright (c) 2019 Altinity LTD
#
# This product is licensed to you under the
# Apache License, Version 2.0 (the "License").
# You may not use this product except in compliance with the License.
#
# This product may include a number of subcomponents with
# separate copyright notices and license terms. Your use of the... | 29.491228 | 73 | 0.69304 | # Copyright (c) 2019 Altinity LTD
#
# This product is licensed to you under the
# Apache License, Version 2.0 (the "License").
# You may not use this product except in compliance with the License.
#
# This product may include a number of subcomponents with
# separate copyright notices and license terms. Your use of the... | 0 | 0 | 0 |
7a1b60707bae88b215279e7925550f92cf562e5a | 15,431 | py | Python | src/models/KinematicModel.py | intelligent-control-lab/BIS | 7df10426373696093271e9afcae0c7e8fa7be0f4 | [
"MIT"
] | 10 | 2019-07-06T06:11:45.000Z | 2021-06-23T06:07:38.000Z | src/models/KinematicModel.py | intelligent-control-lab/BIS | 7df10426373696093271e9afcae0c7e8fa7be0f4 | [
"MIT"
] | null | null | null | src/models/KinematicModel.py | intelligent-control-lab/BIS | 7df10426373696093271e9afcae0c7e8fa7be0f4 | [
"MIT"
] | 6 | 2019-09-09T00:47:40.000Z | 2021-09-11T12:32:06.000Z | import numpy as np
from numpy.matlib import repmat
from numpy import zeros, eye, ones, matrix
from numpy import cos, sin, arccos, sqrt, pi, arctan2
from panda3d.core import *
from direct.gui.DirectGui import *
from utils.ArgsPack import ArgsPack
class KinematicModel:
"""This is the base class for all robot dynamic... | 31.94824 | 216 | 0.548312 | import numpy as np
from numpy.matlib import repmat
from numpy import zeros, eye, ones, matrix
from numpy import cos, sin, arccos, sqrt, pi, arctan2
from panda3d.core import *
from direct.gui.DirectGui import *
from utils.ArgsPack import ArgsPack
class KinematicModel:
"""This is the base class for all robot dynamic... | 674 | 0 | 108 |
0c22cf23c0c0468ce79717df2071e184aaf07b75 | 1,518 | py | Python | src/mds/api/v1/util.py | m-socha/sana.mds | 4d3b71b7ba939c91570fee4f60444cf07035bd51 | [
"BSD-3-Clause"
] | 2 | 2016-05-19T02:32:13.000Z | 2017-09-06T07:06:25.000Z | src/mds/api/v1/util.py | m-socha/sana.mds | 4d3b71b7ba939c91570fee4f60444cf07035bd51 | [
"BSD-3-Clause"
] | 6 | 2015-07-19T17:40:49.000Z | 2016-12-20T21:54:59.000Z | src/mds/api/v1/util.py | m-socha/sana.mds | 4d3b71b7ba939c91570fee4f60444cf07035bd51 | [
"BSD-3-Clause"
] | 14 | 2015-10-30T09:50:21.000Z | 2019-06-15T13:07:37.000Z | """ A collection of utility methods
:Authors: Sana dev team
:Version: 1.1
"""
import os, sys, traceback
import time
import logging
import cjson
from django.conf import settings
LOGGING_ENABLED = 'LOGGING_ENABLE'
LOGGING_START = 'LOGGING_START_TIME'
def trace(f):
"""Decorator to add traces to a method.
"""... | 24.095238 | 78 | 0.646904 | """ A collection of utility methods
:Authors: Sana dev team
:Version: 1.1
"""
import os, sys, traceback
import time
import logging
import cjson
from django.conf import settings
LOGGING_ENABLED = 'LOGGING_ENABLE'
LOGGING_START = 'LOGGING_START_TIME'
def trace(f):
"""Decorator to add traces to a method.
"""... | 231 | 0 | 26 |
a6abad72c95da1bec374aceea516dbc2f0275b83 | 2,052 | py | Python | {{cookiecutter.project_slug}}/backend/app/app/db/utils.py | gma2th/full-stack | fd43b13ade62c5dd7acb9d711400c702593984d4 | [
"MIT"
] | 516 | 2018-03-06T19:20:47.000Z | 2022-03-30T22:22:11.000Z | {{cookiecutter.project_slug}}/backend/app/app/db/utils.py | ohld/full-stack | cc2f9753f268a7e1264dd01b888f587c3a45c9a2 | [
"MIT"
] | 23 | 2018-03-21T19:38:40.000Z | 2020-12-27T23:08:09.000Z | {{cookiecutter.project_slug}}/backend/app/app/db/utils.py | ohld/full-stack | cc2f9753f268a7e1264dd01b888f587c3a45c9a2 | [
"MIT"
] | 85 | 2018-03-29T16:46:40.000Z | 2022-01-27T18:47:39.000Z | from app.models.user import User
from app.models.role import Role
from app.core.security import get_password_hash
| 22.304348 | 87 | 0.721248 | from app.models.user import User
from app.models.role import Role
from app.core.security import get_password_hash
def get_user(username, db_session):
return db_session.query(User).filter(User.id == username).first()
def check_if_user_is_active(user):
return user.is_active
def check_if_user_is_superuser(us... | 1,554 | 0 | 368 |
28fc71c8afc805a515c13a9eb71312c89b89fdb2 | 5,979 | py | Python | confluent_server/confluent/netutil.py | andywray/confluent | 14577be963d84982a7c40d0360a9a35fd5046e2a | [
"Apache-2.0"
] | null | null | null | confluent_server/confluent/netutil.py | andywray/confluent | 14577be963d84982a7c40d0360a9a35fd5046e2a | [
"Apache-2.0"
] | null | null | null | confluent_server/confluent/netutil.py | andywray/confluent | 14577be963d84982a7c40d0360a9a35fd5046e2a | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2017 Lenovo
#
# 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 ... | 39.86 | 121 | 0.657802 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2017 Lenovo
#
# 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 ... | 1,852 | 0 | 46 |
030f933748d255e3106e631b8694892717c23a08 | 331 | py | Python | informatiom/test.py | wangcan-code/information11 | e4f494eefbb6f5365f941512ec6c68fb715c61c9 | [
"MIT"
] | null | null | null | informatiom/test.py | wangcan-code/information11 | e4f494eefbb6f5365f941512ec6c68fb715c61c9 | [
"MIT"
] | null | null | null | informatiom/test.py | wangcan-code/information11 | e4f494eefbb6f5365f941512ec6c68fb715c61c9 | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# -*- coding: UTF-8 -*-
from flask import Flask
app=Flask(__name__)
# app.config.from_pyfile('config.ini')
# app.config.from_envvar('FLASKCONFIG')
@app.route('/')
if __name__ == '__main__':
print(app.url_map)
app.run(host="0.0.0.0", port=5000, debug = True)
| 20.6875 | 52 | 0.65861 | # !/usr/bin/env python
# -*- coding: UTF-8 -*-
from flask import Flask
app=Flask(__name__)
# app.config.from_pyfile('config.ini')
# app.config.from_envvar('FLASKCONFIG')
@app.route('/')
def index():
return 'hello python'
if __name__ == '__main__':
print(app.url_map)
app.run(host="0.0.0.0", port=5000, deb... | 17 | 0 | 22 |
7243f750f770968e7cc35df2bf22b2110bee7427 | 2,523 | py | Python | purchasing/data/importer/importer.py | hamhands/pittsburgh-purchasing-suite | a79aa77c00c95da8f0b3e2f5f7f7143d5857de35 | [
"BSD-3-Clause"
] | 22 | 2015-05-08T15:30:42.000Z | 2021-04-24T20:26:32.000Z | purchasing/data/importer/importer.py | hamhands/pittsburgh-purchasing-suite | a79aa77c00c95da8f0b3e2f5f7f7143d5857de35 | [
"BSD-3-Clause"
] | 516 | 2015-04-23T18:14:40.000Z | 2017-11-08T19:27:41.000Z | purchasing/data/importer/importer.py | CityofPittsburgh/pittsburgh-purchasing-suite | d676ed9c137e5aaa100992a798acd60ac464a2c1 | [
"BSD-3-Clause"
] | 10 | 2015-07-08T19:00:10.000Z | 2021-03-15T18:56:54.000Z | # -*- coding: utf-8 -*-
import csv
def convert_empty_to_none(val):
'''Converts empty or "None" strings to None Types
Arguments:
val: The field to be converted
Returns:
The passed value if the value is not an empty string or
'None', ``None`` otherwise.
'''
return val if va... | 29.337209 | 103 | 0.636544 | # -*- coding: utf-8 -*-
import csv
def convert_empty_to_none(val):
'''Converts empty or "None" strings to None Types
Arguments:
val: The field to be converted
Returns:
The passed value if the value is not an empty string or
'None', ``None`` otherwise.
'''
return val if va... | 0 | 0 | 0 |
564b50d6226926a6ae68b9f6e83522059f4cb904 | 7,232 | py | Python | iemlav/args/arguments.py | GouravRDutta/IemLabsAV | 8d397a3d59e067176269c5e84d73bf53951b7b3f | [
"MIT"
] | null | null | null | iemlav/args/arguments.py | GouravRDutta/IemLabsAV | 8d397a3d59e067176269c5e84d73bf53951b7b3f | [
"MIT"
] | null | null | null | iemlav/args/arguments.py | GouravRDutta/IemLabsAV | 8d397a3d59e067176269c5e84d73bf53951b7b3f | [
"MIT"
] | 1 | 2021-07-02T12:29:10.000Z | 2021-07-02T12:29:10.000Z |
import argparse
| 20.841499 | 75 | 0.53443 |
import argparse
def get_args():
parser = argparse.ArgumentParser(description='Arguments of IemlAV')
parser.add_argument(
'--conf',
type=str,
required=False,
help='Path of config file. default:- "~/.iemlav/iemlav.conf" '
)
parser.add_argument(
'--debug',
... | 7,191 | 0 | 23 |
821fcea7c9bb45c93c9fd75c7d0496c73aa80b0f | 974 | py | Python | setup.py | kamilazdybal/PCAfold | 251ca0dc8c8f98976266b94147504247ddd09bd2 | [
"MIT"
] | 2 | 2021-06-23T12:57:40.000Z | 2021-06-24T17:17:23.000Z | setup.py | ElsevierSoftwareX/SOFTX-D-20-00048 | 14ad08a492ec23d70e0a18d2b9a8493b2d681616 | [
"MIT"
] | null | null | null | setup.py | ElsevierSoftwareX/SOFTX-D-20-00048 | 14ad08a492ec23d70e0a18d2b9a8493b2d681616 | [
"MIT"
] | 1 | 2022-03-13T13:19:56.000Z | 2022-03-13T13:19:56.000Z | from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from numpy import get_include as numpy_include
import os
import platform
cython_extra_compile_args = ['-O3', '-g', '-I' + numpy_include(), '-ffast-math']
is_mac = platform.system() == 'Darwin'
if is_mac:
... | 37.461538 | 127 | 0.666324 | from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from numpy import get_include as numpy_include
import os
import platform
cython_extra_compile_args = ['-O3', '-g', '-I' + numpy_include(), '-ffast-math']
is_mac = platform.system() == 'Darwin'
if is_mac:
... | 0 | 0 | 0 |
a5d7983a41da0d69983fbe94a8f1cc7b2f0b4570 | 2,628 | py | Python | demo_bot.py | VFDan/discord-ext-slash | 86181d467627843fc7793063a050c1d77b7cd8f9 | [
"MIT"
] | null | null | null | demo_bot.py | VFDan/discord-ext-slash | 86181d467627843fc7793063a050c1d77b7cd8f9 | [
"MIT"
] | null | null | null | demo_bot.py | VFDan/discord-ext-slash | 86181d467627843fc7793063a050c1d77b7cd8f9 | [
"MIT"
] | null | null | null | import os
import logging
import discord
from discord.ext import slash
client = slash.SlashBot(
# Pass help_command=None if the bot only uses slash commands
command_prefix='/', description='', help_command=None,
debug_guild=int(os.environ.get('DISCORD_DEBUG_GUILD', 0)) or None
)
@client.slash_cmd()
async d... | 33.692308 | 83 | 0.69102 | import os
import logging
import discord
from discord.ext import slash
client = slash.SlashBot(
# Pass help_command=None if the bot only uses slash commands
command_prefix='/', description='', help_command=None,
debug_guild=int(os.environ.get('DISCORD_DEBUG_GUILD', 0)) or None
)
@client.slash_cmd()
async d... | 490 | 0 | 44 |
58d0c9f86fe3b195c681abccf6a6de939f2f0b41 | 772 | py | Python | src/ebay_rest/api/sell_marketing/api/__init__.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | 3 | 2021-12-12T04:28:03.000Z | 2022-03-10T03:29:18.000Z | src/ebay_rest/api/sell_marketing/api/__init__.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 33 | 2021-06-16T20:44:36.000Z | 2022-03-30T14:55:06.000Z | src/ebay_rest/api/sell_marketing/api/__init__.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 7 | 2021-06-03T09:30:23.000Z | 2022-03-08T19:51:33.000Z | from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from ...sell_marketing.api.ad_api import AdApi
from ...sell_marketing.api.ad_report_api import AdReportApi
from ...sell_marketing.api.ad_report_metadata_api import AdReportMetadataApi
from ...sell_marketing.api.ad_report_task_api imp... | 48.25 | 88 | 0.860104 | from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from ...sell_marketing.api.ad_api import AdApi
from ...sell_marketing.api.ad_report_api import AdReportApi
from ...sell_marketing.api.ad_report_metadata_api import AdReportMetadataApi
from ...sell_marketing.api.ad_report_task_api imp... | 0 | 0 | 0 |
0ef7a74a82a1393787e038c09cbdb7444501ebd1 | 2,187 | py | Python | cmdb/urls.py | 2xx4ever/cmdb | 4652e5c0d6b96eb76a0a8ca2b7bcc3d3eb6c8adf | [
"MIT"
] | 1 | 2017-12-04T08:04:01.000Z | 2017-12-04T08:04:01.000Z | cmdb/urls.py | 4O4nOtfOund/cmdb | 4652e5c0d6b96eb76a0a8ca2b7bcc3d3eb6c8adf | [
"MIT"
] | null | null | null | cmdb/urls.py | 4O4nOtfOund/cmdb | 4652e5c0d6b96eb76a0a8ca2b7bcc3d3eb6c8adf | [
"MIT"
] | null | null | null | # _*_ coding: utf-8 _*_
"""cmdb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, n... | 24.573034 | 79 | 0.609968 | # _*_ coding: utf-8 _*_
"""cmdb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, n... | 0 | 0 | 0 |
beac8e6111473deab474ab7a670957c0d6ce7f7d | 1,264 | py | Python | tests/error/test_format_error.py | melvinkcx/graphql-core-next | b320331faf2fc2f4f1f6a1366f07109d1bdd44f1 | [
"MIT"
] | null | null | null | tests/error/test_format_error.py | melvinkcx/graphql-core-next | b320331faf2fc2f4f1f6a1366f07109d1bdd44f1 | [
"MIT"
] | null | null | null | tests/error/test_format_error.py | melvinkcx/graphql-core-next | b320331faf2fc2f4f1f6a1366f07109d1bdd44f1 | [
"MIT"
] | null | null | null | from typing import List, Union
from pytest import raises # type: ignore
from graphql.error import GraphQLError, format_error
from graphql.language import Node, Source
| 28.088889 | 80 | 0.538766 | from typing import List, Union
from pytest import raises # type: ignore
from graphql.error import GraphQLError, format_error
from graphql.language import Node, Source
def describe_format_error():
def throw_if_not_an_error():
with raises(TypeError):
# noinspection PyTypeChecker
f... | 1,070 | 0 | 23 |
fe8a06d357a853d7e09011476bb00073231fb320 | 1,115 | py | Python | setup.py | YoungTrep/ufcpy | f3363dfcff9d1f1ed3f35bc33a8085a639d93a6d | [
"MIT"
] | 1 | 2021-08-22T14:00:38.000Z | 2021-08-22T14:00:38.000Z | setup.py | YoungTrep/ufcpy | f3363dfcff9d1f1ed3f35bc33a8085a639d93a6d | [
"MIT"
] | null | null | null | setup.py | YoungTrep/ufcpy | f3363dfcff9d1f1ed3f35bc33a8085a639d93a6d | [
"MIT"
] | null | null | null | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='ufcpy',
version='2.0.1',
author='youngtrep',
author_email='youngtrep.business@gmail.com',
description='A fast and easy way to access the UFC roster',
long_description=long_description,... | 31.857143 | 96 | 0.611659 | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='ufcpy',
version='2.0.1',
author='youngtrep',
author_email='youngtrep.business@gmail.com',
description='A fast and easy way to access the UFC roster',
long_description=long_description,... | 0 | 0 | 0 |
856ca3e71bd2cdfe5fc4a4e30cfa0a2f4ea713c1 | 1,955 | py | Python | tests/test_string.py | fondat/fondat | 241b33301547a90e63e11febc51bc4f4fd8854d4 | [
"MIT"
] | 5 | 2021-01-08T19:50:18.000Z | 2022-01-09T06:23:16.000Z | tests/test_string.py | fondat/fondat | 241b33301547a90e63e11febc51bc4f4fd8854d4 | [
"MIT"
] | 1 | 2022-03-02T08:15:37.000Z | 2022-03-02T08:15:37.000Z | tests/test_string.py | fondat/fondat | 241b33301547a90e63e11febc51bc4f4fd8854d4 | [
"MIT"
] | 3 | 2021-02-03T01:02:18.000Z | 2022-02-25T22:59:37.000Z | import pytest
from fondat.string import Template
pytestmark = pytest.mark.asyncio
| 27.928571 | 57 | 0.653197 | import pytest
from fondat.string import Template
pytestmark = pytest.mark.asyncio
async def test_template_start():
async def resolver(variable: str) -> str:
return "World" if variable == "foo" else None
template = Template("${foo}, hello!")
result = "World, hello!"
assert await template.re... | 1,702 | 0 | 161 |
0914424e138d0e12cdefda87705deaa9e27eabcf | 2,420 | py | Python | src/networks.py | OsvaldFrisk/dp-not-all-noise-is-equal | a9293eab2e68577f5244d21c672cf18de33d5d29 | [
"MIT"
] | null | null | null | src/networks.py | OsvaldFrisk/dp-not-all-noise-is-equal | a9293eab2e68577f5244d21c672cf18de33d5d29 | [
"MIT"
] | null | null | null | src/networks.py | OsvaldFrisk/dp-not-all-noise-is-equal | a9293eab2e68577f5244d21c672cf18de33d5d29 | [
"MIT"
] | null | null | null | """Network Architectures"""
from typing import Callable, List
import torch
from torch import nn
from torch.nn import functional as F
class SmallNetwork(nn.Module):
"""
Network used in the experiments on MNIST and Fashion MNIST.
"""
class BigNetwork(nn.Module):
"""
Network used in the experiment... | 31.842105 | 84 | 0.593388 | """Network Architectures"""
from typing import Callable, List
import torch
from torch import nn
from torch.nn import functional as F
class SmallNetwork(nn.Module):
"""
Network used in the experiments on MNIST and Fashion MNIST.
"""
def __init__(self, act_func: Callable = torch.tanh) -> None:
... | 1,885 | 0 | 108 |