hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | 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 130 | 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 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08b321e691944be60f4baac231100dd16f8af4cc | 5,529 | py | Python | main.py | markmumba/password_locker | 2b864dc418c2783f888fc332878e21b6ed04e370 | [
"MIT"
] | null | null | null | main.py | markmumba/password_locker | 2b864dc418c2783f888fc332878e21b6ed04e370 | [
"MIT"
] | null | null | null | main.py | markmumba/password_locker | 2b864dc418c2783f888fc332878e21b6ed04e370 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.8
if __name__ == '__main__':
main()
| 31.061798 | 221 | 0.573702 | #!/usr/bin/env python3.8
import pyperclip
import random
import string
from py_lock import personas, profiles
def create_persona(persona_name, password):
new_persona = personas(persona_name, password)
return new_persona
def save_New_persona(persona_name):
personas.personas_list.append(persona_name)
... | 0 | 0 | 0 | 0 | 0 | 5,092 | 0 | -4 | 364 |
a111b0cae354e20686401a949e25af061b226bbe | 585 | py | Python | refresher/Set.py | arunma/Python_DataScience | 2f23de4517a761f373ef3cd3e708e46e84c62719 | [
"Apache-2.0"
] | 1 | 2018-01-21T06:43:16.000Z | 2018-01-21T06:43:16.000Z | refresher/Set.py | arunma/Python_DataScience | 2f23de4517a761f373ef3cd3e708e46e84c62719 | [
"Apache-2.0"
] | null | null | null | refresher/Set.py | arunma/Python_DataScience | 2f23de4517a761f373ef3cd3e708e46e84c62719 | [
"Apache-2.0"
] | null | null | null |
s=Set([1,2,3])
s.add(4)
print s
print ("contains 5,",s.contains(5))
print ("contains 4,",s.contains(4))
s.remove(3)
print (s)
print ("contains 3,",s.contains(3))
| 18.870968 | 45 | 0.574359 | class Set:
def __init__(self, values=None):
self.dict={}
if values is not None:
for value in values:
self.add(value)
def __repr__(self):
return "Set : "+str(self.dict.keys())
def add (self, value):
self.dict[value]=True
def contains(self, va... | 0 | 0 | 0 | 397 | 0 | 0 | 0 | 0 | 22 |
6cf265d72ec069ba1c8f2f1dcab4bda48de2e36a | 4,638 | py | Python | bevodevo/train.py | riveSunder/bevodevo | d45ec97b825489a9e94f79843e7169daa9491264 | [
"MIT"
] | 4 | 2020-12-02T22:28:29.000Z | 2020-12-28T05:42:06.000Z | bevodevo/train.py | riveSunder/bevodevo | d45ec97b825489a9e94f79843e7169daa9491264 | [
"MIT"
] | 5 | 2020-12-27T16:43:42.000Z | 2021-11-11T21:00:15.000Z | bevodevo/train.py | riveSunder/bevodevo | d45ec97b825489a9e94f79843e7169daa9491264 | [
"MIT"
] | null | null | null | import argparse
from mpi4py import MPI
comm = MPI.COMM_WORLD
#from bevodevo.algos.vpg import VanillaPolicyGradient
#from bevodevo.algos.dqn import DQN
if __name__ == "__main__":
parser = argparse.ArgumentParser("Experiment parameters")
parser.add_argument("-n", "--env_name", type=str, \
help=... | 34.102941 | 89 | 0.681975 | import os
import sys
import argparse
import subprocess
import torch
import numpy as np
import time
import gym
import pybullet
import pybullet_envs
from mpi4py import MPI
comm = MPI.COMM_WORLD
from bevodevo.policies.rnns import GatedRNNPolicy
from bevodevo.policies.cnns import ImpalaCNNPolicy
from bevodevo.policies... | 0 | 0 | 0 | 0 | 0 | 2,117 | 0 | 296 | 454 |
305281d1d65e2e36d46180f95ea3d6692aa1c5ca | 366 | py | Python | prediction/models.py | WaruiAlfred/ail_predict | 8d406e802394d45f4d22039e1d91c695fe8e069f | [
"MIT"
] | null | null | null | prediction/models.py | WaruiAlfred/ail_predict | 8d406e802394d45f4d22039e1d91c695fe8e069f | [
"MIT"
] | null | null | null | prediction/models.py | WaruiAlfred/ail_predict | 8d406e802394d45f4d22039e1d91c695fe8e069f | [
"MIT"
] | null | null | null | # from django.db import models
# Create your models here. | 40.666667 | 83 | 0.803279 | # from django.db import models
from django.contrib.auth.models import AbstractUser
from django.db import models
# Create your models here.
class User(AbstractUser):
is_admin = models.BooleanField('Admin',default=False)
is_patient = models.BooleanField('Patient',default=False)
is_health_practitioner = models.Boo... | 0 | 0 | 0 | 205 | 0 | 0 | 0 | 37 | 66 |
b0f91056a6c368409caf0a5fb324e79cfc59388f | 2,262 | py | Python | demos/demo_face_detection.py | rflamary/demos | af330563f5642d8435fa62641389b530a8396fc7 | [
"MIT"
] | 25 | 2020-03-14T22:01:30.000Z | 2021-10-05T13:50:02.000Z | demos/demo_face_detection.py | rflamary/demos | af330563f5642d8435fa62641389b530a8396fc7 | [
"MIT"
] | null | null | null | demos/demo_face_detection.py | rflamary/demos | af330563f5642d8435fa62641389b530a8396fc7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 Rmi Flamary
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the... | 29 | 92 | 0.716622 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 Rémi Flamary
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation th... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
4a1f4f3d91982d2ea80d4f5e58037fd0d77bdd1f | 2,571 | py | Python | calculateRanking.py | ConorMaley/Catan | c16f1a1d1eb286b13322a8b50ef319dd079ef01c | [
"Apache-2.0"
] | null | null | null | calculateRanking.py | ConorMaley/Catan | c16f1a1d1eb286b13322a8b50ef319dd079ef01c | [
"Apache-2.0"
] | null | null | null | calculateRanking.py | ConorMaley/Catan | c16f1a1d1eb286b13322a8b50ef319dd079ef01c | [
"Apache-2.0"
] | null | null | null |
if __name__ == '__main__':
main() | 30.975904 | 132 | 0.614936 | import googleSheetsApi
import eloCalculator
def main():
masterSheet = googleSheetsApi.getMasterSheet()
Elos = {}
playersArray = []
highestELO = {}
highestELO['score'] = 1200
lowestELO = {}
lowestELO['score'] = 1200
for line_count, row in enumerate(masterSheet):
if line_count == 0:
for name in row[1:]:... | 0 | 0 | 0 | 0 | 0 | 2,466 | 0 | 0 | 67 |
c32342487ddf2e42cf5a098bcc493400e3bb3c02 | 1,211 | py | Python | tests/workflows/test_cli_parser.py | akrherz/pyWWA | 011526f459db00d117e59f570535ac42ca267d83 | [
"MIT"
] | 9 | 2015-03-27T22:43:07.000Z | 2020-04-10T04:19:47.000Z | tests/workflows/test_cli_parser.py | akrherz/pyWWA | 011526f459db00d117e59f570535ac42ca267d83 | [
"MIT"
] | 76 | 2015-03-05T18:20:07.000Z | 2022-03-24T02:04:25.000Z | tests/workflows/test_cli_parser.py | akrherz/pyWWA | 011526f459db00d117e59f570535ac42ca267d83 | [
"MIT"
] | 3 | 2020-11-05T17:38:03.000Z | 2022-03-04T17:39:40.000Z | """Test cli_parser."""
# 3rd Party
# Local
| 29.536585 | 66 | 0.672998 | """Test cli_parser."""
# 3rd Party
from pyiem.util import utc
import pytest
# Local
import pywwa
from pywwa.workflows import cli_parser
from pywwa.testing import get_example_file
@pytest.mark.parametrize("database", ["iem"])
def test_processor(cursor):
"""Test basic parsing."""
data = get_example_file("CLI.t... | 0 | 959 | 0 | 0 | 0 | 0 | 0 | 26 | 179 |
0711d2b2079f706e4f95d3bb4d7821e8f97ba680 | 354 | py | Python | src/modules/services/interfaces/health.py | periket2000/zookeeperize | 3e72337643b60984b3ad8c206088ea6ea18b0206 | [
"Apache-2.0"
] | null | null | null | src/modules/services/interfaces/health.py | periket2000/zookeeperize | 3e72337643b60984b3ad8c206088ea6ea18b0206 | [
"Apache-2.0"
] | null | null | null | src/modules/services/interfaces/health.py | periket2000/zookeeperize | 3e72337643b60984b3ad8c206088ea6ea18b0206 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Metaclass as interface for the health service
"""
| 19.666667 | 45 | 0.621469 | # -*- coding: utf-8 -*-
"""
Metaclass as interface for the health service
"""
from abc import ABCMeta, abstractmethod
class HealthInterface(metaclass=ABCMeta):
@abstractmethod
def process(self, salute=None):
"""
Health interface
:salute: the salute to the system
:return: Json ... | 0 | 165 | 0 | 20 | 0 | 0 | 0 | 18 | 72 |
05a56b2d9163eb6470a1531a5bcf0049c9a4bd4b | 173 | py | Python | course_api/routing.py | dragonbone81/bobcat-courses-backend | d0f98b837f37eb16a89a24ce9bd3f3f0fd52064c | [
"MIT"
] | 3 | 2018-10-25T12:41:33.000Z | 2019-09-19T19:47:39.000Z | course_api/routing.py | dragonbone81/bobcat-courses-backend | d0f98b837f37eb16a89a24ce9bd3f3f0fd52064c | [
"MIT"
] | 22 | 2018-04-01T02:43:01.000Z | 2022-03-11T23:15:55.000Z | course_api/routing.py | dragonbone81/cse120 | d0f98b837f37eb16a89a24ce9bd3f3f0fd52064c | [
"MIT"
] | 1 | 2019-09-19T19:48:59.000Z | 2019-09-19T19:48:59.000Z | # chat/routing.py
from django.conf.urls import url
from . import consumers
websocket_urlpatterns = [
url(r'^api/ws/notifications', consumers.NotificationsConsumer),
]
| 19.222222 | 67 | 0.763006 | # chat/routing.py
from django.conf.urls import url
from . import consumers
websocket_urlpatterns = [
url(r'^api/ws/notifications', consumers.NotificationsConsumer),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
609b8d6d6afdd31120e91ceaa06afaea06a3515a | 14,668 | py | Python | force_wfmanager/tests/test_wfmanager_tasks.py | force-h2020/force-wfmanager | bcd488cd37092cacd9d0c81b544ee8c1654d1d92 | [
"BSD-2-Clause"
] | 1 | 2019-08-19T16:02:20.000Z | 2019-08-19T16:02:20.000Z | force_wfmanager/tests/test_wfmanager_tasks.py | force-h2020/force-wfmanager | bcd488cd37092cacd9d0c81b544ee8c1654d1d92 | [
"BSD-2-Clause"
] | 396 | 2017-07-18T15:19:55.000Z | 2021-05-03T06:23:06.000Z | force_wfmanager/tests/test_wfmanager_tasks.py | force-h2020/force-wfmanager | bcd488cd37092cacd9d0c81b544ee8c1654d1d92 | [
"BSD-2-Clause"
] | 2 | 2019-03-05T16:23:10.000Z | 2020-04-16T08:59:11.000Z | # (C) Copyright 2010-2020 Enthought, Inc., Austin, TX
# All rights reserved.
FILE_DIALOG_PATH = "force_wfmanager.wfmanager_setup_task.FileDialog"
RESULTS_FILE_DIALOG_PATH = "force_wfmanager.wfmanager_review_task.FileDialog"
RESULTS_FILE_OPEN_PATH = "force_wfmanager.io.project_io.open"
RESULTS_JSON_DUMP_PATH = "force... | 37.804124 | 79 | 0.650123 | # (C) Copyright 2010-2020 Enthought, Inc., Austin, TX
# All rights reserved.
import copy
from unittest import mock, TestCase
from pyface.api import OK, CANCEL
from pyface.file_dialog import FileDialog
from pyface.ui.qt4.util.gui_test_assistant import GuiTestAssistant
from pyface.tasks.api import TaskWindow
from fo... | 0 | 0 | 0 | 11,189 | 0 | 1,537 | 0 | 655 | 470 |
795b0560d2ca479481ca8ceaeb887fd7b5cba2be | 9,784 | py | Python | pastamaker/web.py | sileht/pastamaker | 1fda2bfc0dcaa15cb1070cb8bb7c1c74fda424fc | [
"Apache-2.0"
] | 37 | 2017-07-10T10:29:52.000Z | 2019-05-09T01:50:41.000Z | pastamaker/web.py | sileht/pastamaker | 1fda2bfc0dcaa15cb1070cb8bb7c1c74fda424fc | [
"Apache-2.0"
] | 13 | 2017-06-13T08:01:30.000Z | 2018-01-30T12:00:59.000Z | pastamaker/web.py | sileht/pastamaker | 1fda2bfc0dcaa15cb1070cb8bb7c1c74fda424fc | [
"Apache-2.0"
] | 4 | 2017-07-05T15:04:09.000Z | 2017-12-16T20:05:46.000Z | # -*- encoding: utf-8 -*-
#
# Copyright 2017 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 30.767296 | 78 | 0.601799 | # -*- encoding: utf-8 -*-
#
# Copyright © 2017 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 2 | 5,687 | 0 | 0 | 819 | 1,602 | 0 | -46 | 614 |
3d17e01cc03fb6bd6696eb4b21af15c825c85509 | 426 | py | Python | watchlist_app/migrations/0003_alter_streamingplatform_about.py | ivanlegranbizarro/movieList | eeaa875698da608d8cc009341dd31ee8a26169e9 | [
"MIT"
] | null | null | null | watchlist_app/migrations/0003_alter_streamingplatform_about.py | ivanlegranbizarro/movieList | eeaa875698da608d8cc009341dd31ee8a26169e9 | [
"MIT"
] | null | null | null | watchlist_app/migrations/0003_alter_streamingplatform_about.py | ivanlegranbizarro/movieList | eeaa875698da608d8cc009341dd31ee8a26169e9 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-26 06:57
| 22.421053 | 74 | 0.622066 | # Generated by Django 3.2.6 on 2021-08-26 06:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('watchlist_app', '0002_auto_20210826_0852'),
]
operations = [
migrations.AlterField(
model_name='streamingplatform',
... | 0 | 0 | 0 | 312 | 0 | 0 | 0 | 19 | 46 |
70f9fa062d8723acc19d16f3f162787ad7e36d88 | 1,465 | py | Python | src/spaceone/inventory/info/network_info.py | choonho/inventory | cc89757490d28fecb7ffccdfd6f89d4c0aa40da5 | [
"Apache-2.0"
] | null | null | null | src/spaceone/inventory/info/network_info.py | choonho/inventory | cc89757490d28fecb7ffccdfd6f89d4c0aa40da5 | [
"Apache-2.0"
] | null | null | null | src/spaceone/inventory/info/network_info.py | choonho/inventory | cc89757490d28fecb7ffccdfd6f89d4c0aa40da5 | [
"Apache-2.0"
] | null | null | null |
__all__ = ['NetworkInfo', 'NetworksInfo']
| 38.552632 | 134 | 0.709898 | import functools
from spaceone.api.inventory.v1 import network_pb2
from spaceone.core.pygrpc.message_type import *
from spaceone.inventory.model.network_model import Network
from spaceone.inventory.info.zone_info import ZoneInfo
from spaceone.inventory.info.region_info import RegionInfo
__all__ = ['NetworkInfo', 'Net... | 0 | 0 | 0 | 0 | 0 | 1,085 | 0 | 156 | 179 |
1e2c56644b6e59790a6b681324aa7dd41fa8f75d | 5,210 | py | Python | imposer.py | kevinjelnl/yapdfi | cb88e025cda7b79f4fd9f719f07d0b4ef20787ae | [
"MIT"
] | null | null | null | imposer.py | kevinjelnl/yapdfi | cb88e025cda7b79f4fd9f719f07d0b4ef20787ae | [
"MIT"
] | 3 | 2021-09-08T02:23:46.000Z | 2022-03-12T00:43:59.000Z | imposer.py | kevinjelnl/yapdfi | cb88e025cda7b79f4fd9f719f07d0b4ef20787ae | [
"MIT"
] | null | null | null | import logging
logging.basicConfig(format='%(asctime)s,%(msecs)d | %(levelname)-8s | %(filename)s:%(funcName)s:%(lineno)d - %(message)s',
datefmt='%Y-%m-%d:%H:%M:%S',
level=logging.DEBUG)
log = logging.getLogger(__name__)
pt2mm = 0.3527777778
if __name__ == "__main__":
... | 32.767296 | 122 | 0.59405 | import sys
import logging
import math
from pathlib import Path
from pydantic import BaseModel
from typing import *
import PyPDF2
from reportlab.lib.units import mm, inch
logging.basicConfig(format='%(asctime)s,%(msecs)d | %(levelname)-8s | %(filename)s:%(funcName)s:%(lineno)d - %(message)s',
datef... | 0 | 0 | 0 | 4,291 | 0 | 357 | 0 | 1 | 224 |
c4760810a6b30136c57c8727033cf01063f4f5da | 2,439 | py | Python | zcash_test_vectors/orchard/commitments.py | jarys/zcash-test-vectors | 0cbb8200b092867606835d641cf65c606d987fd7 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | zcash_test_vectors/orchard/commitments.py | jarys/zcash-test-vectors | 0cbb8200b092867606835d641cf65c606d987fd7 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | zcash_test_vectors/orchard/commitments.py | jarys/zcash-test-vectors | 0cbb8200b092867606835d641cf65c606d987fd7 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys; assert sys.version_info[0] >= 3, "Python 3 required."
# Commitment schemes used in Orchard https://zips.z.cash/protocol/nu5.pdf#concretecommit
# https://zips.z.cash/protocol/nu5.pdf#constants
L_ORCHARD_BASE = 255
# https://zips.z.cash/protocol/nu5.pdf#concretehomomorphiccommit
# h... | 31.675325 | 107 | 0.707257 | #!/usr/bin/env python3
import sys; assert sys.version_info[0] >= 3, "Python 3 required."
from .group_hash import group_hash
from .pallas import Fp, Scalar
from .sinsemilla import sinsemilla_hash_to_point
from ..utils import i2lebsp
# Commitment schemes used in Orchard https://zips.z.cash/protocol/nu5.pdf#concretecomm... | 0 | 0 | 0 | 0 | 0 | 1,432 | 0 | 55 | 314 |
f14389d4d441d9fa654bdded6abebd61ad14e193 | 18,618 | py | Python | wechatarticles/proxy.py | hjyjh/wechat_articles_spider | 38da6cde565f8d6e09a5822b25b0dcfb1a8cb239 | [
"Apache-2.0"
] | 1,603 | 2018-03-05T03:01:28.000Z | 2022-03-31T05:30:51.000Z | wechatarticles/proxy.py | hjyjh/wechat_articles_spider | 38da6cde565f8d6e09a5822b25b0dcfb1a8cb239 | [
"Apache-2.0"
] | 42 | 2018-03-09T03:06:57.000Z | 2021-12-31T02:30:13.000Z | wechatarticles/proxy.py | hjyjh/wechat_articles_spider | 38da6cde565f8d6e09a5822b25b0dcfb1a8cb239 | [
"Apache-2.0"
] | 491 | 2018-03-05T03:22:31.000Z | 2022-03-30T10:10:59.000Z | # coding:utf-8
import logging
"""
baseproxyhttps://github.com/qiyeboy/BaseProxy
1.
2. http://baseproxy.ca/()
3.
https://github.com/qiyeboy/BaseProxy/blob/master/baseproxy/proxy.py
1. mitmproxy
2. ProxyHandle`self.filter_url_lst`
"""
__all__ = [
"CAAuth",
"ProxyHandle",
"ReqInterc... | 29 | 95 | 0.570738 | # coding:utf-8
import logging
import os
import select
import zlib
import chardet
import time
from http.client import HTTPResponse
from http.server import BaseHTTPRequestHandler, HTTPServer
from socketserver import ThreadingMixIn
from urllib.parse import urlparse, ParseResult, urlunparse
from tempfile import gettempdir... | 2,100 | 148 | 0 | 16,421 | 0 | 0 | 0 | 269 | 518 |
4743e2afb0612962f02991b2d1548016f9ee41de | 3,134 | py | Python | gen_create.py | pdebuyl/f90h5md | 538bda2eebd5474489d963e16175aecdb750ab4d | [
"BSD-3-Clause"
] | 1 | 2019-10-17T15:57:45.000Z | 2019-10-17T15:57:45.000Z | gen_create.py | pdebuyl/f90h5md | 538bda2eebd5474489d963e16175aecdb750ab4d | [
"BSD-3-Clause"
] | null | null | null | gen_create.py | pdebuyl/f90h5md | 538bda2eebd5474489d963e16175aecdb750ab4d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright 2011-2013 Pierre de Buyl
#
# This file is part of f90h5md
#
# f90h5md is free software and is licensed under the modified BSD license (see
# LICENSE file).
types = dict()
types['i'] = 'integer'
types['d'] = 'double precision'
H5T = dict()
H5T['i'] = 'H5T_NATIVE_INTEGER'
H5T['d'] = 'H... | 30.72549 | 107 | 0.624442 | #!/usr/bin/env python
# Copyright 2011-2013 Pierre de Buyl
#
# This file is part of f90h5md
#
# f90h5md is free software and is licensed under the modified BSD license (see
# LICENSE file).
types = dict()
types['i'] = 'integer'
types['d'] = 'double precision'
H5T = dict()
H5T['i'] = 'H5T_NATIVE_INTEGER'
H5T['d'] = 'H... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9c74df1de285f8990eac45aebad0a4ff62e8d973 | 4,531 | py | Python | scripts/dv_del.py | ubc-library-rc/dataverse_utils | 3fbf3e90bba64b84fa141145a27a9ff787507eb7 | [
"MIT"
] | null | null | null | scripts/dv_del.py | ubc-library-rc/dataverse_utils | 3fbf3e90bba64b84fa141145a27a9ff787507eb7 | [
"MIT"
] | 7 | 2021-07-30T23:26:48.000Z | 2021-10-05T21:34:36.000Z | scripts/dv_del.py | ubc-library-rc/dataverse_utils | 3fbf3e90bba64b84fa141145a27a9ff787507eb7 | [
"MIT"
] | null | null | null | #!python
'''Dataverse Bulk Deleter
Deletes unpublished studies at the command line
'''
import argparse
#import json
import sys
import requests
VERSION = (0, 2, 1)
__version__ = '.'.join([str(x) for x in VERSION])
def delstudy(dvurl, key, pid):
'''
Deletes Dataverse study
dvurl : str
Dataverse ins... | 35.398438 | 100 | 0.546237 | #!python
'''Dataverse Bulk Deleter
Deletes unpublished studies at the command line
'''
import argparse
#import json
import sys
import requests
VERSION = (0, 2, 1)
__version__ = '.'.join([str(x) for x in VERSION])
def delstudy(dvurl, key, pid):
'''
Deletes Dataverse study
dvurl : str
Dataverse ins... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
17b91ebb149ff794e7ab9e3c0e500dbf74dd6ee0 | 2,039 | py | Python | src/common.py | nagisc007/pythoncitest | 5200f1e8ae2969ffb733fb2239e9bbb7e700e836 | [
"MIT"
] | null | null | null | src/common.py | nagisc007/pythoncitest | 5200f1e8ae2969ffb733fb2239e9bbb7e700e836 | [
"MIT"
] | null | null | null | src/common.py | nagisc007/pythoncitest | 5200f1e8ae2969ffb733fb2239e9bbb7e700e836 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 23.436782 | 83 | 0.583619 | # -*- coding: utf-8 -*-
from acttypes import ActType
class Act(object):
""" basic action class.
"""
def __init__(self, subject, act_type, action, description, with_subject=False):
self.action = action
self.act_type = act_type
self.description = description
self.subject = ... | 6 | 0 | 0 | 1,791 | 0 | 0 | 0 | 7 | 207 |
3f6fab9af2fd1b2e838b7fc2b62a4615070a323a | 644 | py | Python | oauth2_provider/backends.py | grnspace/django-oauth-toolkit | 3d876563a2528eadac0f832f360a0b269b99b94e | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2021-03-21T03:35:24.000Z | 2021-04-20T05:49:19.000Z | oauth2_provider/backends.py | grnspace/django-oauth-toolkit | 3d876563a2528eadac0f832f360a0b269b99b94e | [
"BSD-2-Clause-FreeBSD"
] | 4 | 2018-06-20T11:33:43.000Z | 2021-05-28T08:02:21.000Z | oauth2_provider/backends.py | grnspace/django-oauth-toolkit | 3d876563a2528eadac0f832f360a0b269b99b94e | [
"BSD-2-Clause-FreeBSD"
] | 4 | 2018-06-20T11:14:46.000Z | 2021-05-21T15:56:02.000Z | from django.contrib.auth import get_user_model
from .oauth2_backends import get_oauthlib_core
UserModel = get_user_model()
OAuthLibCore = get_oauthlib_core()
| 23.851852 | 70 | 0.650621 | from django.contrib.auth import get_user_model
from .oauth2_backends import get_oauthlib_core
UserModel = get_user_model()
OAuthLibCore = get_oauthlib_core()
class OAuth2Backend:
"""
Authenticate against an OAuth2 access token
"""
def authenticate(self, request=None, **credentials):
if req... | 0 | 0 | 0 | 459 | 0 | 0 | 0 | 0 | 23 |
2249f1f9badf4ea52249baafff8509a9ed842631 | 875 | py | Python | example/example_single_cell.py | Yuego/py3o.template | d89293d8154a880e5245df30515ace82effc77e1 | [
"MIT"
] | null | null | null | example/example_single_cell.py | Yuego/py3o.template | d89293d8154a880e5245df30515ace82effc77e1 | [
"MIT"
] | null | null | null | example/example_single_cell.py | Yuego/py3o.template | d89293d8154a880e5245df30515ace82effc77e1 | [
"MIT"
] | null | null | null | from py3o.template import Template
t = Template(
"py3o_example_template_single_cell.odt",
"py3o_example_output_single_cell.odt"
)
t.set_image_path('staticimage.logo', 'images/new_logo.png')
items = list()
item1 = Item()
item1.val1 = 'Item1 Value1'
item1.val2 = 'Item1 Value2'
item1.val3 = 'It... | 21.875 | 60 | 0.645714 | from py3o.template import Template
t = Template(
"py3o_example_template_single_cell.odt",
"py3o_example_output_single_cell.odt"
)
t.set_image_path('staticimage.logo', 'images/new_logo.png')
class Item(object):
pass
items = list()
item1 = Item()
item1.val1 = 'Item1 Value1'
item1.val2 =... | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 25 |
5e529e7707da7ca177bde6d4d7eadd1ee8b03b6b | 468 | py | Python | lesson 6/question 7.py | Kev-in123/ICS2O7 | 425c59975d4ce6aa0937fd8715b51d04487e4fa9 | [
"MIT"
] | 2 | 2021-08-10T18:16:08.000Z | 2021-09-26T19:49:26.000Z | lesson 6/question 7.py | Kev-in123/ICS2O7 | 425c59975d4ce6aa0937fd8715b51d04487e4fa9 | [
"MIT"
] | null | null | null | lesson 6/question 7.py | Kev-in123/ICS2O7 | 425c59975d4ce6aa0937fd8715b51d04487e4fa9 | [
"MIT"
] | null | null | null | num1 = float(input("Number 1: "))
num2 = float(input("Wumber 2: "))
operation = input("Which operation (+,-,/,*): ")
if operation == "+":
print(f"The sum is {num1 + num2}")
if operation == "-":
print(f"The difference is {num1 - num2}")
if operation == "/":
if num2 != 0:
print(f"The quotient... | 24.631579 | 49 | 0.557692 | num1 = float(input("Number 1: "))
num2 = float(input("Wumber 2: "))
operation = input("Which operation (+,-,/,*): ")
if operation == "+":
print(f"The sum is {num1 + num2}")
if operation == "-":
print(f"The difference is {num1 - num2}")
if operation == "/":
if num2 != 0:
print(f"The quotient... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5e3b4e520e44677ef5084651d4a02fae10e6565f | 3,574 | py | Python | hata/discord/integration/integration_detail.py | Multiface24111/hata | cd28f9ef158e347363669cc8d1d49db0ff41aba0 | [
"0BSD"
] | 173 | 2019-06-14T20:25:00.000Z | 2022-03-21T19:36:10.000Z | hata/discord/integration/integration_detail.py | Multiface24111/hata | cd28f9ef158e347363669cc8d1d49db0ff41aba0 | [
"0BSD"
] | 52 | 2020-01-03T17:05:14.000Z | 2022-03-31T11:39:50.000Z | hata/discord/integration/integration_detail.py | Multiface24111/hata | cd28f9ef158e347363669cc8d1d49db0ff41aba0 | [
"0BSD"
] | 47 | 2019-11-09T08:46:45.000Z | 2022-03-31T14:33:34.000Z | __all__ = ('IntegrationDetail', )
| 30.033613 | 116 | 0.570229 | __all__ = ('IntegrationDetail', )
from ..core import ROLES
from ..utils import timestamp_to_datetime, DISCORD_EPOCH_START
from ..role import create_partial_role_from_id
from .preinstanced import IntegrationExpireBehavior
class IntegrationDetail:
"""
Details about a non discord integration.
Attribute... | 0 | 892 | 0 | 2,436 | 0 | 0 | 0 | 99 | 113 |
6cc1141c1620e59785bdb019aca3300e2db9915b | 553 | py | Python | main.py | robingather/com-thesis | 30a6e815c4f71edc332a4e74a25faf0dd21c1244 | [
"MIT"
] | null | null | null | main.py | robingather/com-thesis | 30a6e815c4f71edc332a4e74a25faf0dd21c1244 | [
"MIT"
] | null | null | null | main.py | robingather/com-thesis | 30a6e815c4f71edc332a4e74a25faf0dd21c1244 | [
"MIT"
] | null | null | null | import cProfile
import pstats
OPTIMIZE = False # True to generate performance reports
if OPTIMIZE:
cProfile.run('main()', "output.dat")
with open("output_time.txt","w") as f:
p = pstats.Stats("output. dat", stream=f)
p.sort_stats("time").print_stats()
with open("output_calls.txt","w... | 25.136364 | 55 | 0.636528 | from controller import Controller
import torch
import cProfile
import pstats
OPTIMIZE = False # True to generate performance reports
def main():
with torch.no_grad():
Controller().run()
if OPTIMIZE:
cProfile.run('main()', "output.dat")
with open("output_time.txt","w") as f:
p = psta... | 0 | 0 | 0 | 0 | 0 | 43 | 0 | 3 | 69 |
5f4be6e4666e04d53f03216c425c40dad46daa50 | 2,980 | py | Python | kiosk/kiosk_browser/browser_widget.py | dividat/playos | fae198150789696b2c2d51cf099cb9f6c9563022 | [
"MIT"
] | 1 | 2021-06-10T11:05:05.000Z | 2021-06-10T11:05:05.000Z | kiosk/kiosk_browser/browser_widget.py | dividat/playos | fae198150789696b2c2d51cf099cb9f6c9563022 | [
"MIT"
] | 45 | 2019-01-23T15:36:43.000Z | 2022-03-29T08:23:30.000Z | kiosk/kiosk_browser/browser_widget.py | dividat/playos | fae198150789696b2c2d51cf099cb9f6c9563022 | [
"MIT"
] | 7 | 2019-01-18T13:53:14.000Z | 2021-02-03T10:17:51.000Z | import re
def user_agent_with_system(user_agent, system_name, system_version):
"""Inject a specific system into a user agent string"""
pattern = re.compile('(Mozilla/5.0) \(([^\)]*)\)(.*)')
m = pattern.match(user_agent)
if m == None:
return f"{system_name}/{system_version} {user_agent}"
el... | 35.903614 | 102 | 0.668792 | import re
import urllib
import logging
from PyQt5.QtCore import QTimer
from PyQt5.QtWidgets import QShortcut
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineSettings
from PyQt5.QtWidgets import QSizePolicy
from kiosk_browser import system
class BrowserWidget(QWebEngineView):
def __init__(self, url... | 0 | 0 | 0 | 2,147 | 0 | 0 | 0 | 90 | 178 |
c9f09c526c716364169dbbaeba34b703a91c1d8a | 2,625 | py | Python | wordCloudGenerator.py | cwen96/Word-Cloud-Generator | 0dcc23ad37f231230f80849b49de6448c84e3a7b | [
"MIT"
] | null | null | null | wordCloudGenerator.py | cwen96/Word-Cloud-Generator | 0dcc23ad37f231230f80849b49de6448c84e3a7b | [
"MIT"
] | null | null | null | wordCloudGenerator.py | cwen96/Word-Cloud-Generator | 0dcc23ad37f231230f80849b49de6448c84e3a7b | [
"MIT"
] | null | null | null | #wordCloudGenerator.py
#Reads the selected file and then draws the wordcloud
#Removes punctuation from words
#Calculates how many times each word appears in the text file
if __name__ == "__main__":
main() | 37.5 | 117 | 0.610286 | #wordCloudGenerator.py
import wordcloud
from matplotlib import pyplot as plot
import tkinter
from tkinter.filedialog import askopenfile
#Reads the selected file and then draws the wordcloud
def readFileAndDrawPlot():
file = askopenfile(mode = 'rb', filetypes = [("Text Files", "*.txt")])
fileContents = ""
... | 0 | 0 | 0 | 0 | 0 | 2,179 | 0 | 25 | 201 |
8278d8338dc03e1303d76a76e15b4eab9b77b17e | 400 | py | Python | examples/apps/GetImage/GetImage.py | HornedSungem/SungemSDK-Python | 5ce5eb7f84654aecf6840de773188f436219559d | [
"Apache-2.0"
] | 14 | 2018-08-16T09:11:39.000Z | 2019-12-07T12:54:32.000Z | examples/apps/GetImage/GetImage.py | HornedSungem/SungemSDK-Python | 5ce5eb7f84654aecf6840de773188f436219559d | [
"Apache-2.0"
] | 2 | 2019-08-23T23:31:10.000Z | 2020-06-17T09:21:57.000Z | examples/apps/GetImage/GetImage.py | HornedSungem/SungemSDK-Python | 5ce5eb7f84654aecf6840de773188f436219559d | [
"Apache-2.0"
] | 7 | 2018-10-02T01:46:43.000Z | 2021-06-04T19:10:47.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright(c) 2018 Senscape Corporation.
# License: Apache 2.0
# Import libs
import cv2, sys
sys.path.append('../../../')
import hsapi as hs
device = hs.GetDevice()
device.OpenDevice()
try:
while(1):
image = device.GetImage(False)
cv2.imshow('imag... | 18.181818 | 41 | 0.6325 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright(c) 2018 Senscape Corporation.
# License: Apache 2.0
# Import libs
import cv2, sys, numpy as np
sys.path.append('../../../')
import hsapi as hs
device = hs.GetDevice()
device.OpenDevice()
try:
while(1):
image = device.GetImage(False)
cv2... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 0 |
7ce2de320184ff667c45ca79b9e4aac27a385587 | 1,062 | py | Python | src/cactus/faces/cactus_fillAdjacenciesTest.py | Robin-Rounthwaite/cactus | 3c612779b83b75cb42e08dc143b9cb81c257cf80 | [
"MIT-0"
] | 1 | 2020-12-16T07:08:29.000Z | 2020-12-16T07:08:29.000Z | src/cactus/faces/cactus_fillAdjacenciesTest.py | Robin-Rounthwaite/cactus | 3c612779b83b75cb42e08dc143b9cb81c257cf80 | [
"MIT-0"
] | null | null | null | src/cactus/faces/cactus_fillAdjacenciesTest.py | Robin-Rounthwaite/cactus | 3c612779b83b75cb42e08dc143b9cb81c257cf80 | [
"MIT-0"
] | null | null | null | #!/usr/bin/env python3
#Copyright (C) 2009-2011 by Benedict Paten (benedictpaten@gmail.com)
#
#Released under the MIT license, see LICENSE.txt
import unittest
if __name__ == '__main__':
unittest.main()
| 35.4 | 142 | 0.708098 | #!/usr/bin/env python3
#Copyright (C) 2009-2011 by Benedict Paten (benedictpaten@gmail.com)
#
#Released under the MIT license, see LICENSE.txt
import unittest
import sys
from sonLib.bioio import TestStatus
from cactus.shared.test import getCactusInputs_random
from cactus.shared.test import getCactusInputs_blanchette... | 0 | 544 | 0 | 13 | 0 | 0 | 0 | 109 | 188 |
8aa1d75f638cfc7d435e032ffae08cc74818678a | 127 | py | Python | genetic-algorithm-flyfood/testes/teste/change.py | JessyLeal/flyfood | 5b0ec6b1b86078208202019a8096df0fdbe6c3b3 | [
"MIT"
] | 1 | 2022-03-13T20:22:50.000Z | 2022-03-13T20:22:50.000Z | genetic-algorithm-flyfood/testes/teste/change.py | JessyLeal/flyfood | 5b0ec6b1b86078208202019a8096df0fdbe6c3b3 | [
"MIT"
] | null | null | null | genetic-algorithm-flyfood/testes/teste/change.py | JessyLeal/flyfood | 5b0ec6b1b86078208202019a8096df0fdbe6c3b3 | [
"MIT"
] | null | null | null | lista = ['oi', 'bem', 'meu']
a, b = lista.index('bem'), lista.index('meu')
lista[b], lista[a] = lista[a], lista[b]
print(lista) | 31.75 | 45 | 0.590551 | lista = ['oi', 'bem', 'meu']
a, b = lista.index('bem'), lista.index('meu')
lista[b], lista[a] = lista[a], lista[b]
print(lista) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b759e7bd31af70be7eea8575585cafd0450c2cfe | 1,310 | py | Python | app/app11_plos_HumanEKC/prepData2.py | ameenetemady/DeepPep | 121826309667f1290fa1121746a2992943d0927b | [
"Apache-2.0"
] | 1 | 2020-05-30T06:01:50.000Z | 2020-05-30T06:01:50.000Z | app/app11_plos_HumanEKC/prepData2.py | ameenetemady/DeepPep | 121826309667f1290fa1121746a2992943d0927b | [
"Apache-2.0"
] | null | null | null | app/app11_plos_HumanEKC/prepData2.py | ameenetemady/DeepPep | 121826309667f1290fa1121746a2992943d0927b | [
"Apache-2.0"
] | 1 | 2019-10-20T21:11:48.000Z | 2019-10-20T21:11:48.000Z | # Prerequisite: directories for "in_strProtRefsDir" and "sparseData2", should not contain any ".txt" file
# Output: under sparseData2 directory: target.csv, metaInfo.csv, *.txt
import sys
import os
sys.path.append('../..')
import prepLib
in_strFastaFilename = '{!s}/data/protein/plos_HumanEKC/HumanEKC_uniprot-reviewed_... | 52.4 | 137 | 0.816031 | # Prerequisite: directories for "in_strProtRefsDir" and "sparseData2", should not contain any ".txt" file
# Output: under sparseData2 directory: target.csv, metaInfo.csv, *.txt
import sys
import os
sys.path.append('../..')
import prepLib
in_strFastaFilename = '{!s}/data/protein/plos_HumanEKC/HumanEKC_uniprot-reviewed_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2c97c0f192d433d52d140b286b27d5678d5f5e29 | 10,138 | py | Python | tests/utils/test_gmm_utils.py | Prithwijit-Chak/simpeg | d93145d768b5512621cdd75566b4a8175fee9ed3 | [
"MIT"
] | 358 | 2015-03-11T05:48:41.000Z | 2022-03-26T02:04:12.000Z | tests/utils/test_gmm_utils.py | thast/simpeg | 8021082b8b53f3c08fa87fc085547bdd56437c6b | [
"MIT"
] | 885 | 2015-01-19T09:23:48.000Z | 2022-03-29T12:08:34.000Z | tests/utils/test_gmm_utils.py | thast/simpeg | 8021082b8b53f3c08fa87fc085547bdd56437c6b | [
"MIT"
] | 214 | 2015-03-11T05:48:43.000Z | 2022-03-02T01:05:11.000Z | import unittest
if __name__ == "__main__":
unittest.main()
| 35.823322 | 96 | 0.56451 | import numpy as np
import unittest
import discretize
from SimPEG.maps import Wires
from SimPEG.utils import (
mkvc,
WeightedGaussianMixture,
GaussianMixtureWithPrior,
)
from scipy.stats import norm, multivariate_normal
class TestGMMs(unittest.TestCase):
def setUp(self):
np.random.seed(518936)... | 0 | 0 | 0 | 9,834 | 0 | 0 | 0 | 105 | 133 |
ea221f0eca0e44612cb7425eb660c95162fd9ac7 | 3,176 | py | Python | wagtail/embeds/rich_text.py | wlcrs/wagtail | 8afbc6c3eccef9eb0f09ed56c54cd36779451882 | [
"BSD-3-Clause"
] | 3 | 2019-05-14T13:43:08.000Z | 2021-11-09T11:27:18.000Z | wagtail/embeds/rich_text.py | denza/wagtail | 3939397850f2c73d3f960cea5cc9c2cfae2d005d | [
"BSD-3-Clause"
] | 13 | 2019-03-25T19:57:35.000Z | 2019-12-28T19:25:23.000Z | wagtail/embeds/rich_text.py | denza/wagtail | 3939397850f2c73d3f960cea5cc9c2cfae2d005d | [
"BSD-3-Clause"
] | 1 | 2021-08-13T15:38:43.000Z | 2021-08-13T15:38:43.000Z | from draftjs_exporter.dom import DOM
from wagtail.admin.rich_text.converters import editor_html
from wagtail.embeds import format
# Front-end conversion
def media_embedtype_handler(attrs):
"""
Given a dict of attributes from the <embed> tag, return the real HTML
representation for use on the front-end.
... | 31.445545 | 99 | 0.662469 | from draftjs_exporter.dom import DOM
from wagtail.admin.rich_text.converters import editor_html
from wagtail.admin.rich_text.converters.contentstate_models import Entity
from wagtail.admin.rich_text.converters.html_to_contentstate import AtomicBlockEntityElementHandler
from wagtail.embeds import embeds, format
from wa... | 0 | 686 | 0 | 1,090 | 0 | 0 | 0 | 169 | 112 |
1e5e1b379eece7a8be5749fbe67ee5b0d26fada8 | 332 | py | Python | exercises/ja/exc_01_03_02.py | YanaPalacheva/spacy-course | 59975f7348a601532303be91474d75d02d0540ef | [
"MIT"
] | 1 | 2021-12-30T06:40:11.000Z | 2021-12-30T06:40:11.000Z | exercises/ja/exc_01_03_02.py | YanaPalacheva/spacy-course | 59975f7348a601532303be91474d75d02d0540ef | [
"MIT"
] | null | null | null | exercises/ja/exc_01_03_02.py | YanaPalacheva/spacy-course | 59975f7348a601532303be91474d75d02d0540ef | [
"MIT"
] | 1 | 2020-06-08T13:26:06.000Z | 2020-06-08T13:26:06.000Z | # Englishnlp
from ____ import ____
nlp = ____
#
doc = ____("I like tree kangaroos and narwhals.")
# tree kangaroors
tree_kangaroos = ____
print(tree_kangaroos.text)
# tree kangaroos and narwhals.
tree_kangaroos_and_narwhals = ____
print(tree_kangaroos_and_narwhals.text)
| 20.75 | 49 | 0.795181 | # Englishクラスをインポートし、nlpオブジェクトを作成
from ____ import ____
nlp = ____
# テキストを処理
doc = ____("I like tree kangaroos and narwhals.")
# 「tree kangaroors」のスライスを選択
tree_kangaroos = ____
print(tree_kangaroos.text)
# 「tree kangaroos and narwhals」のスライスを選択(「.」は含まない)
tree_kangaroos_and_narwhals = ____
print(tree_kangaroos_and_nar... | 168 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c51070e21a3ea544b20c010d1a0a301c1ee793fa | 5,524 | py | Python | sequana/iotools.py | ddesvillechabrol/sequana | c92d6071e782df78566fffd15ad619c8c3df6fe3 | [
"BSD-3-Clause"
] | null | null | null | sequana/iotools.py | ddesvillechabrol/sequana | c92d6071e782df78566fffd15ad619c8c3df6fe3 | [
"BSD-3-Clause"
] | null | null | null | sequana/iotools.py | ddesvillechabrol/sequana | c92d6071e782df78566fffd15ad619c8c3df6fe3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016-2017 - Sequana Development Team
#
# File author(s):
# Thomas Cokelaer <thomas.cokelaer@pasteur.fr>
#
# Distributed under the terms of the 3-clause BSD license.
# The full license is in the LICENSE file, distributed with t... | 32.304094 | 84 | 0.56336 | # -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016-2017 - Sequana Development Team
#
# File author(s):
# Thomas Cokelaer <thomas.cokelaer@pasteur.fr>
#
# Distributed under the terms of the 3-clause BSD license.
# The full license is in the LICENSE file, distributed with t... | 0 | 0 | 0 | 4,875 | 0 | 0 | 0 | -15 | 67 |
fb65b58ba30ff18957a19ea60f05ec0892aff289 | 4,628 | py | Python | examples/websocket/tests.py | PyCN/pulsar | fee44e871954aa6ca36d00bb5a3739abfdb89b26 | [
"BSD-3-Clause"
] | 1,410 | 2015-01-02T14:55:07.000Z | 2022-03-28T17:22:06.000Z | examples/websocket/tests.py | PyCN/pulsar | fee44e871954aa6ca36d00bb5a3739abfdb89b26 | [
"BSD-3-Clause"
] | 194 | 2015-01-22T06:18:24.000Z | 2020-10-20T21:21:58.000Z | examples/websocket/tests.py | PyCN/pulsar | fee44e871954aa6ca36d00bb5a3739abfdb89b26 | [
"BSD-3-Clause"
] | 168 | 2015-01-31T10:29:55.000Z | 2022-03-14T10:22:24.000Z | '''Tests the websocket middleware in pulsar.apps.ws.'''
| 33.294964 | 74 | 0.612576 | '''Tests the websocket middleware in pulsar.apps.ws.'''
import unittest
import asyncio
from pulsar.api import send
from pulsar.apps.ws import WebSocket, WS
from pulsar.apps.http import HttpClient
from pulsar.apps.test import run_test_server
from examples.websocket.manage import server
class Echo(WS):
def __ini... | 0 | 338 | 2,906 | 1,048 | 0 | 0 | 0 | 76 | 202 |
361a95a9d55113478f6cb1aacfcbe892d796532c | 3,217 | py | Python | app/main/address_ctlr.py | bvbgrad/betterJob | d54962d31eafde428fa7309c8bf5ac238bf6a640 | [
"MIT"
] | null | null | null | app/main/address_ctlr.py | bvbgrad/betterJob | d54962d31eafde428fa7309c8bf5ac238bf6a640 | [
"MIT"
] | null | null | null | app/main/address_ctlr.py | bvbgrad/betterJob | d54962d31eafde428fa7309c8bf5ac238bf6a640 | [
"MIT"
] | null | null | null | """
"""
import logging
import os
logger_name = os.getenv("LOGGER_NAME")
logger = logging.getLogger(logger_name)
NO_COMPANY_ADDRESS = 'No company address'
| 31.23301 | 79 | 0.632577 | """
"""
import app.utils6L.utils6L as utils
import logging
import os
import PySimpleGUI as sg
from app.main.views import view_create_link_address
from app.model import db_session
from app.model.Company import Address, Company
from PySimpleGUI.PySimpleGUI import popup_scrolled
logger_name = os.getenv("LOGGER_NAME")... | 0 | 2,717 | 0 | 0 | 0 | 0 | 0 | 112 | 227 |
f71a4b33d3f34e4911b2fce2af6caffbdfbb62bf | 1,326 | py | Python | Assessments/count-contained-permutations.py | SaumyaRai2010/algoexpert-data-structures-algorithms | bcafd8d7798661bf86c2d6234221d764c68fc19f | [
"MIT"
] | 2 | 2021-08-17T14:13:01.000Z | 2021-08-17T14:13:16.000Z | Assessments/count-contained-permutations.py | SaumyaRai2010/algoexpert-data-structures-algorithms | bcafd8d7798661bf86c2d6234221d764c68fc19f | [
"MIT"
] | null | null | null | Assessments/count-contained-permutations.py | SaumyaRai2010/algoexpert-data-structures-algorithms | bcafd8d7798661bf86c2d6234221d764c68fc19f | [
"MIT"
] | null | null | null |
# COUNT CONTAINED PERMUTATIONS
# O(M * U + N) time and O(U) space, where M -> length of big string,
# U -> number of unique characters in small string, N -> length
# of small string.
# U is actually a constant since it can't be greater than 26. and
# M > N, so M will dissolve N
# So, modified complexities:
# O(M) ti... | 26 | 68 | 0.684766 |
# COUNT CONTAINED PERMUTATIONS
# O(M * U + N) time and O(U) space, where M -> length of big string,
# U -> number of unique characters in small string, N -> length
# of small string.
# U is actually a constant since it can't be greater than 26. and
# M > N, so M will dissolve N
# So, modified complexities:
# O(M) ti... | 0 | 0 | 0 | 0 | 0 | 917 | 0 | 0 | 45 |
014ea7ee19fe30e5e999c1aec260c631eca49b6a | 372 | py | Python | rblxpy/__init__.py | INfoUpgraders/rblxpy | 481af14bb7a8bc349c635b865afa1c113097b3a7 | [
"MIT"
] | null | null | null | rblxpy/__init__.py | INfoUpgraders/rblxpy | 481af14bb7a8bc349c635b865afa1c113097b3a7 | [
"MIT"
] | null | null | null | rblxpy/__init__.py | INfoUpgraders/rblxpy | 481af14bb7a8bc349c635b865afa1c113097b3a7 | [
"MIT"
] | null | null | null |
print(Users.get_user(Users("INfoUpgradersYT")))
| 26.571429 | 116 | 0.669355 | import urllib.request, json
class Users:
def __init__(self, username):
self.username = username
def get_user(self):
with urllib.request.urlopen(f"http://api.roblox.com/users/get-by-username?username={self.username}") as url:
data = json.loads(url.read().decode())
return da... | 0 | 0 | 0 | 272 | 0 | 0 | 0 | 6 | 45 |
5821dd47fba75dd2ea15fba39cbd3efaf72653d2 | 431 | py | Python | Markets/BTCMarkets/btcmarkets_fetch.py | infectiious/Pharaoh | edde36f578fec1f0621da4ef212c3b01ea7b67ed | [
"MIT"
] | null | null | null | Markets/BTCMarkets/btcmarkets_fetch.py | infectiious/Pharaoh | edde36f578fec1f0621da4ef212c3b01ea7b67ed | [
"MIT"
] | null | null | null | Markets/BTCMarkets/btcmarkets_fetch.py | infectiious/Pharaoh | edde36f578fec1f0621da4ef212c3b01ea7b67ed | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from btcmarkets_api import Market
BTC = Market("/market/BTC/AUD/tick", "BTC")
LTC = Market("/market/LTC/AUD/tick", "LTC")
ETH = Market("/market/ETH/AUD/tick", "ETH")
ETC = Market("/market/ETC/AUD/tick", "ETC")
XRP = Market("/market/XRP/AUD/tick", "XRP")
BCH = Market("/market/BCH/AUD/tick", "BCH"... | 25.352941 | 43 | 0.691415 | #!/usr/bin/env python3
from btcmarkets_api import Market
BTC = Market("/market/BTC/AUD/tick", "BTC")
LTC = Market("/market/LTC/AUD/tick", "LTC")
ETH = Market("/market/ETH/AUD/tick", "ETH")
ETC = Market("/market/ETC/AUD/tick", "ETC")
XRP = Market("/market/XRP/AUD/tick", "XRP")
BCH = Market("/market/BCH/AUD/tick", "BCH"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
616c3bf20e5e0eba25e4c7b33ae80a18eea27832 | 701 | py | Python | tests/concordance_test.py | stencila/libdh | 41b0dc826e6a6af3390877736185ed90b52459a2 | [
"Apache-2.0"
] | 2 | 2019-01-20T09:35:06.000Z | 2019-03-29T20:29:59.000Z | tests/concordance_test.py | stencila/libdh | 41b0dc826e6a6af3390877736185ed90b52459a2 | [
"Apache-2.0"
] | 1 | 2018-03-19T22:56:07.000Z | 2018-03-20T03:14:19.000Z | tests/concordance_test.py | stencila/libdh | 41b0dc826e6a6af3390877736185ed90b52459a2 | [
"Apache-2.0"
] | 1 | 2018-04-04T00:08:22.000Z | 2018-04-04T00:08:22.000Z | from funcs.concordance import concordance
def test_concordance_string():
"""
concordance can be called with a string (e.g. a single cell containing a string)
"""
grams = concordance('Hello world. Hello, my great world! Hello Alice and Bob.', 'world')
assert grams == [
('Hello world'),
... | 29.208333 | 100 | 0.623395 | from funcs.concordance import concordance
def test_concordance_string():
"""
concordance can be called with a string (e.g. a single cell containing a string)
"""
grams = concordance('Hello world. Hello, my great world! Hello Alice and Bob.', 'world')
assert grams == [
('Hello world'),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
77342629a5359863a3e4ac211322c8f62eafaf6f | 7,392 | py | Python | prototipo_mouse_expressions.py | AlbertMelo/MouseExpressions | 8e2bc36d8378541d512e04b17908bdefac6090e8 | [
"MIT"
] | 3 | 2019-07-22T18:29:10.000Z | 2019-09-11T12:24:05.000Z | prototipo_mouse_expressions.py | AlbertMelo/MouseExpressions | 8e2bc36d8378541d512e04b17908bdefac6090e8 | [
"MIT"
] | 7 | 2019-12-16T22:20:58.000Z | 2022-02-10T00:50:45.000Z | prototipo_mouse_expressions.py | AlbertMelo/MouseExpressions | 8e2bc36d8378541d512e04b17908bdefac6090e8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pyautogui
pyautogui.FAILSAFE = False
if __name__== '__main__':
mouse_expressions().executar() | 33.6 | 278 | 0.684389 | # -*- coding: utf-8 -*-
import numpy as np
import cv2 as cv
from keras.preprocessing import image
from keras.models import model_from_json
import click
import pandas as pd
from keras.layers import Input
from keras import models
from keras.models import load_model
import pyautogui
import statistics
from PyQt5 import QtW... | 66 | 0 | 0 | 6,761 | 0 | 0 | 0 | 50 | 421 |
4c97aa5d3d19d9348f63b93ed4291c1b26df65b9 | 1,496 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/plugins/doc_fragments/vmware_rest_client.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/ansible/plugins/doc_fragments/vmware_rest_client.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/ansible/plugins/doc_fragments/vmware_rest_client.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
| 34.790698 | 129 | 0.701872 | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Parameters for VMware REST Client based modules
DOCUMENT... | 0 | 0 | 0 | 1,253 | 0 | 0 | 0 | 0 | 23 |
679ad77e84c8222952811ad00bc89e353d4ed471 | 5,617 | py | Python | automol/zmatrix/bmat.py | kevinmooreiii/autochem | 87f50adc09c3f1170459c629697aadd74154c769 | [
"Apache-2.0"
] | null | null | null | automol/zmatrix/bmat.py | kevinmooreiii/autochem | 87f50adc09c3f1170459c629697aadd74154c769 | [
"Apache-2.0"
] | null | null | null | automol/zmatrix/bmat.py | kevinmooreiii/autochem | 87f50adc09c3f1170459c629697aadd74154c769 | [
"Apache-2.0"
] | null | null | null | """
IN PROGRESS:Transliterating Carlo's routine from Fortran
Form the B-Matrix and C-Matrix used to convert the coordinates
Calcualtes all of the derivaties via finite-difference
define starting xyz geometry.
convention: atom 1 is is 0 0 0
atom 2 bd 0 0
atom 3 on xy plane
"""
# import numpy as np
#
# NATOMS = 10 #... | 33.434524 | 79 | 0.513263 | """
IN PROGRESS:Transliterating Carlo's routine from Fortran
Form the B-Matrix and C-Matrix used to convert the coordinates
Calcualtes all of the derivaties via finite-difference
define starting xyz geometry.
convention: atom 1 is is 0 0 0
atom 2 bd 0 0
atom 3 on xy plane
"""
# import numpy as np
#
# NATOMS = 10 #... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
58eab8d36c5aa9986701a4f86760228903a57b48 | 2,315 | py | Python | src/command_modules/azure-cli-botservice/azure/cli/command_modules/botservice/converged_app.py | jfcoz/azure-cli | 8459ef3fd3c76d9f99defd95d4c980923891fa6d | [
"MIT"
] | 1 | 2019-06-21T05:07:59.000Z | 2019-06-21T05:07:59.000Z | src/command_modules/azure-cli-botservice/azure/cli/command_modules/botservice/converged_app.py | jfcoz/azure-cli | 8459ef3fd3c76d9f99defd95d4c980923891fa6d | [
"MIT"
] | 3 | 2019-07-12T22:10:38.000Z | 2019-07-12T22:10:49.000Z | src/command_modules/azure-cli-botservice/azure/cli/command_modules/botservice/converged_app.py | jfcoz/azure-cli | 8459ef3fd3c76d9f99defd95d4c980923891fa6d | [
"MIT"
] | 1 | 2019-06-21T05:08:09.000Z | 2019-06-21T05:08:09.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 45.392157 | 120 | 0.621598 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 0 | 1,649 | 0 | 168 | 0 | 0 | 0 | 40 | 112 |
a29ae9caec88596cb11a22a6a82947490844cecd | 1,325 | py | Python | final_exam_prep/3rd.py | lowrybg/SoftuniPythonFund | ab80c424c35824bbfda5f43f1ba8ba5aa2f4efb5 | [
"MIT"
] | null | null | null | final_exam_prep/3rd.py | lowrybg/SoftuniPythonFund | ab80c424c35824bbfda5f43f1ba8ba5aa2f4efb5 | [
"MIT"
] | null | null | null | final_exam_prep/3rd.py | lowrybg/SoftuniPythonFund | ab80c424c35824bbfda5f43f1ba8ba5aa2f4efb5 | [
"MIT"
] | null | null | null | n = int(input())
pieces = {}
for _ in range(n):
piece, composer, key = input().split("|")
pieces[piece] = {'composer': composer, 'key': key}
data = input()
while not data == "Stop":
command = data.split("|")
if command[0] == "Add":
piece, composer, key = command[1:]
if piece in piec... | 33.974359 | 87 | 0.568302 | n = int(input())
pieces = {}
for _ in range(n):
piece, composer, key = input().split("|")
pieces[piece] = {'composer': composer, 'key': key}
data = input()
while not data == "Stop":
command = data.split("|")
if command[0] == "Add":
piece, composer, key = command[1:]
if piece in piec... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
374bd98516fb14783c4dd99d65e20d161f2986ee | 1,125 | py | Python | plugins/recorded_future/komand_recorded_future/actions/lookup_alert/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/recorded_future/komand_recorded_future/actions/lookup_alert/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/recorded_future/komand_recorded_future/actions/lookup_alert/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z |
# Custom imports below
| 36.290323 | 118 | 0.649778 | import insightconnect_plugin_runtime
from .schema import LookupAlertInput, LookupAlertOutput, Input, Output, Component
# Custom imports below
from insightconnect_plugin_runtime.exceptions import PluginException
from komand_recorded_future.util.api import Endpoint
class LookupAlert(insightconnect_plugin_runtime.Actio... | 0 | 0 | 0 | 836 | 0 | 0 | 0 | 153 | 111 |
bc85e43a576f203604dcb456c0e57b0aa707256a | 7,132 | py | Python | test/functional/feature_index_prune.py | hernanmarino/bitcoin | 51eebe082d0d5542ba10a470ee44dfcbd1f2d7e7 | [
"MIT"
] | 1 | 2020-01-03T01:06:07.000Z | 2020-01-03T01:06:07.000Z | test/functional/feature_index_prune.py | hernanmarino/bitcoin | 51eebe082d0d5542ba10a470ee44dfcbd1f2d7e7 | [
"MIT"
] | 1 | 2022-02-09T21:05:47.000Z | 2022-02-09T21:05:47.000Z | test/functional/feature_index_prune.py | hernanmarino/bitcoin | 51eebe082d0d5542ba10a470ee44dfcbd1f2d7e7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2020-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test indices in conjunction with prune."""
if __name__ == '__main__':
FeatureIndexPruneTest().ma... | 45.717949 | 188 | 0.662227 | #!/usr/bin/env python3
# Copyright (c) 2020-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test indices in conjunction with prune."""
from test_framework.test_framework import BitcoinTestFramewo... | 0 | 0 | 0 | 6,613 | 0 | 0 | 0 | 127 | 67 |
83599f9c39e0eb9c2eb150ed207890f904271e54 | 437 | py | Python | slice_script.py | harsh52/endoscopy-artifact-detection | 496d89ae0d162b97e616d586c56c8675a7652b4f | [
"MIT"
] | 22 | 2019-07-08T02:34:22.000Z | 2021-11-29T05:25:04.000Z | slice_script.py | harsh52/endoscopy-artifact-detection | 496d89ae0d162b97e616d586c56c8675a7652b4f | [
"MIT"
] | 1 | 2019-12-03T15:30:28.000Z | 2019-12-03T15:30:28.000Z | slice_script.py | harsh52/endoscopy-artifact-detection | 496d89ae0d162b97e616d586c56c8675a7652b4f | [
"MIT"
] | 7 | 2019-08-29T16:34:40.000Z | 2020-12-08T10:23:25.000Z | import re
import csv
line = []
list2 = []
with open('output2.txt') as f:
for i in f:
line.append(i)
outList = re.findall(r"[-+]?\d*\.\d+|\d+", line[0]) # extracting integers from string
list2.append(outList[0])
list2.append(outList[2])
#writing into csv file
with open('epoch_loss.csv', 'a... | 24.277778 | 90 | 0.606407 | import re
import csv
line = []
list2 = []
with open('output2.txt') as f:
for i in f:
line.append(i)
outList = re.findall(r"[-+]?\d*\.\d+|\d+", line[0]) # extracting integers from string
list2.append(outList[0])
list2.append(outList[2])
#writing into csv file
with open('epoch_loss.csv', 'a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d8beb893a13694f876607ea939fc05d2189e77e6 | 3,947 | py | Python | handlers/acceptmembermulti.py | micjerry/groupservice | 807e5d53533897ac36d9bf1cce30aee09979ea9f | [
"Apache-2.0"
] | 1 | 2015-12-14T08:31:30.000Z | 2015-12-14T08:31:30.000Z | handlers/acceptmembermulti.py | micjerry/groupservice | 807e5d53533897ac36d9bf1cce30aee09979ea9f | [
"Apache-2.0"
] | null | null | null | handlers/acceptmembermulti.py | micjerry/groupservice | 807e5d53533897ac36d9bf1cce30aee09979ea9f | [
"Apache-2.0"
] | null | null | null | import tornado.web
| 32.089431 | 105 | 0.541677 | import tornado.web
import tornado.gen
import json
import io
import logging
import motor
from bson.objectid import ObjectId
import mickey.userfetcher
from mickey.basehandler import BaseHandler
class AcceptMultimemberHandler(BaseHandler):
@tornado.web.asynchronous
@tornado.gen.coroutine
def post(self):
... | 0 | 3,654 | 0 | 23 | 0 | 0 | 0 | -3 | 254 |
3c41be0847b2540835a2e5b84d62ce2bdcdb833d | 7,601 | py | Python | rpi_pcm_ws281x.py | tvoverbeek/rpi-pcm-ws2811 | 479d7996f3b042cb579858caedd5ef7993d7549c | [
"MIT"
] | 5 | 2016-10-20T09:15:03.000Z | 2021-12-14T19:15:11.000Z | rpi_pcm_ws281x.py | tvoverbeek/rpi-pcm-ws2811 | 479d7996f3b042cb579858caedd5ef7993d7549c | [
"MIT"
] | 3 | 2016-10-21T10:13:33.000Z | 2018-08-11T22:04:45.000Z | rpi_pcm_ws281x.py | tvoverbeek/rpi-pcm-ws2811 | 479d7996f3b042cb579858caedd5ef7993d7549c | [
"MIT"
] | 1 | 2017-03-27T18:00:55.000Z | 2017-03-27T18:00:55.000Z | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
_rpi_pcm_ws281x = swig_import_helper()
del swig... | 44.976331 | 142 | 0.778187 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path impo... | 0 | 0 | 0 | 4,067 | 0 | 1,707 | 0 | 0 | 326 |
ec821600b761fbf8efdb41b115e466a61978364e | 16,410 | py | Python | tests/test_pendulum.py | shromonag/active_testing | ca9c8f909f6b0f4e7b1affda6f9333e0d0b6c04b | [
"MIT"
] | 4 | 2019-03-09T12:38:46.000Z | 2021-12-08T15:45:44.000Z | tests/test_pendulum.py | shromonag/active_testing | ca9c8f909f6b0f4e7b1affda6f9333e0d0b6c04b | [
"MIT"
] | null | null | null | tests/test_pendulum.py | shromonag/active_testing | ca9c8f909f6b0f4e7b1affda6f9333e0d0b6c04b | [
"MIT"
] | 3 | 2019-01-09T13:43:06.000Z | 2021-11-30T22:15:28.000Z | '''
Here we consider a controller trained on nearest neighbor for the pendulum
environment in OpenAI Gym. The controller is taken from baselines ppo.
'''
import gym
import numpy as np
from baselines.common import tf_util as U
import gym, logging
import numpy as np
U.make_session(num_cpu=1).__enter__()
env= gym.make('... | 40.220588 | 123 | 0.625168 | '''
Here we consider a controller trained on nearest neighbor for the pendulum
environment in OpenAI Gym. The controller is taken from baselines ppo.
'''
import gym
import numpy as np
from gym import spaces
from baselines import deepq
from baselines.common import set_global_seeds, tf_util as U
import gym, logging
from... | 0 | 0 | 0 | 0 | 0 | 8,081 | 0 | 126 | 360 |
3bacdb47786b68ea0eb99f183c0ed33e5b4958ed | 1,189 | py | Python | setup.py | vvd170501/pyhton-gforms | 684956e06f4c6d8224ea3eb2f66827d3ec9bec46 | [
"MIT"
] | 3 | 2021-05-28T11:17:30.000Z | 2022-03-13T14:49:24.000Z | setup.py | vvd170501/pyhton-gforms | 684956e06f4c6d8224ea3eb2f66827d3ec9bec46 | [
"MIT"
] | 3 | 2021-05-26T17:19:18.000Z | 2022-03-01T09:46:14.000Z | setup.py | vvd170501/pyhton-gforms | 684956e06f4c6d8224ea3eb2f66827d3ec9bec46 | [
"MIT"
] | 2 | 2021-11-14T17:09:50.000Z | 2021-12-02T20:13:49.000Z | import re
from setuptools import setup
with open('README.md', 'r', encoding='utf-8') as f:
readme = f.read()
with open('gforms/__init__.py', encoding='utf-8') as f:
version = re.search(r"__version__ = '(.+)'", f.read()).group(1)
setup(
name='gforms',
description='Google Forms wrapper for Python',
... | 25.297872 | 67 | 0.592094 | import re
from setuptools import setup, find_packages
with open('README.md', 'r', encoding='utf-8') as f:
readme = f.read()
with open('gforms/__init__.py', encoding='utf-8') as f:
version = re.search(r"__version__ = '(.+)'", f.read()).group(1)
setup(
name='gforms',
description='Google Forms wrappe... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 0 |
f6e7faf06c12bf23f5e307d5f0d9371d91449b85 | 3,754 | py | Python | seqcluster/libs/annotation.py | kkarolis/seqcluster | 774e23add8cd4fdc83d626cea3bd1f458e7d060d | [
"MIT"
] | 33 | 2015-01-26T23:18:01.000Z | 2022-01-07T21:40:49.000Z | seqcluster/libs/annotation.py | kkarolis/seqcluster | 774e23add8cd4fdc83d626cea3bd1f458e7d060d | [
"MIT"
] | 44 | 2015-01-21T17:43:42.000Z | 2021-08-25T15:49:18.000Z | seqcluster/libs/annotation.py | kkarolis/seqcluster | 774e23add8cd4fdc83d626cea3bd1f458e7d060d | [
"MIT"
] | 18 | 2015-05-18T15:34:32.000Z | 2021-02-10T17:58:24.000Z | import seqcluster.libs.logger as mylog
import os
from seqcluster.libs.classes import annotation, dbannotation
logger = mylog.getLogger("run")
def read_gtf_line(cols, field="name"):
"""parse gtf line to get class/name information"""
field = field.lower()
try:
group = cols[2]
attrs = cols[... | 35.084112 | 123 | 0.537294 | import seqcluster.libs.logger as mylog
import os
from seqcluster.libs.classes import annotation, dbannotation
logger = mylog.getLogger("run")
def read_gtf_line(cols, field="name"):
"""parse gtf line to get class/name information"""
field = field.lower()
try:
group = cols[2]
attrs = cols[... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
286bc6b3c5ed8544085b2f819632a9e139dca2dd | 310 | py | Python | testttt.py | Srinivassan-Ramamurthy/python_programs | 53b390669c7e88532c67d80b758a9199d6fde8cf | [
"bzip2-1.0.6"
] | null | null | null | testttt.py | Srinivassan-Ramamurthy/python_programs | 53b390669c7e88532c67d80b758a9199d6fde8cf | [
"bzip2-1.0.6"
] | null | null | null | testttt.py | Srinivassan-Ramamurthy/python_programs | 53b390669c7e88532c67d80b758a9199d6fde8cf | [
"bzip2-1.0.6"
] | null | null | null | pattern()
| 23.846154 | 37 | 0.380645 | def pattern():
a=input('enter 5 letter word ')
for i in range(len(a)):
for j in range(len(a)):
if(j==i):
print(a[i],end='')
elif(j+i==4):
print(a[-1-i],end='')
else:
print(' ',end='')
print()
pattern()
| 0 | 0 | 0 | 0 | 0 | 278 | 0 | 0 | 22 |
ac8b860ac3e67063a748e256dd35316334efdf95 | 4,826 | py | Python | compose/plugin.py | GM-Alex/compose-improved | 585175e50b71b07596b0cba3b7d66ad367c9b2ed | [
"Apache-2.0"
] | 1 | 2017-05-26T15:22:02.000Z | 2017-05-26T15:22:02.000Z | compose/plugin.py | GM-Alex/compose-improved | 585175e50b71b07596b0cba3b7d66ad367c9b2ed | [
"Apache-2.0"
] | null | null | null | compose/plugin.py | GM-Alex/compose-improved | 585175e50b71b07596b0cba3b7d66ad367c9b2ed | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import unicode_literals
| 30.352201 | 101 | 0.627849 | from __future__ import absolute_import
from __future__ import unicode_literals
import collections
import inspect
import json
import os
import re
from functools import partial
import compose
class PartialMethod(partial):
def __get__(self, instance, owner):
if instance is None:
return self
... | 0 | 271 | 0 | 1,643 | 0 | 2,528 | 0 | -43 | 340 |
d7e9adcefd3cab5ccb8d34cc92eaa8b709da5a03 | 3,774 | py | Python | pygsm/tests/test_ase.py | stenczelt/pyGSM | 48e7a710744ec768e2c4a0f4d8dc1f9ffd948ce1 | [
"MIT"
] | null | null | null | pygsm/tests/test_ase.py | stenczelt/pyGSM | 48e7a710744ec768e2c4a0f4d8dc1f9ffd948ce1 | [
"MIT"
] | 2 | 2021-05-29T13:04:31.000Z | 2021-05-30T11:05:41.000Z | pygsm/tests/test_ase.py | stenczelt/pyGSM | 48e7a710744ec768e2c4a0f4d8dc1f9ffd948ce1 | [
"MIT"
] | null | null | null |
xyz_4x4 = [
["H", 1.0, 2.0, 3.0],
["He", 4.0, 5.0, 6.0],
["Li", 7.0, 8.0, 9.0],
["Be", 10.0, 11.0, 12.0],
]
| 28.80916 | 84 | 0.659777 | import numpy as np
from ase.calculators.lj import LennardJones
from ase.units import Bohr, Ha
from pytest import approx, raises
from pygsm.level_of_theories.ase import ASELoT, geom_to_ase, xyz_to_ase
from pygsm.level_of_theories.base_lot import LoTError
xyz_4x4 = [
["H", 1.0, 2.0, 3.0],
["He", 4.0, 5.0, 6.0],... | 0 | 0 | 0 | 0 | 0 | 3,202 | 0 | 122 | 317 |
59d73a2e5b7f78e4793c434d33a541c7dae2d810 | 254 | py | Python | survey/features/page_objects/weights.py | ericazhou7/uSurvey | 1236f33355662957e7e1e769dde1811b910673a5 | [
"BSD-3-Clause"
] | 5 | 2016-08-25T12:48:54.000Z | 2018-08-16T22:49:43.000Z | survey/features/page_objects/weights.py | ericazhou7/uSurvey | 1236f33355662957e7e1e769dde1811b910673a5 | [
"BSD-3-Clause"
] | 2 | 2016-08-11T06:43:56.000Z | 2016-12-08T09:11:36.000Z | survey/features/page_objects/weights.py | ericazhou7/uSurvey | 1236f33355662957e7e1e769dde1811b910673a5 | [
"BSD-3-Clause"
] | 7 | 2016-09-16T11:03:44.000Z | 2020-10-28T22:01:20.000Z |
__author__ = 'mnandri'
| 21.166667 | 56 | 0.783465 | from survey.features.page_objects.base import PageObject
__author__ = 'mnandri'
class ListLocationWeightsPage(PageObject):
url = "/locations/weights/"
class ListLocationWeightsErrorLogPage(PageObject):
url = "/locations/weights/error_logs/"
| 0 | 0 | 0 | 125 | 0 | 0 | 0 | 35 | 68 |
be6fc59741cd65844495a4517390894b6f81b3ef | 11,198 | py | Python | muffin_debugtoolbar/plugin.py | klen/muffin-debugtoolbar | bce845f48ae3f21c859663190f5be3ae69970ccc | [
"MIT"
] | 4 | 2015-06-09T15:22:56.000Z | 2016-11-08T11:49:57.000Z | muffin_debugtoolbar/plugin.py | klen/muffin-debugtoolbar | bce845f48ae3f21c859663190f5be3ae69970ccc | [
"MIT"
] | null | null | null | muffin_debugtoolbar/plugin.py | klen/muffin-debugtoolbar | bce845f48ae3f21c859663190f5be3ae69970ccc | [
"MIT"
] | null | null | null | """Debug Toolbar Plugin."""
import os.path as op
import re
RE_BODY = re.compile(b'<\/body>', re.I)
U_SSE_PAYLOAD = "id: {0}\nevent: new_request\ndata: {1}\n\n"
REDIRECT_CODES = (300, 301, 302, 303, 305, 307, 308)
PLUGIN_ROOT = op.dirname(op.abspath(__file__))
| 34.349693 | 99 | 0.610734 | """Debug Toolbar Plugin."""
import asyncio
import importlib
import ipaddress as ip
import os.path as op
import re
import sys
import uuid
from muffin import (
Response, StaticRoute, HTTPException, HTTPBadRequest, to_coroutine, HTTPForbidden)
from muffin.plugins import BasePlugin, PluginException
from muffin.utils i... | 0 | 6,019 | 0 | 4,499 | 0 | 0 | 0 | 122 | 291 |
0c7e1e059eedf931f70c49d679202f99a195fd40 | 8,200 | py | Python | Operations/PH_Walker.py | ClarkLabUVA/hctsa-py | 4382a7e852d21cdfefdac1a4a09ea6e11abd9be1 | [
"MIT"
] | 6 | 2020-08-14T00:16:19.000Z | 2022-01-20T05:49:12.000Z | Operations/PH_Walker.py | fairscape/hctsa-py | 4382a7e852d21cdfefdac1a4a09ea6e11abd9be1 | [
"MIT"
] | null | null | null | Operations/PH_Walker.py | fairscape/hctsa-py | 4382a7e852d21cdfefdac1a4a09ea6e11abd9be1 | [
"MIT"
] | 4 | 2020-08-14T00:22:45.000Z | 2021-02-18T05:31:14.000Z |
import numpy as np
from scipy import stats
import statsmodels.sandbox.stats.runs as runs
# 18/21 output statistics fully implemented from MATLAB, the other three are either from complex helper functions or MATLAB functions that don't transfer well
def PH_Walker(y, walkerRule='prop', walkerParams=np.array([])):
"... | 41.836735 | 216 | 0.517561 |
import numpy as np
from scipy import stats
import statsmodels.sandbox.stats.runs as runs
# 18/21 output statistics fully implemented from MATLAB, the other three are either from complex helper functions or MATLAB functions that don't transfer well
def PH_Walker(y, walkerRule='prop', walkerParams=np.array([])):
"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b15d0d88548bec009f72b3c26a79df2dbb7cf9c5 | 790 | py | Python | modules/crawler/Utilities/helpers.py | kivzcu/heatmap.zcu | 526c4df9c1c299eb1b3e9df6bd2be5578d462405 | [
"MIT"
] | null | null | null | modules/crawler/Utilities/helpers.py | kivzcu/heatmap.zcu | 526c4df9c1c299eb1b3e9df6bd2be5578d462405 | [
"MIT"
] | null | null | null | modules/crawler/Utilities/helpers.py | kivzcu/heatmap.zcu | 526c4df9c1c299eb1b3e9df6bd2be5578d462405 | [
"MIT"
] | null | null | null | from typing import Dict
SKIP = "SKIP"
UNKNOWN = "UNKNOWN!"
def detect_change(first: Dict[str, str], second: Dict[str, str],
compareKeys: [str]) -> bool:
"""Detects change between two dictonaries
Args:
first (Dict[str, str]): First dictionary
second (Dict[str, str]): Second... | 26.333333 | 64 | 0.588608 | from typing import Dict
SKIP = "SKIP"
UNKNOWN = "UNKNOWN!"
def should_skip(device: Dict[str, str]) -> bool:
return device['x'] == SKIP or device['y'] == SKIP or device[
'x'] == UNKNOWN or device['y'] == UNKNOWN
def detect_change(first: Dict[str, str], second: Dict[str, str],
compareKe... | 0 | 0 | 0 | 0 | 0 | 142 | 0 | 0 | 23 |
371b5d6ccd471e0f2f61a35d10fdcaf0c575c962 | 36 | py | Python | src/backend/training/__init__.py | ToJestKrzysio/TheJungleGame | 904dd4adc937145df2c8c353eb83bec3b5dd1f7e | [
"MIT"
] | null | null | null | src/backend/training/__init__.py | ToJestKrzysio/TheJungleGame | 904dd4adc937145df2c8c353eb83bec3b5dd1f7e | [
"MIT"
] | null | null | null | src/backend/training/__init__.py | ToJestKrzysio/TheJungleGame | 904dd4adc937145df2c8c353eb83bec3b5dd1f7e | [
"MIT"
] | null | null | null | from . helpers import get_timestamp
| 18 | 35 | 0.833333 | from . helpers import get_timestamp
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5b06d060ba415fd61bd539d1de87749c0e6359bb | 883 | py | Python | collect_pong.py | Loptt/pong-autoencoder | c5123bb2466f644f7513d807044e11a4a17aae22 | [
"MIT"
] | null | null | null | collect_pong.py | Loptt/pong-autoencoder | c5123bb2466f644f7513d807044e11a4a17aae22 | [
"MIT"
] | 1 | 2021-03-19T03:06:46.000Z | 2021-08-02T13:29:05.000Z | collect_pong.py | Loptt/pong-autoencoder | c5123bb2466f644f7513d807044e11a4a17aae22 | [
"MIT"
] | null | null | null | import gym
from PIL import Image
import sys
env = gym.make('Pong-v0')
env.reset()
done = False
i = 0
start = 0
if len(sys.argv) < 3:
print("Usage: collect_pong <games> <start_point>")
exit()
try:
games = int(sys.argv[1])
start = int(sys.argv[2])
i = start
except:
print("Please provide a vali... | 21.02381 | 87 | 0.596829 | import gym
import numpy as np
from PIL import Image
import sys
env = gym.make('Pong-v0')
env.reset()
done = False
i = 0
start = 0
if len(sys.argv) < 3:
print("Usage: collect_pong <games> <start_point>")
exit()
try:
games = int(sys.argv[1])
start = int(sys.argv[2])
i = start
except:
print("Pl... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
1177ec39443f0c4afc68b0f4bb00985b22bbdd21 | 887 | py | Python | python/bubblesort.py | gmoise/sandbox | 1ad01904448b19cec5f9ad89e698b59bc11150ed | [
"MIT"
] | null | null | null | python/bubblesort.py | gmoise/sandbox | 1ad01904448b19cec5f9ad89e698b59bc11150ed | [
"MIT"
] | null | null | null | python/bubblesort.py | gmoise/sandbox | 1ad01904448b19cec5f9ad89e698b59bc11150ed | [
"MIT"
] | null | null | null | import random
mylist = []
for somethin in range(1,10):
x = random.randrange(0,9)
mylist.append(x)
print(mylist)
last_index=len(mylist)
print ("length of mylist is:",len(mylist))
print ("first element is:",mylist[0])
print ("last element is:",mylist[len(mylist)-1])
#is mylist sorted?
is_mylist_sorted ... | 16.425926 | 48 | 0.620068 | import random
mylist = []
for somethin in range(1,10):
x = random.randrange(0,9)
mylist.append(x)
print(mylist)
last_index=len(mylist)
print ("length of mylist is:",len(mylist))
print ("first element is:",mylist[0])
print ("last element is:",mylist[len(mylist)-1])
#is mylist sorted?
is_mylist_sorted ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c793722d0b378ee7db2b64de100d0736b9b47fda | 1,117 | py | Python | setup.py | stacy0416/afs2-datasource | 25d498fc56eb142f2e97ea2d274d534245a4c301 | [
"Apache-2.0"
] | 4 | 2019-07-19T05:40:37.000Z | 2021-03-31T05:49:30.000Z | setup.py | stacy0416/afs2-datasource | 25d498fc56eb142f2e97ea2d274d534245a4c301 | [
"Apache-2.0"
] | 1 | 2019-08-13T18:27:40.000Z | 2019-08-13T18:27:40.000Z | setup.py | stacy0416/afs2-datasource | 25d498fc56eb142f2e97ea2d274d534245a4c301 | [
"Apache-2.0"
] | null | null | null | import os
import setuptools
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements
requirements_path = os.path.join(os.path.dirname(__file__), 'requirements.txt')
install_requires = parse_requirements(requirements_... | 33.848485 | 80 | 0.733214 | import os
import setuptools
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements
requirements_path = os.path.join(os.path.dirname(__file__), 'requirements.txt')
install_requires = parse_requirements(requirements_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1d241f184661fa37b57913861e9fb9b2387cc4b1 | 5,168 | py | Python | predict.py | jaym096/FIFA-WorldCup-Match-Predictor | 4b5b6fbc91391133f595cba4f650736eea81d2e0 | [
"MIT"
] | null | null | null | predict.py | jaym096/FIFA-WorldCup-Match-Predictor | 4b5b6fbc91391133f595cba4f650736eea81d2e0 | [
"MIT"
] | null | null | null | predict.py | jaym096/FIFA-WorldCup-Match-Predictor | 4b5b6fbc91391133f595cba4f650736eea81d2e0 | [
"MIT"
] | null | null | null |
#============== First Round ===================#
#===============================================#
#============== Other Rounds ===================#
#===============================================#
| 42.710744 | 124 | 0.614551 | import pandas as pd
#============== First Round ===================#
def predict_firstRound(ranking, final_dataset, logreg):
# Obtained from https://fixturedownload.com/results/fifa-world-cup-2018
fixtures = pd.read_csv('data/fixtures.csv')
#List for storing the group stage games
pred_set = []
... | 0 | 0 | 0 | 0 | 0 | 4,898 | 0 | -2 | 66 |
e4f38538428142f303485b2cb2db48de167944ae | 410 | py | Python | Aula_01/exercicio_03.py | Luferat/Curso_Python_Senac | a0710b25e4fedeacb1139c1c8f4e4a00c63dba73 | [
"MIT"
] | 1 | 2021-11-18T19:02:10.000Z | 2021-11-18T19:02:10.000Z | Aula_01/exercicio_03.py | Luferat/Curso_Python_Senac | a0710b25e4fedeacb1139c1c8f4e4a00c63dba73 | [
"MIT"
] | null | null | null | Aula_01/exercicio_03.py | Luferat/Curso_Python_Senac | a0710b25e4fedeacb1139c1c8f4e4a00c63dba73 | [
"MIT"
] | null | null | null | """
Exerccio 03
Pea ao usurio para digitar 3 valores inteiros e imprima a soma deles.
"""
print('Digite trs nmeros inteiros para som-los:\n')
num1 = int(float(input('Primeiro nmero: ').replace(',', '.')))
num2 = int(float(input('Segundo nmero: ').replace(',', '.')))
num3 = int(float(input('Terceiro nmero: ').replace('... | 34.166667 | 71 | 0.658537 | """
Exercício 03
Peça ao usuário para digitar 3 valores inteiros e imprima a soma deles.
"""
print('Digite três números inteiros para somá-los:\n')
num1 = int(float(input('Primeiro número: ').replace(',', '.')))
num2 = int(float(input('Segundo número: ').replace(',', '.')))
num3 = int(float(input('Terceiro número: ').... | 20 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d5e35b7eef70f9ce665c2f92c0cb10aaae53e7e9 | 4,228 | py | Python | plugins/module_utils/definitions/discovery_network_device.py | robertcsapo/dnacenter-ansible | 33f776f8c0bc7113da73191c301dd1807e6b4a43 | [
"MIT"
] | null | null | null | plugins/module_utils/definitions/discovery_network_device.py | robertcsapo/dnacenter-ansible | 33f776f8c0bc7113da73191c301dd1807e6b4a43 | [
"MIT"
] | null | null | null | plugins/module_utils/definitions/discovery_network_device.py | robertcsapo/dnacenter-ansible | 33f776f8c0bc7113da73191c301dd1807e6b4a43 | [
"MIT"
] | null | null | null | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
module_definition = json.loads(
"""{
"family": "discovery",
"name": "discovery_network_device",
"operations": {
"get": [
"get_discovered_network_devices_by_discovery_id",
... | 26.26087 | 66 | 0.346736 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
module_definition = json.loads(
"""{
"family": "discovery",
"name": "discovery_network_device",
"operations": {
"get": [
"get_discovered_network_devices_by_discovery_id",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
72b850981a06edc2f84483d0a9fb974636249292 | 1,156 | py | Python | tools/deep_memory_profiler/subcommands/stacktrace.py | nagineni/chromium-crosswalk | 5725642f1c67d0f97e8613ec1c3e8107ab53fdf8 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | tools/deep_memory_profiler/subcommands/stacktrace.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2017-02-14T21:55:58.000Z | 2017-02-14T21:55:58.000Z | tools/deep_memory_profiler/subcommands/stacktrace.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
| 27.52381 | 72 | 0.67128 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
from lib.bucket import BUCKET_ID
from lib.subcommand import SubCommand
class StacktraceCommand(SubCommand):
def __init__(self):
super(Sta... | 0 | 497 | 0 | 389 | 0 | 0 | 0 | 16 | 91 |
431b39143b9b0cf0b40e592c7fd8d42ef1d24d16 | 978 | py | Python | FCFS.py | Aamina27/Amina-Afzal | 90c4b2ab97051bfa6c7ec83aa216ad303b3d1135 | [
"MIT"
] | null | null | null | FCFS.py | Aamina27/Amina-Afzal | 90c4b2ab97051bfa6c7ec83aa216ad303b3d1135 | [
"MIT"
] | null | null | null | FCFS.py | Aamina27/Amina-Afzal | 90c4b2ab97051bfa6c7ec83aa216ad303b3d1135 | [
"MIT"
] | null | null | null | burst_time=[]
print("Enter the number of process: ")
n=int(input())
print("Enter the burst time of the processes: \n")
burst_time=list(map(int, input().split()))
waiting_time=[]
avg_waiting_time=0
turnaround_time=[]
avg_turnaround_time=0
waiting_time.insert(0,0)
turnaround_time.insert(0,burst_time[0])
for i ... | 39.12 | 100 | 0.741309 | burst_time=[]
print("Enter the number of process: ")
n=int(input())
print("Enter the burst time of the processes: \n")
burst_time=list(map(int, input().split()))
waiting_time=[]
avg_waiting_time=0
turnaround_time=[]
avg_turnaround_time=0
waiting_time.insert(0,0)
turnaround_time.insert(0,burst_time[0])
for i ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bcbe7560b6bd844d2aac187e3e4e713f4dc467a8 | 13,482 | py | Python | benchmarks/code/cifar10.py | nhahn7/SDTF | d9ff23b57f8b16a1be7d2fd49fb319b5a90bc20e | [
"MIT"
] | null | null | null | benchmarks/code/cifar10.py | nhahn7/SDTF | d9ff23b57f8b16a1be7d2fd49fb319b5a90bc20e | [
"MIT"
] | null | null | null | benchmarks/code/cifar10.py | nhahn7/SDTF | d9ff23b57f8b16a1be7d2fd49fb319b5a90bc20e | [
"MIT"
] | null | null | null | """
Author: Haoyin Xu
"""
import time
import psutil
import argparse
import numpy as np
import torchvision.datasets as datasets
from numpy.random import permutation
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from river import tree
from skgarden import MondrianFore... | 29.565789 | 88 | 0.61927 | """
Author: Haoyin Xu
"""
import time
import psutil
import argparse
import numpy as np
import torchvision.datasets as datasets
from numpy.random import permutation
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from river import tree
from skgarden import MondrianFore... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
116ebabd373174e9bc708935a5a25a2354aabd43 | 11,479 | py | Python | src/textwrap.py | pineapplemachine/mwde | e68378b74d1712347351f1d8fe41edd434d7af16 | [
"MIT"
] | 6 | 2018-08-19T18:50:13.000Z | 2021-06-05T01:14:24.000Z | src/textwrap.py | pineapplemachine/mwde | e68378b74d1712347351f1d8fe41edd434d7af16 | [
"MIT"
] | 1 | 2018-12-01T14:18:34.000Z | 2018-12-01T14:59:22.000Z | src/textwrap.py | pineapplemachine/mwde | e68378b74d1712347351f1d8fe41edd434d7af16 | [
"MIT"
] | 1 | 2021-06-05T01:14:31.000Z | 2021-06-05T01:14:31.000Z | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
# Modified by Sophie Kirschner
# https://github.com/python/cpython/blob/master/Lib/textwrap.py
# https://github.com/python/cpython/blob/master/L... | 41.143369 | 80 | 0.605105 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
# Modified by Sophie Kirschner
# https://github.com/python/cpython/blob/master/Lib/textwrap.py
# https://github.com/python/cpython/blob/master/L... | 0 | 0 | 0 | 10,237 | 0 | 0 | 0 | -4 | 46 |
729c2aa69dc495d2e9bbc6997b3e87438b9334a0 | 9,382 | py | Python | nova/objects/network.py | viveknandavanam/nova | 556377b6915936467436c9d5bb33bc0e22244e1e | [
"Apache-2.0"
] | 1 | 2019-07-29T10:30:24.000Z | 2019-07-29T10:30:24.000Z | nova/objects/network.py | ljzjohnson/nova | 87e1951a1b8c03b9ecdf8f75610d14690b61f272 | [
"Apache-2.0"
] | 11 | 2017-06-19T01:28:55.000Z | 2017-06-23T02:01:47.000Z | nova/objects/network.py | ljzjohnson/nova | 87e1951a1b8c03b9ecdf8f75610d14690b61f272 | [
"Apache-2.0"
] | 7 | 2015-01-20T10:30:08.000Z | 2020-02-05T10:29:05.000Z | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 40.791304 | 78 | 0.649329 | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 0 | 8,417 | 0 | 0 | 0 | 0 | 0 | 45 | 222 |
aa48483bb4d631377a6e0d2824f5c99ecea55f93 | 2,968 | py | Python | ImageData.py | Guwudao/WeChat-Python-demo | 243b0c15f4d6a27271713f38ac5a987472844ce0 | [
"MIT"
] | null | null | null | ImageData.py | Guwudao/WeChat-Python-demo | 243b0c15f4d6a27271713f38ac5a987472844ce0 | [
"MIT"
] | 3 | 2021-12-13T20:41:27.000Z | 2022-03-12T00:22:24.000Z | ImageData.py | Guwudao/WeChat-Python-demo | 243b0c15f4d6a27271713f38ac5a987472844ce0 | [
"MIT"
] | null | null | null | from PIL import Image
from PIL.ExifTags import TAGS
def get_exif_data(fname):
"""Get embedded EXIF data from image file."""
ret = {}
try:
img = Image.open(fname)
if hasattr( img, '_getexif' ):
exifinfo = img._getexif()
if exifinfo != None:
for tag, va... | 39.052632 | 109 | 0.506739 | from PIL import Image
from PIL.ExifTags import TAGS
import exifread
import re
import json
def read():
with open('IMG_1956.HEIC', 'rb') as f:
try:
contents = exifread.process_file(f)
for key in contents:
if key == "GPS GPSLongitude":
print("经度: ",... | 198 | 0 | 0 | 0 | 0 | 2,215 | 0 | -28 | 90 |
f6f4753aa6c34ab70ffbc004f50c721b01c9c100 | 1,788 | py | Python | app/__init__.py | avb76/barbershop | 975b501b0c53600909910619e248dff627acaa22 | [
"MIT"
] | null | null | null | app/__init__.py | avb76/barbershop | 975b501b0c53600909910619e248dff627acaa22 | [
"MIT"
] | null | null | null | app/__init__.py | avb76/barbershop | 975b501b0c53600909910619e248dff627acaa22 | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_bootstrap import Bootstrap
from flask_login import LoginManager
from flask_moment import Moment
from flask_mail import Mail
# from flask_mail_sendgrid import MailSendGrid
db = SQLAlchemy()
migrate = Migrate()
bootstrap = Bootstrap()
... | 28.83871 | 74 | 0.709172 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_bootstrap import Bootstrap
from flask_login import LoginManager
from flask_moment import Moment
from flask_mail import Mail
# from flask_mail_sendgrid import MailSendGrid
from config import Config
from logging.h... | 0 | 0 | 0 | 0 | 0 | 1,241 | 0 | 15 | 156 |
35e9d55eab18f67cc2fc4818d7246c681b504cad | 1,407 | py | Python | gale/timeseries/test_conversions.py | adamrpah/GALE | 94ab2613c5d53ea471f664a75c7d780a2689302f | [
"WTFPL"
] | null | null | null | gale/timeseries/test_conversions.py | adamrpah/GALE | 94ab2613c5d53ea471f664a75c7d780a2689302f | [
"WTFPL"
] | null | null | null | gale/timeseries/test_conversions.py | adamrpah/GALE | 94ab2613c5d53ea471f664a75c7d780a2689302f | [
"WTFPL"
] | null | null | null | '''
File: test_conversions.py
Author: Adam Pah
Description:
py.test test ensemble
'''
| 29.93617 | 100 | 0.637527 | '''
File: test_conversions.py
Author: Adam Pah
Description:
py.test test ensemble
'''
import pytest
import conversions as conv
class TestConvertTimeseries:
'''
Covers the convert_timeseries_to_intervalseries function
'''
timeseries = [[0, 2], [2, 3], [5, 3]]
def test_basic(self):
'''
... | 0 | 0 | 0 | 1,256 | 0 | 0 | 0 | -3 | 67 |
5f3c6e3145e4c5a9194485b8fe52b7dad8e138d8 | 2,449 | py | Python | scripts/dbutil/hads_delete_dups.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | 1 | 2019-10-07T17:01:24.000Z | 2019-10-07T17:01:24.000Z | scripts/dbutil/hads_delete_dups.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | null | null | null | scripts/dbutil/hads_delete_dups.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | null | null | null | """
Our HADS database gets loaded up with duplicates, this cleans it up.
called from RUN_MIDNIGHT.sh
"""
from __future__ import print_function
import datetime
import sys
import pytz
from pyiem.util import get_dbconn, utc
def query(sql, args=None):
"""
Do a query and make it atomic
"""
pgconn = get... | 28.476744 | 78 | 0.601062 | """
Our HADS database gets loaded up with duplicates, this cleans it up.
called from RUN_MIDNIGHT.sh
"""
from __future__ import print_function
import datetime
import sys
import pytz
from pyiem.util import get_dbconn, utc
def query(sql, args=None):
"""
Do a query and make it atomic
"""
pgconn = get... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
417bba34d989778ffd40ffac7f4e3a0415f9798f | 11,193 | py | Python | Filter3x3.py | charlie-jones/Chinese-Character-Recognition | 26ba530effa4d14542ffc76bfbb1dec1795c18b0 | [
"MIT"
] | 2 | 2020-07-26T14:18:08.000Z | 2020-11-07T01:56:31.000Z | Filter3x3.py | charlie-jones/Chinese-Character-Recognition | 26ba530effa4d14542ffc76bfbb1dec1795c18b0 | [
"MIT"
] | null | null | null | Filter3x3.py | charlie-jones/Chinese-Character-Recognition | 26ba530effa4d14542ffc76bfbb1dec1795c18b0 | [
"MIT"
] | null | null | null | #128x128
####################################################
'''
Inputs 128x128 pixel array
Returns label where:
label 0 = 1
label 1 = 2
etc
'''
'''
returns an array of arrays, each one is the data from one image
'''
###########################################
# training Code for class (comment it before ... | 35.087774 | 133 | 0.558653 | import numpy as np
import os
import pickle
#128x128
class Filter3x3:
n_filters = 0
PATH_NAME = '' # set this if you want to train it
filters = []
weights = []
biases = []
# generate weights and biases
# self.weights = random.randn(n_inputs, n_nodes) / n_inputs
# self.biases = zeros(n_... | 6 | 0 | 0 | 6,965 | 0 | 3,205 | 0 | -23 | 155 |
9a90caab9991af9886325ebdd19a8ec880dc8732 | 1,381 | py | Python | stalinsort.py | Gagis/stalinsort | b5ad8dad2b76ab5843deb9ba66f9eabb98d34479 | [
"MIT"
] | null | null | null | stalinsort.py | Gagis/stalinsort | b5ad8dad2b76ab5843deb9ba66f9eabb98d34479 | [
"MIT"
] | null | null | null | stalinsort.py | Gagis/stalinsort | b5ad8dad2b76ab5843deb9ba66f9eabb98d34479 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Python implementation of the StalinSort algorithm.
References
----------
- :cite:`mathew` : @mathew@mastodon.social (2018/10/26 04:20:16)
''I came up with a single pass O(n) sort algorithm I call StalinSort. You
iterate down the list of elements checking if they're in order. Any e... | 27.62 | 79 | 0.621289 | # -*- coding: utf-8 -*-
"""Python implementation of the StalinSort algorithm.
References
----------
- :cite:`mathew` : @mathew@mastodon.social (2018/10/26 04:20:16)
''I came up with a single pass O(n) sort algorithm I call StalinSort. You
iterate down the list of elements checking if they're in order. Any e... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
420d28be65691041897d75814dd5308850466971 | 423 | py | Python | examples/pade_agent/run_master.py | bressanmarcos/pade-fmi | e3c7a4a5c60bcd3afc8070465640c5aa8051380a | [
"MIT"
] | null | null | null | examples/pade_agent/run_master.py | bressanmarcos/pade-fmi | e3c7a4a5c60bcd3afc8070465640c5aa8051380a | [
"MIT"
] | null | null | null | examples/pade_agent/run_master.py | bressanmarcos/pade-fmi | e3c7a4a5c60bcd3afc8070465640c5aa8051380a | [
"MIT"
] | 1 | 2020-12-11T04:09:49.000Z | 2020-12-11T04:09:49.000Z | import matplotlib.pyplot as plt
import numpy as np
from pyfmi import load_fmu
model = load_fmu('./PadeSlave.fmu')
inputs = ('inputVariable', lambda t: 5. * np.cos(t))
simulation = model.simulate(final_time=30, input=inputs)
plt.plot(simulation['time'], simulation['inputVariable'])
plt.plot(simulation['time'], simula... | 26.4375 | 58 | 0.742317 | import matplotlib.pyplot as plt
import numpy as np
from pyfmi import load_fmu
model = load_fmu('./PadeSlave.fmu')
inputs = ('inputVariable', lambda t: 5. * np.cos(t))
simulation = model.simulate(final_time=30, input=inputs)
plt.plot(simulation['time'], simulation['inputVariable'])
plt.plot(simulation['time'], simula... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1b433d882adc6a9898daff097cf811d91e1207bd | 40,416 | py | Python | Tools/ResizePic/nnedi3_resample.py | capric98/macOS-Miscellaneous | 0b3a42bfd5aad2a4477c0e220c5c55e56cda2e57 | [
"WTFPL"
] | 1 | 2021-06-21T17:30:22.000Z | 2021-06-21T17:30:22.000Z | Tools/ResizePic/nnedi3_resample.py | capric98/macOS-Miscellaneous | 0b3a42bfd5aad2a4477c0e220c5c55e56cda2e57 | [
"WTFPL"
] | null | null | null | Tools/ResizePic/nnedi3_resample.py | capric98/macOS-Miscellaneous | 0b3a42bfd5aad2a4477c0e220c5c55e56cda2e57 | [
"WTFPL"
] | null | null | null | # Requirements:
# - fmtc
# - nnedi3
# From:
# - https://github.com/mawen1250/VapourSynth-script
# - https://github.com/HomeOfVapourSynthEvolution/mvsfunc
## Gamma conversion functions from HAvsFunc-r18
# Convert the luma channel to linear light
# Convert back a clip to gamma-corrected luma
# Apply the i... | 39.584721 | 677 | 0.606715 | # Requirements:
# - fmtc
# - nnedi3
# From:
# - https://github.com/mawen1250/VapourSynth-script
# - https://github.com/HomeOfVapourSynthEvolution/mvsfunc
import vapoursynth as vs
import math
def SetColorSpace(clip, ChromaLocation=None, ColorRange=None, Primaries=None, Matrix=None, Transfer=None):
# Set VS ... | 0 | 0 | 0 | 0 | 0 | 39,577 | 0 | -7 | 385 |
330a2345fb075320f63417f0ddce382a5a7b8c85 | 1,243 | py | Python | teamlogic/migrations/0004_auto_20170317_1729.py | SarFootball/backend | 9c51118becf34085dfd9bf8cb1c765631839a43b | [
"Apache-2.0"
] | 11 | 2017-07-05T20:03:00.000Z | 2018-09-19T17:18:26.000Z | teamlogic/migrations/0004_auto_20170317_1729.py | SarFootball/backend | 9c51118becf34085dfd9bf8cb1c765631839a43b | [
"Apache-2.0"
] | 50 | 2016-07-15T16:21:03.000Z | 2018-04-17T11:18:06.000Z | teamlogic/migrations/0004_auto_20170317_1729.py | SarFootball/backend | 9c51118becf34085dfd9bf8cb1c765631839a43b | [
"Apache-2.0"
] | 6 | 2017-06-23T14:53:38.000Z | 2022-01-03T12:38:46.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-03-17 17:29
from __future__ import unicode_literals
| 30.317073 | 106 | 0.583266 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-03-17 17:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('teamlogic', '0003_auto_20170316_1536'),
]
operations = [
migrations.AddField... | 0 | 0 | 0 | 1,065 | 0 | 0 | 0 | 19 | 46 |
489ac134887d5f6319601625cffa35d5b3daae5d | 9,635 | py | Python | EZ/parameter.py | Alex6022/EZ | c90d13b78b3fb67fd191700965e0827ee40eccbf | [
"MIT"
] | null | null | null | EZ/parameter.py | Alex6022/EZ | c90d13b78b3fb67fd191700965e0827ee40eccbf | [
"MIT"
] | null | null | null | EZ/parameter.py | Alex6022/EZ | c90d13b78b3fb67fd191700965e0827ee40eccbf | [
"MIT"
] | 2 | 2021-01-26T16:57:26.000Z | 2021-03-21T18:04:25.000Z | import EZ.stderr as stderr
| 24.516539 | 72 | 0.532745 | import numpy as np
import EZ.stderr as stderr
class Parameter():
def __init__(self, x, y, name="", unit="", scale=1, xlabel=""):
self.name = name
self.unit = unit
self.scale = scale
self.x = x
self.y = y
self.fit_x = None
self.fit_y = None
self.mode... | 0 | 0 | 0 | 5,623 | 0 | 3,704 | 0 | -3 | 275 |
d26b10ff6669fa3fb71b08771c9e2a65a51f7bb3 | 9,074 | py | Python | deep_coach.py | jendelel/rhl-algs | d5b8779d7e271265d4f0bfcb3602bc56958e3eb3 | [
"Apache-2.0"
] | 2 | 2019-03-30T23:29:10.000Z | 2019-04-05T21:54:21.000Z | deep_coach.py | jendelel/rhl-algs | d5b8779d7e271265d4f0bfcb3602bc56958e3eb3 | [
"Apache-2.0"
] | 3 | 2019-03-29T11:23:17.000Z | 2020-12-28T02:00:17.000Z | deep_coach.py | jendelel/rhl-algs | d5b8779d7e271265d4f0bfcb3602bc56958e3eb3 | [
"Apache-2.0"
] | null | null | null | from collections import namedtuple
import torch.nn as nn
HumanFeedback = namedtuple('HumanFeedback', ['feedback_value'])
SavedAction = namedtuple('SavedAction', ['state', 'action', 'logprob'])
SavedActionsWithFeedback = namedtuple('SavedActionsWithFeedback', ['saved_actions', 'final_feedback'])
| 45.144279 | 119 | 0.622548 | from PyQt5 import QtGui, QtCore, QtWidgets
from collections import namedtuple
import time
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
from utils import utils
HumanFeedback = namedtuple('HumanFeedback', ['feedback_value'])
SavedAction = namedtuple('SavedAction', ['state', 'action', ... | 0 | 471 | 0 | 6,948 | 0 | 1,100 | 0 | 6 | 247 |
07b7f98b58a60c6fd215e2e961645309aca54a73 | 7,048 | py | Python | BogalSolver.py | NAU-OSS/CS499_Group_7 | 8986ca82410b907b47f6eeca53ae382031442481 | [
"MIT"
] | 1 | 2018-09-27T15:48:10.000Z | 2018-09-27T15:48:10.000Z | BogalSolver.py | NAU-OSS/CS499_Group_7 | 8986ca82410b907b47f6eeca53ae382031442481 | [
"MIT"
] | 3 | 2018-09-25T16:15:13.000Z | 2018-10-04T02:54:51.000Z | BogalSolver.py | NAU-OSS/CS499_Group_7 | 8986ca82410b907b47f6eeca53ae382031442481 | [
"MIT"
] | 5 | 2018-09-25T15:30:40.000Z | 2018-10-08T05:00:38.000Z |
rawBoard = ''
moves = 0
# size -> int
# generate board of size size x size filled with random chars
# @returns none
# textFile -> string
# loads a board from a text file
# @returns board in 2D list form
# board -> 2D array
# prints out the bogal board
# coordinate -> list, board -> 2D list
# @returns... | 34.048309 | 112 | 0.588394 | import sys, random, string, time
rawBoard = ''
moves = 0
# size -> int
# generate board of size size x size filled with random chars
# @returns none
def generateBoard(size):
outFile = 'test.txt'
out = open(outFile, 'w')
charlist = string.ascii_uppercase
for z in range(0, size):
line... | 0 | 0 | 0 | 0 | 0 | 5,926 | 0 | 11 | 234 |
d39b40d76ad390bb6e4fffa2f6e2fbcdc65ce596 | 65 | py | Python | control flow/functions.py | karan1276/learning-python | 9f0791370fbdf9e1d5b94ef874f8eb403d34c22c | [
"MIT"
] | null | null | null | control flow/functions.py | karan1276/learning-python | 9f0791370fbdf9e1d5b94ef874f8eb403d34c22c | [
"MIT"
] | null | null | null | control flow/functions.py | karan1276/learning-python | 9f0791370fbdf9e1d5b94ef874f8eb403d34c22c | [
"MIT"
] | null | null | null |
myFunc("That's neat")
| 13 | 29 | 0.646154 | def myFunc(str = "yo world"):
print str
myFunc("That's neat")
| 0 | 0 | 0 | 0 | 0 | 20 | 0 | 0 | 22 |
31b9775840bb061015540ecd002cded13941b01b | 3,596 | py | Python | tests/test_pytest_pydocstyle.py | henry0312/pytest-docstyle | cc78c65804f87a9fb6386d222a058a1dd593411d | [
"MIT"
] | 9 | 2018-06-02T14:02:26.000Z | 2019-11-28T16:00:02.000Z | tests/test_pytest_pydocstyle.py | henry0312/pytest-docstyle | cc78c65804f87a9fb6386d222a058a1dd593411d | [
"MIT"
] | 9 | 2018-01-15T04:09:48.000Z | 2019-12-11T05:19:59.000Z | tests/test_pytest_pydocstyle.py | henry0312/pytest-docstyle | cc78c65804f87a9fb6386d222a058a1dd593411d | [
"MIT"
] | 3 | 2017-12-27T02:33:30.000Z | 2018-06-09T20:11:45.000Z |
# https://docs.pytest.org/en/5.2.2/writing_plugins.html#testing-plugins
pytest_plugins = ["pytester"]
| 25.870504 | 72 | 0.603448 | import pytest_pydocstyle
# https://docs.pytest.org/en/5.2.2/writing_plugins.html#testing-plugins
pytest_plugins = ["pytester"]
def test_option_false(testdir):
p = testdir.makepyfile("""
def test_option(request):
flag = request.config.getoption('pydocstyle')
assert flag is False
... | 0 | 0 | 0 | 432 | 0 | 2,796 | 0 | 3 | 252 |
008790803e7b775bedbd07bf57d31032aeb4bcd3 | 217 | py | Python | db/manage.py | yabirgb/hilos | e3a90aa21c4d6f7e1c0301bf815ceb2a57c156f8 | [
"MIT"
] | 1 | 2020-04-28T08:01:27.000Z | 2020-04-28T08:01:27.000Z | db/manage.py | yabirgb/hilos | e3a90aa21c4d6f7e1c0301bf815ceb2a57c156f8 | [
"MIT"
] | 1 | 2021-06-01T22:03:58.000Z | 2021-06-01T22:03:58.000Z | db/manage.py | yabirgb/hilos | e3a90aa21c4d6f7e1c0301bf815ceb2a57c156f8 | [
"MIT"
] | null | null | null |
from models_data import calldb
db = calldb()
create_tables()
| 14.466667 | 45 | 0.709677 | from peewee import *
import peeweedbevolve
from models_data import Tweet, Branch, calldb
db = calldb()
def create_tables():
calldb()
db.evolve([Tweet, Branch])
print("Tables created")
create_tables()
| 0 | 0 | 0 | 0 | 0 | 71 | 0 | 14 | 67 |
862dc8bb6d24ecac3d2901e91126649fc31737e3 | 10,931 | py | Python | friend/tests.py | HumphreyLu6/SpongeBook | 9d12e4be0ffc21bb2114df785f4278668a695f39 | [
"Apache-2.0"
] | 1 | 2020-04-01T21:37:49.000Z | 2020-04-01T21:37:49.000Z | friend/tests.py | HumphreyLu6/SpongeBook | 9d12e4be0ffc21bb2114df785f4278668a695f39 | [
"Apache-2.0"
] | 7 | 2020-03-06T00:20:30.000Z | 2020-04-04T21:04:43.000Z | friend/tests.py | HumphreyLu6/SpongeBook | 9d12e4be0ffc21bb2114df785f4278668a695f39 | [
"Apache-2.0"
] | 1 | 2020-07-08T07:29:49.000Z | 2020-07-08T07:29:49.000Z |
# Create your tests here.
ACCEPT_STATUS = "A"
REJECT_STATUS = "R"
UNFRIEND_STATUS = "R"
| 38.625442 | 87 | 0.519623 | import json
import base64
from rest_framework import status
from rest_framework.test import APITestCase
from rest_framework.authtoken.models import Token
from .models import User
# Create your tests here.
ACCEPT_STATUS = "A"
REJECT_STATUS = "R"
UNFRIEND_STATUS = "R"
class FriendTestCase(APITestCase):
def setUp(s... | 0 | 0 | 0 | 10,638 | 0 | 0 | 0 | 47 | 155 |
3836be24e6da9b7521e2fa8859eb76a407788328 | 4,926 | py | Python | Crawler/Install Files/eyeD3-0.7.4/src/eyed3/plugins/lameinfo.py | hanvo/MusicCloud | b91b9481df087955fcb09f472308c9ad1a94ba94 | [
"BSD-3-Clause"
] | null | null | null | Crawler/Install Files/eyeD3-0.7.4/src/eyed3/plugins/lameinfo.py | hanvo/MusicCloud | b91b9481df087955fcb09f472308c9ad1a94ba94 | [
"BSD-3-Clause"
] | null | null | null | Crawler/Install Files/eyeD3-0.7.4/src/eyed3/plugins/lameinfo.py | hanvo/MusicCloud | b91b9481df087955fcb09f472308c9ad1a94ba94 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
################################################################################
# Copyright (C) 2009 Travis Shirk <travis@pobox.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free So... | 43.59292 | 80 | 0.556029 | # -*- coding: utf-8 -*-
################################################################################
# Copyright (C) 2009 Travis Shirk <travis@pobox.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free So... | 0 | 0 | 0 | 3,635 | 0 | 0 | 0 | 163 | 133 |
5ea65d4873a5243d2a44e0d39d0611c949e980c6 | 3,307 | py | Python | clothing_recommender_project.py | rb2001/Clothing_Recommender | 48399911686e7cbb8c830340338ca59d0475815c | [
"Unlicense"
] | null | null | null | clothing_recommender_project.py | rb2001/Clothing_Recommender | 48399911686e7cbb8c830340338ca59d0475815c | [
"Unlicense"
] | null | null | null | clothing_recommender_project.py | rb2001/Clothing_Recommender | 48399911686e7cbb8c830340338ca59d0475815c | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""Clothing_Recommender Project .ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1nw0ewNdkx8o3WULAp2ynhHpbq1kVq7YZ
Clean the data and use input
"""
## Import and Organize Data ##
import pandas as pd
import numpy as np
... | 35.180851 | 195 | 0.752646 | # -*- coding: utf-8 -*-
"""Clothing_Recommender Project .ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1nw0ewNdkx8o3WULAp2ynhHpbq1kVq7YZ
Clean the data and use input
"""
## Import and Organize Data ##
import pandas as pd
import numpy as np
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 41 | 45 |
3d7273fc6bb41c58edc1197e7e7b8b7f7da08c10 | 2,773 | py | Python | src/features/build_rtree.py | mingxiiii/trajectory-search | ac3c751a47be8f6a6cc389d53e5c001c01c4ca8f | [
"FTL"
] | null | null | null | src/features/build_rtree.py | mingxiiii/trajectory-search | ac3c751a47be8f6a6cc389d53e5c001c01c4ca8f | [
"FTL"
] | null | null | null | src/features/build_rtree.py | mingxiiii/trajectory-search | ac3c751a47be8f6a6cc389d53e5c001c01c4ca8f | [
"FTL"
] | null | null | null | import sys
if __name__ == '__main__':
train_data = sys.argv[1]
q_size = int(sys.argv[2])
main(train_data, q_size)
| 34.6625 | 89 | 0.647313 | from rtree.index import Rtree
from src.features.helper import *
import sys
import logging
import time
def main(train, qgram_size):
logger = logging.getLogger('build_rtree')
logger.setLevel(logging.DEBUG)
fh = logging.FileHandler('./log/%s' % train)
fh.setLevel(logging.DEBUG)
# create console hand... | 0 | 0 | 0 | 0 | 0 | 2,530 | 0 | 3 | 111 |
d65bca6881e00c4d8e00349db6bc84adc3dfb3d6 | 141 | py | Python | wsgi.py | brettrhenderson/WhiteElephant | e63b7ceae22e7da7b0f5b2b0775308da34b42e3b | [
"MIT"
] | null | null | null | wsgi.py | brettrhenderson/WhiteElephant | e63b7ceae22e7da7b0f5b2b0775308da34b42e3b | [
"MIT"
] | null | null | null | wsgi.py | brettrhenderson/WhiteElephant | e63b7ceae22e7da7b0f5b2b0775308da34b42e3b | [
"MIT"
] | null | null | null | from app import app
import logging
logging.basicConfig(level=logging.WARNING)
if __name__ == "__main__":
app.debug = True
app.run() | 17.625 | 42 | 0.723404 | from app import app
import logging
logging.basicConfig(level=logging.WARNING)
if __name__ == "__main__":
app.debug = True
app.run() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f7cfaa20a69f2a7b5703c65f15095a00399bcd2b | 653 | py | Python | var/spack/repos/builtin/packages/r-affypdnn/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2018-11-27T03:39:44.000Z | 2021-09-06T15:50:35.000Z | var/spack/repos/builtin/packages/r-affypdnn/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-01-11T20:11:52.000Z | 2019-01-11T20:11:52.000Z | var/spack/repos/builtin/packages/r-affypdnn/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
| 32.65 | 73 | 0.709035 | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RAffypdnn(RPackage):
"""The package contains functions to perform the PDNN method
desc... | 0 | 0 | 0 | 411 | 0 | 0 | 0 | -2 | 46 |
d18a94277219f1495767914e43a9e25e30e24490 | 1,605 | py | Python | modules/population_initialization.py | EmanueleMusumeci/MMPI-2_GeneticAlgorithm_Clustering_no_data | 32a18f080387f296a75c99190abb4b0df1cd4779 | [
"CC0-1.0"
] | null | null | null | modules/population_initialization.py | EmanueleMusumeci/MMPI-2_GeneticAlgorithm_Clustering_no_data | 32a18f080387f296a75c99190abb4b0df1cd4779 | [
"CC0-1.0"
] | null | null | null | modules/population_initialization.py | EmanueleMusumeci/MMPI-2_GeneticAlgorithm_Clustering_no_data | 32a18f080387f296a75c99190abb4b0df1cd4779 | [
"CC0-1.0"
] | null | null | null | #######################################################################
"""
@author: Emanuele Musumeci (https://github.com/EmanueleMusumeci)
PopulationInitializer abstract class and basic initializer that generates
a population of random binary strings of a given length
"""
######################################... | 32.1 | 123 | 0.658567 | #######################################################################
"""
@author: Emanuele Musumeci (https://github.com/EmanueleMusumeci)
PopulationInitializer abstract class and basic initializer that generates
a population of random binary strings of a given length
"""
######################################... | 0 | 92 | 0 | 857 | 0 | 0 | 0 | -11 | 112 |
915aa51395b0122e7d71f533efe1d0daf8c758c5 | 14,691 | py | Python | pycondor/dagman.py | karlhornlund/pycondor | 7f0dd59c776697d402515b78b35c5fd6084c2c5c | [
"MIT"
] | 1 | 2020-01-21T10:25:25.000Z | 2020-01-21T10:25:25.000Z | pycondor/dagman.py | karlhornlund/pycondor | 7f0dd59c776697d402515b78b35c5fd6084c2c5c | [
"MIT"
] | null | null | null | pycondor/dagman.py | karlhornlund/pycondor | 7f0dd59c776697d402515b78b35c5fd6084c2c5c | [
"MIT"
] | null | null | null | from .basenode import BaseNode
from .job import Job
def _get_parent_child_string(node):
"""Constructs the parent/child line for node to be added to a Dagman
"""
if not isinstance(node, BaseNode):
raise ValueError('Expecting a Job or Dagman object, '
'got {}'.format(type... | 35.744526 | 90 | 0.57137 |
import os
import subprocess
from .utils import checkdir, get_condor_version, requires_command
from .basenode import BaseNode
from .job import Job
def _get_subdag_string(dagman):
if not isinstance(dagman, Dagman):
raise TypeError(
'Expecting a Dagman object, got {}'.format(type(dagman)))... | 0 | 2,889 | 0 | 9,114 | 1,194 | 318 | 0 | 28 | 137 |
875425da3ed2a31653ab5479cf56429d96c1a09a | 4,123 | py | Python | src/napari_tissuemaps_interface/lazy_array.py | fractal-napari-plugins-collection/napari_tissuemaps_interface | 4cba72a6193b1853c8534ccecf5fc0ace5202fb3 | [
"BSD-3-Clause"
] | null | null | null | src/napari_tissuemaps_interface/lazy_array.py | fractal-napari-plugins-collection/napari_tissuemaps_interface | 4cba72a6193b1853c8534ccecf5fc0ace5202fb3 | [
"BSD-3-Clause"
] | null | null | null | src/napari_tissuemaps_interface/lazy_array.py | fractal-napari-plugins-collection/napari_tissuemaps_interface | 4cba72a6193b1853c8534ccecf5fc0ace5202fb3 | [
"BSD-3-Clause"
] | null | null | null | """
Module containing a numpy-like array which supports lazy reading of tiled 2D-image data.
"""
| 36.486726 | 96 | 0.600049 | """
Module containing a numpy-like array which supports lazy reading of tiled 2D-image data.
"""
import abc
import dask.array as da
import numpy as np
class LazyArray:
"""
An abstract class of a numpy-like array which supports lazy reading of tiled 2D-image data.
The class represents a custom array contai... | 0 | 277 | 0 | 3,671 | 0 | 0 | 0 | -12 | 89 |
73d5971c32585318885749af3454e804597d68f8 | 11,142 | py | Python | ID18_U18_ONE_LENS/7keV_UndSource_RectSlit_R200um_MultiMode/run7keV_h.py | srio/paper-transfocators-resources | 917d8b4114056f62c84b295579e55bf5f0b56b6b | [
"MIT"
] | 1 | 2021-03-25T15:34:56.000Z | 2021-03-25T15:34:56.000Z | ID18_U18_ONE_LENS/7keV_UndSource_RectSlit_R200um_MultiMode/run7keV_h.py | srio/paper-transfocators-resources | 917d8b4114056f62c84b295579e55bf5f0b56b6b | [
"MIT"
] | null | null | null | ID18_U18_ONE_LENS/7keV_UndSource_RectSlit_R200um_MultiMode/run7keV_h.py | srio/paper-transfocators-resources | 917d8b4114056f62c84b295579e55bf5f0b56b6b | [
"MIT"
] | null | null | null | #
# Import section
#
import numpy
#
# SOURCE========================
#
#
# BEAMLINE========================
#
#
# MAIN FUNCTION========================
#
#
# MAIN========================
#
# main()
if __name__ == "__main__":
from oasys.util.oasys_util import get_fwhm
#
#
#
# size_at_ape... | 36.29316 | 218 | 0.653114 | #
# Import section
#
import numpy
from syned.beamline.beamline_element import BeamlineElement
from syned.beamline.element_coordinates import ElementCoordinates
from wofry.propagator.propagator import PropagationManager, PropagationElements, PropagationParameters
from wofry.propagator.wavefront1D.generic_wavefront imp... | 0 | 0 | 0 | 0 | 0 | 7,838 | 0 | 615 | 344 |
bfa9580d8d9a5ab354f53be8a0dc88c93072abd5 | 3,302 | py | Python | tests/test_bounding_box_query.py | HamutalCohen3/anyway | d130fc37ed51f838b53a79a641fe2706f2a29c6a | [
"BSD-3-Clause"
] | null | null | null | tests/test_bounding_box_query.py | HamutalCohen3/anyway | d130fc37ed51f838b53a79a641fe2706f2a29c6a | [
"BSD-3-Clause"
] | null | null | null | tests/test_bounding_box_query.py | HamutalCohen3/anyway | d130fc37ed51f838b53a79a641fe2706f2a29c6a | [
"BSD-3-Clause"
] | null | null | null | import unittest
# This tests year 2014 accidents as this is the current example git data for testing
# Once this changes to another year or to the current year's accidents (as should be) un-comment lines 11,13,15
# and change both 2014 and 2015 to: %s
if __name__ == '__main__':
unittest.main()
suite = unitt... | 41.797468 | 113 | 0.640521 | import unittest
from models import Marker # for Marker.bounding_box_query
import datetime
# This tests year 2014 accidents as this is the current example git data for testing
# Once this changes to another year or to the current year's accidents (as should be) un-comment lines 11,13,15
# and change both 2014 and 2015... | 0 | 0 | 0 | 2,775 | 0 | 0 | 0 | -2 | 100 |
ba4934ddd31bff45e2438851f4120f4932853815 | 2,513 | py | Python | service/learner/brains/tensor_nest_test.py | lcrh/falken | 7545431c7bfa34a9b45c2243cae40dbb58adefaa | [
"Apache-2.0"
] | 213 | 2021-06-11T01:15:16.000Z | 2022-02-25T16:18:57.000Z | service/learner/brains/tensor_nest_test.py | lcrh/falken | 7545431c7bfa34a9b45c2243cae40dbb58adefaa | [
"Apache-2.0"
] | 32 | 2021-06-17T17:58:54.000Z | 2022-02-02T05:58:10.000Z | service/learner/brains/tensor_nest_test.py | lcrh/falken | 7545431c7bfa34a9b45c2243cae40dbb58adefaa | [
"Apache-2.0"
] | 28 | 2021-06-17T17:34:21.000Z | 2022-03-24T14:05:20.000Z | # Copyright 2021 Google LLC
#
# 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, ... | 31.810127 | 77 | 0.569439 | # Copyright 2021 Google LLC
#
# 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, ... | 0 | 0 | 0 | 1,768 | 0 | 0 | 0 | 19 | 68 |
2a4e1bcd422d71f49eec11d6fa5a7c3eff0d4a8c | 1,868 | py | Python | ads/exercises/dynamic_programming/longest_palindromic_subsequence.py | Aminul-Momin/Algorithms_and_Data_Structures | cba73b36b73ad92fb34bc34a0e03503f7a137713 | [
"MIT"
] | null | null | null | ads/exercises/dynamic_programming/longest_palindromic_subsequence.py | Aminul-Momin/Algorithms_and_Data_Structures | cba73b36b73ad92fb34bc34a0e03503f7a137713 | [
"MIT"
] | null | null | null | ads/exercises/dynamic_programming/longest_palindromic_subsequence.py | Aminul-Momin/Algorithms_and_Data_Structures | cba73b36b73ad92fb34bc34a0e03503f7a137713 | [
"MIT"
] | null | null | null | """ Longest Palindromic Subsequence
Given a string s, find the longest palindromic subsequence's length in s.
A subsequence is a sequence that can be derived from another sequence by
deleting some or no elements without changing the order of the remaining elements.
- Example 1:
- Input: s = "bbbab"
- Output:... | 30.129032 | 82 | 0.619379 | """ Longest Palindromic Subsequence
Given a string s, find the longest palindromic subsequence's length in s.
A subsequence is a sequence that can be derived from another sequence by
deleting some or no elements without changing the order of the remaining elements.
- Example 1:
- Input: s = "bbbab"
- Output:... | 0 | 0 | 0 | 0 | 0 | 918 | 0 | 0 | 22 |