hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72b65b992c41b19e9209c007df907202066b8d1 | 2,817 | py | Python | weatherScraper/spiders/weatherbot.py | aabedi/weatherScraper | 069d07c19fbbba93aad5499cd1bb400accbcf644 | [
"MIT"
] | null | null | null | weatherScraper/spiders/weatherbot.py | aabedi/weatherScraper | 069d07c19fbbba93aad5499cd1bb400accbcf644 | [
"MIT"
] | null | null | null | weatherScraper/spiders/weatherbot.py | aabedi/weatherScraper | 069d07c19fbbba93aad5499cd1bb400accbcf644 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from weatherScraper.items import TempData
from weatherScraper.items import InputData
import scrapy
| 48.568966 | 120 | 0.619453 | # -*- coding: utf-8 -*-
from weatherScraper.items import TempData
from weatherScraper.items import InputData
import scrapy
class WeatherbotSpider(scrapy.Spider):
name = 'weatherbot'
allowed_domains = ['www.wunderground.com']
start_urls = ['http://www.wunderground.com/history/']
def __init__(self, cod... | 2,443 | 227 | 23 |
5943ec98bd05e59e909c2bd9c0c1da92c858b244 | 1,138 | py | Python | bin/notification.py | Wikia/athena_alerter | 819d766d7f2495b9f297fdf6f268f5b58c8a920c | [
"MIT"
] | 5 | 2019-02-05T12:37:27.000Z | 2021-06-07T05:26:17.000Z | bin/notification.py | Wikia/athena_alerter | 819d766d7f2495b9f297fdf6f268f5b58c8a920c | [
"MIT"
] | 3 | 2019-04-22T16:53:07.000Z | 2020-03-03T11:10:41.000Z | bin/notification.py | Wikia/athena_alerter | 819d766d7f2495b9f297fdf6f268f5b58c8a920c | [
"MIT"
] | 1 | 2020-03-03T11:54:34.000Z | 2020-03-03T11:54:34.000Z | """
This file contains a lambda function reacting to query update sqs event and sending notifications for large queries
Currently only slack notifications are supported
"""
import json
import logging
from typing import Sequence
from . import settings
from .model import UnknownEventException
from .notificators.notifi... | 30.756757 | 115 | 0.716169 | """
This file contains a lambda function reacting to query update sqs event and sending notifications for large queries
Currently only slack notifications are supported
"""
import json
import logging
from typing import Sequence
from . import settings
from .model import UnknownEventException
from .notificators.notifi... | 0 | 0 | 0 |
bc4a3d646ecf4ed8fabc6a0a371d7c57b58d6eb7 | 1,726 | py | Python | enwiktprocessor.py | radomd92/botjagwar | 1dc96600c40041057a9f9afde38c31ca34b8db38 | [
"MIT"
] | 7 | 2015-01-23T17:24:04.000Z | 2022-01-12T16:54:24.000Z | enwiktprocessor.py | radomd92/botjagwar | 1dc96600c40041057a9f9afde38c31ca34b8db38 | [
"MIT"
] | 18 | 2017-12-09T01:11:23.000Z | 2021-09-22T13:26:24.000Z | enwiktprocessor.py | radomd92/botjagwar | 1dc96600c40041057a9f9afde38c31ca34b8db38 | [
"MIT"
] | 1 | 2015-06-22T02:17:55.000Z | 2015-06-22T02:17:55.000Z | import logging
from api.entryprocessor.wiki.en import ENWiktionaryProcessor as ENWiktionaryProcessor
from redis_wikicache import RedisPage, RedisSite
"""
Requires RedisSite and RedisPage wrappers.
All data must have been imported there.
see redis_wikicache.py for more details.
"""
logger = logging.getLogger('process... | 25.382353 | 85 | 0.608922 | import logging
from api.entryprocessor.wiki.en import ENWiktionaryProcessor as ENWiktionaryProcessor
from redis_wikicache import RedisPage, RedisSite
"""
Requires RedisSite and RedisPage wrappers.
All data must have been imported there.
see redis_wikicache.py for more details.
"""
logger = logging.getLogger('process... | 1,251 | 0 | 46 |
a248842e6e5297de2c99311cff1ea6fe688a6cb9 | 277 | py | Python | examples/__init__.py | chineseluo/nightwalker | c7e9fb40401d632241b501d9c90f2e33522db51b | [
"Apache-2.0"
] | 1 | 2020-10-13T02:55:26.000Z | 2020-10-13T02:55:26.000Z | examples/__init__.py | chineseluo/nightwalker | c7e9fb40401d632241b501d9c90f2e33522db51b | [
"Apache-2.0"
] | null | null | null | examples/__init__.py | chineseluo/nightwalker | c7e9fb40401d632241b501d9c90f2e33522db51b | [
"Apache-2.0"
] | null | null | null | #!/user/bin/env python
# -*- coding: utf-8 -*-
"""
------------------------------------
@Project : nightwalker
@Time : 2020/10/13 11:18
@Auth : luozhongwen
@Email : luozw@inhand.com.cn
@File : __init__.py
@IDE : PyCharm
------------------------------------
"""
| 19.785714 | 36 | 0.433213 | #!/user/bin/env python
# -*- coding: utf-8 -*-
"""
------------------------------------
@Project : nightwalker
@Time : 2020/10/13 11:18
@Auth : luozhongwen
@Email : luozw@inhand.com.cn
@File : __init__.py
@IDE : PyCharm
------------------------------------
"""
| 0 | 0 | 0 |
eb7f3546dbed6986ad6023dbc26eff76342be96a | 154 | py | Python | envs/__init__.py | ege-k/nlp4nethack | 8b8b45a2f0be09c5233b33a47f421906e9e4b561 | [
"MIT"
] | 3 | 2022-03-23T21:20:44.000Z | 2022-03-29T06:25:55.000Z | envs/__init__.py | ege-k/nlp4nethack | 8b8b45a2f0be09c5233b33a47f421906e9e4b561 | [
"MIT"
] | null | null | null | envs/__init__.py | ege-k/nlp4nethack | 8b8b45a2f0be09c5233b33a47f421906e9e4b561 | [
"MIT"
] | 2 | 2022-03-26T14:59:43.000Z | 2022-03-29T06:26:07.000Z | from gym.envs.registration import register
register('NetHackChallengeBatched-v0',
entry_point='nle_batched_env.NetHackChallengeBatchedEnv')
| 30.8 | 69 | 0.792208 | from gym.envs.registration import register
register('NetHackChallengeBatched-v0',
entry_point='nle_batched_env.NetHackChallengeBatchedEnv')
| 0 | 0 | 0 |
aba0b9305e4226ebcb30d20796bdd475044c1f7d | 2,896 | py | Python | common/util.py | hsjplus/word2vec-from-scratch | 47285dccfd3b1fbf14f0d873b42b5b2b09111c0a | [
"MIT"
] | null | null | null | common/util.py | hsjplus/word2vec-from-scratch | 47285dccfd3b1fbf14f0d873b42b5b2b09111c0a | [
"MIT"
] | null | null | null | common/util.py | hsjplus/word2vec-from-scratch | 47285dccfd3b1fbf14f0d873b42b5b2b09111c0a | [
"MIT"
] | null | null | null | # The MIT License (MIT)
# Copyright (c) 2018 Koki Saitoh
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modi... | 32.909091 | 82 | 0.639157 | # The MIT License (MIT)
# Copyright (c) 2018 Koki Saitoh
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modi... | 1,554 | 0 | 91 |
f264c60a81c80b0c8e5939d8abe0501c1fc0e111 | 10,953 | py | Python | game/pacman/src/formula/formula.py | GuillaumeFalourd/formulas-games | 7530ef09cc85f30157e62b8761868c2a0eddb93d | [
"Apache-2.0"
] | 10 | 2021-05-31T03:11:56.000Z | 2021-07-13T11:45:18.000Z | game/pacman/src/formula/formula.py | ErosMLima/formulas-python | 15f1f56630131a2d3202ca7a1f685c2708a4815b | [
"Apache-2.0"
] | 1 | 2021-06-06T19:12:54.000Z | 2021-06-06T19:12:54.000Z | game/pacman/src/formula/formula.py | ErosMLima/formulas-python | 15f1f56630131a2d3202ca7a1f685c2708a4815b | [
"Apache-2.0"
] | 1 | 2021-05-31T03:11:58.000Z | 2021-05-31T03:11:58.000Z | #!/usr/bin/python3
import pygame
from classes.wall import Wall
from classes.block import Block
from classes.player import Player
from classes.ghost import Ghost
black = (0,0,0)
white = (255,255,255)
blue = (0,0,255)
green = (0,255,0)
red = (255,0,0)
purple = (255,0,255)
yellow = (255,255,0)
# Commands
print("")
pri... | 25.954976 | 117 | 0.590523 | #!/usr/bin/python3
import pygame
from classes.wall import Wall
from classes.block import Block
from classes.player import Player
from classes.ghost import Ghost
black = (0,0,0)
white = (255,255,255)
blue = (0,0,255)
green = (0,255,0)
red = (255,0,0)
purple = (255,0,255)
yellow = (255,255,0)
# Commands
print("")
pri... | 8,212 | 0 | 114 |
eb7bc4698679d0c26c6acac20c8799f7b2f57960 | 1,338 | py | Python | test_proj/test_app/tests.py | liberation/django-admin-tools | 42087cb634fe7410d9cb6cd2166a8a5cc9b435c1 | [
"MIT"
] | 1 | 2019-05-24T10:14:58.000Z | 2019-05-24T10:14:58.000Z | test_proj/test_app/tests.py | Merino/django-admin-tools | 13362185741a77606dbf8507861d17025f119f3e | [
"MIT"
] | 4 | 2015-03-10T10:20:23.000Z | 2015-07-08T14:36:12.000Z | test_proj/test_app/tests.py | Merino/django-admin-tools | 13362185741a77606dbf8507861d17025f119f3e | [
"MIT"
] | 2 | 2015-05-15T13:54:43.000Z | 2021-02-03T09:31:04.000Z | from django.test import TestCase
| 37.166667 | 80 | 0.66293 | from django.test import TestCase
class AdminBasicTest(TestCase):
def index_page(self, username='staff', password='123'):
self.assertTrue(self.client.login(username=username, password=password))
return self.client.get('/admin/')
def test_admin_loads(self):
self.assertEqual(self.index_p... | 1,163 | 10 | 131 |
dfa4c610c6f676cd88da76a1e9c0eddbb6f8139f | 183 | py | Python | ABC/abc201-abc250/abc215/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | ABC/abc201-abc250/abc215/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | ABC/abc201-abc250/abc215/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
if __name__ == "__main__":
main()
| 11.4375 | 26 | 0.42623 | # -*- coding: utf-8 -*-
def main():
s = input()
t = "Hello,World!"
if s == t:
print("AC")
else:
print("WA")
if __name__ == "__main__":
main()
| 95 | 0 | 23 |
bd847eda5bbf7439c06cef9cf5e2e620af014ec9 | 2,240 | py | Python | amplify/agent/containers/nginx/collectors/errorlog.py | digideskio/digidesk-amplified | 547f899d6fd47dc726df28ee90bf3511f02bd6cf | [
"BSD-2-Clause"
] | null | null | null | amplify/agent/containers/nginx/collectors/errorlog.py | digideskio/digidesk-amplified | 547f899d6fd47dc726df28ee90bf3511f02bd6cf | [
"BSD-2-Clause"
] | null | null | null | amplify/agent/containers/nginx/collectors/errorlog.py | digideskio/digidesk-amplified | 547f899d6fd47dc726df28ee90bf3511f02bd6cf | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from amplify.agent.containers.abstract import AbstractCollector
from amplify.agent.context import context
from amplify.agent.nginx.config.config import ERROR_LOG_LEVELS
from amplify.agent.nginx.log.error import NginxErrorLogParser
from amplify.agent.util.tail import FileTail
__author__ = "Mike ... | 36.721311 | 116 | 0.633482 | # -*- coding: utf-8 -*-
from amplify.agent.containers.abstract import AbstractCollector
from amplify.agent.context import context
from amplify.agent.nginx.config.config import ERROR_LOG_LEVELS
from amplify.agent.nginx.log.error import NginxErrorLogParser
from amplify.agent.util.tail import FileTail
__author__ = "Mike ... | 1,301 | 330 | 23 |
5d4bd54a2a0da40e100001a0bb967fd2b68e9b2c | 22,669 | py | Python | holoviews/plotting/plotly/util.py | zertrin/holoviews | c38ece9ae3f346375dcda5945bbe57cef28f2213 | [
"BSD-3-Clause"
] | null | null | null | holoviews/plotting/plotly/util.py | zertrin/holoviews | c38ece9ae3f346375dcda5945bbe57cef28f2213 | [
"BSD-3-Clause"
] | null | null | null | holoviews/plotting/plotly/util.py | zertrin/holoviews | c38ece9ae3f346375dcda5945bbe57cef28f2213 | [
"BSD-3-Clause"
] | null | null | null | import copy
import re
import numpy as np
from plotly import colors
from ..util import color_intervals, process_cmap
# Constants
# ---------
# Trace types that are individually positioned with their own domain.
# These are traces that don't overlay on top of each other in a shared subplot,
# so they are positioned i... | 33.435103 | 79 | 0.607967 | import copy
import re
import numpy as np
from plotly import colors
from ..util import color_intervals, process_cmap
# Constants
# ---------
# Trace types that are individually positioned with their own domain.
# These are traces that don't overlay on top of each other in a shared subplot,
# so they are positioned i... | 409 | 0 | 81 |
2bdc7428371e1f0e0536de790d51e8f3b6654246 | 589 | py | Python | batchrun/migrations/0005_logentry_kind_3.py | joonvena/mvj | 2191a6e23067f8e7fdda2bcbfe5e80a5dd749abc | [
"MIT"
] | 1 | 2021-01-12T08:14:10.000Z | 2021-01-12T08:14:10.000Z | batchrun/migrations/0005_logentry_kind_3.py | joonvena/mvj | 2191a6e23067f8e7fdda2bcbfe5e80a5dd749abc | [
"MIT"
] | 249 | 2017-04-18T14:00:13.000Z | 2022-03-30T12:18:03.000Z | batchrun/migrations/0005_logentry_kind_3.py | joonvena/mvj | 2191a6e23067f8e7fdda2bcbfe5e80a5dd749abc | [
"MIT"
] | 7 | 2017-04-18T08:43:54.000Z | 2021-07-28T07:29:30.000Z | from django.db import migrations
from enumfields.fields import EnumIntegerField
from ..enums import LogEntryKind
| 28.047619 | 75 | 0.663837 | from django.db import migrations
from enumfields.fields import EnumIntegerField
from ..enums import LogEntryKind
class Migration(migrations.Migration):
dependencies = [
("batchrun", "0004_logentry_kind_2"),
]
operations = [
migrations.AlterField(
model_name="jobrunlogentry",
... | 0 | 451 | 23 |
27065cb010e16c1d6a83346b080f65fa05f9cae2 | 1,370 | py | Python | examples/webhook/bin/wh.py | zoqaeski/wireguard-tools | 25253fc0425c22a849f57e7c2b8b99464ff2e0b1 | [
"MIT"
] | 122 | 2020-06-08T15:02:26.000Z | 2022-03-29T10:34:56.000Z | examples/webhook/bin/wh.py | zoqaeski/wireguard-tools | 25253fc0425c22a849f57e7c2b8b99464ff2e0b1 | [
"MIT"
] | 2 | 2020-10-23T08:53:54.000Z | 2021-12-08T14:30:25.000Z | examples/webhook/bin/wh.py | zoqaeski/wireguard-tools | 25253fc0425c22a849f57e7c2b8b99464ff2e0b1 | [
"MIT"
] | 16 | 2020-07-11T20:06:07.000Z | 2022-02-21T05:13:15.000Z | #!/usr/bin/env python3
# Author: Milos Buncic
# Date: 2020/06/10
# Description: Generate main configuration file (hooks.json) for webhook service
import os
import sys
import json
# Webhook working directory
WH_DIR = '/etc/webhook'
# Webhook configuration file
WH_CONFIG = '{}/hooks.json'.format(WH_DIR)
def writefile... | 22.833333 | 118 | 0.652555 | #!/usr/bin/env python3
# Author: Milos Buncic
# Date: 2020/06/10
# Description: Generate main configuration file (hooks.json) for webhook service
import os
import sys
import json
# Webhook working directory
WH_DIR = '/etc/webhook'
# Webhook configuration file
WH_CONFIG = '{}/hooks.json'.format(WH_DIR)
def writefile... | 532 | 0 | 23 |
67f279a99d4e956aac0b1d7b4ce200edead6010c | 330 | py | Python | assets/Duplicates.py | securityhook/Discord-Recon | 3386a423dd290c43de25c7c60572e9e43cda9557 | [
"MIT"
] | 30 | 2021-02-20T04:03:40.000Z | 2022-03-17T20:42:31.000Z | assets/Duplicates.py | securityhook/Discord-Recon | 3386a423dd290c43de25c7c60572e9e43cda9557 | [
"MIT"
] | 20 | 2021-02-21T04:02:06.000Z | 2021-06-08T20:12:57.000Z | assets/Duplicates.py | securityhook/Discord-Recon | 3386a423dd290c43de25c7c60572e9e43cda9557 | [
"MIT"
] | 11 | 2021-04-09T15:49:29.000Z | 2022-03-20T21:20:54.000Z | # define globals
subdomainsList = [] | 23.571429 | 50 | 0.681818 | # define globals
subdomainsList = []
def Duplicates(Subdomains):
global subdomainsList
Subdomains = Subdomains.split('\n')
for singleSubdomain in Subdomains:
if singleSubdomain not in subdomainsList:
subdomainsList.append(singleSubdomain)
else:
pass
return subd... | 271 | 0 | 23 |
859285290a2f8ccd5125928f5c709170add2d5e6 | 315 | py | Python | rcommander_web/scripts/rcommander_web_plain.py | gt-ros-pkg/rcommander-pr2 | 7c7408db30525b80a77dde34b4a8af68ec23d5a4 | [
"BSD-3-Clause"
] | 3 | 2015-03-18T10:20:13.000Z | 2021-03-01T02:46:20.000Z | rcommander_web/scripts/rcommander_web_plain.py | gt-ros-pkg/rcommander-pr2 | 7c7408db30525b80a77dde34b4a8af68ec23d5a4 | [
"BSD-3-Clause"
] | null | null | null | rcommander_web/scripts/rcommander_web_plain.py | gt-ros-pkg/rcommander-pr2 | 7c7408db30525b80a77dde34b4a8af68ec23d5a4 | [
"BSD-3-Clause"
] | 2 | 2016-08-03T21:50:59.000Z | 2021-03-01T02:46:20.000Z | import roslib; roslib.load_manifest('rcommander_web')
import rcommander_web.rcommander_auto_server as rcs
import sys
import rospy
rospy.init_node('rcommander_web_test')
path = sys.argv[1]
robot = MyRobotClass()
rcs.run(robot, path)
| 22.5 | 53 | 0.771429 | import roslib; roslib.load_manifest('rcommander_web')
import rcommander_web.rcommander_auto_server as rcs
import sys
import rospy
class MyRobotClass:
def __init__(self):
self.some_resource = "hello"
rospy.init_node('rcommander_web_test')
path = sys.argv[1]
robot = MyRobotClass()
rcs.run(robot, path)
| 35 | -2 | 49 |
2d417794331f8b35053520f1f16c117cc036ce17 | 958 | py | Python | cracking_the_coding_interview/robot.py | ac2sherry/AlgorithmTest | 823a8be8707afb959dd3bb9246bf875d0ffad967 | [
"MIT"
] | 1 | 2018-12-21T01:15:57.000Z | 2018-12-21T01:15:57.000Z | cracking_the_coding_interview/robot.py | Li-Aaron/AlgorithmTest | 823a8be8707afb959dd3bb9246bf875d0ffad967 | [
"MIT"
] | null | null | null | cracking_the_coding_interview/robot.py | Li-Aaron/AlgorithmTest | 823a8be8707afb959dd3bb9246bf875d0ffad967 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
'''
有一个XxY的网格,一个机器人只能走格点且只能向右或向下走,要从左上角走到右下角。请设计一个算法,计算机器人有多少种走法。注意这次的网格中有些障碍点是不能走的。
给定一个int[][] map(C++ 中为vector >),表示网格图,若map[i][j]为1则说明该点不是障碍点,否则则为障碍。另外给定int x,int y,表示网格的大小。请返回机器人从(0,0)走到(x - 1,y - 1)的走法数,为了防止溢出,请将结果Mod 1000000007。保证x和y均小于等于50
'''
# test case
m = [[1,1,1,1],[1,1,1,1... | 33.034483 | 163 | 0.503132 | # -*- coding:utf-8 -*-
'''
有一个XxY的网格,一个机器人只能走格点且只能向右或向下走,要从左上角走到右下角。请设计一个算法,计算机器人有多少种走法。注意这次的网格中有些障碍点是不能走的。
给定一个int[][] map(C++ 中为vector >),表示网格图,若map[i][j]为1则说明该点不是障碍点,否则则为障碍。另外给定int x,int y,表示网格的大小。请返回机器人从(0,0)走到(x - 1,y - 1)的走法数,为了防止溢出,请将结果Mod 1000000007。保证x和y均小于等于50
'''
class Robot:
def countWays(self, m,... | 439 | -9 | 48 |
171b6e8669227374acb2881ffd655291d017fda9 | 8,112 | py | Python | ms_deisotope/qc/graph_reduction.py | mstim/ms_deisotope | 29f4f466e92e66b65a2d21eca714aa627caa21db | [
"Apache-2.0"
] | 18 | 2017-09-01T12:26:12.000Z | 2022-02-23T02:31:29.000Z | ms_deisotope/qc/graph_reduction.py | mstim/ms_deisotope | 29f4f466e92e66b65a2d21eca714aa627caa21db | [
"Apache-2.0"
] | 19 | 2017-03-12T20:40:36.000Z | 2022-03-31T22:50:47.000Z | ms_deisotope/qc/graph_reduction.py | mstim/ms_deisotope | 29f4f466e92e66b65a2d21eca714aa627caa21db | [
"Apache-2.0"
] | 14 | 2016-05-06T02:25:30.000Z | 2022-03-31T14:40:06.000Z | from ms_deisotope.peak_set import DeconvolutedPeakSet
from ms_deisotope.spectrum_graph import (PathFinder, amino_acids, MassWrapper)
from brainpy import SimpleComposition
H2O = SimpleComposition({"H": 2, "O": 1})
NH3 = SimpleComposition({"H": 3, "N": 1})
default_losses = [MassWrapper("-H2O", -H2O.mass()), MassWrapp... | 34.815451 | 101 | 0.608111 | from ms_deisotope.peak_set import DeconvolutedPeakSet
from ms_deisotope.spectrum_graph import (PathFinder, amino_acids, MassWrapper)
from brainpy import SimpleComposition
H2O = SimpleComposition({"H": 2, "O": 1})
NH3 = SimpleComposition({"H": 3, "N": 1})
default_losses = [MassWrapper("-H2O", -H2O.mass()), MassWrapp... | 739 | 7,004 | 23 |
dbe9167763e9026b05b5a7a93c168bed47be85b7 | 329 | py | Python | fitnesse/tasks.py | SecurityCodeRu/web-fitnesse | 423288b4cc8cf1506285913558b3fcff9e7788fa | [
"Apache-2.0"
] | null | null | null | fitnesse/tasks.py | SecurityCodeRu/web-fitnesse | 423288b4cc8cf1506285913558b3fcff9e7788fa | [
"Apache-2.0"
] | 2 | 2015-05-21T11:39:55.000Z | 2016-03-11T13:38:10.000Z | fitnesse/tasks.py | SecurityCodeRu/web-fitnesse | 423288b4cc8cf1506285913558b3fcff9e7788fa | [
"Apache-2.0"
] | 1 | 2015-05-21T11:33:50.000Z | 2015-05-21T11:33:50.000Z | # -*- coding: utf-8 -*-
from celery import shared_task
from django.http import HttpResponse
import fitnesse.import_data
@shared_task
| 20.5625 | 48 | 0.772036 | # -*- coding: utf-8 -*-
from celery import shared_task
from django.http import HttpResponse
import fitnesse.import_data
@shared_task
def import_job_task(job_name):
fitnesse.import_data.import_job(job_name)
def import_job(request, job_name):
import_job_task.apply_async(args=[job_name])
return HttpRespon... | 147 | 0 | 45 |
0bab2ec930a06a036042930ad4aaf3fa78b55b15 | 2,010 | py | Python | app/imr/utils.py | DarkMaguz/IMR-ReportGenerator | 3c14cfa75702b6560da351becb7db0e36d740b90 | [
"MIT"
] | null | null | null | app/imr/utils.py | DarkMaguz/IMR-ReportGenerator | 3c14cfa75702b6560da351becb7db0e36d740b90 | [
"MIT"
] | null | null | null | app/imr/utils.py | DarkMaguz/IMR-ReportGenerator | 3c14cfa75702b6560da351becb7db0e36d740b90 | [
"MIT"
] | null | null | null | import os
import time
import magic
import settings as cfg
| 24.216867 | 64 | 0.689552 | import os
import time
import magic
import settings as cfg
class MyTimer():
def __init__(self):
self.start = time.time()
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
end = time.time()
runtime = end - self.start
msg = 'The function took {time} seconds to complete'
print... | 1,680 | -5 | 276 |
0c52c42653a4681278a5cce8b6cf0ae4c14d1331 | 49 | py | Python | bsamcli/__init__.py | bcelabs/bce-sam-cli | 692fceabd3fe3efc6418202dc372d3b95acadf3c | [
"Apache-2.0"
] | 3 | 2018-11-29T12:57:56.000Z | 2021-02-24T11:58:58.000Z | bsamcli/__init__.py | bcelabs/bce-sam-cli | 692fceabd3fe3efc6418202dc372d3b95acadf3c | [
"Apache-2.0"
] | null | null | null | bsamcli/__init__.py | bcelabs/bce-sam-cli | 692fceabd3fe3efc6418202dc372d3b95acadf3c | [
"Apache-2.0"
] | 2 | 2018-09-03T11:54:16.000Z | 2021-02-05T03:32:17.000Z | """
BSAM CLI version
"""
__version__ = '0.7.12'
| 8.166667 | 22 | 0.591837 | """
BSAM CLI version
"""
__version__ = '0.7.12'
| 0 | 0 | 0 |
c9be065d18c2c5911e6ebaeb74f95c60dde00049 | 1,867 | py | Python | helper/slicable_set.py | theblacklion/diamond-framework | 0996a517a6821d8903f5c378a85e9b1f3998109f | [
"MIT"
] | null | null | null | helper/slicable_set.py | theblacklion/diamond-framework | 0996a517a6821d8903f5c378a85e9b1f3998109f | [
"MIT"
] | null | null | null | helper/slicable_set.py | theblacklion/diamond-framework | 0996a517a6821d8903f5c378a85e9b1f3998109f | [
"MIT"
] | null | null | null | # Slicable Set.
#
# @author Oktay Acikalin <oktay.acikalin@gmail.com>
# @copyright Oktay Acikalin
# @license MIT (LICENSE.txt)
# from diamond.decorators import time
| 31.644068 | 78 | 0.588109 | # Slicable Set.
#
# @author Oktay Acikalin <oktay.acikalin@gmail.com>
# @copyright Oktay Acikalin
# @license MIT (LICENSE.txt)
# from diamond.decorators import time
class SlicableSet(set):
# @time
def __getitem__(self, index):
'''
Returns an item of the ordered set.
Please keep ... | 171 | 1,501 | 23 |
d4d4f265f1d8b2c79a40895e200e8d6ec1efdebe | 39 | py | Python | config.py | nullaf/ScribeUp_Assignment_Backend | baeda12efe971f37b5a2b2b7b8f3d403993ed562 | [
"MIT"
] | null | null | null | config.py | nullaf/ScribeUp_Assignment_Backend | baeda12efe971f37b5a2b2b7b8f3d403993ed562 | [
"MIT"
] | null | null | null | config.py | nullaf/ScribeUp_Assignment_Backend | baeda12efe971f37b5a2b2b7b8f3d403993ed562 | [
"MIT"
] | null | null | null | DEBUG = True
FLASK_ENV = 'development'
| 13 | 25 | 0.74359 | DEBUG = True
FLASK_ENV = 'development'
| 0 | 0 | 0 |
07221ba6ed7ef31d0713cb42a0ff17ba1af1eb3f | 1,778 | py | Python | moltin/token.py | YuraHavrylko/python-sdk | 899886e54bfcb6c0fb918a9a65a3f1ccefe7d96b | [
"MIT"
] | 8 | 2015-06-12T21:40:40.000Z | 2019-01-25T02:57:30.000Z | moltin/token.py | YuraHavrylko/python-sdk | 899886e54bfcb6c0fb918a9a65a3f1ccefe7d96b | [
"MIT"
] | 9 | 2016-02-12T17:19:38.000Z | 2018-10-09T01:51:31.000Z | moltin/token.py | YuraHavrylko/python-sdk | 899886e54bfcb6c0fb918a9a65a3f1ccefe7d96b | [
"MIT"
] | 14 | 2016-02-11T22:14:13.000Z | 2020-09-07T18:19:31.000Z | import time
| 25.4 | 62 | 0.639483 | import time
class TokenContainer:
tokens = {}
def __init__(self, access_token=None, refresh_token=None):
self.tokens["access"] = access_token
self.tokens["refresh"] = refresh_token
def set(self, access_or_refresh, token):
self.tokens[access_or_refresh] = token
def get(self,... | 1,194 | 321 | 247 |
a4b42e1ad8d07f7bd2bde5d6961683c054e5b505 | 24 | py | Python | bot/__init__.py | airdropbird/calc | ebad54d6d9de9eee4205ca3920496c65bc04967e | [
"MIT"
] | 1 | 2021-09-06T15:40:51.000Z | 2021-09-06T15:40:51.000Z | bot/__init__.py | airdropbird/calc | ebad54d6d9de9eee4205ca3920496c65bc04967e | [
"MIT"
] | null | null | null | bot/__init__.py | airdropbird/calc | ebad54d6d9de9eee4205ca3920496c65bc04967e | [
"MIT"
] | null | null | null | from .bot import CalcBot | 24 | 24 | 0.833333 | from .bot import CalcBot | 0 | 0 | 0 |
cac51e55e36a9b9eadd21f454fda3ab9cad91cbc | 618 | py | Python | gaphor/ui/tests/test_consolewindow.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | null | null | null | gaphor/ui/tests/test_consolewindow.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | null | null | null | gaphor/ui/tests/test_consolewindow.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | null | null | null | import pytest
from gaphor.ui.consolewindow import ConsoleWindow
import gaphor.services.componentregistry
@pytest.fixture
@pytest.fixture
| 19.935484 | 64 | 0.747573 | import pytest
from gaphor.ui.consolewindow import ConsoleWindow
import gaphor.services.componentregistry
class MainWindowStub:
def __init__(self):
self.window = None
@pytest.fixture
def component_registry():
return gaphor.services.componentregistry.ComponentRegistry()
@pytest.fixture
def main_win... | 358 | 0 | 116 |
3bfdb4af14b7e7cd303aaabe0d86a23e4e096ea6 | 344 | py | Python | Alfabeto.py | uip-pc2/simulacion-dado-Alvaroh04 | a42a945fabf71c9d0950a4403f9532f9a2e366cd | [
"MIT"
] | null | null | null | Alfabeto.py | uip-pc2/simulacion-dado-Alvaroh04 | a42a945fabf71c9d0950a4403f9532f9a2e366cd | [
"MIT"
] | null | null | null | Alfabeto.py | uip-pc2/simulacion-dado-Alvaroh04 | a42a945fabf71c9d0950a4403f9532f9a2e366cd | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
letra = letras()
try:
for i in range(ord('M')):
print(next(letra))
if i == 'M':
break
except Exception as e:
print(e)
| 22.933333 | 42 | 0.383721 | def letras():
for i in range(ord('A'), ord('M')+1):
yield (chr(i))
if __name__ == '__main__':
letra = letras()
try:
for i in range(ord('M')):
print(next(letra))
if i == 'M':
break
except Exception as e:... | 59 | 0 | 23 |
38c5d5137c314499b45d13a501ffb0168095284e | 5,266 | py | Python | make_representative_images.py | jehenninger/in_vitro_droplet_assay | 99344b96fbb2ac73bd0b20334b9dfede4529c5e2 | [
"MIT"
] | 1 | 2020-07-22T17:29:33.000Z | 2020-07-22T17:29:33.000Z | make_representative_images.py | jehenninger/in_vitro_droplet_assay | 99344b96fbb2ac73bd0b20334b9dfede4529c5e2 | [
"MIT"
] | null | null | null | make_representative_images.py | jehenninger/in_vitro_droplet_assay | 99344b96fbb2ac73bd0b20334b9dfede4529c5e2 | [
"MIT"
] | null | null | null | import sys
import os
import json
from datetime import datetime
import argparse
import pandas as pd
import numpy as np
from skimage import io, filters, measure, color, exposure, morphology, feature, img_as_float, img_as_uint
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
from scipy.optimi... | 38.437956 | 138 | 0.680972 | import sys
import os
import json
from datetime import datetime
import argparse
import pandas as pd
import numpy as np
from skimage import io, filters, measure, color, exposure, morphology, feature, img_as_float, img_as_uint
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
from scipy.optimi... | 3,734 | 0 | 46 |
41518b023218b2609d74203dbc40abbadcbe1894 | 329 | py | Python | src/directory/migrations/0025_remove_author_genre.py | Aleksander-Protasevich/django_project | 49d7b0f5e86d544f94340d8343995f6d4b70bbd8 | [
"Apache-2.0"
] | null | null | null | src/directory/migrations/0025_remove_author_genre.py | Aleksander-Protasevich/django_project | 49d7b0f5e86d544f94340d8343995f6d4b70bbd8 | [
"Apache-2.0"
] | null | null | null | src/directory/migrations/0025_remove_author_genre.py | Aleksander-Protasevich/django_project | 49d7b0f5e86d544f94340d8343995f6d4b70bbd8 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.5 on 2021-02-21 13:29
from django.db import migrations
| 18.277778 | 49 | 0.592705 | # Generated by Django 3.1.5 on 2021-02-21 13:29
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('directory', '0024_auto_20210214_2205'),
]
operations = [
migrations.RemoveField(
model_name='author',
name='genre',
... | 0 | 223 | 23 |
f956aea638114497d04311890486f3971149b4ae | 600 | py | Python | setup.py | ukch/jclib | e3e293024d225865bec5e704fca753e08c7fdf2e | [
"MIT"
] | null | null | null | setup.py | ukch/jclib | e3e293024d225865bec5e704fca753e08c7fdf2e | [
"MIT"
] | null | null | null | setup.py | ukch/jclib | e3e293024d225865bec5e704fca753e08c7fdf2e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import setuptools
with open("README.rst", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="jclib",
version="0.0.1",
author="Joel Cross",
author_email="joel@kazbak.co.uk",
description="Reusable code",
long_description=long_description,
url="https:... | 24 | 49 | 0.615 | #!/usr/bin/env python3
import setuptools
with open("README.rst", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="jclib",
version="0.0.1",
author="Joel Cross",
author_email="joel@kazbak.co.uk",
description="Reusable code",
long_description=long_description,
url="https:... | 0 | 0 | 0 |
faf99e9ca3ebeccce61e5598e8d6dc4660763fa4 | 2,366 | py | Python | imaging/startup-script.py | dmageeLANL/hip-fortran | 6b459a1c0a941de26a24cb4540cbb44b0b93b7ed | [
"Apache-2.0"
] | 9 | 2020-05-22T09:22:00.000Z | 2021-09-13T02:44:53.000Z | imaging/startup-script.py | dmageeLANL/hip-fortran | 6b459a1c0a941de26a24cb4540cbb44b0b93b7ed | [
"Apache-2.0"
] | 1 | 2020-05-22T09:48:56.000Z | 2020-05-22T09:48:56.000Z | imaging/startup-script.py | dmageeLANL/hip-fortran | 6b459a1c0a941de26a24cb4540cbb44b0b93b7ed | [
"Apache-2.0"
] | 2 | 2020-04-10T15:32:29.000Z | 2021-06-14T16:58:39.000Z | #!/usr/bin/python
# Copyright 2020 Fluid Numerics 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 ... | 26.886364 | 143 | 0.670752 | #!/usr/bin/python
# Copyright 2020 Fluid Numerics 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 ... | 1,452 | 0 | 92 |
b099886bb10ceb5c81e9fe37010b41a46c435c05 | 10,312 | py | Python | lstchain/calib/camera/calibrator.py | calispac/cta-lstchain | 83c7058a291c55f5841e984b99f22ac49e759d0f | [
"BSD-3-Clause"
] | null | null | null | lstchain/calib/camera/calibrator.py | calispac/cta-lstchain | 83c7058a291c55f5841e984b99f22ac49e759d0f | [
"BSD-3-Clause"
] | null | null | null | lstchain/calib/camera/calibrator.py | calispac/cta-lstchain | 83c7058a291c55f5841e984b99f22ac49e759d0f | [
"BSD-3-Clause"
] | 1 | 2020-11-05T09:18:27.000Z | 2020-11-05T09:18:27.000Z | import numpy as np
import os
from ctapipe.core.traits import Unicode, List, Int, Bool
from ctapipe.calib.camera import CameraCalibrator
from ctapipe.calib.camera.calibrator import integration_correction
from ctapipe.image.reducer import DataVolumeReducer
from ctapipe.image.extractor import ImageExtractor
from ctapipe.i... | 36.309859 | 125 | 0.62083 | import numpy as np
import os
from ctapipe.core.traits import Unicode, List, Int, Bool
from ctapipe.calib.camera import CameraCalibrator
from ctapipe.calib.camera.calibrator import integration_correction
from ctapipe.image.reducer import DataVolumeReducer
from ctapipe.image.extractor import ImageExtractor
from ctapipe.i... | 0 | 0 | 0 |
79a1e8376d507b317b509336d08df4f82f090cd0 | 621 | py | Python | src/user.py | RARM/homeless_registration | 4b5b4ed88d9516afb0af556b38846ae091fce3c7 | [
"MIT"
] | 1 | 2020-08-02T02:26:50.000Z | 2020-08-02T02:26:50.000Z | src/user.py | RARM/homeless_registration | 4b5b4ed88d9516afb0af556b38846ae091fce3c7 | [
"MIT"
] | null | null | null | src/user.py | RARM/homeless_registration | 4b5b4ed88d9516afb0af556b38846ae091fce3c7 | [
"MIT"
] | null | null | null |
# Main
userName = "Admin"
passWord = "Admin"
print("What is the username?")
passWord = input()
print("what is the password?")
passWord = input()
test = checkPassword(userName, passWord)
if test == True:
print("Login successful")
else:
print("Login not successful")
| 23.884615 | 41 | 0.624799 | def checkPassword(userName, passWord):
actualUsername = "Admin"
actualPassword = "Admin"
if userName == actualUsername:
if passWord == actualPassword:
checkPassword = True
else:
checkPassword = False
else:
checkPassword = False
return c... | 311 | 0 | 23 |
9b12fd6c2f1dbaae7c090c4ae53f8f1c5e334e43 | 1,378 | py | Python | news/serializers.py | Yuhjiang/hellofamilyclub | 4d01a41cde57023b0fd10685b67ab31d51fe1fb7 | [
"BSD-2-Clause"
] | 1 | 2020-11-06T01:55:37.000Z | 2020-11-06T01:55:37.000Z | news/serializers.py | Yuhjiang/hellofamilyclub | 4d01a41cde57023b0fd10685b67ab31d51fe1fb7 | [
"BSD-2-Clause"
] | 34 | 2020-03-13T04:49:53.000Z | 2022-03-07T06:08:35.000Z | news/serializers.py | Yuhjiang/hellofamilyclub | 4d01a41cde57023b0fd10685b67ab31d51fe1fb7 | [
"BSD-2-Clause"
] | null | null | null | from rest_framework import serializers
from .models import NewsType, HelloNews
from pictures.serializers import GroupSerializerDetail, MemberSerializerDetail
| 29.956522 | 90 | 0.680697 | from rest_framework import serializers
from .models import NewsType, HelloNews
from pictures.serializers import GroupSerializerDetail, MemberSerializerDetail
class NewsTypeSerializerDetail(serializers.ModelSerializer):
class Meta:
model = NewsType
fields = ['id', 'name', 'color']
class NewsType... | 50 | 1,049 | 115 |
eb82cb6814f513d77e4bb2781b38dd0e8f229d28 | 250 | py | Python | utils.py | dstarr1/compare_personality_models | 244c1de231c9efa05307920733b62230cabdce7a | [
"MIT"
] | null | null | null | utils.py | dstarr1/compare_personality_models | 244c1de231c9efa05307920733b62230cabdce7a | [
"MIT"
] | null | null | null | utils.py | dstarr1/compare_personality_models | 244c1de231c9efa05307920733b62230cabdce7a | [
"MIT"
] | null | null | null | """
Shared utility functions.
"""
import json
def read_local_config(config_fname):
''' Read configs from local, non-git commited json file.
'''
with open(config_fname) as fp:
local_config = json.load(fp)
return local_config
| 19.230769 | 60 | 0.68 | """
Shared utility functions.
"""
import json
def read_local_config(config_fname):
''' Read configs from local, non-git commited json file.
'''
with open(config_fname) as fp:
local_config = json.load(fp)
return local_config
| 0 | 0 | 0 |
f554bc3238b4eabccf04a59aae745f16c658b5c6 | 4,168 | py | Python | TelegramBotAPI/types/methods.py | b2ornot2b/pyTelegramBotAPI | f560dc66a2e07897ff3a357952b38f37c03cb6b0 | [
"MIT"
] | 22 | 2015-08-23T19:51:21.000Z | 2020-01-22T04:17:47.000Z | TelegramBotAPI/types/methods.py | b2ornot2b/pyTelegramBotAPI | f560dc66a2e07897ff3a357952b38f37c03cb6b0 | [
"MIT"
] | 2 | 2015-11-14T06:23:31.000Z | 2016-01-27T22:39:52.000Z | TelegramBotAPI/types/methods.py | b2ornot2b/pyTelegramBotAPI | f560dc66a2e07897ff3a357952b38f37c03cb6b0 | [
"MIT"
] | 10 | 2015-10-29T11:58:58.000Z | 2020-09-30T18:58:37.000Z | from TelegramBotAPI.types.type import Type
from TelegramBotAPI.types.field import Field
from TelegramBotAPI.types.primitive import Integer, String, Boolean, Float, InputFile
from TelegramBotAPI.types.compound import ReplyKeyboardMarkup, ReplyKeyboardHide, ForceReply
from TelegramBotAPI.types.compound import Update, Mes... | 28.162162 | 92 | 0.738244 | from TelegramBotAPI.types.type import Type
from TelegramBotAPI.types.field import Field
from TelegramBotAPI.types.primitive import Integer, String, Boolean, Float, InputFile
from TelegramBotAPI.types.compound import ReplyKeyboardMarkup, ReplyKeyboardHide, ForceReply
from TelegramBotAPI.types.compound import Update, Mes... | 0 | 3,404 | 391 |
0279f51715bc3008cd501168d7d22b7f712a10ea | 48,830 | py | Python | MCNPtools/material_collection.py | sellitforcache/MCNPtools | 5192111910328bc2220d8fa421d5928d93305ced | [
"BSD-3-Clause"
] | 5 | 2015-02-02T16:57:25.000Z | 2021-11-09T00:50:33.000Z | MCNPtools/material_collection.py | sellitforcache/MCNPtools | 5192111910328bc2220d8fa421d5928d93305ced | [
"BSD-3-Clause"
] | 1 | 2018-03-23T09:54:57.000Z | 2018-03-23T09:59:55.000Z | MCNPtools/material_collection.py | sellitforcache/MCNPtools | 5192111910328bc2220d8fa421d5928d93305ced | [
"BSD-3-Clause"
] | 4 | 2015-08-02T23:19:50.000Z | 2020-09-30T22:16:01.000Z | from MCNPtools import calculate_materials
#
# Stainless Steel 316
#
ss316=calculate_materials.mixture('SS316')
ss316.mass_density=7.95
ss316.add_mixture( 'P' , 210.00, mode='mass')
ss316.add_mixture( 'Mo' , 1990.00, mode='mass')
ss316.add_mixture( 'Zn' , 12.00, mode='mass')
ss316.add_mixture( 'Pb' , 40.0... | 39.602595 | 116 | 0.687467 | from MCNPtools import calculate_materials
#
# Stainless Steel 316
#
ss316=calculate_materials.mixture('SS316')
ss316.mass_density=7.95
ss316.add_mixture( 'P' , 210.00, mode='mass')
ss316.add_mixture( 'Mo' , 1990.00, mode='mass')
ss316.add_mixture( 'Zn' , 12.00, mode='mass')
ss316.add_mixture( 'Pb' , 40.0... | 0 | 0 | 0 |
10e0fb5cabfe832160d41e8bb7fb78e20465b3cf | 189 | py | Python | osmaxx/profile/apps.py | tyrasd/osmaxx | da4454083d17b2ef8b0623cad62e39992b6bd52a | [
"MIT"
] | 27 | 2015-03-30T14:17:26.000Z | 2022-02-19T17:30:44.000Z | osmaxx/profile/apps.py | tyrasd/osmaxx | da4454083d17b2ef8b0623cad62e39992b6bd52a | [
"MIT"
] | 483 | 2015-03-09T16:58:03.000Z | 2022-03-14T09:29:06.000Z | osmaxx/profile/apps.py | tyrasd/osmaxx | da4454083d17b2ef8b0623cad62e39992b6bd52a | [
"MIT"
] | 6 | 2015-04-07T07:38:30.000Z | 2020-04-01T12:45:53.000Z | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
| 23.625 | 54 | 0.772487 | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class ExcerptExportConfig(AppConfig):
name = 'osmaxx.profile'
verbose_name = _("Profile")
| 0 | 76 | 23 |
411280651611a2916471de0473cfe5b2f47dcf1b | 7,786 | py | Python | engine.py | nicktgn/wakeword-benchmark | 633502ba357bd210bd39132814306a5eb4e323f8 | [
"Apache-2.0"
] | null | null | null | engine.py | nicktgn/wakeword-benchmark | 633502ba357bd210bd39132814306a5eb4e323f8 | [
"Apache-2.0"
] | null | null | null | engine.py | nicktgn/wakeword-benchmark | 633502ba357bd210bd39132814306a5eb4e323f8 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Picovoice Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 30.29572 | 116 | 0.652453 | #
# Copyright 2018 Picovoice Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 758 | 0 | 324 |
42723acf8863ef47ffbc8ecf4fa60ebbb9847c60 | 1,235 | py | Python | app/Database/DatabaseConnector.py | ejach/InventoryApplication | cf08fe2edb5ad3af347fd6f368bb33cffadc42bf | [
"MIT"
] | 1 | 2021-12-22T16:07:13.000Z | 2021-12-22T16:07:13.000Z | app/Database/DatabaseConnector.py | ejach/InventoryApplication | cf08fe2edb5ad3af347fd6f368bb33cffadc42bf | [
"MIT"
] | 40 | 2021-09-28T18:53:24.000Z | 2022-03-31T17:58:20.000Z | app/Database/DatabaseConnector.py | ejach/InventoryApplication | cf08fe2edb5ad3af347fd6f368bb33cffadc42bf | [
"MIT"
] | null | null | null | from os import environ
from pymysql import connect, Error
# Test if the connection is successful; print errors if it was not
| 27.444444 | 101 | 0.59919 | from os import environ
from pymysql import connect, Error
class DatabaseConnector:
def __init__(self):
self.host = environ.get('host')
self.port = environ.get('webui_port')
self.db_port = int(environ.get('db_port'))
self.user = environ.get('username')
self.password = envir... | 863 | 3 | 237 |
147606efd02c473d877d782fb47db716bf843174 | 10,404 | py | Python | tests/unit/deferred.py | CCI-MOC/hil | 8c6de2214ddf908c01549b117d5684ac52a93934 | [
"ECL-2.0",
"Apache-2.0"
] | 23 | 2016-09-27T18:41:46.000Z | 2021-12-20T15:06:32.000Z | tests/unit/deferred.py | CCI-MOC/hil | 8c6de2214ddf908c01549b117d5684ac52a93934 | [
"ECL-2.0",
"Apache-2.0"
] | 522 | 2016-06-22T21:19:26.000Z | 2020-11-12T20:54:40.000Z | tests/unit/deferred.py | CCI-MOC/hil | 8c6de2214ddf908c01549b117d5684ac52a93934 | [
"ECL-2.0",
"Apache-2.0"
] | 30 | 2016-06-24T08:27:59.000Z | 2018-08-20T17:34:45.000Z | '''Functional test for deferred.py'''
import pytest
import tempfile
import uuid
from hil import config, deferred, model, api
from hil.model import db, Switch
from hil.errors import SwitchError
from hil.test_common import config_testsuite, config_merge, \
fresh_database
from flask import F... | 34.564784 | 79 | 0.627259 | '''Functional test for deferred.py'''
import pytest
import tempfile
import uuid
from hil import config, deferred, model, api
from hil.model import db, Switch
from hil.errors import SwitchError
from hil.test_common import config_testsuite, config_merge, \
fresh_database
from flask import F... | 3,317 | 0 | 22 |
b15a6bfe47eaa9078e2ec77dad64e9c9debea00d | 472 | py | Python | filebeat/tests/conftest.py | divyamamgai/integrations-extras | 8c40a9cf870578687cc224ee91d3c70cd3a435a4 | [
"BSD-3-Clause"
] | 158 | 2016-06-02T16:25:31.000Z | 2022-03-16T15:55:14.000Z | filebeat/tests/conftest.py | divyamamgai/integrations-extras | 8c40a9cf870578687cc224ee91d3c70cd3a435a4 | [
"BSD-3-Clause"
] | 554 | 2016-03-15T17:39:12.000Z | 2022-03-31T10:29:16.000Z | filebeat/tests/conftest.py | divyamamgai/integrations-extras | 8c40a9cf870578687cc224ee91d3c70cd3a435a4 | [
"BSD-3-Clause"
] | 431 | 2016-05-13T15:33:13.000Z | 2022-03-31T10:06:46.000Z | import os
import pytest
from datadog_checks.dev.docker import docker_run
from .common import DOCKER_DIR, ENDPOINT, URL, registry_file_path
INSTANCE = {
"stats_endpoint": ENDPOINT,
"registry_file_path": registry_file_path("empty"),
}
@pytest.fixture(scope="session")
@pytest.fixture
| 18.88 | 84 | 0.739407 | import os
import pytest
from datadog_checks.dev.docker import docker_run
from .common import DOCKER_DIR, ENDPOINT, URL, registry_file_path
INSTANCE = {
"stats_endpoint": ENDPOINT,
"registry_file_path": registry_file_path("empty"),
}
@pytest.fixture(scope="session")
def dd_environment():
with docker_r... | 130 | 0 | 44 |
acffc257f4aec5a1b5c2f37f9921487fb330d660 | 1,228 | py | Python | tests/pymcell4_positive/0185_model_deepcopy/model.py | mcellteam/mcell-tests | 34d2d967b75d56edbae999bf0090641850f4f4fe | [
"MIT"
] | 1 | 2021-08-13T20:40:54.000Z | 2021-08-13T20:40:54.000Z | tests/pymcell4_positive/0185_model_deepcopy/model.py | mcellteam/mcell_tests | 34d2d967b75d56edbae999bf0090641850f4f4fe | [
"MIT"
] | null | null | null | tests/pymcell4_positive/0185_model_deepcopy/model.py | mcellteam/mcell_tests | 34d2d967b75d56edbae999bf0090641850f4f4fe | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import os
import math
import copy
MCELL_PATH = os.environ.get('MCELL_PATH', '')
if MCELL_PATH:
sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
print("Error: variable MCELL_PATH that is used to find the mcell library was not set.")
sys.exit(1)
import mcell as m
fr... | 21.172414 | 91 | 0.722313 | #!/usr/bin/env python3
import sys
import os
import math
import copy
MCELL_PATH = os.environ.get('MCELL_PATH', '')
if MCELL_PATH:
sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
print("Error: variable MCELL_PATH that is used to find the mcell library was not set.")
sys.exit(1)
import mcell as m
fr... | 0 | 0 | 0 |
28e14f0ca9a3fb40edb82cf1613b51d9d5e3ae53 | 822 | py | Python | d3dfacs_face_experiments.py | akashsengupta1997/FLAME_PyTorch | 100e66c1c0621d0a3e0273ff9cc65e43e4f0ddbb | [
"MIT"
] | null | null | null | d3dfacs_face_experiments.py | akashsengupta1997/FLAME_PyTorch | 100e66c1c0621d0a3e0273ff9cc65e43e4f0ddbb | [
"MIT"
] | null | null | null | d3dfacs_face_experiments.py | akashsengupta1997/FLAME_PyTorch | 100e66c1c0621d0a3e0273ff9cc65e43e4f0ddbb | [
"MIT"
] | null | null | null | import matplotlib
matplotlib.use('MACOSX')
import matplotlib.pyplot as plt
import numpy as np
from metrics.full_face_vertex_deviation import compute_vertex_deviations_over_sequence, compute_vertex_deviations_for_actor, \
compute_vertex_deviations_for_all
# d3dfacs_path = "/Users/Akash_Sengupta/Documents/Datasets... | 39.142857 | 126 | 0.784672 | import matplotlib
matplotlib.use('MACOSX')
import matplotlib.pyplot as plt
import numpy as np
from metrics.full_face_vertex_deviation import compute_vertex_deviations_over_sequence, compute_vertex_deviations_for_actor, \
compute_vertex_deviations_for_all
# d3dfacs_path = "/Users/Akash_Sengupta/Documents/Datasets... | 0 | 0 | 0 |
37f86d341ea75699493f0cdbf63996e250c6f548 | 9,218 | py | Python | hyperparameter_tuning/rapids_bring_your_own/code/HPOConfig.py | jerrypeng7773/amazon-sagemaker-examples | c5ddecce1f739a345465b9a38b064983a129141d | [
"Apache-2.0"
] | 1 | 2021-05-31T17:19:10.000Z | 2021-05-31T17:19:10.000Z | hyperparameter_tuning/rapids_bring_your_own/code/HPOConfig.py | jerrypeng7773/amazon-sagemaker-examples | c5ddecce1f739a345465b9a38b064983a129141d | [
"Apache-2.0"
] | 1 | 2019-07-01T23:54:20.000Z | 2019-07-01T23:55:29.000Z | hyperparameter_tuning/rapids_bring_your_own/code/HPOConfig.py | jerrypeng7773/amazon-sagemaker-examples | c5ddecce1f739a345465b9a38b064983a129141d | [
"Apache-2.0"
] | 2 | 2021-06-24T11:49:58.000Z | 2021-06-24T11:54:01.000Z | #
# Copyright (c) 2019-2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 39.393162 | 100 | 0.618464 | #
# Copyright (c) 2019-2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 885 | 0 | 27 |
c1635c6228b2c2ba6ae51a07d323eaa758d5e8a8 | 7,673 | py | Python | tests/test_memory.py | aserhiychuk/pyreinforce | 62957dbc920d9909a22d0677d047e31173f511b4 | [
"MIT"
] | 11 | 2019-07-25T12:09:03.000Z | 2020-02-13T18:23:14.000Z | tests/test_memory.py | aserhiychuk/pyreinforce | 62957dbc920d9909a22d0677d047e31173f511b4 | [
"MIT"
] | null | null | null | tests/test_memory.py | aserhiychuk/pyreinforce | 62957dbc920d9909a22d0677d047e31173f511b4 | [
"MIT"
] | null | null | null | import unittest
import random
import numpy as np
from pyreinforce.memory import Memory, EpisodicMemory
_seed = 123
_random = random.Random()
_random.seed(_seed)
if __name__ == '__main__':
unittest.main()
| 31.064777 | 91 | 0.592858 | import unittest
import random
import numpy as np
from pyreinforce.memory import Memory, EpisodicMemory
_seed = 123
_random = random.Random()
_random.seed(_seed)
def _random_experience(s=None, a=None, r=None, s1=None, is_terminal=None):
if s is None:
s = _random.random()
if a is None:
a = ... | 6,946 | 38 | 472 |
2cad7b548c1d1841de3c4cc718832b4dbd4cb823 | 6,344 | py | Python | scrapers/inform.py | mcarans/hdx-scraper-covid-viz | 8ae4617717a4265af996621e1b01b1845d3044bc | [
"MIT"
] | null | null | null | scrapers/inform.py | mcarans/hdx-scraper-covid-viz | 8ae4617717a4265af996621e1b01b1845d3044bc | [
"MIT"
] | null | null | null | scrapers/inform.py | mcarans/hdx-scraper-covid-viz | 8ae4617717a4265af996621e1b01b1845d3044bc | [
"MIT"
] | null | null | null | import logging
from dateutil.relativedelta import relativedelta
from hdx.scraper.base_scraper import BaseScraper
from hdx.utilities.dateparse import default_date, parse_date
from hdx.utilities.dictandlist import dict_of_lists_add
logger = logging.getLogger(__name__)
| 39.65 | 83 | 0.54319 | import logging
from dateutil.relativedelta import relativedelta
from hdx.scraper.base_scraper import BaseScraper
from hdx.utilities.dateparse import default_date, parse_date
from hdx.utilities.dictandlist import dict_of_lists_add
logger = logging.getLogger(__name__)
class Inform(BaseScraper):
def __init__(self,... | 5,912 | 5 | 157 |
d404398fb042cd434b0f9843f79b98159c31386b | 115 | py | Python | server/apps/bot/dispatcher/callbacks/__init__.py | LowerDeez/movies_finder | 3763bfe4c0d1cfe36e081c45a9cc9cdaa85e0ee4 | [
"MIT"
] | null | null | null | server/apps/bot/dispatcher/callbacks/__init__.py | LowerDeez/movies_finder | 3763bfe4c0d1cfe36e081c45a9cc9cdaa85e0ee4 | [
"MIT"
] | null | null | null | server/apps/bot/dispatcher/callbacks/__init__.py | LowerDeez/movies_finder | 3763bfe4c0d1cfe36e081c45a9cc9cdaa85e0ee4 | [
"MIT"
] | null | null | null | from .discover_movies import *
from .entry_points import *
from .list_movies import *
from .search_movies import *
| 23 | 30 | 0.791304 | from .discover_movies import *
from .entry_points import *
from .list_movies import *
from .search_movies import *
| 0 | 0 | 0 |
38ebd9c49496629e71b003c8cb880d21e14b1907 | 2,008 | py | Python | examples/transformPDF_Imagenet.py | trikpachu/DDE | 603369dd65861981424e55585e3aeae538f1d104 | [
"MIT"
] | 2 | 2021-07-08T09:30:31.000Z | 2021-11-16T13:26:05.000Z | examples/transformPDF_Imagenet.py | trikpachu/DDE | 603369dd65861981424e55585e3aeae538f1d104 | [
"MIT"
] | null | null | null | examples/transformPDF_Imagenet.py | trikpachu/DDE | 603369dd65861981424e55585e3aeae538f1d104 | [
"MIT"
] | null | null | null | '''
Generates and samples the PDF from the Imagenet dataset. Data is expected to be imagefiles in 8bit png format.
The probability values at arbitrary points are interpolated from the surrounding values by linear interpolation.
Dumps a list per sample in a directory, containing [samples] or [samples, grid_samples], w... | 55.777778 | 242 | 0.76992 | '''
Generates and samples the PDF from the Imagenet dataset. Data is expected to be imagefiles in 8bit png format.
The probability values at arbitrary points are interpolated from the surrounding values by linear interpolation.
Dumps a list per sample in a directory, containing [samples] or [samples, grid_samples], w... | 171 | 0 | 23 |
30ae1739e8c51c06b969dac12f01448a5c61f84e | 4,915 | py | Python | src/leftTicket/LeftTicketQuery.py | SeaYellow/12306_basic | 2a25c90cdec6f7877f0364fb8f0126b9fbe05358 | [
"Apache-2.0"
] | null | null | null | src/leftTicket/LeftTicketQuery.py | SeaYellow/12306_basic | 2a25c90cdec6f7877f0364fb8f0126b9fbe05358 | [
"Apache-2.0"
] | null | null | null | src/leftTicket/LeftTicketQuery.py | SeaYellow/12306_basic | 2a25c90cdec6f7877f0364fb8f0126b9fbe05358 | [
"Apache-2.0"
] | null | null | null | import re
import requests
import json
if __name__ == '__main__':
trainDate = "2018-05-21"
fromStation = "西安"
toStation = "成都"
ltq = LeftTicketQuery()
staticonNameCode = ltq.queryStation()
stationCodeName = dict((v, k) for k, v in staticonNameCode.items())
leftTicketUrl = ltq.makeLeftTicke... | 48.663366 | 221 | 0.544659 | import re
import requests
import json
class LeftTicketQuery:
def queryStation(self):
stationUrl = "https://kyfw.12306.cn/otn/resources/js/framework/station_name.js?station_version=1.8971"
requests.packages.urllib3.disable_warnings()
response = requests.get(stationUrl, verify=False)
... | 3,672 | 1 | 103 |
2ee0514dc3998889165a96a91604287c35963751 | 5,819 | py | Python | deity.py | harlowja/Quietus | 786f07271a70bbdaa1508750af1c43444bd9826d | [
"Apache-2.0"
] | null | null | null | deity.py | harlowja/Quietus | 786f07271a70bbdaa1508750af1c43444bd9826d | [
"Apache-2.0"
] | null | null | null | deity.py | harlowja/Quietus | 786f07271a70bbdaa1508750af1c43444bd9826d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... | 33.635838 | 79 | 0.533941 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... | 4,603 | 202 | 69 |
df151440c4b3219f5b8974dd48f9f511b4d6e7b7 | 192 | py | Python | portfolio_project/views.py | madelinepet/portfolio | c9b1b6318a4ff0018cb55d722d4705057acfe1ee | [
"MIT"
] | null | null | null | portfolio_project/views.py | madelinepet/portfolio | c9b1b6318a4ff0018cb55d722d4705057acfe1ee | [
"MIT"
] | null | null | null | portfolio_project/views.py | madelinepet/portfolio | c9b1b6318a4ff0018cb55d722d4705057acfe1ee | [
"MIT"
] | null | null | null | from django.shortcuts import render
| 19.2 | 51 | 0.755208 | from django.shortcuts import render
def home_view(request):
return render(request, 'generic/home.html')
def projects_view(request):
return render(request, 'generic/projects.html')
| 108 | 0 | 46 |
973ff234f4f36e7ea57f61cee27c31e5ff172ace | 764 | py | Python | main.py | Alpxnz/ytdownloader | 4ea80e3055be763faa8b2a1284268a8393f48710 | [
"MIT"
] | 3 | 2020-08-27T03:30:07.000Z | 2020-08-27T06:24:14.000Z | main.py | Alpxnz/ytdownloader | 4ea80e3055be763faa8b2a1284268a8393f48710 | [
"MIT"
] | null | null | null | main.py | Alpxnz/ytdownloader | 4ea80e3055be763faa8b2a1284268a8393f48710 | [
"MIT"
] | null | null | null | import youtube_dl
import os
import sys
directory = (os.getcwd() + '/Downloads')
ydl_opts = {}
try:
main()
except IndexError:
print('Não foi detectado nenhum URL!')
| 26.344828 | 106 | 0.585079 | import youtube_dl
import os
import sys
directory = (os.getcwd() + '/Downloads')
ydl_opts = {}
def main():
arg = sys.argv[1]
try:
os.chdir(directory)
print(f'Foi detectado que a pasta {directory} já existe e o arquivo está sendo baixado:')
with youtube_dl.YoutubeDL(yd... | 554 | 0 | 25 |
d2a75bd711ad427623bb91d72c41b15b9b44a5b6 | 4,371 | py | Python | dialogflow/cloud-client/context_management.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 3 | 2021-01-24T23:42:57.000Z | 2021-02-17T12:02:12.000Z | dialogflow/cloud-client/context_management.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 320 | 2020-11-08T21:02:43.000Z | 2022-02-10T10:43:29.000Z | dialogflow/cloud-client/context_management.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 3 | 2019-02-11T16:16:11.000Z | 2019-04-19T21:34:37.000Z | #!/usr/bin/env python
# Copyright 2017 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... | 32.619403 | 74 | 0.708991 | #!/usr/bin/env python
# Copyright 2017 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... | 1,428 | 0 | 66 |
35f231c3173c93c7b3b4e850edc1214c5b072cb9 | 851 | py | Python | transport_data_analis/data.py | levkovalenko/pm_task_2018 | 8bffa5327dc59b1640d922c4faa7381eb4255ead | [
"Apache-2.0"
] | null | null | null | transport_data_analis/data.py | levkovalenko/pm_task_2018 | 8bffa5327dc59b1640d922c4faa7381eb4255ead | [
"Apache-2.0"
] | null | null | null | transport_data_analis/data.py | levkovalenko/pm_task_2018 | 8bffa5327dc59b1640d922c4faa7381eb4255ead | [
"Apache-2.0"
] | null | null | null | from math import log
| 30.392857 | 112 | 0.60282 | from math import log
class data():
def __init__(self, logn, lat, request_ts, trans_ts, label, spec=False):
self.log = float(logn)
self.lat = float(lat)
if spec:
self.request_ts = log(float(request_ts)-1510000000)
self.trans_ts = log(float(trans_ts)-1510000000)
... | 679 | -8 | 157 |
80d6de7b360aad2cea38b2d9c76d6376c1a7715f | 586 | py | Python | AutotestWebD/apps/demo/services/UserService.py | yangjourney/sosotest | 2e88099a829749910ca325253c9b1a2e368d21a0 | [
"MIT"
] | 422 | 2019-08-18T05:04:20.000Z | 2022-03-31T06:49:19.000Z | AutotestWebD/apps/demo/services/UserService.py | LinSongJian1985/sosotest | 091863dee531b5726650bb63efd6f169267cbeb4 | [
"MIT"
] | 10 | 2019-10-24T09:55:38.000Z | 2021-09-29T17:28:43.000Z | AutotestWebD/apps/demo/services/UserService.py | LinSongJian1985/sosotest | 091863dee531b5726650bb63efd6f169267cbeb4 | [
"MIT"
] | 202 | 2019-08-18T05:04:27.000Z | 2022-03-30T05:57:18.000Z | import apps.common.func.InitDjango
from all_models.models import TbUser
if __name__ == "__main__":
print(UserService.getUsers()[0].loginname)
print(UserService.getUserByLoginname(UserService.getUsers()[0].loginname)) | 29.3 | 78 | 0.71843 | import apps.common.func.InitDjango
from all_models.models import TbUser
class UserService(object):
@staticmethod
def getUsers():
return TbUser.objects.all()
@staticmethod
def getUserByLoginname(loginname):
return TbUser.objects.filter(loginname=loginname)
@staticmethod
def upd... | 199 | 140 | 22 |
3000e6f01e03417bf2a6b41cbda92068a927f938 | 460 | py | Python | tests/test_plotting.py | zdk123/ms2deepscore | 965e6806d33454f8537376dad790c0e708fca51d | [
"Apache-2.0"
] | 17 | 2021-01-30T22:40:07.000Z | 2022-03-28T10:38:04.000Z | tests/test_plotting.py | zdk123/ms2deepscore | 965e6806d33454f8537376dad790c0e708fca51d | [
"Apache-2.0"
] | 90 | 2020-11-24T13:27:47.000Z | 2022-03-31T08:00:44.000Z | tests/test_plotting.py | zdk123/ms2deepscore | 965e6806d33454f8537376dad790c0e708fca51d | [
"Apache-2.0"
] | 9 | 2021-05-09T01:18:39.000Z | 2022-02-24T22:28:28.000Z | import numpy as np
from ms2deepscore.plotting import create_confusion_matrix_plot
| 38.333333 | 75 | 0.76087 | import numpy as np
from ms2deepscore.plotting import create_confusion_matrix_plot
def test_create_confusion_matrix_plot():
reference_scores = np.random.random((100, 100))
comparison_scores = np.random.random((100, 100))
fig = create_confusion_matrix_plot(reference_scores, comparison_scores)
assert fig... | 354 | 0 | 23 |
4a9f63094fa0d5081a8a7c18572a2425319d1200 | 3,315 | py | Python | helpdesk/providers/models.py | zeenfaizpy/helpdesk | 38a2fc1135c0d1a37ed2f6635db2928a731bcc83 | [
"MIT"
] | 1 | 2015-04-28T16:42:47.000Z | 2015-04-28T16:42:47.000Z | helpdesk/providers/models.py | zeenfaizpy/helpdesk | 38a2fc1135c0d1a37ed2f6635db2928a731bcc83 | [
"MIT"
] | null | null | null | helpdesk/providers/models.py | zeenfaizpy/helpdesk | 38a2fc1135c0d1a37ed2f6635db2928a731bcc83 | [
"MIT"
] | null | null | null | from django.db import models
from django.conf import settings
from django.core.validators import RegexValidator
from model_utils import Choices
from helpers.models import TimestampedModel
class ServiceKeyword(TimestampedModel):
"""
Model to keep track of service keywords.
"""
name = models.CharField... | 33.15 | 81 | 0.531825 | from django.db import models
from django.conf import settings
from django.core.validators import RegexValidator
from model_utils import Choices
from helpers.models import TimestampedModel
class ServiceKeyword(TimestampedModel):
"""
Model to keep track of service keywords.
"""
name = models.CharField... | 0 | 0 | 0 |
45387763832e9d086d8c80b77f40ec6b157dc300 | 310 | py | Python | flowjs/tasks.py | nelsonmonteiro/django-flowjs | 7f2c88df12a9e8f19bb7a3fa21a628d07849d61e | [
"MIT"
] | 16 | 2015-01-02T16:41:17.000Z | 2022-03-09T00:15:56.000Z | flowjs/tasks.py | nelsonmonteiro/django-flowjs | 7f2c88df12a9e8f19bb7a3fa21a628d07849d61e | [
"MIT"
] | 2 | 2015-10-03T18:00:20.000Z | 2016-08-02T07:07:21.000Z | flowjs/tasks.py | nelsonmonteiro/django-flowjs | 7f2c88df12a9e8f19bb7a3fa21a628d07849d61e | [
"MIT"
] | 18 | 2015-01-07T14:46:19.000Z | 2018-07-22T22:56:05.000Z | from __future__ import absolute_import
from celery import shared_task
@shared_task
@shared_task
| 20.666667 | 38 | 0.780645 | from __future__ import absolute_import
from celery import shared_task
@shared_task
def join_chunks_task(flow_file):
print('starting join task'),
return flow_file._join_chunks()
@shared_task
def delete_chunks_task(flow_file):
print('starting delete task'),
return flow_file._delete_chunks()
| 166 | 0 | 44 |
a395fbf8aca6ace4b96e480c89ba346f108cc53d | 1,499 | py | Python | server/extensions.py | shepilov-vladislav/Flask-Restless-Restangular-with-JWT-auth | 1559cefef0dfb376e4579b1beea6a47f55081eb3 | [
"MIT"
] | 34 | 2015-11-13T07:52:50.000Z | 2017-09-02T07:38:35.000Z | server/extensions.py | shepilov-vladislav/Flask-Restless-Restangular-with-JWT-auth | 1559cefef0dfb376e4579b1beea6a47f55081eb3 | [
"MIT"
] | 4 | 2015-11-11T07:14:51.000Z | 2016-01-21T12:04:28.000Z | server/extensions.py | shepilov-vladislav/Flask-Restless-Restangular-with-JWT-auth | 1559cefef0dfb376e4579b1beea6a47f55081eb3 | [
"MIT"
] | 7 | 2016-01-21T03:59:20.000Z | 2019-06-12T13:42:58.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from flask.ext.mail import Mail
mail = Mail()
from flask.ext.cors import CORS
cors = CORS()
from flask.ext.security import Security, SQLAlchemyUserDatastore
from .models import User, Role, db
datastore = SQLAlchemyUserDatastore(db, User, Role)
securi... | 25.40678 | 90 | 0.731821 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
class CheckError(ValueError):
pass
from flask.ext.mail import Mail
mail = Mail()
from flask.ext.cors import CORS
cors = CORS()
from flask.ext.security import Security, SQLAlchemyUserDatastore
from .models import User, Role, db
datastore = SQLAlc... | 790 | 17 | 111 |
b18449d77673343fa8fea3496c2943cef9aebaf3 | 5,753 | py | Python | importers/wikidata.py | trompamusic/ce-import-muziekweb | 3635c735e1a632fdefbb75b249f2f8dc0bb66b85 | [
"Apache-2.0"
] | null | null | null | importers/wikidata.py | trompamusic/ce-import-muziekweb | 3635c735e1a632fdefbb75b249f2f8dc0bb66b85 | [
"Apache-2.0"
] | 2 | 2021-01-26T10:20:50.000Z | 2021-03-05T11:14:31.000Z | importers/wikidata.py | trompamusic/ce-import-muziekweb | 3635c735e1a632fdefbb75b249f2f8dc0bb66b85 | [
"Apache-2.0"
] | null | null | null | from wikidata.client import Client
from urllib.parse import urlparse
import wikipedia
import requests
from requests.adapters import HTTPAdapter
from .ceimport import cache
s = requests.Session()
adapter = HTTPAdapter(max_retries=5, pool_connections=100, pool_maxsize=100)
s.mount("https://", adapter)
@cache.dict()... | 30.120419 | 122 | 0.654094 | from wikidata.client import Client
from urllib.parse import urlparse
import wikipedia
import requests
from requests.adapters import HTTPAdapter
from .ceimport import cache
s = requests.Session()
adapter = HTTPAdapter(max_retries=5, pool_connections=100, pool_maxsize=100)
s.mount("https://", adapter)
class Wikipedi... | 2,293 | 24 | 206 |
457032f405cc925e20d15484b9fc1988c83a9219 | 7,043 | py | Python | vika/services/svc_note.py | jtprogru/vika | 6bf59dbad169cdb3a10f354e6df0c99cb5d98988 | [
"WTFPL"
] | null | null | null | vika/services/svc_note.py | jtprogru/vika | 6bf59dbad169cdb3a10f354e6df0c99cb5d98988 | [
"WTFPL"
] | null | null | null | vika/services/svc_note.py | jtprogru/vika | 6bf59dbad169cdb3a10f354e6df0c99cb5d98988 | [
"WTFPL"
] | null | null | null | import json
import os.path
from datetime import date
from rich import box
from rich.console import Console
from rich.table import Table
from vika.config import NOTE_DEFAULT_PATH
| 42.173653 | 120 | 0.524634 | import json
import os.path
from datetime import date
from rich import box
from rich.console import Console
from rich.table import Table
from vika.config import NOTE_DEFAULT_PATH
class Note:
def __init__(self):
# Console API from rich module
self.console = Console()
# Highlight color 1 for... | 6,689 | -10 | 184 |
9a16bea049365af002632dcc4785b6f2d6ac6b83 | 705 | py | Python | post-receive.py | hendiko/git-ring | 5d4bcb47821e157f84d8644cea2bc5cd896d02d1 | [
"MIT"
] | 1 | 2015-05-25T01:25:49.000Z | 2015-05-25T01:25:49.000Z | post-receive.py | hendiko/git-ring | 5d4bcb47821e157f84d8644cea2bc5cd896d02d1 | [
"MIT"
] | null | null | null | post-receive.py | hendiko/git-ring | 5d4bcb47821e157f84d8644cea2bc5cd896d02d1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf8 -*-
# Created by Xavier Yin on 2015/2/28
from modules.conf import Config
from modules import run_as_post_receive
import os
import sys
CURRENT_FILE_PATH = os.path.abspath(__file__)
CURRENT_WORK_DIR = os.path.dirname(CURRENT_FILE_PATH)
GIT_DIR = os.path.dirname(CURRENT_WORK_DIR... | 27.115385 | 62 | 0.716312 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# Created by Xavier Yin on 2015/2/28
from modules.conf import Config
from modules import run_as_post_receive
import os
import sys
CURRENT_FILE_PATH = os.path.abspath(__file__)
CURRENT_WORK_DIR = os.path.dirname(CURRENT_FILE_PATH)
GIT_DIR = os.path.dirname(CURRENT_WORK_DIR... | 0 | 0 | 0 |
becff4b7e0d62c4248ab7817a89e6a89f43bcb24 | 1,457 | py | Python | coordinated/rnn.py | phueb/Coordinated | 623b5e416faceb04b870d0adc5d82023cad89df9 | [
"MIT"
] | null | null | null | coordinated/rnn.py | phueb/Coordinated | 623b5e416faceb04b870d0adc5d82023cad89df9 | [
"MIT"
] | null | null | null | coordinated/rnn.py | phueb/Coordinated | 623b5e416faceb04b870d0adc5d82023cad89df9 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
from coordinated import configs
| 33.883721 | 109 | 0.578586 | import torch
import torch.nn as nn
import numpy as np
from coordinated import configs
class RNN(nn.Module):
def __init__(self, flavor, input_size):
super().__init__()
self.hidden_size = 2
self.input_size = input_size
# define just rnn without output layer
self.embed = tor... | 1,294 | 0 | 76 |
777407644678e27922087d95adb747afa8731523 | 2,180 | py | Python | PyOpenGL-3.0.2/OpenGL/raw/GL/EXT/histogram.py | frederica07/Dragon_Programming_Process | c0dff2e20c1be6db5adc6f9977efae8f7f888ef5 | [
"BSD-2-Clause"
] | null | null | null | PyOpenGL-3.0.2/OpenGL/raw/GL/EXT/histogram.py | frederica07/Dragon_Programming_Process | c0dff2e20c1be6db5adc6f9977efae8f7f888ef5 | [
"BSD-2-Clause"
] | null | null | null | PyOpenGL-3.0.2/OpenGL/raw/GL/EXT/histogram.py | frederica07/Dragon_Programming_Process | c0dff2e20c1be6db5adc6f9977efae8f7f888ef5 | [
"BSD-2-Clause"
] | null | null | null | '''Autogenerated by get_gl_extensions script, do not edit!'''
from OpenGL import platform as _p, constants as _cs, arrays
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_EXT_histogram'
_p.unpack_constants( """GL_HISTOGRAM_EXT 0x8024
GL_PROXY_HISTOGRAM_EXT 0x8025
GL_HISTOGRAM_WIDTH_EXT 0x8026
GL_HISTOGRAM... | 36.333333 | 78 | 0.819266 | '''Autogenerated by get_gl_extensions script, do not edit!'''
from OpenGL import platform as _p, constants as _cs, arrays
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_EXT_histogram'
def _f( function ):
return _p.createFunction( function,_p.GL,'GL_EXT_histogram',False)
_p.unpack_constants( """GL_HI... | 394 | 0 | 242 |
534a3baa7e4ce7c1035274b38c8f580ee9d1c8e2 | 8,217 | py | Python | lino_xl/lib/uploads/models.py | khchine5/xl | b1634937a9ce87af1e948eb712b934b11f221d9d | [
"BSD-2-Clause"
] | 1 | 2018-01-12T14:09:48.000Z | 2018-01-12T14:09:48.000Z | lino_xl/lib/uploads/models.py | khchine5/xl | b1634937a9ce87af1e948eb712b934b11f221d9d | [
"BSD-2-Clause"
] | 1 | 2019-09-10T05:03:47.000Z | 2019-09-10T05:03:47.000Z | lino_xl/lib/uploads/models.py | khchine5/xl | b1634937a9ce87af1e948eb712b934b11f221d9d | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
# Copyright 2014-2018 Luc Saffre
# License: BSD (see file COPYING for details)
"""
Database models for this plugin.
"""
from __future__ import unicode_literals
from builtins import str
from django.utils.translation import ugettext_lazy as _
from lino.api import dd
from lino.modlib.upload... | 28.630662 | 86 | 0.651576 | # -*- coding: UTF-8 -*-
# Copyright 2014-2018 Luc Saffre
# License: BSD (see file COPYING for details)
"""
Database models for this plugin.
"""
from __future__ import unicode_literals
from builtins import str
from django.utils.translation import ugettext_lazy as _
from lino.api import dd
from lino.modlib.upload... | 2,097 | 1,848 | 270 |
87a392d1addd40507180fe095c4ce9d432f2c621 | 8,575 | py | Python | api/server/swagger_server/data_access/minio_client.py | Tomcli/mlx | 5da8a9f25efd242aed5590d257f322908e2f85cb | [
"Apache-2.0"
] | null | null | null | api/server/swagger_server/data_access/minio_client.py | Tomcli/mlx | 5da8a9f25efd242aed5590d257f322908e2f85cb | [
"Apache-2.0"
] | null | null | null | api/server/swagger_server/data_access/minio_client.py | Tomcli/mlx | 5da8a9f25efd242aed5590d257f322908e2f85cb | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 32.236842 | 116 | 0.676968 | # Copyright 2021 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 6,750 | 0 | 299 |
9edd6bdca39fbf7054794863fb65cbb9d3a9690e | 3,777 | py | Python | exp/base.py | yifeng-lee/ctftools | bdc16188336b02644c06e8122fc2a5df4a0c795f | [
"MIT"
] | 2 | 2020-09-04T08:14:24.000Z | 2020-10-21T15:50:47.000Z | exp/base.py | yifeng-lee/ctftools | bdc16188336b02644c06e8122fc2a5df4a0c795f | [
"MIT"
] | null | null | null | exp/base.py | yifeng-lee/ctftools | bdc16188336b02644c06e8122fc2a5df4a0c795f | [
"MIT"
] | null | null | null | import base64
import base58
import base91
b16table = '0123456789ABCDEF'
b32table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'
b58table = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
b64table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
b85table = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZab... | 21.338983 | 104 | 0.627482 | import base64
import base58
import base91
b16table = '0123456789ABCDEF'
b32table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'
b58table = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
b64table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
b85table = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZab... | 3,016 | 0 | 276 |
d5da00dde98161416f332b31943642ff37f0983a | 40,810 | py | Python | src/python/tests/appengine/handlers/cron/manage_vms_test.py | nopsledder/clusterfuzz | 529963438d956e46ddddfb62debc6ed808be0083 | [
"Apache-2.0"
] | null | null | null | src/python/tests/appengine/handlers/cron/manage_vms_test.py | nopsledder/clusterfuzz | 529963438d956e46ddddfb62debc6ed808be0083 | [
"Apache-2.0"
] | 20 | 2020-07-28T19:01:56.000Z | 2021-03-23T01:04:42.000Z | src/python/tests/appengine/handlers/cron/manage_vms_test.py | nopsledder/clusterfuzz | 529963438d956e46ddddfb62debc6ed808be0083 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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, ... | 35.486957 | 80 | 0.56099 | # Copyright 2019 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, ... | 10,823 | 0 | 150 |
eb812cedd3d2cf92428bf06ee48e3365296b8ae1 | 3,028 | py | Python | wotapy_old/util/terminal.py | VeloceWattwing/Will-of-the-Alpha-Python | 1f94094646cd190c57b25bb58b2262cfa0657506 | [
"Apache-2.0"
] | null | null | null | wotapy_old/util/terminal.py | VeloceWattwing/Will-of-the-Alpha-Python | 1f94094646cd190c57b25bb58b2262cfa0657506 | [
"Apache-2.0"
] | null | null | null | wotapy_old/util/terminal.py | VeloceWattwing/Will-of-the-Alpha-Python | 1f94094646cd190c57b25bb58b2262cfa0657506 | [
"Apache-2.0"
] | null | null | null | # https://github.com/jeongukjae/terminal-palette/blob/master/README.md
from terminal_palette import Palette
pal = Palette()
class Symbol:
"""
# Symbol
An object that encapsulates properties of a symbol with color and decorator.
"""
def get(self, char=None, fg=None, bg=None, *decos):
"""... | 32.55914 | 125 | 0.558124 | # https://github.com/jeongukjae/terminal-palette/blob/master/README.md
from terminal_palette import Palette
pal = Palette()
class Symbol:
"""
# Symbol
An object that encapsulates properties of a symbol with color and decorator.
"""
def __init__(self, char, fg='default', bg='default', *decos):
... | 134 | 0 | 27 |
eb371c86768f5cecdb7af971b8d6acba4aa62d38 | 7,461 | py | Python | im/we_chat.py | journeyOS/global_scripts | 583dbc1876948b505321b07e7fcabef07ddb6c61 | [
"Apache-2.0"
] | null | null | null | im/we_chat.py | journeyOS/global_scripts | 583dbc1876948b505321b07e7fcabef07ddb6c61 | [
"Apache-2.0"
] | null | null | null | im/we_chat.py | journeyOS/global_scripts | 583dbc1876948b505321b07e7fcabef07ddb6c61 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2020 anqi.huang@outlook.com
#
# 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.apach... | 33.013274 | 99 | 0.595363 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2020 anqi.huang@outlook.com
#
# 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.apach... | 5,982 | -3 | 508 |
3fe9ec84a073a56ba62c8f25638e6d889122d258 | 22,538 | py | Python | test/test_AutoFitTableAppender.py | dolphindb/api_python3 | caf1c6a38fe3dc0febf33ca5f299c2cdae0f139d | [
"Apache-2.0"
] | 26 | 2020-08-09T06:02:41.000Z | 2022-03-22T10:21:27.000Z | test/test_AutoFitTableAppender.py | dolphindb/api_python3 | caf1c6a38fe3dc0febf33ca5f299c2cdae0f139d | [
"Apache-2.0"
] | 8 | 2020-09-15T03:26:34.000Z | 2022-03-23T10:44:33.000Z | test/test_AutoFitTableAppender.py | dolphindb/api_python3 | caf1c6a38fe3dc0febf33ca5f299c2cdae0f139d | [
"Apache-2.0"
] | 5 | 2020-09-22T16:15:50.000Z | 2021-07-28T05:48:27.000Z |
import unittest
import dolphindb as ddb
import numpy as np
import pandas as pd
from setup import HOST, PORT, WORK_DIR, DATA_DIR
from numpy.testing import assert_array_equal, assert_array_almost_equal
from pandas.testing import assert_series_equal
from pandas.testing import assert_frame_equal
if __name__... | 58.845953 | 342 | 0.598101 |
import unittest
import dolphindb as ddb
import numpy as np
import pandas as pd
from setup import HOST, PORT, WORK_DIR, DATA_DIR
from numpy.testing import assert_array_equal, assert_array_almost_equal
from pandas.testing import assert_series_equal
from pandas.testing import assert_frame_equal
class TestAutoF... | 21,484 | 674 | 24 |
f4e5be2759113a035b590f3b86dadf0f5734a139 | 1,942 | py | Python | Repository/json_repository.py | VargaIonut23/restaurant | 3f991f30b03921481142187ef33f81d1dc4fe2ad | [
"MIT"
] | null | null | null | Repository/json_repository.py | VargaIonut23/restaurant | 3f991f30b03921481142187ef33f81d1dc4fe2ad | [
"MIT"
] | null | null | null | Repository/json_repository.py | VargaIonut23/restaurant | 3f991f30b03921481142187ef33f81d1dc4fe2ad | [
"MIT"
] | null | null | null | import jsonpickle
from typing import Dict, Union, Optional, List, Type
from Domain.entity import Entity
from Repository.repository import Repository
| 28.985075 | 68 | 0.589083 | import jsonpickle
from typing import Dict, Union, Optional, List, Type
from Domain.entity import Entity
from Repository.repository import Repository
class JsonRepository(Repository):
def __init__(self, filename):
self.filename = filename
def __read_file(self):
try:
with open(sel... | 1,567 | 12 | 212 |
8d55fa2258b13c4e2ca9397666cf431f6627679b | 2,474 | py | Python | qtvscodestyle/examples/widget_gallery/__main__.py | Greatness7/QtVSCodeStyle | 2654ca967c7ae5db3ce3fb46657ace9f1104f6b9 | [
"MIT"
] | 8 | 2021-10-04T00:21:25.000Z | 2022-03-14T19:57:03.000Z | qtvscodestyle/examples/widget_gallery/__main__.py | Greatness7/QtVSCodeStyle | 2654ca967c7ae5db3ce3fb46657ace9f1104f6b9 | [
"MIT"
] | null | null | null | qtvscodestyle/examples/widget_gallery/__main__.py | Greatness7/QtVSCodeStyle | 2654ca967c7ae5db3ce3fb46657ace9f1104f6b9 | [
"MIT"
] | 3 | 2021-11-15T23:58:33.000Z | 2022-02-01T18:50:01.000Z | import sys
import qtvscodestyle as qtvsc
from qtvscodestyle.examples.widget_gallery.ui.main_ui import UI
from qtvscodestyle.qtpy.QtCore import Qt, Slot
from qtvscodestyle.qtpy.QtWidgets import QApplication, QColorDialog, QFileDialog, QMainWindow
if __name__ == "__main__":
app = QApplication(sys.argv)
# Fix ... | 39.903226 | 114 | 0.699272 | import sys
import qtvscodestyle as qtvsc
from qtvscodestyle.examples.widget_gallery.ui.main_ui import UI
from qtvscodestyle.qtpy.QtCore import Qt, Slot
from qtvscodestyle.qtpy.QtWidgets import QApplication, QColorDialog, QFileDialog, QMainWindow
class WidgetGallery(QMainWindow):
def __init__(self) -> None:
... | 1,526 | 182 | 23 |
758787683057bb9bb9cee1f533b04ef2a1eeb485 | 5,120 | py | Python | German Gritsay/GameOfLife.py | droidroot1995/DAFE_Python_914 | 0de65a84ab7f4c8f24b83a5747f71f52d57ecc20 | [
"Unlicense"
] | null | null | null | German Gritsay/GameOfLife.py | droidroot1995/DAFE_Python_914 | 0de65a84ab7f4c8f24b83a5747f71f52d57ecc20 | [
"Unlicense"
] | 7 | 2021-05-08T22:02:59.000Z | 2021-05-13T22:44:27.000Z | German Gritsay/GameOfLife.py | droidroot1995/DAFE_Python_914 | 0de65a84ab7f4c8f24b83a5747f71f52d57ecc20 | [
"Unlicense"
] | 13 | 2021-02-13T07:32:10.000Z | 2021-05-15T09:09:08.000Z | import sys
import numpy as np
from PyQt5.QtWidgets import QWidget, QApplication, QPushButton, QColorDialog, QInputDialog, QMenu
from PyQt5.QtGui import QPainter, QColor, QPen, QBrush
from PyQt5.QtCore import Qt, QTimer
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = GameOfLife(70, 40, 15)
... | 30.843373 | 122 | 0.544922 | import sys
import numpy as np
from PyQt5.QtWidgets import QWidget, QApplication, QPushButton, QColorDialog, QInputDialog, QMenu
from PyQt5.QtGui import QPainter, QColor, QPen, QBrush
from PyQt5.QtCore import Qt, QTimer
class GameOfLife(QWidget):
def __init__(self, width=50, height=50, grid_step=10):
supe... | 4,398 | 5 | 373 |
27f3203f678e27b24c96e307afab05603ba86c48 | 3,313 | py | Python | src/scs_host/sys/nmcli.py | south-coast-science/scs_host_rpi | a02afde3fd2e1f2b8c6dc08beef8c74039108a64 | [
"MIT"
] | null | null | null | src/scs_host/sys/nmcli.py | south-coast-science/scs_host_rpi | a02afde3fd2e1f2b8c6dc08beef8c74039108a64 | [
"MIT"
] | 1 | 2020-07-13T14:54:08.000Z | 2020-11-16T10:11:04.000Z | src/scs_host/sys/nmcli.py | south-coast-science/scs_host_rpi | a02afde3fd2e1f2b8c6dc08beef8c74039108a64 | [
"MIT"
] | 2 | 2017-11-07T16:59:02.000Z | 2019-09-29T15:39:37.000Z | """
Created on 17 Jun 2019
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
eth0: connected to Wired connection 1
"TP-LINK USB 10/100/1000 LAN"
ethernet (r8152), 98:DE:D0:04:9B:CC, hw, mtu 1500
ip4 default
inet4 192.168.1.88/24
inet6 fe80::131d:325a:f7bd:e3e/64
wlan0: connected to TP-Li... | 26.717742 | 118 | 0.421974 | """
Created on 17 Jun 2019
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
eth0: connected to Wired connection 1
"TP-LINK USB 10/100/1000 LAN"
ethernet (r8152), 98:DE:D0:04:9B:CC, hw, mtu 1500
ip4 default
inet4 192.168.1.88/24
inet6 fe80::131d:325a:f7bd:e3e/64
wlan0: connected to TP-Li... | 1,244 | 0 | 158 |
7de097ffd11765a81ba7bc974ba64fe724e3a01c | 300 | py | Python | ABC/abc151-abc200/abc186/b/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | ABC/abc151-abc200/abc186/b/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | ABC/abc151-abc200/abc186/b/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
if __name__ == "__main__":
main()
| 15.789474 | 59 | 0.536667 | # -*- coding: utf-8 -*-
def main():
import numpy as np
import sys
input = sys.stdin.readline
h, w = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(h)]
a = np.array(a)
print(np.sum(a - np.min(a)))
if __name__ == "__main__":
main()
| 212 | 0 | 23 |
7453762c73d1406b11cdcd56d28535ea4684e96a | 8,432 | py | Python | biorxiv/exploratory_data_analysis/EDA_BioRxiv.py | danich1/annorxiver | 8fab17e1c3ebce7b9e3fc54ea64585b37d9b3825 | [
"CC0-1.0",
"BSD-3-Clause"
] | 4 | 2020-05-13T23:44:57.000Z | 2021-07-04T23:51:46.000Z | biorxiv/exploratory_data_analysis/EDA_BioRxiv.py | danich1/annorxiver | 8fab17e1c3ebce7b9e3fc54ea64585b37d9b3825 | [
"CC0-1.0",
"BSD-3-Clause"
] | 23 | 2020-03-23T18:35:25.000Z | 2021-09-21T21:14:20.000Z | biorxiv/exploratory_data_analysis/EDA_BioRxiv.py | danich1/annorxiver | 8fab17e1c3ebce7b9e3fc54ea64585b37d9b3825 | [
"CC0-1.0",
"BSD-3-Clause"
] | 3 | 2020-01-31T18:27:55.000Z | 2020-05-29T20:26:22.000Z | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.9.1+dev
# kernelspec:
# display_name: Python [conda env:annorxiver]
# language: python
# nam... | 31.699248 | 143 | 0.621798 | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.9.1+dev
# kernelspec:
# display_name: Python [conda env:annorxiver]
# language: python
# nam... | 1,115 | 0 | 23 |
6cd6e802a9b546a028d4eef5cca7c2304a7f8f8b | 109 | py | Python | BlogManage/urls.py | ahriknow/ahriknow | 817b5670c964e01ffe19ed182ce0a7b42e17ce09 | [
"MIT"
] | null | null | null | BlogManage/urls.py | ahriknow/ahriknow | 817b5670c964e01ffe19ed182ce0a7b42e17ce09 | [
"MIT"
] | 3 | 2021-03-19T01:28:43.000Z | 2021-04-08T19:57:19.000Z | BlogManage/urls.py | ahriknow/ahriknow | 817b5670c964e01ffe19ed182ce0a7b42e17ce09 | [
"MIT"
] | null | null | null | from django.urls import path, include
urlpatterns = [
path('blog/', include('BlogManage.blog.urls')),
]
| 18.166667 | 51 | 0.688073 | from django.urls import path, include
urlpatterns = [
path('blog/', include('BlogManage.blog.urls')),
]
| 0 | 0 | 0 |
a13408b1c6abc4dec38f5d386628bb4e667406bc | 435 | py | Python | CodeQuest/2021/Prob08.py | wkaisertexas/hs-competitive-programming | ab1778c6348ac45ade172b83b6a8b06717c7071f | [
"MIT"
] | null | null | null | CodeQuest/2021/Prob08.py | wkaisertexas/hs-competitive-programming | ab1778c6348ac45ade172b83b6a8b06717c7071f | [
"MIT"
] | null | null | null | CodeQuest/2021/Prob08.py | wkaisertexas/hs-competitive-programming | ab1778c6348ac45ade172b83b6a8b06717c7071f | [
"MIT"
] | null | null | null | import math
if __name__ == "__main__":
main()
| 19.772727 | 63 | 0.455172 | import math
def main():
n = int(input())
for i in range(n):
line = input()
x, y = int(line.split(" ")[0]), int(line.split(" ")[1])
squared_sum = 0
for j in range(x):
line = input()
for k in line.split(" ")[:]:
squared_sum += abs(int(k)) ... | 359 | 0 | 23 |
8611150a14c8b84b06b464494258744b1209aefb | 5,617 | py | Python | tests/ssg_test_suite/common.py | aghassemlouei/openscap-content | 2de2d291cf2939552da56f1e7991bcd39252d0b3 | [
"BSD-3-Clause"
] | 1 | 2019-01-07T10:43:25.000Z | 2019-01-07T10:43:25.000Z | tests/ssg_test_suite/common.py | aghassemlouei/openscap-content | 2de2d291cf2939552da56f1e7991bcd39252d0b3 | [
"BSD-3-Clause"
] | null | null | null | tests/ssg_test_suite/common.py | aghassemlouei/openscap-content | 2de2d291cf2939552da56f1e7991bcd39252d0b3 | [
"BSD-3-Clause"
] | null | null | null | import logging
import subprocess
from collections import namedtuple
import enum
import functools
from ssg.constants import MULTI_PLATFORM_MAPPING
from ssg.constants import PRODUCT_TO_CPE_MAPPING
from ssg.constants import FULL_NAME_TO_PRODUCT_MAPPING
Scenario_run = namedtuple(
"Scenario_run",
("rule_id", "scrip... | 32.656977 | 90 | 0.651059 | import logging
import subprocess
from collections import namedtuple
import enum
import functools
from ssg.constants import MULTI_PLATFORM_MAPPING
from ssg.constants import PRODUCT_TO_CPE_MAPPING
from ssg.constants import FULL_NAME_TO_PRODUCT_MAPPING
Scenario_run = namedtuple(
"Scenario_run",
("rule_id", "scrip... | 4,298 | 559 | 160 |
cbe0de53c73d80dfbd486500eec876da9eabba8f | 7,005 | py | Python | services/web/project/api_struc/models.py | JoelGotsch/Kantnprojekt_Backend | f681f8527def48f423762363d9b44521b6cbb444 | [
"MIT"
] | null | null | null | services/web/project/api_struc/models.py | JoelGotsch/Kantnprojekt_Backend | f681f8527def48f423762363d9b44521b6cbb444 | [
"MIT"
] | null | null | null | services/web/project/api_struc/models.py | JoelGotsch/Kantnprojekt_Backend | f681f8527def48f423762363d9b44521b6cbb444 | [
"MIT"
] | null | null | null | # from flask import Flask
import random
from marshmallow import Schema, fields, pre_load, validate
from flask_marshmallow import Marshmallow
from datetime import datetime
# from app import db
from flask_sqlalchemy import SQLAlchemy
from ..misc import funcs as funcs
ma = Marshmallow()
db = SQLAlchemy()
# as a ... | 37.063492 | 197 | 0.621699 | # from flask import Flask
import random
from marshmallow import Schema, fields, pre_load, validate
from flask_marshmallow import Marshmallow
from datetime import datetime
# from app import db
from flask_sqlalchemy import SQLAlchemy
from ..misc import funcs as funcs
ma = Marshmallow()
db = SQLAlchemy()
def default_u... | 1,779 | 3,920 | 161 |
f9d2b5f6b32d3eca566e63fa5eadbbfec1046a70 | 3,923 | py | Python | paleomix/common/logging.py | jfy133/paleomix | f7f687f6f69b2faedd247a1d289d28657710a8c2 | [
"MIT"
] | null | null | null | paleomix/common/logging.py | jfy133/paleomix | f7f687f6f69b2faedd247a1d289d28657710a8c2 | [
"MIT"
] | null | null | null | paleomix/common/logging.py | jfy133/paleomix | f7f687f6f69b2faedd247a1d289d28657710a8c2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Copyright (c) 2013 Mikkel Schubert <MikkelSch@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#... | 33.818966 | 79 | 0.682896 | #!/usr/bin/python
#
# Copyright (c) 2013 Mikkel Schubert <MikkelSch@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#... | 1,051 | 753 | 92 |
59df9b1c09dd3004650b0647130eabbfa4244162 | 2,704 | py | Python | drl/agents/architectures/stateless/abstract.py | lucaslingle/pytorch_drl | 6b2c1142a36553ce5dcb0a5768767579676d5791 | [
"MIT"
] | null | null | null | drl/agents/architectures/stateless/abstract.py | lucaslingle/pytorch_drl | 6b2c1142a36553ce5dcb0a5768767579676d5791 | [
"MIT"
] | null | null | null | drl/agents/architectures/stateless/abstract.py | lucaslingle/pytorch_drl | 6b2c1142a36553ce5dcb0a5768767579676d5791 | [
"MIT"
] | null | null | null | from typing import Optional, Callable, Mapping, Any, List
import abc
import torch as tc
from drl.agents.architectures.abstract import Architecture
class StatelessArchitecture(Architecture, metaclass=abc.ABCMeta):
"""
Abstract class for stateless (i.e., memoryless) architectures.
"""
def __init__(
... | 28.765957 | 82 | 0.573225 | from typing import Optional, Callable, Mapping, Any, List
import abc
import torch as tc
from drl.agents.architectures.abstract import Architecture
class StatelessArchitecture(Architecture, metaclass=abc.ABCMeta):
"""
Abstract class for stateless (i.e., memoryless) architectures.
"""
def __init__(
... | 414 | 0 | 79 |
31d5c9ba5b08c65b7c9b5644b63dcdcfad2704cf | 25,456 | py | Python | csiread/core.py | yangece/csiread | ecbe81303530d5c3391a28701224b2e6554a6a4f | [
"MIT"
] | null | null | null | csiread/core.py | yangece/csiread | ecbe81303530d5c3391a28701224b2e6554a6a4f | [
"MIT"
] | null | null | null | csiread/core.py | yangece/csiread | ecbe81303530d5c3391a28701224b2e6554a6a4f | [
"MIT"
] | null | null | null | """A fast channel state information parser for Intel, Atheros and Nexmon."""
from . import _csiread
class Intel(_csiread.Intel):
"""Parse CSI obtained using 'Linux 802.11n CSI Tool'.
Args:
file (str or None): CSI data file. If ``str``, ``read`` and ``readstp``
methods are allowed. If ``N... | 39.223421 | 126 | 0.569885 | """A fast channel state information parser for Intel, Atheros and Nexmon."""
from . import _csiread
class Intel(_csiread.Intel):
"""Parse CSI obtained using 'Linux 802.11n CSI Tool'.
Args:
file (str or None): CSI data file. If ``str``, ``read`` and ``readstp``
methods are allowed. If ``N... | 3,093 | 0 | 241 |
28bb5987e7fcec36f5c70409e6ed522d851e118e | 1,791 | py | Python | tests/test_wavefront_coverage_path_planner.py | duken72/PythonRobotics | 177f04618c4bbba40bea38cd57d642f7ab9e3725 | [
"MIT"
] | 15,431 | 2016-10-07T08:25:10.000Z | 2022-03-31T22:06:02.000Z | tests/test_wavefront_coverage_path_planner.py | duken72/PythonRobotics | 177f04618c4bbba40bea38cd57d642f7ab9e3725 | [
"MIT"
] | 486 | 2017-05-01T00:40:00.000Z | 2022-03-23T06:57:42.000Z | tests/test_wavefront_coverage_path_planner.py | duken72/PythonRobotics | 177f04618c4bbba40bea38cd57d642f7ab9e3725 | [
"MIT"
] | 4,978 | 2017-03-05T22:23:36.000Z | 2022-03-31T12:42:17.000Z | import conftest # Add root path to sys.path
import os
import matplotlib.pyplot as plt
from PathPlanning.WavefrontCPP import wavefront_coverage_path_planner
wavefront_coverage_path_planner.do_animation = False
if __name__ == '__main__':
conftest.run_this_test(__file__)
| 27.984375 | 72 | 0.670017 | import conftest # Add root path to sys.path
import os
import matplotlib.pyplot as plt
from PathPlanning.WavefrontCPP import wavefront_coverage_path_planner
wavefront_coverage_path_planner.do_animation = False
def wavefront_cpp(img, start, goal):
num_free = 0
for i in range(img.shape[0]):
for j in ra... | 1,418 | 0 | 92 |
625937fe2103b5c073f4e090e7056a74d4bcb4f7 | 706 | py | Python | modules/do_markdown.py | tbersez/Allmine | 092fb1f5abcb4fd4e40b4a25386f05ecb2dea55b | [
"MIT"
] | 5 | 2019-02-13T13:47:24.000Z | 2019-04-27T18:27:03.000Z | modules/do_markdown.py | tbersez/Allmine | 092fb1f5abcb4fd4e40b4a25386f05ecb2dea55b | [
"MIT"
] | null | null | null | modules/do_markdown.py | tbersez/Allmine | 092fb1f5abcb4fd4e40b4a25386f05ecb2dea55b | [
"MIT"
] | null | null | null | # Markdown builder
#
# Starts the .R script for Markdown generation
#
# Inputs:
# - Coverage_Track.tab
# - regions.bed
# - Non_synonymous_variants_summary.tab
#
# Output:
# - Run_report.html
#
# Parameters:
# None
rule make_markdown :
input:
"Non_synonymous_variants_su... | 22.0625 | 88 | 0.570822 | # Markdown builder
#
# Starts the .R script for Markdown generation
#
# Inputs:
# - Coverage_Track.tab
# - regions.bed
# - Non_synonymous_variants_summary.tab
#
# Output:
# - Run_report.html
#
# Parameters:
# None
rule make_markdown :
input:
"Non_synonymous_variants_su... | 0 | 0 | 0 |
4a5c60efd77e377c8d7aedd277c8dc1bc7af742f | 361 | py | Python | pellets.py | Utshaan/PuckAMaze | c4128a1aeff56a51a9224b829ad850f970f0e94c | [
"MIT"
] | null | null | null | pellets.py | Utshaan/PuckAMaze | c4128a1aeff56a51a9224b829ad850f970f0e94c | [
"MIT"
] | null | null | null | pellets.py | Utshaan/PuckAMaze | c4128a1aeff56a51a9224b829ad850f970f0e94c | [
"MIT"
] | null | null | null | import pygame as pg
from screen import resource_path | 40.111111 | 93 | 0.67036 | import pygame as pg
from screen import resource_path
class PowerPellets(pg.sprite.Sprite):
def __init__(self, x, y, *groups) -> None:
super().__init__(*groups)
self.x, self.y = x, y
self.image = pg.image.load(resource_path("Assets/Images/pellet.png")).convert_alpha()
self.rect = sel... | 244 | 16 | 49 |
5743ed10755166abc7d50e18945c871531dd1fe3 | 14,687 | py | Python | db/setup_db.py | matteyeux/MyBookingServices | ce6ec906b3a58da16e1f066b9af290fb7e8b82d3 | [
"MIT"
] | null | null | null | db/setup_db.py | matteyeux/MyBookingServices | ce6ec906b3a58da16e1f066b9af290fb7e8b82d3 | [
"MIT"
] | 3 | 2022-02-26T16:50:12.000Z | 2022-02-26T16:50:12.000Z | db/setup_db.py | matteyeux/MyBookingServices | ce6ec906b3a58da16e1f066b9af290fb7e8b82d3 | [
"MIT"
] | null | null | null | import datetime
import enum
import hashlib
import pandas as pd
from faker import Faker
from sqlalchemy import BigInteger
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import create_engine
from sqlalchemy import Date
from sqlalchemy import DateTime
from sqlalchemy import Float
from sqlalc... | 29.551308 | 83 | 0.636617 | import datetime
import enum
import hashlib
import pandas as pd
from faker import Faker
from sqlalchemy import BigInteger
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import create_engine
from sqlalchemy import Date
from sqlalchemy import DateTime
from sqlalchemy import Float
from sqlalc... | 0 | 4,504 | 252 |
0bf55e7c458f0558d5da1712e4db0c6454406298 | 4,293 | py | Python | gencode/__init__.py | zdebeer99/generate_software | d7c86e2b52263b22c185d2e62cbdcd5c847bac1c | [
"MIT"
] | null | null | null | gencode/__init__.py | zdebeer99/generate_software | d7c86e2b52263b22c185d2e62cbdcd5c847bac1c | [
"MIT"
] | null | null | null | gencode/__init__.py | zdebeer99/generate_software | d7c86e2b52263b22c185d2e62cbdcd5c847bac1c | [
"MIT"
] | null | null | null | from jinja2 import Environment, FileSystemLoader
import jinja2_stringcase
import stringcase
import csv
import openpyxl
from gencode.internal import default
import gencode.text_helpers as text_helpers
import os
# Config Loading
# helper
| 29.204082 | 119 | 0.583508 | from jinja2 import Environment, FileSystemLoader
import jinja2_stringcase
import stringcase
import csv
import openpyxl
from gencode.internal import default
import gencode.text_helpers as text_helpers
import os
# Config Loading
class SourceConfig:
def __init__(self) -> None:
self.tables = []
self.... | 3,347 | 511 | 190 |
229583db6eaa0002ee095bd34e0eef377cd8d295 | 17,984 | py | Python | src/stagedml/models/transformer/model.py | stagedml/stagedml | 35c1b107cc92bb727bf2e7ccd4a1983f475d5938 | [
"BSD-4-Clause"
] | 7 | 2020-02-17T19:09:13.000Z | 2021-06-19T10:16:21.000Z | src/stagedml/models/transformer/model.py | stagedml/stagedml | 35c1b107cc92bb727bf2e7ccd4a1983f475d5938 | [
"BSD-4-Clause"
] | null | null | null | src/stagedml/models/transformer/model.py | stagedml/stagedml | 35c1b107cc92bb727bf2e7ccd4a1983f475d5938 | [
"BSD-4-Clause"
] | null | null | null | import tensorflow as tf
from stagedml.imports.tf import ( Model, Layer, Tensor, Adam, LayerNormalization )
from stagedml.models.transformer.imports import (
transformer_loss, get_padding_bias, get_padding,
get_position_encoding, get_decoder_self_attention_bias,
sequence_beam_search, EOS_ID, LearningRateSch... | 38.675269 | 89 | 0.674766 | import tensorflow as tf
from stagedml.imports.tf import ( Model, Layer, Tensor, Adam, LayerNormalization )
from stagedml.models.transformer.imports import (
transformer_loss, get_padding_bias, get_padding,
get_position_encoding, get_decoder_self_attention_bias,
sequence_beam_search, EOS_ID, LearningRateSch... | 6,116 | 8,830 | 217 |
b2df8932612771b9728e42834660038ccd3fb73e | 1,484 | py | Python | ros2action/ros2action/verb/show.py | ben-greenberg/ros2cli | e5c3821c02d985e638f2d4f57a21c8a5adb383f9 | [
"Apache-2.0"
] | null | null | null | ros2action/ros2action/verb/show.py | ben-greenberg/ros2cli | e5c3821c02d985e638f2d4f57a21c8a5adb383f9 | [
"Apache-2.0"
] | null | null | null | ros2action/ros2action/verb/show.py | ben-greenberg/ros2cli | e5c3821c02d985e638f2d4f57a21c8a5adb383f9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Open Source Robotics Foundation, 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... | 38.051282 | 80 | 0.701482 | # Copyright 2019 Open Source Robotics Foundation, 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... | 621 | 0 | 54 |
9a2edec99005ea85ea806d12f218d51b0c10b3ec | 927 | py | Python | protopy/vassal_engine/runner.py | MislavJaksic/Prototyping-Python | 8934ae1a7df22ed4e39d24aa66a1bc97299aa56c | [
"MIT"
] | null | null | null | protopy/vassal_engine/runner.py | MislavJaksic/Prototyping-Python | 8934ae1a7df22ed4e39d24aa66a1bc97299aa56c | [
"MIT"
] | null | null | null | protopy/vassal_engine/runner.py | MislavJaksic/Prototyping-Python | 8934ae1a7df22ed4e39d24aa66a1bc97299aa56c | [
"MIT"
] | null | null | null | import sys
def main(args):
"""main() will be run if you run this script directly"""
parse_server_status(
"protopy/vassal_engine/data/2021-03-vassal-players-month.txt",
"server_status.csv",
)
def run():
"""Entry point for the runnable script."""
sys.exit(main(sys.argv[1:]))
if ... | 25.75 | 70 | 0.512406 | import sys
def parse_server_status(input_file, output_file):
with open(input_file, "r") as input:
with open(output_file, "w") as output:
for line in input:
line = line.strip()
seperation_index = -1
while line[seperation_index] != "(":
... | 522 | 0 | 23 |
18312d574b042035ee27bf81d1de244ef3e0daf3 | 695 | py | Python | tools/stop_server.py | grtfou/dokuwiki-tools | 0d88d2bdc891d3959c57882ebaa82182b9df2082 | [
"MIT"
] | null | null | null | tools/stop_server.py | grtfou/dokuwiki-tools | 0d88d2bdc891d3959c57882ebaa82182b9df2082 | [
"MIT"
] | null | null | null | tools/stop_server.py | grtfou/dokuwiki-tools | 0d88d2bdc891d3959c57882ebaa82182b9df2082 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @first_date 20140829
# @date
# @version 0.0
# @brief stop dokuwiki Apache server
import os
import time
import signal
import subprocess
os.chdir(r'server')
print("Stop Apache Server")
p = subprocess.Popen(["ApacheKill.exe"])
### Replace "ApacheKill.e... | 21.71875 | 61 | 0.634532 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @first_date 20140829
# @date
# @version 0.0
# @brief stop dokuwiki Apache server
import os
import time
import signal
import subprocess
os.chdir(r'server')
print("Stop Apache Server")
p = subprocess.Popen(["ApacheKill.exe"])
### Replace "ApacheKill.e... | 0 | 0 | 0 |
fb355aab17d2381e15a7630b0292aa78e5ec074d | 240 | py | Python | Contest/ABC166/e/main.py | mpses/AtCoder | 9c101fcc0a1394754fcf2385af54b05c30a5ae2a | [
"CC0-1.0"
] | null | null | null | Contest/ABC166/e/main.py | mpses/AtCoder | 9c101fcc0a1394754fcf2385af54b05c30a5ae2a | [
"CC0-1.0"
] | null | null | null | Contest/ABC166/e/main.py | mpses/AtCoder | 9c101fcc0a1394754fcf2385af54b05c30a5ae2a | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
from collections import*
n = int(input())
a = list(map(int, input().split()))
l = []
r = []
for i, j in enumerate(a):
l += [i + j]
r += [i - j]
c = 0
l = Counter(l)
for r in r:
c += l.get(r, 0)
print(c) | 14.117647 | 35 | 0.5125 | #!/usr/bin/env python3
from collections import*
n = int(input())
a = list(map(int, input().split()))
l = []
r = []
for i, j in enumerate(a):
l += [i + j]
r += [i - j]
c = 0
l = Counter(l)
for r in r:
c += l.get(r, 0)
print(c) | 0 | 0 | 0 |
0a7507e6491b5424e66421b091b2e0f50962ffc8 | 4,329 | py | Python | model_innondations/pipeline/download-climateknowledgeportal.py | PayjPan/batch8_worldbank | e220136257a8ab848e850eee57dcb6a1af706073 | [
"MIT"
] | null | null | null | model_innondations/pipeline/download-climateknowledgeportal.py | PayjPan/batch8_worldbank | e220136257a8ab848e850eee57dcb6a1af706073 | [
"MIT"
] | null | null | null | model_innondations/pipeline/download-climateknowledgeportal.py | PayjPan/batch8_worldbank | e220136257a8ab848e850eee57dcb6a1af706073 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import requests
import os, sys
import pandas as pd
import urllib.parse
import logging
#import asyncio
import concurrent.futures
from pathlib import Path
'''
Script to download dataset from https://climateknowledgeportal.worldbank.org/api/data/get-download-data
'''
DATASET_FOLDER = '../../dataset... | 37.643478 | 123 | 0.687919 | # -*- coding: utf-8 -*-
import requests
import os, sys
import pandas as pd
import urllib.parse
import logging
#import asyncio
import concurrent.futures
from pathlib import Path
'''
Script to download dataset from https://climateknowledgeportal.worldbank.org/api/data/get-download-data
'''
DATASET_FOLDER = '../../dataset... | 744 | 0 | 23 |
fa8a23eda422107e69b00ba214a0681760f67b8d | 2,552 | py | Python | src/sentinel/azext_sentinel/vendored_sdks/security_insights/models/alert_rule_template_properties_base_py3.py | hpsan/azure-cli-extensions | be1589bb6dd23837796e088d28e65e873050171e | [
"MIT"
] | null | null | null | src/sentinel/azext_sentinel/vendored_sdks/security_insights/models/alert_rule_template_properties_base_py3.py | hpsan/azure-cli-extensions | be1589bb6dd23837796e088d28e65e873050171e | [
"MIT"
] | null | null | null | src/sentinel/azext_sentinel/vendored_sdks/security_insights/models/alert_rule_template_properties_base_py3.py | hpsan/azure-cli-extensions | be1589bb6dd23837796e088d28e65e873050171e | [
"MIT"
] | 1 | 2020-07-16T23:49:49.000Z | 2020-07-16T23:49:49.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 44.77193 | 184 | 0.675157 | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 533 | 0 | 27 |
366ff5d397b28d5e6fd3da95adba0a827ea78dbb | 696 | py | Python | python/learn/base/class/mix_class.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | 2 | 2017-06-07T03:20:42.000Z | 2020-01-07T09:14:26.000Z | python/learn/base/class/mix_class.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | null | null | null | python/learn/base/class/mix_class.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
class CC1(object):
"""Docstring for CC1. """
def __init__(self):
"""TODO: to be defined1. """
# 这个类调用了CC1里面的方法, CC1与CC2并没有关系
class CC2(object):
"""Docstring for CC2. """
def __init__(self):
"""TODO: to be defined1. """
class CC3(CC1, CC2... | 15.818182 | 36 | 0.550287 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
class CC1(object):
"""Docstring for CC1. """
def __init__(self):
"""TODO: to be defined1. """
def cc1_method(self):
print(" cc1_method ")
# 这个类调用了CC1里面的方法, CC1与CC2并没有关系
class CC2(object):
"""Docstring for CC2. """
def __init__(self):... | 112 | 0 | 98 |
e9a20cb7b1eecfaa9e4a0378ca0a31f210281a57 | 634 | py | Python | src/rab/storage/__init__.py | JHibbard/rest-api-base | ba47a56e2f57fc184d4258ba9889e6c31979f36e | [
"MIT"
] | null | null | null | src/rab/storage/__init__.py | JHibbard/rest-api-base | ba47a56e2f57fc184d4258ba9889e6c31979f36e | [
"MIT"
] | null | null | null | src/rab/storage/__init__.py | JHibbard/rest-api-base | ba47a56e2f57fc184d4258ba9889e6c31979f36e | [
"MIT"
] | null | null | null | # External Libraries
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
Base = declarative_base()
| 30.190476 | 77 | 0.66877 | # External Libraries
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
Base = declarative_base()
def row2dict(row):
return {c.name: str(getattr(row, c.name)) for c in row.__table__.columns}
def init_db(uri):
... | 388 | 0 | 46 |
0500677a4c2553954a6216bb86929110bd81544d | 230 | py | Python | core/urls.py | evantbyrne/khanban | 39ed990a706013408cd7ccc82d6045b2319507c4 | [
"0BSD"
] | 1 | 2018-09-03T21:07:43.000Z | 2018-09-03T21:07:43.000Z | core/urls.py | evantbyrne/khanban | 39ed990a706013408cd7ccc82d6045b2319507c4 | [
"0BSD"
] | 43 | 2018-06-27T23:48:00.000Z | 2018-10-28T19:58:09.000Z | core/urls.py | evantbyrne/khanban | 39ed990a706013408cd7ccc82d6045b2319507c4 | [
"0BSD"
] | null | null | null | from django.conf.urls.static import static
from django.urls import include, path
from . import settings
urlpatterns = [
path('', include('frontend.urls')),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
| 25.555556 | 67 | 0.76087 | from django.conf.urls.static import static
from django.urls import include, path
from . import settings
urlpatterns = [
path('', include('frontend.urls')),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
| 0 | 0 | 0 |
ed507ba09d84f4e72003722038d7cfb2ed5aa702 | 22,586 | py | Python | src/foolscap/logging/gatherer.py | jaraco/foolscap | 845bea550447991b194ef884713a7b3be4b4a6c2 | [
"MIT"
] | 29 | 2015-01-05T19:37:27.000Z | 2021-03-03T21:59:13.000Z | src/foolscap/logging/gatherer.py | jaraco/foolscap | 845bea550447991b194ef884713a7b3be4b4a6c2 | [
"MIT"
] | 65 | 2015-03-01T03:18:03.000Z | 2022-03-24T16:00:48.000Z | src/foolscap/logging/gatherer.py | jaraco/foolscap | 845bea550447991b194ef884713a7b3be4b4a6c2 | [
"MIT"
] | 22 | 2015-01-28T10:51:46.000Z | 2022-01-26T07:56:25.000Z | from __future__ import print_function, unicode_literals
import six, os, sys, time, bz2
signal = None
try:
import signal
except ImportError:
pass
from zope.interface import implementer
from twisted.internet import reactor, utils, defer
from twisted.python import usage, procutils, filepath, log as tw_log
from twi... | 38.542662 | 123 | 0.635969 | from __future__ import print_function, unicode_literals
import six, os, sys, time, bz2
signal = None
try:
import signal
except ImportError:
pass
from zope.interface import implementer
from twisted.internet import reactor, utils, defer
from twisted.python import usage, procutils, filepath, log as tw_log
from twi... | 15,071 | 281 | 963 |