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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
513ef3edbae8277d962b74a9d9c209ea7791d7c5 | 2,540 | py | Python | fn_apility/fn_apility/components/function_apility.py | nickpartner-goahead/resilient-community-apps | 097c0dbefddbd221b31149d82af9809420498134 | [
"MIT"
] | 65 | 2017-12-04T13:58:32.000Z | 2022-03-24T18:33:17.000Z | fn_apility/fn_apility/components/function_apility.py | nickpartner-goahead/resilient-community-apps | 097c0dbefddbd221b31149d82af9809420498134 | [
"MIT"
] | 48 | 2018-03-02T19:17:14.000Z | 2022-03-09T22:00:38.000Z | fn_apility/fn_apility/components/function_apility.py | nickpartner-goahead/resilient-community-apps | 097c0dbefddbd221b31149d82af9809420498134 | [
"MIT"
] | 95 | 2018-01-11T16:23:39.000Z | 2022-03-21T11:34:29.000Z | # (c) Copyright IBM Corp. 2010, 2018. All Rights Reserved.
# -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use
"""Function implementation"""
import logging
from resilient_circuits import ResilientComponent, function, handler, StatusMessage, FunctionResult, FunctionError
import fn_apility.util... | 41.639344 | 184 | 0.652362 | # (c) Copyright IBM Corp. 2010, 2018. All Rights Reserved.
# -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use
"""Function implementation"""
import logging
from resilient_circuits import ResilientComponent, function, handler, StatusMessage, FunctionResult, FunctionError
import fn_apility.util... | 0 | 0 | 0 |
d7078b37dd4fb5b2784ec91f80868383739be167 | 183 | py | Python | tests/test_layers/test_2p5d/checks_2p5d/common.py | DevinCheung/ColossalAI | 632e622de818697f9949e35117c0432d88f62c87 | [
"Apache-2.0"
] | 1 | 2021-11-02T03:13:36.000Z | 2021-11-02T03:13:36.000Z | tests/test_layers/test_2p5d/checks_2p5d/common.py | DevinCheung/ColossalAI | 632e622de818697f9949e35117c0432d88f62c87 | [
"Apache-2.0"
] | null | null | null | tests/test_layers/test_2p5d/checks_2p5d/common.py | DevinCheung/ColossalAI | 632e622de818697f9949e35117c0432d88f62c87 | [
"Apache-2.0"
] | null | null | null | import torch
TESSERACT_DIM = 2
TESSERACT_DEP = 2
BATCH_SIZE = 8
SEQ_LENGTH = 8
HIDDEN_SIZE = 8
| 15.25 | 61 | 0.699454 | import torch
TESSERACT_DIM = 2
TESSERACT_DEP = 2
BATCH_SIZE = 8
SEQ_LENGTH = 8
HIDDEN_SIZE = 8
def check_equal(A, B):
assert torch.allclose(A, B, rtol=1e-5, atol=1e-2) == True
| 63 | 0 | 23 |
4c231590b75724b5d628f6a35085f505a321fb9d | 1,511 | py | Python | django_postgres_extensions/models/sql/subqueries.py | parth-verma/django3_postgres_extensions | 72045b72d56debeb8c480fad52871f486edfe021 | [
"BSD-3-Clause"
] | null | null | null | django_postgres_extensions/models/sql/subqueries.py | parth-verma/django3_postgres_extensions | 72045b72d56debeb8c480fad52871f486edfe021 | [
"BSD-3-Clause"
] | null | null | null | django_postgres_extensions/models/sql/subqueries.py | parth-verma/django3_postgres_extensions | 72045b72d56debeb8c480fad52871f486edfe021 | [
"BSD-3-Clause"
] | null | null | null | from django.db.models.sql.subqueries import UpdateQuery as BaseUpdateQuery
from django.core.exceptions import FieldError | 45.787879 | 94 | 0.563203 | from django.db.models.sql.subqueries import UpdateQuery as BaseUpdateQuery
from django.core.exceptions import FieldError
class UpdateQuery(BaseUpdateQuery):
def add_update_values(self, values):
"""
Convert a dictionary of field name to value mappings into an update
query. This is the entry ... | 0 | 1,368 | 23 |
66eac9cb899e469fef458d2d4c796284f67a7dc6 | 1,130 | py | Python | larcv/app/arxiv/mac/pyrgb/rgb_cv2/cv2gausblur.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | 14 | 2017-10-19T15:08:29.000Z | 2021-03-31T21:21:07.000Z | larcv/app/arxiv/mac/pyrgb/rgb_cv2/cv2gausblur.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | 32 | 2017-10-25T22:54:06.000Z | 2019-10-01T13:57:15.000Z | larcv/app/arxiv/mac/pyrgb/rgb_cv2/cv2gausblur.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | 16 | 2017-12-07T12:04:40.000Z | 2021-11-15T00:53:31.000Z | from cv2selection import CV2Selection
from cv2selection import QtGui
import cv2
| 31.388889 | 81 | 0.625664 | from cv2selection import CV2Selection
from cv2selection import QtGui
import cv2
class CV2GausBlur(CV2Selection):
def __init__(self):
super(CV2GausBlur,self).__init__()
self.name = "CV2GausBlur"
# default options
self.options['ksize'] = (5,5)
self.options['sigmaX'] = 1.0
... | 403 | 531 | 116 |
00b683c64c7dd7c2dbeb53d7fb96c9be873918a1 | 644 | py | Python | Arbie/Actions/__init__.py | owodunni/Arbie | abc209a9f209bcd1f61e3b0209ec80b13f7b8f8b | [
"MIT"
] | 12 | 2021-03-17T10:21:49.000Z | 2022-03-06T04:26:39.000Z | Arbie/Actions/__init__.py | owodunni/arbie | abc209a9f209bcd1f61e3b0209ec80b13f7b8f8b | [
"MIT"
] | 45 | 2020-07-22T19:33:04.000Z | 2022-03-04T11:35:41.000Z | Arbie/Actions/__init__.py | owodunni/Arbie | abc209a9f209bcd1f61e3b0209ec80b13f7b8f8b | [
"MIT"
] | 3 | 2020-08-13T12:25:09.000Z | 2021-03-17T10:21:51.000Z | """Actions are used for building complex interactions with smart contracts."""
from Arbie.Actions.action import Action, Store # noqa: F401
from Arbie.Actions.action_tree import ActionTree # noqa: F401
from Arbie.Actions.arbitrage import Arbitrage # noqa:F401
from Arbie.Actions.path_finder import PathFinder # noqa:... | 53.666667 | 78 | 0.799689 | """Actions are used for building complex interactions with smart contracts."""
from Arbie.Actions.action import Action, Store # noqa: F401
from Arbie.Actions.action_tree import ActionTree # noqa: F401
from Arbie.Actions.arbitrage import Arbitrage # noqa:F401
from Arbie.Actions.path_finder import PathFinder # noqa:... | 0 | 0 | 0 |
52ff3a2f0415ac3223a20fa695330480f46fc21b | 1,503 | py | Python | mail/mail.py | MiracleWong/PythonBasic | cb8ec59dc646842b41966ea4ea4b1ee66a342eee | [
"MIT"
] | null | null | null | mail/mail.py | MiracleWong/PythonBasic | cb8ec59dc646842b41966ea4ea4b1ee66a342eee | [
"MIT"
] | null | null | null | mail/mail.py | MiracleWong/PythonBasic | cb8ec59dc646842b41966ea4ea4b1ee66a342eee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import email
from email.header import decode_header
# 只读取收件箱中的未读邮件 | 35.785714 | 73 | 0.50499 | # -*- coding: utf-8 -*-
import email
from email.header import decode_header
# 只读取收件箱中的未读邮件
def get_mail(client):
mail_list = []
resp, data = client.search(None, "UNSEEN")
if data:
for num in data[0].split():
typ, data = client.fetch(int(num), "(RFC822)")
msg = data[0][1]
... | 1,433 | 0 | 22 |
70fe1de5df6c36d8235904a90a0a5de3ebf7a09a | 11,079 | py | Python | util/database.py | ssunqf/mana | eff753f83b2129e3537dc3cee3952cb61f55fea0 | [
"BSD-3-Clause"
] | null | null | null | util/database.py | ssunqf/mana | eff753f83b2129e3537dc3cee3952cb61f55fea0 | [
"BSD-3-Clause"
] | null | null | null | util/database.py | ssunqf/mana | eff753f83b2129e3537dc3cee3952cb61f55fea0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import asyncio
import json
import logging
import re
from typing import List, Tuple, Dict
from datetime import datetime
from tqdm import tqdm
from parser.nsfw import detect_nsfw
import asyncpg
from util.categories import guess_metainfo
from parser.search import make_tsv... | 38.873684 | 127 | 0.476668 | #!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import asyncio
import json
import logging
import re
from typing import List, Tuple, Dict
from datetime import datetime
from tqdm import tqdm
from parser.nsfw import detect_nsfw
import asyncpg
from util.categories import guess_metainfo
from parser.search import make_tsv... | 10,012 | -7 | 427 |
4550d03f499be9eae5048493c3d980accb44af5d | 25,804 | py | Python | Lib/asyncio/sslproto.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | 1 | 2018-06-21T18:21:24.000Z | 2018-06-21T18:21:24.000Z | Lib/asyncio/sslproto.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | Lib/asyncio/sslproto.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | zaimportuj collections
zaimportuj warnings
spróbuj:
zaimportuj ssl
wyjąwszy ImportError: # pragma: no cover
ssl = Nic
z . zaimportuj compat
z . zaimportuj protocols
z . zaimportuj transports
z .log zaimportuj logger
inaczej:
# Fallback dla Python 3.3.
sslcontext = ssl.SSLContext(ssl.PROTO... | 38.284866 | 93 | 0.610332 | zaimportuj collections
zaimportuj warnings
spróbuj:
zaimportuj ssl
wyjąwszy ImportError: # pragma: no cover
ssl = Nic
z . zaimportuj compat
z . zaimportuj protocols
z . zaimportuj transports
z .log zaimportuj logger
def _create_transport_context(server_side, server_hostname):
jeżeli server_side:
... | 4,533 | 0 | 212 |
cc8eeedb7d67215bfa1d6a760e871b3c51b0bb7e | 1,077 | py | Python | fme_server_lib/FMERepositoryUtility/XMLTextUtility.py | bcgov/fme | 0564363c59ccd06fe79459ec08ff3b7c5bf7e061 | [
"Apache-2.0"
] | null | null | null | fme_server_lib/FMERepositoryUtility/XMLTextUtility.py | bcgov/fme | 0564363c59ccd06fe79459ec08ff3b7c5bf7e061 | [
"Apache-2.0"
] | 2 | 2021-07-26T20:33:16.000Z | 2021-07-26T20:33:19.000Z | fme_server_lib/FMERepositoryUtility/XMLTextUtility.py | bcgov/fme | 0564363c59ccd06fe79459ec08ff3b7c5bf7e061 | [
"Apache-2.0"
] | null | null | null | from .RegSearch import RegSearch
| 29.916667 | 67 | 0.587744 | from .RegSearch import RegSearch
class XMLTextUtility:
def __init__(self, text=None, section_end=None):
self.text = text
self.section_end = section_end
def find_sections(self, head, include_cri, exclude_cri):
search = RegSearch(self.text, self.section_end)
return search.find_... | 894 | 126 | 23 |
b91b37c602d7161bdb18fbb612ec1c44bdb5dd70 | 2,468 | py | Python | tests/test_main.py | flopraden/bemenu-extended | 0427ec101552cf62bd0ba98d0cb83699a99ce8de | [
"MIT"
] | 1 | 2020-03-01T19:15:43.000Z | 2020-03-01T19:15:43.000Z | tests/test_main.py | flopraden/bemenu-extended | 0427ec101552cf62bd0ba98d0cb83699a99ce8de | [
"MIT"
] | null | null | null | tests/test_main.py | flopraden/bemenu-extended | 0427ec101552cf62bd0ba98d0cb83699a99ce8de | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf8 -*-
import mock
import pytest
import sys
from os import path
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
import bemenu_extended as d
menu = d.bemenu()
| 60.195122 | 182 | 0.651135 | #! /usr/bin/env python
# -*- coding: utf8 -*-
import mock
import pytest
import sys
from os import path
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
import bemenu_extended as d
menu = d.bemenu()
def test_required_variables_available():
assert d.path_cache[-len('bemenu-extended'):] ==... | 2,186 | 0 | 69 |
05663d5ebabfab987aea80e85ceb98316e7f9363 | 223 | py | Python | individual_22.py | HeartAttack417/labs2 | efc13855ebb2b096b08edf4215d054a097d1a257 | [
"MIT"
] | null | null | null | individual_22.py | HeartAttack417/labs2 | efc13855ebb2b096b08edf4215d054a097d1a257 | [
"MIT"
] | null | null | null | individual_22.py | HeartAttack417/labs2 | efc13855ebb2b096b08edf4215d054a097d1a257 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from math import pi
print(ring_area(5, 3))
| 14.866667 | 38 | 0.475336 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from math import pi
def ring_area(R, r):
area = 'Error'
if 0 <= r <= R:
area = pi * (R ** 2 - r ** 2)
return area
print(ring_area(5, 3))
| 96 | 0 | 25 |
1e7cd5441d75e159ca18198c76eb7e5786a50c12 | 1,869 | py | Python | ants.py | doug-letough/ants | feab4ae6857fa21d0f9addaf46fcccd7a20cd940 | [
"WTFPL"
] | null | null | null | ants.py | doug-letough/ants | feab4ae6857fa21d0f9addaf46fcccd7a20cd940 | [
"WTFPL"
] | null | null | null | ants.py | doug-letough/ants | feab4ae6857fa21d0f9addaf46fcccd7a20cd940 | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python
# -*- coding:Utf-8 -*-
"""The ants module entry point.
"""
import config
import ant
import farm
import mine
import playground
import display
import logging
import random
import utils
__author__ = "Doug Le Tough"
__copyright__ = "Copyright 2017, Doug Le Tough"
__credits__ = ["Doug Le Tough",]
__... | 30.145161 | 115 | 0.607277 | #!/usr/bin/env python
# -*- coding:Utf-8 -*-
"""The ants module entry point.
"""
import config
import ant
import farm
import mine
import playground
import display
import logging
import random
import utils
__author__ = "Doug Le Tough"
__copyright__ = "Copyright 2017, Doug Le Tough"
__credits__ = ["Doug Le Tough",]
__... | 0 | 0 | 0 |
8916d7dddc0388e8fed8401c56cf19605144c021 | 194 | py | Python | exercicios curso em video/ex018.py | Nilton-Miguel/Prog_Python3 | 4cabcb1a30dde6ababce3cb8d1fbb7d417cb1d8b | [
"MIT"
] | null | null | null | exercicios curso em video/ex018.py | Nilton-Miguel/Prog_Python3 | 4cabcb1a30dde6ababce3cb8d1fbb7d417cb1d8b | [
"MIT"
] | null | null | null | exercicios curso em video/ex018.py | Nilton-Miguel/Prog_Python3 | 4cabcb1a30dde6ababce3cb8d1fbb7d417cb1d8b | [
"MIT"
] | null | null | null | from math import sin, cos, tan, radians
a = radians(float(input('informe o ângulo: ')))
print(' o seno é: {:.2f}\n o cosseno é: {:.2f}\n a tangente é: {:.2f}'.format(sin(a), cos(a), tan(a)))
| 48.5 | 103 | 0.608247 | from math import sin, cos, tan, radians
a = radians(float(input('informe o ângulo: ')))
print(' o seno é: {:.2f}\n o cosseno é: {:.2f}\n a tangente é: {:.2f}'.format(sin(a), cos(a), tan(a)))
| 0 | 0 | 0 |
420fa1fbc980f7660660c628ae98928c0adf0f74 | 1,464 | py | Python | tutorial/collection.py | luanxiangming/rqsts | 0bd3fa2fe64c71bf5702654de46e953d7a144847 | [
"Apache-2.0"
] | 2 | 2017-04-28T09:54:39.000Z | 2017-05-03T12:38:19.000Z | tutorial/collection.py | luanxiangming/rqsts | 0bd3fa2fe64c71bf5702654de46e953d7a144847 | [
"Apache-2.0"
] | null | null | null | tutorial/collection.py | luanxiangming/rqsts | 0bd3fa2fe64c71bf5702654de46e953d7a144847 | [
"Apache-2.0"
] | null | null | null | from collections import *
def collections_nametuple():
"""
namedtuple是一个函数,它用来创建一个自定义的tuple对象,并且规定了tuple元素的个数,并可以用属性而不是索引来引用tuple的某个元素。
"""
Point = namedtuple('Point', ['x', 'y'])
p = Point(1, 2)
print('p.x: ' + str(p.x))
print('isInstance(p, Point): ' + str(isinstance(p, Point)))
print('isInstance(p, tuple):... | 21.850746 | 82 | 0.636612 | from collections import *
def collections_nametuple():
"""
namedtuple是一个函数,它用来创建一个自定义的tuple对象,并且规定了tuple元素的个数,并可以用属性而不是索引来引用tuple的某个元素。
"""
Point = namedtuple('Point', ['x', 'y'])
p = Point(1, 2)
print('p.x: ' + str(p.x))
print('isInstance(p, Point): ' + str(isinstance(p, Point)))
print('isInstance(p, tuple):... | 385 | 0 | 23 |
f0abad9215aed2e7afdafcb8b139d6cc861997dd | 1,258 | py | Python | backend/models/competitor.py | brownben/munro | 2beeae23f29fd064b102a44a1c2d3d852eed65e0 | [
"MIT"
] | 5 | 2020-02-02T14:58:15.000Z | 2022-01-07T08:24:37.000Z | backend/models/competitor.py | brownben/munro | 2beeae23f29fd064b102a44a1c2d3d852eed65e0 | [
"MIT"
] | 773 | 2020-01-04T22:54:01.000Z | 2022-03-31T16:07:56.000Z | backend/models/competitor.py | brownben/munro | 2beeae23f29fd064b102a44a1c2d3d852eed65e0 | [
"MIT"
] | 1 | 2021-12-25T14:32:25.000Z | 2021-12-25T14:32:25.000Z | from flask_restx import Model, fields
competitorModel = Model(
"Competitor",
{
"id": fields.Integer(
description="ID of the Competitor",
example=7,
),
"name": fields.String(
description="Name of the Competitor",
required=True,
... | 28.590909 | 82 | 0.5469 | from flask_restx import Model, fields
competitorModel = Model(
"Competitor",
{
"id": fields.Integer(
description="ID of the Competitor",
example=7,
),
"name": fields.String(
description="Name of the Competitor",
required=True,
... | 0 | 0 | 0 |
4920c07ffca83a5e8f40fa65e59790c3aa7f4d62 | 74 | py | Python | my_bot/__main__.py | ColinTheShark/async_modular | 9c359a97761e4ff50ee71c809b7af64eedac7053 | [
"MIT"
] | null | null | null | my_bot/__main__.py | ColinTheShark/async_modular | 9c359a97761e4ff50ee71c809b7af64eedac7053 | [
"MIT"
] | null | null | null | my_bot/__main__.py | ColinTheShark/async_modular | 9c359a97761e4ff50ee71c809b7af64eedac7053 | [
"MIT"
] | null | null | null | from .my_bot import My_Bot
if __name__ == "__main__":
My_Bot().run()
| 14.8 | 26 | 0.662162 | from .my_bot import My_Bot
if __name__ == "__main__":
My_Bot().run()
| 0 | 0 | 0 |
e08bca8e8b6a3d18942ada9c30818ad1a8c120ae | 5,861 | py | Python | catalog/lots_of_missiles.py | akshaym91/p5-itemcatalog | 203deca5b43952c0d19f8397d99c54bd903fbec3 | [
"MIT"
] | null | null | null | catalog/lots_of_missiles.py | akshaym91/p5-itemcatalog | 203deca5b43952c0d19f8397d99c54bd903fbec3 | [
"MIT"
] | null | null | null | catalog/lots_of_missiles.py | akshaym91/p5-itemcatalog | 203deca5b43952c0d19f8397d99c54bd903fbec3 | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Country, Base, Missile, User
engine = create_engine('sqlite:///lots_of_missiles.db')
# Bind the engine to the metadata of the Base class so that the
# declaratives can be accessed through a DBSession instance
Base.... | 34.680473 | 90 | 0.628903 | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Country, Base, Missile, User
engine = create_engine('sqlite:///lots_of_missiles.db')
# Bind the engine to the metadata of the Base class so that the
# declaratives can be accessed through a DBSession instance
Base.... | 0 | 0 | 0 |
dde91c0374d34e326519572f04e8b6cb7b12efe1 | 9,455 | py | Python | flexible_manipulation_flexbe_states/src/flexible_manipulation_flexbe_states/state_validation_state.py | ZiwenZhuang/flexible_manipulation | 052a6acf6791ed7a7dea06bf6073d9a52e96ce3e | [
"BSD-3-Clause"
] | 5 | 2019-05-15T07:14:15.000Z | 2020-09-01T06:56:56.000Z | flexible_manipulation_flexbe_states/src/flexible_manipulation_flexbe_states/state_validation_state.py | ZiwenZhuang/flexible_manipulation | 052a6acf6791ed7a7dea06bf6073d9a52e96ce3e | [
"BSD-3-Clause"
] | 2 | 2020-03-24T07:57:04.000Z | 2020-09-02T01:08:01.000Z | flexible_manipulation_flexbe_states/src/flexible_manipulation_flexbe_states/state_validation_state.py | ZiwenZhuang/flexible_manipulation | 052a6acf6791ed7a7dea06bf6073d9a52e96ce3e | [
"BSD-3-Clause"
] | 5 | 2019-04-27T23:25:25.000Z | 2020-09-02T01:08:18.000Z | #!/usr/bin/env python
import rospy
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxyActionClient
from actionlib_msgs.msg import GoalStatus
from flexible_manipulation_msgs.msg import StateValidationAction, StateValidationGoal
from moveit_msgs.msg import Constraints, RobotState, ContactI... | 43.173516 | 211 | 0.618932 | #!/usr/bin/env python
import rospy
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxyActionClient
from actionlib_msgs.msg import GoalStatus
from flexible_manipulation_msgs.msg import StateValidationAction, StateValidationGoal
from moveit_msgs.msg import Constraints, RobotState, ContactI... | 3,406 | 0 | 108 |
0000c38c9907915220ad701f5b1b867061a657a4 | 1,120 | py | Python | network/Decoder.py | muberraozmen/MrMP | da6bcccbad85a682c848ff4aa1121c773d779e57 | [
"MIT"
] | null | null | null | network/Decoder.py | muberraozmen/MrMP | da6bcccbad85a682c848ff4aa1121c773d779e57 | [
"MIT"
] | null | null | null | network/Decoder.py | muberraozmen/MrMP | da6bcccbad85a682c848ff4aa1121c773d779e57 | [
"MIT"
] | null | null | null | from network.Modules import *
__all__ = ['Decoder']
| 29.473684 | 101 | 0.682143 | from network.Modules import *
__all__ = ['Decoder']
class DecoderLayer(nn.Module):
def __init__(self, d_model, d_inner, n_head, d_k, d_v, dropout=0.1):
super().__init__()
self.enc_attn = MultiHeadAttention(n_head, d_model, d_k, d_v, dropout=dropout)
self.pos_ffn1 = PositionwiseFeedForwar... | 895 | 13 | 154 |
378cf7dca487527b4a9f6e1bf40392184760e105 | 2,456 | py | Python | blendernc/messages.py | blendernc/blendernc | 11a545270720e5489174b39693d317a797eea273 | [
"MIT"
] | 39 | 2020-06-15T15:58:43.000Z | 2022-02-02T01:11:57.000Z | blendernc/messages.py | netgodz/blendernc | 09ed7c7791da46abb2c5fd3ee83286ef0bf82302 | [
"MIT"
] | 137 | 2020-06-19T15:29:06.000Z | 2022-03-30T11:18:55.000Z | blendernc/messages.py | netgodz/blendernc | 09ed7c7791da46abb2c5fd3ee83286ef0bf82302 | [
"MIT"
] | 8 | 2020-06-17T09:33:12.000Z | 2022-01-21T00:26:19.000Z | #!/usr/bin/env python3
import warnings
import bpy
# TODO Replace all messages with print_message.
# Possibly shift to class when blendernc is initiated. and move to logging.
| 23.390476 | 88 | 0.675896 | #!/usr/bin/env python3
import warnings
import bpy
# TODO Replace all messages with print_message.
# Possibly shift to class when blendernc is initiated. and move to logging.
class PrintMessage(object):
def __init__(self, text, title, icon):
self.message = text()
self.title = title
self.ic... | 1,811 | 6 | 447 |
25d83a23955fc06a3f295c7d49f12798eea2f86b | 1,911 | py | Python | raspeedi/migrations/0001_initial.py | Nels885/csd_dashboard | aa5a3b970c50a2a93af722f962bd87c3728f233c | [
"MIT"
] | null | null | null | raspeedi/migrations/0001_initial.py | Nels885/csd_dashboard | aa5a3b970c50a2a93af722f962bd87c3728f233c | [
"MIT"
] | null | null | null | raspeedi/migrations/0001_initial.py | Nels885/csd_dashboard | aa5a3b970c50a2a93af722f962bd87c3728f233c | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-06-04 11:41
from django.db import migrations, models
| 57.909091 | 239 | 0.591313 | # Generated by Django 2.2.1 on 2019-06-04 11:41
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Raspeedi',
fields=[
('ref_boitier', models.... | 0 | 1,804 | 23 |
98075587e2bfd7e8b06a04f56e0bdc4ea5bc88f8 | 5,808 | py | Python | TP3/MM1K.py | NicolasBologna/Simulacion | d407379b182a373d9f28ca74c25472e711b5fc0f | [
"MIT"
] | null | null | null | TP3/MM1K.py | NicolasBologna/Simulacion | d407379b182a373d9f28ca74c25472e711b5fc0f | [
"MIT"
] | null | null | null | TP3/MM1K.py | NicolasBologna/Simulacion | d407379b182a373d9f28ca74c25472e711b5fc0f | [
"MIT"
] | null | null | null | import sys
import numpy as np
import statistics
import matplotlib.pyplot as plt
from MM1Utiles import funExpon
#README
#Criterio de estabilidad MM1: la tasa de servicio debe ser mayor que la tasa de llegada
NumEvents = 2 #Defimos número de tipos de eventos (usamos 2: arribos y llegadas)
#Constantes a usar para ente... | 31.394595 | 145 | 0.660813 | import sys
import numpy as np
import statistics
import matplotlib.pyplot as plt
from MM1Utiles import funExpon
#README
#Criterio de estabilidad MM1: la tasa de servicio debe ser mayor que la tasa de llegada
NumEvents = 2 #Defimos número de tipos de eventos (usamos 2: arribos y llegadas)
#Constantes a usar para ente... | 3,294 | 0 | 173 |
65dc232a4e565e414a1ddeeebbd38bc5f5656593 | 599 | py | Python | 13022.py | WaiNaat/BOJ-Python | 3365ef090c7dcf6e6a598fea0b25c416a5a3e01b | [
"MIT"
] | null | null | null | 13022.py | WaiNaat/BOJ-Python | 3365ef090c7dcf6e6a598fea0b25c416a5a3e01b | [
"MIT"
] | null | null | null | 13022.py | WaiNaat/BOJ-Python | 3365ef090c7dcf6e6a598fea0b25c416a5a3e01b | [
"MIT"
] | null | null | null | # input
word = input()
# process
'''
처음에 o가 나올때까지 w의 개수를 세면 됨.
'''
isValid = True
i = 0
while i < len(word):
# w
wCnt = 0
while i < len(word) and word[i] == 'w':
i += 1
wCnt += 1
if wCnt == 0: isValid = False
# o
cnt = 0
while i < len(word) and word[i] == 'o':
i += 1
cnt += 1
if cnt != wCnt: isValid = F... | 16.638889 | 40 | 0.540902 | # input
word = input()
# process
'''
처음에 o가 나올때까지 w의 개수를 세면 됨.
'''
isValid = True
i = 0
while i < len(word):
# w
wCnt = 0
while i < len(word) and word[i] == 'w':
i += 1
wCnt += 1
if wCnt == 0: isValid = False
# o
cnt = 0
while i < len(word) and word[i] == 'o':
i += 1
cnt += 1
if cnt != wCnt: isValid = F... | 0 | 0 | 0 |
a5cbcb842d821b1612b92455a043bbf547f0e203 | 795 | py | Python | zaimcsvconverter/zaim_csv_converter.py | yukihiko-shinoda/zaim-csv-converter | 28b124573a6dfdb03fc94985c84684e639346b2c | [
"MIT"
] | 1 | 2020-01-09T00:45:20.000Z | 2020-01-09T00:45:20.000Z | zaimcsvconverter/zaim_csv_converter.py | yukihiko-shinoda/zaim-csv-converter | 28b124573a6dfdb03fc94985c84684e639346b2c | [
"MIT"
] | 4 | 2020-05-31T19:55:26.000Z | 2021-11-13T09:54:02.000Z | zaimcsvconverter/zaim_csv_converter.py | yukihiko-shinoda/zaim-csv-converter | 28b124573a6dfdb03fc94985c84684e639346b2c | [
"MIT"
] | null | null | null | """This module implements converting steps from account CSV to Zaim CSV."""
from zaimcsvconverter import CONFIG, PATH_FILE_CONFIG, DirectoryCsv
from zaimcsvconverter.convert_table_importer import ConvertTableImporter
from zaimcsvconverter.input_csv_converter_iterator import InputCsvConverterIterator
from zaimcsvconvert... | 44.166667 | 96 | 0.788679 | """This module implements converting steps from account CSV to Zaim CSV."""
from zaimcsvconverter import CONFIG, PATH_FILE_CONFIG, DirectoryCsv
from zaimcsvconverter.convert_table_importer import ConvertTableImporter
from zaimcsvconverter.input_csv_converter_iterator import InputCsvConverterIterator
from zaimcsvconvert... | 0 | 0 | 0 |
d5e7c18bd1ec88ecd0da18a5cacdc574bd5930a8 | 1,212 | py | Python | classroom/migrations/0004_roomstream.py | Minecraft3193092/school-classroom | c0ea63f09d4125b0ae9033fd8b0a4aab2604bb42 | [
"Apache-2.0"
] | 11 | 2021-07-16T11:08:29.000Z | 2022-01-10T12:53:03.000Z | classroom/migrations/0004_roomstream.py | Minecraft3193092/school-classroom | c0ea63f09d4125b0ae9033fd8b0a4aab2604bb42 | [
"Apache-2.0"
] | 1 | 2021-11-11T09:35:20.000Z | 2022-01-13T05:15:19.000Z | classroom/migrations/0004_roomstream.py | Allesanddro/Zooming-cls | 5555f1aa588ede6707b34ed8ac91bd4daeb4989c | [
"Apache-2.0"
] | 9 | 2021-09-02T06:30:02.000Z | 2022-03-28T16:53:05.000Z | # Generated by Django 3.1.5 on 2021-07-13 07:22
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
| 36.727273 | 129 | 0.618812 | # Generated by Django 3.1.5 on 2021-07-13 07:22
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('classroom', ... | 0 | 1,020 | 23 |
dc4949ec7770471dd8d5f3920a8442c211a7a49b | 1,584 | py | Python | src/ch02/plot_height_multipanel.py | AAGAN/tsunami | 82635516dcb7f85eb6434ffdb98a9ddc4c1403ad | [
"MIT"
] | 103 | 2018-03-29T23:39:31.000Z | 2022-03-29T12:24:25.000Z | src/ch02/plot_height_multipanel.py | AAGAN/tsunami | 82635516dcb7f85eb6434ffdb98a9ddc4c1403ad | [
"MIT"
] | 13 | 2018-04-06T14:33:04.000Z | 2022-03-21T19:50:12.000Z | src/ch02/plot_height_multipanel.py | AAGAN/tsunami | 82635516dcb7f85eb6434ffdb98a9ddc4c1403ad | [
"MIT"
] | 32 | 2018-04-01T19:54:12.000Z | 2022-03-27T14:06:03.000Z | """
plot_water_height_multipanel.py
Reads output of tsunami and plots the results in an image file.
"""
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('input_file', help='text file output by the tsunami simulator (chapter 2 version)')
args = parser.parse_args()
input_file = args.input_file
im... | 25.967213 | 103 | 0.667298 | """
plot_water_height_multipanel.py
Reads output of tsunami and plots the results in an image file.
"""
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('input_file', help='text file output by the tsunami simulator (chapter 2 version)')
args = parser.parse_args()
input_file = args.input_file
im... | 0 | 0 | 0 |
7397c45fd6ce87f11502a2835e27ad1692511b42 | 1,751 | py | Python | Leet-Code/Backspace String Compare.py | aminzayer/My-Python-Code | 475e99a134f11e5784478c1d68bce7033ffe02a2 | [
"MIT"
] | 2 | 2022-02-16T22:24:14.000Z | 2022-02-24T16:59:42.000Z | Leet-Code/Backspace String Compare.py | aminzayer/My-Python-Code | 475e99a134f11e5784478c1d68bce7033ffe02a2 | [
"MIT"
] | null | null | null | Leet-Code/Backspace String Compare.py | aminzayer/My-Python-Code | 475e99a134f11e5784478c1d68bce7033ffe02a2 | [
"MIT"
] | null | null | null | # Backspace String Compare
""" Given two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace character.
Note that after backspacing an empty text, the text will continue empty.
Example 1:
Input: s = "ab#c", t = "ad#c"
Output: true
Explanation: Both s and... | 24.661972 | 138 | 0.467733 | # Backspace String Compare
""" Given two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace character.
Note that after backspacing an empty text, the text will continue empty.
Example 1:
Input: s = "ab#c", t = "ad#c"
Output: true
Explanation: Both s and... | 1,058 | -6 | 49 |
27ad12942b6502b5ad80e3d82eafd85656556fd1 | 632 | py | Python | jpipes/cli/controllers/base.py | derks/jpipes | 91f4614da7de7d982bf331d307d30fd7994eaa7b | [
"BSD-3-Clause"
] | 1 | 2020-04-25T13:27:05.000Z | 2020-04-25T13:27:05.000Z | jpipes/cli/controllers/base.py | derks/jpipes | 91f4614da7de7d982bf331d307d30fd7994eaa7b | [
"BSD-3-Clause"
] | 2 | 2017-04-28T18:31:12.000Z | 2017-04-28T19:23:48.000Z | jpipes/cli/controllers/base.py | derks/jpipes | 91f4614da7de7d982bf331d307d30fd7994eaa7b | [
"BSD-3-Clause"
] | null | null | null |
import sys
from time import sleep
from cement.ext.ext_argparse import ArgparseController, expose as ex
| 24.307692 | 68 | 0.672468 |
import sys
from time import sleep
from cement.ext.ext_argparse import ArgparseController, expose as ex
class BaseController(ArgparseController):
class Meta:
label = 'base'
description = 'Jenkins Pipeline Automation'
default_func = '_default'
@ex(hide=True)
def _default(self):
... | 160 | 320 | 46 |
501996cb5578902068a7dde08a1ee813c501b3a5 | 921 | py | Python | pytdd/dollar.py | marcelotrevisani/tdd-presentation | a8851c5df4c15dcfe47c16384a82d7a883e2102d | [
"MIT"
] | null | null | null | pytdd/dollar.py | marcelotrevisani/tdd-presentation | a8851c5df4c15dcfe47c16384a82d7a883e2102d | [
"MIT"
] | null | null | null | pytdd/dollar.py | marcelotrevisani/tdd-presentation | a8851c5df4c15dcfe47c16384a82d7a883e2102d | [
"MIT"
] | null | null | null | import requests
URL_API = r"https://www.alphavantage.co/query?function=CURRENCY_EXCHANGE_RATE"
API_KEY = "FJOSXYTTSW4VUT7H"
| 27.088235 | 79 | 0.661238 | import requests
URL_API = r"https://www.alphavantage.co/query?function=CURRENCY_EXCHANGE_RATE"
API_KEY = "FJOSXYTTSW4VUT7H"
class Dollar:
def __init__(self, value):
self._value = value
def __add__(self, dollar_add):
return Dollar(self._value + dollar_add.value)
@property
def value(s... | 605 | 167 | 23 |
70cf10f92c92a45bd7efc7454c1bd861a6c5caf3 | 3,525 | py | Python | experiments/mj60/sync_data.py | sweigart/pygama | 3c5fe4c69230814933b2de879b9a305ff0d4ad5e | [
"Apache-2.0"
] | 13 | 2019-05-01T01:37:30.000Z | 2022-03-18T08:52:19.000Z | experiments/mj60/sync_data.py | sweigart/pygama | 3c5fe4c69230814933b2de879b9a305ff0d4ad5e | [
"Apache-2.0"
] | 111 | 2019-03-25T00:50:48.000Z | 2022-03-30T17:13:43.000Z | experiments/mj60/sync_data.py | sweigart/pygama | 3c5fe4c69230814933b2de879b9a305ff0d4ad5e | [
"Apache-2.0"
] | 52 | 2019-01-24T21:05:04.000Z | 2022-03-07T23:37:55.000Z | #!/usr/bin/env python3
import os
import glob
import json
from datetime import datetime
import subprocess as sp
from pprint import pprint
from pygama.utils import *
def main():
"""
sync MJ60 data with cenpa-rocks.
- rsync the entire Data/MJ60 directory using the $DATADIR variable
- set flags to then rem... | 29.621849 | 79 | 0.601135 | #!/usr/bin/env python3
import os
import glob
import json
from datetime import datetime
import subprocess as sp
from pprint import pprint
from pygama.utils import *
def main():
"""
sync MJ60 data with cenpa-rocks.
- rsync the entire Data/MJ60 directory using the $DATADIR variable
- set flags to then rem... | 0 | 0 | 0 |
61df2b933869a21dbcd5ef0a8ddbcdd052aeb71c | 453 | py | Python | VHDTools/PyVinil/setup.py | maerd-zinbieL/x86 | 88a5ba9894a5f1319dd3aff13696ecf73803c765 | [
"MIT"
] | null | null | null | VHDTools/PyVinil/setup.py | maerd-zinbieL/x86 | 88a5ba9894a5f1319dd3aff13696ecf73803c765 | [
"MIT"
] | null | null | null | VHDTools/PyVinil/setup.py | maerd-zinbieL/x86 | 88a5ba9894a5f1319dd3aff13696ecf73803c765 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name='PyVinil',
version='0.1.0',
author='Igor Bonadio',
author_email='igorbonadio@gmail.com',
packages=['pyvinil', 'pyvinil.test'],
url='https://github.com/igorbonadio/pyvinil',
license='LICENSE.txt',
description='PyVinil is a Python library, whic... | 34.846154 | 133 | 0.693157 | from distutils.core import setup
setup(
name='PyVinil',
version='0.1.0',
author='Igor Bonadio',
author_email='igorbonadio@gmail.com',
packages=['pyvinil', 'pyvinil.test'],
url='https://github.com/igorbonadio/pyvinil',
license='LICENSE.txt',
description='PyVinil is a Python library, whic... | 0 | 0 | 0 |
db5922ac640569bd2ff71faaaf243e178ad47431 | 8,641 | py | Python | boto3_mock/mock_client.py | yutaka-kabu/pandas-redshift | 1e5f808d110ca82b77b28a383695743622e14d27 | [
"BSD-3-Clause"
] | null | null | null | boto3_mock/mock_client.py | yutaka-kabu/pandas-redshift | 1e5f808d110ca82b77b28a383695743622e14d27 | [
"BSD-3-Clause"
] | 3 | 2021-08-10T01:01:59.000Z | 2021-08-10T02:39:37.000Z | boto3_mock/mock_client.py | yutaka-kabu/pandas-redshift | 1e5f808d110ca82b77b28a383695743622e14d27 | [
"BSD-3-Clause"
] | 1 | 2021-09-24T02:19:57.000Z | 2021-09-24T02:19:57.000Z | import copy
import jsonschema
from jsonschema import ValidationError
from datetime import datetime
from dateutil.tz import tzlocal
from botocore import xform_name
from botocore.model import ServiceModel
from botocore.serialize import create_serializer
import botocore.session
botocore_session = botocore.session.get... | 33.10728 | 78 | 0.594607 | import copy
import jsonschema
from jsonschema import ValidationError
from datetime import datetime
from dateutil.tz import tzlocal
from botocore import xform_name
from botocore.model import ServiceModel
from botocore.serialize import create_serializer
import botocore.session
botocore_session = botocore.session.get... | 6,592 | 1,606 | 46 |
cf09709decd334b101b925de361fe7d9fdd3b7a0 | 1,240 | py | Python | bbdev/utils.py | ekivemark/BlueButtonDev | c751a5c52a83df6b97ef2c653a4492d959610c42 | [
"Apache-2.0"
] | null | null | null | bbdev/utils.py | ekivemark/BlueButtonDev | c751a5c52a83df6b97ef2c653a4492d959610c42 | [
"Apache-2.0"
] | 7 | 2020-02-11T23:00:50.000Z | 2021-12-13T19:41:39.000Z | bbdev/utils.py | ekivemark/BlueButtonDev | c751a5c52a83df6b97ef2c653a4492d959610c42 | [
"Apache-2.0"
] | 2 | 2018-10-06T21:46:22.000Z | 2020-10-10T16:10:42.000Z | """
bluebuttondev.bbdev
FILE: utils
Created: 6/16/15 12:11 AM
Basic conversion tools
"""
__author__ = 'Mark Scrimshire:@ekivemark'
def email_mask(email=""):
"""
mask and potentially shorten an email address
Useful for communications
:param email:
:return:
"""
if email=="":
retu... | 20 | 70 | 0.565323 | """
bluebuttondev.bbdev
FILE: utils
Created: 6/16/15 12:11 AM
Basic conversion tools
"""
__author__ = 'Mark Scrimshire:@ekivemark'
def str2int(inp):
output = 0 + int(inp)
return output
def str2bool(inp):
output = False
if inp.upper() == "TRUE":
output = True
elif inp.upper() == "FALSE":
... | 592 | 0 | 92 |
9c243c1755c8320c9607913fee3e4483abf4735a | 2,026 | py | Python | testsuite/tests/apicast/policy/caching/test_caching_policy_allow.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | 5 | 2021-11-04T14:09:24.000Z | 2021-12-23T13:48:36.000Z | testsuite/tests/apicast/policy/caching/test_caching_policy_allow.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | 41 | 2021-11-03T14:27:21.000Z | 2022-03-29T14:46:16.000Z | testsuite/tests/apicast/policy/caching/test_caching_policy_allow.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | 12 | 2021-11-03T17:28:31.000Z | 2021-11-30T12:28:25.000Z | """
Rewrite spec/functional_specs/policies/caching/caching_allow_policy_spec.rb
"""
import pytest
from testsuite import rawobj
from testsuite.capabilities import Capability
@pytest.fixture(scope="module")
def policy_settings():
"Add caching policy configured as 'caching_type': 'allow'"
return rawobj.PolicyCo... | 36.178571 | 87 | 0.685094 | """
Rewrite spec/functional_specs/policies/caching/caching_allow_policy_spec.rb
"""
import pytest
from testsuite import rawobj
from testsuite.capabilities import Capability
@pytest.fixture(scope="module")
def policy_settings():
"Add caching policy configured as 'caching_type': 'allow'"
return rawobj.PolicyCo... | 0 | 0 | 0 |
ceb1b9eef7aadc583f322e87617783f52bf1e3a2 | 5,475 | py | Python | python/pyspark/pandas/indexes/numeric.py | akhalymon-cv/spark | 76191b9151b6a7804f8894e53eef74106f98b787 | [
"Apache-2.0"
] | 35,083 | 2015-01-01T03:05:13.000Z | 2022-03-31T21:57:40.000Z | python/pyspark/pandas/indexes/numeric.py | akhalymon-cv/spark | 76191b9151b6a7804f8894e53eef74106f98b787 | [
"Apache-2.0"
] | 32,117 | 2015-01-01T00:00:24.000Z | 2022-03-31T23:54:58.000Z | python/pyspark/pandas/indexes/numeric.py | akhalymon-cv/spark | 76191b9151b6a7804f8894e53eef74106f98b787 | [
"Apache-2.0"
] | 29,687 | 2015-01-01T02:40:43.000Z | 2022-03-31T16:49:33.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 27.651515 | 99 | 0.628493 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 1,889 | 0 | 77 |
2357e757eeab0c39ba22803f30a4f577979d9970 | 2,010 | py | Python | common/func_plots.py | jdvelasq/demand-forecast-using-time-series-clustering | 5d08f225076dbd370944202143e85e46a8962655 | [
"MIT"
] | null | null | null | common/func_plots.py | jdvelasq/demand-forecast-using-time-series-clustering | 5d08f225076dbd370944202143e85e46a8962655 | [
"MIT"
] | null | null | null | common/func_plots.py | jdvelasq/demand-forecast-using-time-series-clustering | 5d08f225076dbd370944202143e85e46a8962655 | [
"MIT"
] | 1 | 2021-07-17T19:28:24.000Z | 2021-07-17T19:28:24.000Z | from statsmodels.graphics.tsaplots import plot_acf
from statsmodels.graphics.tsaplots import plot_pacf
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
__author__ = "Jose Fernando Montoya Cardona"
__credits__ = ["Jose Fernando Montoya Cardona"]
__email__ = "jomon... | 36.545455 | 110 | 0.681592 | from statsmodels.graphics.tsaplots import plot_acf
from statsmodels.graphics.tsaplots import plot_pacf
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
__author__ = "Jose Fernando Montoya Cardona"
__credits__ = ["Jose Fernando Montoya Cardona"]
__email__ = "jomon... | 1,575 | 0 | 92 |
4855f833b139d223b0bf8bfee33e39906051e030 | 952 | py | Python | src/genie/libs/parser/iosxe/tests/ShowStackPower/cli/equal/golden_output_c3850_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/iosxe/tests/ShowStackPower/cli/equal/golden_output_c3850_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/iosxe/tests/ShowStackPower/cli/equal/golden_output_c3850_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | expected_output = {
"power_stack": {
"Powerstack-1": {
"switch_num": 1,
"allocated_power": 200,
"topology": "Stndaln",
"unused_power": 485,
"power_supply_num": 1,
"total_power": 715,
"mode": "SP-PS",
"reserved_p... | 27.2 | 35 | 0.423319 | expected_output = {
"power_stack": {
"Powerstack-1": {
"switch_num": 1,
"allocated_power": 200,
"topology": "Stndaln",
"unused_power": 485,
"power_supply_num": 1,
"total_power": 715,
"mode": "SP-PS",
"reserved_p... | 0 | 0 | 0 |
d1bd8f9d238d2aa19bb05482a8ad5ba9649d115d | 630 | py | Python | tests/sample/climate_sample_test.py | south-coast-science/scs_core | 81ad4010abb37ca935f3a31ac805639ef53b1bcf | [
"MIT"
] | 3 | 2019-03-12T01:59:58.000Z | 2020-09-12T07:27:42.000Z | tests/sample/climate_sample_test.py | south-coast-science/scs_core | 81ad4010abb37ca935f3a31ac805639ef53b1bcf | [
"MIT"
] | 1 | 2018-04-20T07:58:38.000Z | 2021-03-27T08:52:45.000Z | tests/sample/climate_sample_test.py | south-coast-science/scs_core | 81ad4010abb37ca935f3a31ac805639ef53b1bcf | [
"MIT"
] | 4 | 2017-09-29T13:08:43.000Z | 2019-10-09T09:13:58.000Z | #!/usr/bin/env python3
"""
Created on 16 Nov 2020
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
import json
from scs_core.data.json import JSONify
from scs_core.sample.climate_sample import ClimateSample
# -------------------------------------------------------------------------------------------... | 21 | 118 | 0.555556 | #!/usr/bin/env python3
"""
Created on 16 Nov 2020
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
import json
from scs_core.data.json import JSONify
from scs_core.sample.climate_sample import ClimateSample
# -------------------------------------------------------------------------------------------... | 0 | 0 | 0 |
0bedc3e831ab7fb8bdaaae07208c05d1cd94b9d2 | 680 | py | Python | classifier.py | monkey-cli/monkey-trainer | 50ad34f1ace21ac4435806c3521e4cab5e16c540 | [
"MIT"
] | null | null | null | classifier.py | monkey-cli/monkey-trainer | 50ad34f1ace21ac4435806c3521e4cab5e16c540 | [
"MIT"
] | 1 | 2021-02-12T18:57:24.000Z | 2021-02-12T18:58:15.000Z | classifier.py | monkey-cli/monkey-trainer | 50ad34f1ace21ac4435806c3521e4cab5e16c540 | [
"MIT"
] | null | null | null | import cv2
import subprocess
imageURI = "dummy.png"
image = cv2.imread(imageURI)
cv2.imshow("Focus window", image)
# Device type, simple check
isIOS = True
scriptPath = None
if isIOS:
scriptPath = "./monkey-scripts/monkey-screenshot-ios.sh"
else:
scriptPath = "./monkey-scripts/monkey-screenshot-android.sh"
... | 22.666667 | 69 | 0.630882 | import cv2
import subprocess
imageURI = "dummy.png"
image = cv2.imread(imageURI)
cv2.imshow("Focus window", image)
# Device type, simple check
isIOS = True
scriptPath = None
if isIOS:
scriptPath = "./monkey-scripts/monkey-screenshot-ios.sh"
else:
scriptPath = "./monkey-scripts/monkey-screenshot-android.sh"
... | 0 | 0 | 0 |
f913182b513ae01ec8491113fe37ccedc418d446 | 363 | py | Python | examples/example_stdIn.py | Prince2347X/pydoodle | c5dbf5c43eb120eed45a44a8de30848b271eb1b2 | [
"MIT"
] | 11 | 2021-04-05T07:33:32.000Z | 2021-11-21T16:50:59.000Z | examples/example_stdIn.py | Prince2347X/pydoodle | c5dbf5c43eb120eed45a44a8de30848b271eb1b2 | [
"MIT"
] | null | null | null | examples/example_stdIn.py | Prince2347X/pydoodle | c5dbf5c43eb120eed45a44a8de30848b271eb1b2 | [
"MIT"
] | 3 | 2021-05-03T13:53:58.000Z | 2021-06-26T05:11:50.000Z | import pydoodle
c = pydoodle.Compiler(clientId="client-id",
clientSecret="client-secret")
with open(file="test2.py") as f:
script = f.read()
f.close()
result = c.execute(script=script, language="python3",
stdIn="1st Input ||2nd Input") # Double pipe(||) is used to sepa... | 33 | 105 | 0.630854 | import pydoodle
c = pydoodle.Compiler(clientId="client-id",
clientSecret="client-secret")
with open(file="test2.py") as f:
script = f.read()
f.close()
result = c.execute(script=script, language="python3",
stdIn="1st Input ||2nd Input") # Double pipe(||) is used to sepa... | 0 | 0 | 0 |
2d08d8891b2a537c867a0fe586168d7a88dacc35 | 484 | py | Python | bdcloud_paper/python_prototype/samplers.py | rnowling/bigpetstore-data-generator | fae5a4a84343d06545ebed77be35bc527d625ad7 | [
"Apache-2.0"
] | 6 | 2015-04-08T02:56:41.000Z | 2021-05-26T15:21:17.000Z | bdcloud_paper/python_prototype/samplers.py | rnowling/bigpetstore-data-generator | fae5a4a84343d06545ebed77be35bc527d625ad7 | [
"Apache-2.0"
] | 8 | 2015-01-10T02:02:49.000Z | 2015-02-12T15:27:44.000Z | bdcloud_paper/python_prototype/samplers.py | rnowling/bigpetstore-data-generator | fae5a4a84343d06545ebed77be35bc527d625ad7 | [
"Apache-2.0"
] | 5 | 2015-08-30T19:56:42.000Z | 2018-12-30T22:16:35.000Z | import random
| 25.473684 | 54 | 0.528926 | import random
class RouletteWheelSampler(object):
def __init__(self, values):
self._wheel = []
end = 0.0
for x, w in values:
end += w
self._wheel.append((end, x))
def sample(self):
r = random.random()
for end, x in self._wheel:
if r <... | 380 | 14 | 76 |
b39c4cdcb731753ed352c502c1d23118d2de8c0b | 3,231 | py | Python | kratos/tests/test_delete_model_parts_modeler.py | hbayraktaroglu/Kratos | 6b71869ca7adb36a798e0cb11b34287fdc482590 | [
"BSD-4-Clause"
] | null | null | null | kratos/tests/test_delete_model_parts_modeler.py | hbayraktaroglu/Kratos | 6b71869ca7adb36a798e0cb11b34287fdc482590 | [
"BSD-4-Clause"
] | null | null | null | kratos/tests/test_delete_model_parts_modeler.py | hbayraktaroglu/Kratos | 6b71869ca7adb36a798e0cb11b34287fdc482590 | [
"BSD-4-Clause"
] | null | null | null | # Importing the Kratos Library
import KratosMultiphysics
import KratosMultiphysics.KratosUnittest as KratosUnittest
from KratosMultiphysics.modelers.delete_model_parts_modeler import DeleteModelPartsModeler
if __name__ == '__main__':
KratosMultiphysics.Logger.GetDefaultOutput().SetSeverity(KratosMultiphysics.Logge... | 46.826087 | 105 | 0.7264 | # Importing the Kratos Library
import KratosMultiphysics
import KratosMultiphysics.KratosUnittest as KratosUnittest
from KratosMultiphysics.modelers.delete_model_parts_modeler import DeleteModelPartsModeler
class TestDeleteModelPartModeler(KratosUnittest.TestCase):
def testDeleteModelPartModelerOneModelPart(self):... | 2,753 | 37 | 76 |
64652ddca6102b9868aadc77bb15fee6c313ab7e | 548 | py | Python | angalabiri/shop/migrations/0004_productvariation_varation_type.py | dark-codr/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | 1 | 2021-03-25T14:06:23.000Z | 2021-03-25T14:06:23.000Z | angalabiri/shop/migrations/0004_productvariation_varation_type.py | dark-codr/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | 5 | 2021-09-08T03:08:46.000Z | 2022-03-12T00:56:35.000Z | angalabiri/shop/migrations/0004_productvariation_varation_type.py | me-edavids/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-31 22:21
from django.db import migrations, models
| 28.842105 | 201 | 0.620438 | # Generated by Django 3.1.7 on 2021-03-31 22:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0003_product_old_stock'),
]
operations = [
migrations.AddField(
model_name='productvariation',
name='varatio... | 0 | 434 | 23 |
b6614a7082de6cf37bfc2b8529705dec58d50267 | 3,410 | py | Python | sbws/util/state.py | juga0/simple-bw-scanner | fd139b89de20b6d38941f137325e05069995793b | [
"CC0-1.0"
] | 15 | 2018-09-24T00:56:19.000Z | 2022-03-30T08:47:20.000Z | sbws/util/state.py | juga0/simple-bw-scanner | fd139b89de20b6d38941f137325e05069995793b | [
"CC0-1.0"
] | 52 | 2018-10-08T08:27:38.000Z | 2020-03-09T14:40:26.000Z | sbws/util/state.py | juga0/simple-bw-scanner | fd139b89de20b6d38941f137325e05069995793b | [
"CC0-1.0"
] | 11 | 2018-10-05T16:36:44.000Z | 2021-12-29T14:47:43.000Z | from sbws.util.filelock import FileLock
import os
import json
from .json import CustomDecoder, CustomEncoder
class State:
"""
`json` wrapper to read a json file every time it gets a key and to write
to the file every time a key is set.
Every time a key is got or set, the file is locked, to atomicall... | 31 | 78 | 0.583871 | from sbws.util.filelock import FileLock
import os
import json
from .json import CustomDecoder, CustomEncoder
class State:
"""
`json` wrapper to read a json file every time it gets a key and to write
to the file every time a key is set.
Every time a key is got or set, the file is locked, to atomicall... | 1,099 | 0 | 243 |
c5492ac6722300d26d1822224e145070df8b46c3 | 918 | py | Python | day09/day09.py | alcatrazEscapee/AdventOfCode2021 | a473b01b8931791b4a1fd03bf05b286ed0ac9f85 | [
"MIT"
] | 4 | 2021-12-07T22:25:51.000Z | 2021-12-22T18:15:25.000Z | day09/day09.py | alcatrazEscapee/AdventOfCode2021 | a473b01b8931791b4a1fd03bf05b286ed0ac9f85 | [
"MIT"
] | null | null | null | day09/day09.py | alcatrazEscapee/AdventOfCode2021 | a473b01b8931791b4a1fd03bf05b286ed0ac9f85 | [
"MIT"
] | 1 | 2021-12-17T00:47:26.000Z | 2021-12-17T00:47:26.000Z | # Day 9: Smoke Basin
# Leaderboard Rank: 60 / 20
from utils import FiniteGrid, get_input
from collections import Counter
if __name__ == '__main__':
main(get_input())
| 28.6875 | 86 | 0.603486 | # Day 9: Smoke Basin
# Leaderboard Rank: 60 / 20
from utils import FiniteGrid, get_input
from collections import Counter
def main(text: str):
grid: FiniteGrid[int] = FiniteGrid.of_str(text, default='9').map_values(int)
risk = 0
for pos in grid.locations():
height = grid[pos]
if all(heigh... | 721 | 0 | 23 |
d29f6c144da74d1fa33b5a79532d015a19b058b9 | 3,834 | py | Python | djangoql/lexer.py | Bodyhealer/djangoql | 4e95317997a9543444a1eea22c6e71710525661c | [
"MIT"
] | null | null | null | djangoql/lexer.py | Bodyhealer/djangoql | 4e95317997a9543444a1eea22c6e71710525661c | [
"MIT"
] | null | null | null | djangoql/lexer.py | Bodyhealer/djangoql | 4e95317997a9543444a1eea22c6e71710525661c | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import ply.lex as lex
from ply.lex import TOKEN
from .exceptions import DjangoQLLexerError
| 22.686391 | 76 | 0.532603 | from __future__ import unicode_literals
import ply.lex as lex
from ply.lex import TOKEN
from .exceptions import DjangoQLLexerError
class DjangoQLLexer(object):
def __init__(self, **kwargs):
self._lexer = lex.lex(module=self, **kwargs)
self.reset()
def reset(self):
self.text = ''
... | 898 | 2,779 | 23 |
f1ca6994cfa86a641058969e3ef4a37d988330ff | 3,539 | py | Python | Python3-Learn/AdventureWithRio.py | nikhiljain-413/Hacktoberfest2021_beginner | 56b008c9ed294c3fc23b44fa13faced99948236d | [
"MIT"
] | 65 | 2021-10-01T07:02:29.000Z | 2022-03-23T10:41:37.000Z | Python3-Learn/AdventureWithRio.py | nikhiljain-413/Hacktoberfest2021_beginner | 56b008c9ed294c3fc23b44fa13faced99948236d | [
"MIT"
] | 82 | 2021-10-01T14:21:42.000Z | 2022-03-29T03:43:58.000Z | Python3-Learn/AdventureWithRio.py | nikhiljain-413/Hacktoberfest2021_beginner | 56b008c9ed294c3fc23b44fa13faced99948236d | [
"MIT"
] | 210 | 2021-10-01T07:02:39.000Z | 2022-03-27T17:41:00.000Z | #AUTHOR: Rio Cantre
#Python3 Concept: Adventure Game
#GITHUB: https://github.com/RioCantre
import time
import random
weather = ["sunny", "rainy", "stormy", "windy", "snowy", "dark"]
ambience = random.choice(weather)
tools = ["flashlight", "stick", "bat", "gun", "phone", "knife"]
weapon = random.choice(tools)
emotio... | 32.768519 | 76 | 0.631534 | #AUTHOR: Rio Cantre
#Python3 Concept: Adventure Game
#GITHUB: https://github.com/RioCantre
import time
import random
weather = ["sunny", "rainy", "stormy", "windy", "snowy", "dark"]
ambience = random.choice(weather)
tools = ["flashlight", "stick", "bat", "gun", "phone", "knife"]
weapon = random.choice(tools)
emotio... | 2,942 | 0 | 161 |
44dd6ee2425f137fd9c53b0be99c6741efb74649 | 1,596 | py | Python | tests/test_day17_2.py | pcalg/AdventOfCode2019 | 93b55414c7ad13d2d74d1dea1df98dd481b94d5a | [
"MIT"
] | null | null | null | tests/test_day17_2.py | pcalg/AdventOfCode2019 | 93b55414c7ad13d2d74d1dea1df98dd481b94d5a | [
"MIT"
] | 6 | 2020-02-04T20:45:02.000Z | 2020-02-04T20:45:03.000Z | tests/test_day17_2.py | pcalg/AdventOfCode2019 | 93b55414c7ad13d2d74d1dea1df98dd481b94d5a | [
"MIT"
] | null | null | null | from app.day17_2 import cross2d
from app.day17_2 import len_route
from app.day17_2 import all_sub_lists
from app.day17_2 import possible_register_values
from app.day17_2 import has_possible_route
| 37.116279 | 93 | 0.464286 | from app.day17_2 import cross2d
from app.day17_2 import len_route
from app.day17_2 import all_sub_lists
from app.day17_2 import possible_register_values
from app.day17_2 import has_possible_route
class TestDay17_2:
def test_cross2d(self):
assert cross2d((0, 1), (1, 0)) == -1
assert cross2d((0, 1)... | 1,244 | -3 | 158 |
1bebd0e161e5d84621069a3146b89b69793f068a | 508 | py | Python | biopanning_data_bank/bdb_tables/sotmc.py | griffinclausen/bdb | 5b29995ebf399ce47a874984bd6e9eec879327b8 | [
"MIT"
] | null | null | null | biopanning_data_bank/bdb_tables/sotmc.py | griffinclausen/bdb | 5b29995ebf399ce47a874984bd6e9eec879327b8 | [
"MIT"
] | 1 | 2021-06-01T23:26:15.000Z | 2021-06-01T23:26:15.000Z | biopanning_data_bank/bdb_tables/sotmc.py | griffinclausen/bdb | 5b29995ebf399ce47a874984bd6e9eec879327b8 | [
"MIT"
] | null | null | null | from biopanning_data_bank.bdb_tables.tables import (
BDB_Entry, BDB_Database)
from biopanning_data_bank.bdb_tables.fields import (
SOTMC_FIELDS)
class SOTMC(BDB_Entry):
"""
SOTMC entry container from Biopanning Data Bank SOTMC Database.
"""
| 23.090909 | 67 | 0.688976 | from biopanning_data_bank.bdb_tables.tables import (
BDB_Entry, BDB_Database)
from biopanning_data_bank.bdb_tables.fields import (
SOTMC_FIELDS)
class SOTMCDatabase(BDB_Database):
def __init__(self, entries):
self.fields = SOTMC_FIELDS
super().__init__(entries)
class SOTMC(BDB_E... | 146 | 13 | 77 |
57a23ec08a099a9c054fd60256f6bc69af42a90b | 6,268 | py | Python | enaml/core/block_compiler.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 1,080 | 2015-01-04T14:29:34.000Z | 2022-03-29T05:44:51.000Z | enaml/core/block_compiler.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 308 | 2015-01-05T22:44:13.000Z | 2022-03-30T21:19:18.000Z | enaml/core/block_compiler.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 123 | 2015-01-25T16:33:48.000Z | 2022-02-25T19:57:10.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2013-2017, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#------------------------------------------------... | 33.164021 | 79 | 0.628271 | #------------------------------------------------------------------------------
# Copyright (c) 2013-2017, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#------------------------------------------------... | 4,269 | 0 | 485 |
e7bda1f0e2ab84fc86e9229ca20b8b5215ecebd9 | 46 | py | Python | deidentify/tokenizer/__init__.py | bbieniek/deidentify | 7021bf0540e0a7f931e65544d12a2909c79a14eb | [
"MIT"
] | 64 | 2020-01-16T16:20:47.000Z | 2022-03-31T12:59:19.000Z | deidentify/tokenizer/__init__.py | HabibMrad/deidentify | d8960a74c852a71b29a6ee0fd6a3cf7f946a5f60 | [
"MIT"
] | 14 | 2020-01-28T08:47:06.000Z | 2022-02-12T08:32:12.000Z | deidentify/tokenizer/__init__.py | HabibMrad/deidentify | d8960a74c852a71b29a6ee0fd6a3cf7f946a5f60 | [
"MIT"
] | 12 | 2020-01-21T07:54:04.000Z | 2022-02-19T06:42:53.000Z | from .base import Tokenizer, TokenizerFactory
| 23 | 45 | 0.847826 | from .base import Tokenizer, TokenizerFactory
| 0 | 0 | 0 |
1371183d26f36f81df8c25639f4523c744c2c32b | 1,682 | py | Python | pwn/writeup.py | GinkgoTeam/2019YJTZB | 7acb23f145ff70e09baade92e6b5a65856b36a1e | [
"MIT"
] | 41 | 2019-05-13T14:22:58.000Z | 2021-11-12T03:30:10.000Z | pwn/writeup.py | GinkgoTeam/2019YJTZB | 7acb23f145ff70e09baade92e6b5a65856b36a1e | [
"MIT"
] | null | null | null | pwn/writeup.py | GinkgoTeam/2019YJTZB | 7acb23f145ff70e09baade92e6b5a65856b36a1e | [
"MIT"
] | 10 | 2019-05-13T22:49:22.000Z | 2021-02-16T20:33:32.000Z | from pwn import *
import requests
import time
import re
for i in range(101,125):
try:
ip='172.20.{}.101'.format(str(i))
flag=main(ip)
print ip,flag
time.sleep(11)
except:
print 'wrong' | 18.086022 | 41 | 0.631391 | from pwn import *
import requests
import time
import re
def main(ip):
p=remote(ip,10000)
elf=ELF('./calculator')
system_addr=elf.symbols['system']
binsh_addr=0x006020A0
poprdi=0x00400ec3
poprsi=0x400ec1
frmst_addr=0x400FD2
scanf_plt=elf.symbols['__isoc99_scanf']
#context.log_level='debu... | 1,443 | 0 | 25 |
9b6af6ffc3ebeeecd335510475daec57d7b18297 | 3,615 | py | Python | dogs-vs-cats-tf-cnn.py | sandeshrjain/DNN_helper | 1d03c794c1b54193f4a6fca177f34600c5a9c4e0 | [
"MIT"
] | null | null | null | dogs-vs-cats-tf-cnn.py | sandeshrjain/DNN_helper | 1d03c794c1b54193f4a6fca177f34600c5a9c4e0 | [
"MIT"
] | null | null | null | dogs-vs-cats-tf-cnn.py | sandeshrjain/DNN_helper | 1d03c794c1b54193f4a6fca177f34600c5a9c4e0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 7 15:08:04 2022
@author: Sandesh Jain
"""
import tensorflow as tf
import numpy as np
import os
from tensorflow.keras.models import Model
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.layers import (Conv2D, Dense, F... | 30.378151 | 133 | 0.526141 | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 7 15:08:04 2022
@author: Sandesh Jain
"""
import tensorflow as tf
import numpy as np
import os
from tensorflow.keras.models import Model
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.layers import (Conv2D, Dense, F... | 1,888 | 0 | 51 |
836d5f3396fbb107c7f1329399d9eb4e57f2fdd0 | 5,575 | py | Python | io_tools/msrsync_sim.py | samuelsh/MultiFileOps | bc998fee6b02120a7783527767c93d5bf2ebfacd | [
"MIT"
] | 5 | 2019-06-05T11:22:25.000Z | 2020-07-13T10:37:01.000Z | io_tools/msrsync_sim.py | samuelsh/MultiFileOps | bc998fee6b02120a7783527767c93d5bf2ebfacd | [
"MIT"
] | 1 | 2021-01-05T11:18:27.000Z | 2021-01-05T11:18:27.000Z | io_tools/msrsync_sim.py | samuelsh/pyfs_stress | bc998fee6b02120a7783527767c93d5bf2ebfacd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.6
"""
author: samuels
"""
import argparse
import hashlib
import os
import queue
import sys
import random
import threading
sys.path.append(os.path.join(os.path.join('../')))
from concurrent.futures import ThreadPoolExecutor
from threading import Event
from client.generic_mounter import Mounter
... | 33.787879 | 120 | 0.650583 | #!/usr/bin/env python3.6
"""
author: samuels
"""
import argparse
import hashlib
import os
import queue
import sys
import random
import threading
sys.path.append(os.path.join(os.path.join('../')))
from concurrent.futures import ThreadPoolExecutor
from threading import Event
from client.generic_mounter import Mounter
... | 4,523 | 17 | 214 |
61a8114a54c19e8c1a637205d2457235593b05db | 916 | py | Python | test/python_comparison.py | fmaguire/metagenome_simulator | 79fc18ab21a897d2d16cca45e40e934acbf315d6 | [
"MIT"
] | null | null | null | test/python_comparison.py | fmaguire/metagenome_simulator | 79fc18ab21a897d2d16cca45e40e934acbf315d6 | [
"MIT"
] | null | null | null | test/python_comparison.py | fmaguire/metagenome_simulator | 79fc18ab21a897d2d16cca45e40e934acbf315d6 | [
"MIT"
] | null | null | null |
if __name__=="__main__":
name_to_aro = {'mel': "3000616", 'pmrA':"3000822" , 'patB': "3000025"}
strict_perfect = {'500': "strict", '1000': "perfect"}
expected_bedtool_labels = open('bedtools_labels.tsv', 'w')
labels = {}
with open('intersection.tsv') as fh:
for line in fh:
li... | 31.586207 | 79 | 0.505459 |
if __name__=="__main__":
name_to_aro = {'mel': "3000616", 'pmrA':"3000822" , 'patB': "3000025"}
strict_perfect = {'500': "strict", '1000': "perfect"}
expected_bedtool_labels = open('bedtools_labels.tsv', 'w')
labels = {}
with open('intersection.tsv') as fh:
for line in fh:
li... | 0 | 0 | 0 |
a6cea3059e191fe8d12739e5c5b75a0fafb9d802 | 1,822 | py | Python | src/commercetools/importapi/models/_schemas/inventories.py | labd/commercetools-python-sdk | d8ec285f08d56ede2e4cad45c74833f5b609ab5c | [
"MIT"
] | 15 | 2018-11-02T14:35:52.000Z | 2022-03-16T07:51:44.000Z | src/commercetools/importapi/models/_schemas/inventories.py | labd/commercetools-python-sdk | d8ec285f08d56ede2e4cad45c74833f5b609ab5c | [
"MIT"
] | 84 | 2018-11-02T12:50:32.000Z | 2022-03-22T01:25:54.000Z | src/commercetools/importapi/models/_schemas/inventories.py | labd/commercetools-python-sdk | d8ec285f08d56ede2e4cad45c74833f5b609ab5c | [
"MIT"
] | 13 | 2019-01-03T09:16:50.000Z | 2022-02-15T18:37:19.000Z | # This file is automatically generated by the rmf-codegen project.
#
# The Python code generator is maintained by Lab Digital. If you want to
# contribute to this project then please do not edit this file directly
# but send a pull request to the Lab Digital fork of rmf-codegen at
# https://github.com/labd/rmf-codegen
... | 29.387097 | 77 | 0.698683 | # This file is automatically generated by the rmf-codegen project.
#
# The Python code generator is maintained by Lab Digital. If you want to
# contribute to this project then please do not edit this file directly
# but send a pull request to the Lab Digital fork of rmf-codegen at
# https://github.com/labd/rmf-codegen
... | 62 | 1,216 | 22 |
a14f792aeed702ea0d392d0cee6f0f3d00bd091c | 1,909 | py | Python | unimodal/vision/dataset.py | shubham-gupta-iitr/mmmlX | 3485e6191e0e45bf1c8168e4e928a36ab9264d22 | [
"Apache-2.0"
] | null | null | null | unimodal/vision/dataset.py | shubham-gupta-iitr/mmmlX | 3485e6191e0e45bf1c8168e4e928a36ab9264d22 | [
"Apache-2.0"
] | null | null | null | unimodal/vision/dataset.py | shubham-gupta-iitr/mmmlX | 3485e6191e0e45bf1c8168e4e928a36ab9264d22 | [
"Apache-2.0"
] | 1 | 2022-02-12T23:38:10.000Z | 2022-02-12T23:38:10.000Z | import numpy as np
from torch.utils.data import Dataset
import cv2
from torchvision import transforms
import base64
from PIL import Image
np.random.seed(0)
| 34.709091 | 107 | 0.590885 | import numpy as np
from torch.utils.data import Dataset
import cv2
from torchvision import transforms
import base64
from PIL import Image
np.random.seed(0)
class ImageDataset(Dataset):
def __init__(self, cfg, ids, dataset):
self.cfg = cfg
self._ids = ids
self._num_ids = len(ids)
sel... | 1,599 | 7 | 138 |
cea112fa5664fda55582fe64fab2a7e867c249ca | 1,144 | py | Python | Lib/test/test_exceptions_jy.py | clach04/bb_import_jython | 4529a0f578186a1c33c476300294ab42658eaf7c | [
"CNRI-Jython"
] | 49 | 2015-03-10T17:34:19.000Z | 2021-11-10T22:23:18.000Z | Lib/test/test_exceptions_jy.py | clach04/bb_import_jython | 4529a0f578186a1c33c476300294ab42658eaf7c | [
"CNRI-Jython"
] | 1 | 2021-04-11T15:01:12.000Z | 2021-04-11T15:01:12.000Z | Lib/test/test_exceptions_jy.py | clach04/bb_import_jython | 4529a0f578186a1c33c476300294ab42658eaf7c | [
"CNRI-Jython"
] | 32 | 2015-02-06T12:10:32.000Z | 2019-06-18T03:21:36.000Z | """Misc. exception related tests
Made for Jython.
"""
from test import test_support
import unittest
#From bugtests/test076.py
if __name__ == '__main__':
test_main()
| 22.88 | 65 | 0.565559 | """Misc. exception related tests
Made for Jython.
"""
from test import test_support
import unittest
class C:
def __str__(self):
raise Exception("E")
def __repr__(self):
raise Exception("S")
class ExceptionsTestCase(unittest.TestCase):
def test_keyerror_str(self):
self.assertEqual... | 756 | 10 | 201 |
c17d297d3e3b1768409a383f1791dd0e2160d9ed | 97 | py | Python | pythonProject/MUNDO 3/Relembrando listas 2.py | lucasjlgc/Aulas-de-Python- | 6aaed1c660487a680e9c449210600ccdfa326612 | [
"MIT"
] | null | null | null | pythonProject/MUNDO 3/Relembrando listas 2.py | lucasjlgc/Aulas-de-Python- | 6aaed1c660487a680e9c449210600ccdfa326612 | [
"MIT"
] | 1 | 2021-06-25T15:29:11.000Z | 2021-06-25T15:29:11.000Z | pythonProject/MUNDO 3/Relembrando listas 2.py | lucasjlgc/Aulas-de-Python- | 6aaed1c660487a680e9c449210600ccdfa326612 | [
"MIT"
] | null | null | null | import pandas as pd
df = pd.read_excel("Média teste.xlsx", sheet_name= "Média")
print(df.head()) | 24.25 | 59 | 0.721649 | import pandas as pd
df = pd.read_excel("Média teste.xlsx", sheet_name= "Média")
print(df.head()) | 0 | 0 | 0 |
5033e4ea9ff6c8c56046be03a2caffa035f89f26 | 1,117 | py | Python | src/interpreter.py | Vekteur/vprolog | c40afed4d61a7637e63d522b230ed4d187950382 | [
"MIT"
] | 1 | 2021-05-19T11:00:53.000Z | 2021-05-19T11:00:53.000Z | src/interpreter.py | Vekteur/vprolog | c40afed4d61a7637e63d522b230ed4d187950382 | [
"MIT"
] | null | null | null | src/interpreter.py | Vekteur/vprolog | c40afed4d61a7637e63d522b230ed4d187950382 | [
"MIT"
] | null | null | null | from prolog_parser import PrologParser
from inference import Inference
from copy import deepcopy
import sys
import lark | 23.270833 | 83 | 0.703671 | from prolog_parser import PrologParser
from inference import Inference
from copy import deepcopy
import sys
import lark
def read(file):
with open(file) as f:
return f.read()
class Interpreter:
builtin_file = 'data/builtin.pl'
def __init__(self, input_file):
program_parser = PrologParser()
self.request_parse... | 848 | 104 | 46 |
83d56b2fdd5a7b665bc10619bbd403eda9df6a10 | 1,479 | py | Python | hknweb/events/views/event_transactions/update_event.py | jyxzhang/hknweb | a01ffd8587859bf63c46213be6a0c8b87164a5c2 | [
"MIT"
] | null | null | null | hknweb/events/views/event_transactions/update_event.py | jyxzhang/hknweb | a01ffd8587859bf63c46213be6a0c8b87164a5c2 | [
"MIT"
] | null | null | null | hknweb/events/views/event_transactions/update_event.py | jyxzhang/hknweb | a01ffd8587859bf63c46213be6a0c8b87164a5c2 | [
"MIT"
] | null | null | null | from django.contrib import messages
from django.views.generic.edit import UpdateView
from hknweb.utils import (
method_login_and_permission,
DATETIME_12_HOUR_FORMAT,
PACIFIC_TIMEZONE,
)
from hknweb.events.models import Event
from hknweb.events.forms import EventUpdateForm
@method_login_and_permission("ev... | 33.613636 | 85 | 0.673428 | from django.contrib import messages
from django.views.generic.edit import UpdateView
from hknweb.utils import (
method_login_and_permission,
DATETIME_12_HOUR_FORMAT,
PACIFIC_TIMEZONE,
)
from hknweb.events.models import Event
from hknweb.events.forms import EventUpdateForm
@method_login_and_permission("ev... | 480 | 637 | 22 |
e71d446c2173eb797a2b7e29df4a14d48d6548ac | 7,353 | py | Python | library/mapr_entity.py | jaideepjoshi/ezmeral-orock-ansible | 6debe998cfd613ecf8a91d242e298b5b6822d936 | [
"Apache-2.0"
] | 35 | 2017-12-10T22:03:48.000Z | 2020-09-15T12:05:24.000Z | library/mapr_entity.py | jaideepjoshi/ezmeral-orock-ansible | 6debe998cfd613ecf8a91d242e298b5b6822d936 | [
"Apache-2.0"
] | 105 | 2017-11-28T10:13:23.000Z | 2022-01-07T00:33:21.000Z | library/mapr_entity.py | jaideepjoshi/ezmeral-orock-ansible | 6debe998cfd613ecf8a91d242e298b5b6822d936 | [
"Apache-2.0"
] | 53 | 2017-02-02T13:18:33.000Z | 2022-03-22T20:25:24.000Z | #!/usr/bin/python
ANSIBLE_METADATA = {
'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: mapr_entity
short_description: This module manages MapR accountable entities
version_added: "2.4"
description:
- "This module manages MapR accountab... | 31.55794 | 143 | 0.636339 | #!/usr/bin/python
ANSIBLE_METADATA = {
'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: mapr_entity
short_description: This module manages MapR accountable entities
version_added: "2.4"
description:
- "This module manages MapR accountab... | 5,414 | 0 | 207 |
31e32c129aa7d92384a69bef1420f94126542831 | 17,313 | py | Python | app/vehicle/managers.py | ab7289-tandon-nyu/csgy6083_PDS_Project | d2b7d22274dcabbb6ae35c17a8ffd06498f3634f | [
"MIT"
] | null | null | null | app/vehicle/managers.py | ab7289-tandon-nyu/csgy6083_PDS_Project | d2b7d22274dcabbb6ae35c17a8ffd06498f3634f | [
"MIT"
] | null | null | null | app/vehicle/managers.py | ab7289-tandon-nyu/csgy6083_PDS_Project | d2b7d22274dcabbb6ae35c17a8ffd06498f3634f | [
"MIT"
] | null | null | null | from typing import List, Optional
from jinjasql import JinjaSql
from app.db import DBManager
from app.vehicle.models import Driver, Vehicle
| 38.473333 | 119 | 0.39866 | from typing import List, Optional
from jinjasql import JinjaSql
from app.db import DBManager
from app.vehicle.models import Driver, Vehicle
class VehicleManager(DBManager):
def get_by_id(self, vin: str) -> Optional[Vehicle]:
with self.get_connection() as conn:
with conn.cursor() as cursor:
... | 5,112 | 11,987 | 69 |
8c945debc7403eef7d5bb53554f95856e8985e78 | 79 | py | Python | abc240/b/test.py | seigot/atcoder | 6c2da684c75b7c5de162de3713a13507aeecce1d | [
"MIT"
] | 2 | 2021-12-28T11:43:47.000Z | 2022-02-20T14:41:27.000Z | abc240/b/test.py | seigot/atcoder | 6c2da684c75b7c5de162de3713a13507aeecce1d | [
"MIT"
] | null | null | null | abc240/b/test.py | seigot/atcoder | 6c2da684c75b7c5de162de3713a13507aeecce1d | [
"MIT"
] | null | null | null | n = input()
arr = list(map(int, input().split()))
s = set(arr)
print(len(s))
| 13.166667 | 37 | 0.56962 | n = input()
arr = list(map(int, input().split()))
s = set(arr)
print(len(s))
| 0 | 0 | 0 |
c6b099c2eeccca6fd594c51318bc6cd9faebc7ab | 41 | py | Python | src/pruebas.py | edoomm/compiladores | f8badd2f44e4e0273161266f739aab7c1ca5dfb2 | [
"MIT"
] | 1 | 2021-03-23T14:22:26.000Z | 2021-03-23T14:22:26.000Z | src/pruebas.py | edoomm/compiladores | f8badd2f44e4e0273161266f739aab7c1ca5dfb2 | [
"MIT"
] | null | null | null | src/pruebas.py | edoomm/compiladores | f8badd2f44e4e0273161266f739aab7c1ca5dfb2 | [
"MIT"
] | null | null | null |
for i in range(255):
print(chr(i))
| 8.2 | 20 | 0.560976 |
for i in range(255):
print(chr(i))
| 0 | 0 | 0 |
5b15f03a9e21ad9e630b8c38b2ac80ff1cf06549 | 4,625 | py | Python | lib/session.py | Hiteshsuhas/err-stackstorm | 7579350ac50d9324b64a73b86d57e094270cb275 | [
"Apache-2.0"
] | 15 | 2016-09-19T12:06:12.000Z | 2021-11-30T12:04:44.000Z | lib/session.py | Hiteshsuhas/err-stackstorm | 7579350ac50d9324b64a73b86d57e094270cb275 | [
"Apache-2.0"
] | 22 | 2017-06-19T18:13:54.000Z | 2021-05-28T09:25:01.000Z | lib/session.py | Hiteshsuhas/err-stackstorm | 7579350ac50d9324b64a73b86d57e094270cb275 | [
"Apache-2.0"
] | 7 | 2017-06-19T17:03:59.000Z | 2021-09-27T11:06:31.000Z | # coding:utf-8
import uuid
import string
import hashlib
import logging
from lib.errors import SessionExpiredError, SessionConsumedError
from datetime import datetime as dt
from random import SystemRandom
LOG = logging.getLogger("errbot.plugin.st2.session")
| 34.774436 | 99 | 0.611676 | # coding:utf-8
import uuid
import string
import hashlib
import logging
from lib.errors import SessionExpiredError, SessionConsumedError
from datetime import datetime as dt
from random import SystemRandom
LOG = logging.getLogger("errbot.plugin.st2.session")
def generate_password(length=8):
rnd = SystemRandom()
... | 1,487 | 2,832 | 46 |
66388d70125d6d722d8baaab807b4f12201dcdd0 | 7,710 | py | Python | mwtab/fileio.py | MoseleyBioinformaticsLab/mwtab | 1bc1e3715538348b29a5760a9c3184fe04f568a6 | [
"BSD-3-Clause-Clear"
] | 7 | 2018-02-02T07:50:20.000Z | 2021-03-14T22:46:58.000Z | mwtab/fileio.py | MoseleyBioinformaticsLab/mwtab | 1bc1e3715538348b29a5760a9c3184fe04f568a6 | [
"BSD-3-Clause-Clear"
] | 2 | 2019-02-14T08:38:54.000Z | 2020-02-19T08:08:02.000Z | mwtab/fileio.py | MoseleyBioinformaticsLab/mwtab | 1bc1e3715538348b29a5760a9c3184fe04f568a6 | [
"BSD-3-Clause-Clear"
] | 1 | 2019-10-12T23:38:44.000Z | 2019-10-12T23:38:44.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mwtab.fileio
~~~~~~~~~~~~
This module provides routines for reading ``mwTab`` formatted files
from difference kinds of sources:
* Single ``mwTab`` formatted file on a local machine.
* Directory containing multiple ``mwTab`` formatted files.
* Compressed zip... | 32.125 | 104 | 0.568742 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mwtab.fileio
~~~~~~~~~~~~
This module provides routines for reading ``mwTab`` formatted files
from difference kinds of sources:
* Single ``mwTab`` formatted file on a local machine.
* Directory containing multiple ``mwTab`` formatted files.
* Compressed zip... | 0 | 0 | 0 |
aa69cf9bb36a467022c07fe2ac1ca628a579afb9 | 1,897 | py | Python | 7-Color Detecting.py | macerman/Open-CV | 8a2bc35ba2610186fe2a38006b2ebbb3efbce31e | [
"MIT"
] | 1 | 2021-10-03T15:39:12.000Z | 2021-10-03T15:39:12.000Z | 7-Color Detecting.py | macerman/Open-CV | 8a2bc35ba2610186fe2a38006b2ebbb3efbce31e | [
"MIT"
] | null | null | null | 7-Color Detecting.py | macerman/Open-CV | 8a2bc35ba2610186fe2a38006b2ebbb3efbce31e | [
"MIT"
] | null | null | null | #--COLOR DETECTION--#
import cv2
import numpy as np
#our function for trackbars
path = "sources/lambo2.png"
#Burada renklerimizi ayarlayabilmek için bir trackbar hazırlayacağız
cv2.namedWindow("Trackbars") #making our window that our trackbars gon' be in
cv2.resizeWindow("Trackbars",640,240) #resizing ou... | 41.23913 | 108 | 0.714286 | #--COLOR DETECTION--#
import cv2
import numpy as np
#our function for trackbars
def empty(x):
pass
path = "sources/lambo2.png"
#Burada renklerimizi ayarlayabilmek için bir trackbar hazırlayacağız
cv2.namedWindow("Trackbars") #making our window that our trackbars gon' be in
cv2.resizeWindow("Trackba... | 2 | 0 | 23 |
724a8012ca1002b7331d8c73f477e13ffdcfc4e3 | 947 | py | Python | modules/photons_canvas/points/rearrange.py | Djelibeybi/photons | bc0aa91771d8e88fd3c691fb58f18cb876f292ec | [
"MIT"
] | 51 | 2020-07-03T08:34:48.000Z | 2022-03-16T10:56:08.000Z | modules/photons_canvas/points/rearrange.py | delfick/photons | bc0aa91771d8e88fd3c691fb58f18cb876f292ec | [
"MIT"
] | 81 | 2020-07-03T08:13:59.000Z | 2022-03-31T23:02:54.000Z | modules/photons_canvas/points/rearrange.py | Djelibeybi/photons | bc0aa91771d8e88fd3c691fb58f18cb876f292ec | [
"MIT"
] | 8 | 2020-07-24T23:48:20.000Z | 2021-05-24T17:20:16.000Z | from photons_canvas.points.canvas import Canvas
| 23.097561 | 85 | 0.599789 | from photons_canvas.points.canvas import Canvas
class Separate:
def rearrange(self, canvas):
user_x = 0
for part in canvas.parts:
yield part.clone(user_x=user_x)
user_x += part.width / 8
class Straight:
def rearrange(self, canvas):
user_x = 0
for part ... | 734 | -9 | 170 |
8bf92f9554a026c81421946868bc7e095ee1d032 | 31,097 | py | Python | Embedd_Network_model.py | AutumnCrocus/shadow_sim | 79ad13ff9bd7131c82f269af32a3970f3e4bf2ca | [
"MIT"
] | 6 | 2020-11-08T18:41:23.000Z | 2022-03-29T07:11:37.000Z | Embedd_Network_model.py | AutumnCrocus/shadow_sim | 79ad13ff9bd7131c82f269af32a3970f3e4bf2ca | [
"MIT"
] | 5 | 2020-08-09T11:32:59.000Z | 2022-03-12T00:21:44.000Z | Embedd_Network_model.py | AutumnCrocus/shadow_sim | 79ad13ff9bd7131c82f269af32a3970f3e4bf2ca | [
"MIT"
] | 1 | 2021-01-31T05:57:10.000Z | 2021-01-31T05:57:10.000Z | # -*- coding: utf-8 -*-
import torch
import os
from torch.multiprocessing import Pool, Process, set_start_method,cpu_count, RLock,freeze_support, Value, Array, Manager,cpu_count
#os.environ["OMP_NUM_THREADS"] = "4" if torch.cuda.is_available() else "6"
os.environ["PYTHONWARNINGS"] = 'ignore:semaphore_tracker:UserWarni... | 47.045386 | 149 | 0.610123 | # -*- coding: utf-8 -*-
import torch
import os
from torch.multiprocessing import Pool, Process, set_start_method,cpu_count, RLock,freeze_support, Value, Array, Manager,cpu_count
#os.environ["OMP_NUM_THREADS"] = "4" if torch.cuda.is_available() else "6"
os.environ["PYTHONWARNINGS"] = 'ignore:semaphore_tracker:UserWarni... | 20,388 | 35 | 408 |
7cfa0517f6f611e9e8a1d7cb043611f70bfb1a0f | 2,196 | py | Python | app/recipe/tests/test_tag_api.py | Ivanrputra/recipe-app-api | e70548a4f7f8756f8f4224dcf39b809a8b546da1 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tag_api.py | Ivanrputra/recipe-app-api | e70548a4f7f8756f8f4224dcf39b809a8b546da1 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tag_api.py | Ivanrputra/recipe-app-api | e70548a4f7f8756f8f4224dcf39b809a8b546da1 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
# test the publi... | 28.894737 | 64 | 0.754554 | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class PublicTags... | 1,576 | 27 | 213 |
5b244dbad1c8ca8a9375ead11274a786704c74b2 | 789 | py | Python | gardenizer/event/forms.py | plegulluche/OPC-P13 | 0bad4e1bd7293e5a3397611f80df00ca2fd9cf60 | [
"Unlicense"
] | null | null | null | gardenizer/event/forms.py | plegulluche/OPC-P13 | 0bad4e1bd7293e5a3397611f80df00ca2fd9cf60 | [
"Unlicense"
] | null | null | null | gardenizer/event/forms.py | plegulluche/OPC-P13 | 0bad4e1bd7293e5a3397611f80df00ca2fd9cf60 | [
"Unlicense"
] | null | null | null | from django import forms
from event.models import Customer, Evenement
| 19.725 | 47 | 0.52218 | from django import forms
from event.models import Customer, Evenement
class AddCustomerForm(forms.ModelForm):
class Meta:
model = Customer
fields = (
"firstname",
"lastname",
"phone",
"company",
"street_number",
"streetname",
... | 0 | 647 | 69 |
470a6e476d032e3bf06631db5a62d5885240fdf0 | 1,184 | py | Python | app/handler.py | KiraLT/certbot-lambda | 3bec9e3575a67345849778f55227836591c5eee7 | [
"MIT"
] | 2 | 2022-01-19T07:27:30.000Z | 2022-02-08T17:25:23.000Z | app/handler.py | KiraLT/certbot-lambda | 3bec9e3575a67345849778f55227836591c5eee7 | [
"MIT"
] | null | null | null | app/handler.py | KiraLT/certbot-lambda | 3bec9e3575a67345849778f55227836591c5eee7 | [
"MIT"
] | 1 | 2022-02-16T14:38:36.000Z | 2022-02-16T14:38:36.000Z | #!/usr/bin/env python3
import shutil
from app.settings import settings
from app.services.certbot import obtain_certbot_certs
from app.services.aws import list_secret_names, upload_certs_as_secrets
if __name__ == "__main__":
handler(None, None)
| 29.6 | 80 | 0.697635 | #!/usr/bin/env python3
import shutil
from app.settings import settings
from app.services.certbot import obtain_certbot_certs
from app.services.aws import list_secret_names, upload_certs_as_secrets
def handler(_event, _context):
try:
shutil.rmtree(str(settings.CERTBOT_DIR), ignore_errors=True)
#... | 908 | 0 | 23 |
5a2b9719bea651a230205b8011c0b27198c10cbf | 23 | py | Python | something-learned/Algorithms and Data-Structures/Competitive-programming-library/CP/codeforces/656A-Da_Vinci_Powers.py | gopala-kr/CR-101 | dd27b767cdc0c667655ab8e32e020ed4248bd112 | [
"MIT"
] | 5 | 2018-05-09T04:02:04.000Z | 2021-02-21T19:27:56.000Z | something-learned/Algorithms and Data-Structures/Competitive-programming-library/CP/codeforces/656A-Da_Vinci_Powers.py | gopala-kr/CR-101 | dd27b767cdc0c667655ab8e32e020ed4248bd112 | [
"MIT"
] | null | null | null | something-learned/Algorithms and Data-Structures/Competitive-programming-library/CP/codeforces/656A-Da_Vinci_Powers.py | gopala-kr/CR-101 | dd27b767cdc0c667655ab8e32e020ed4248bd112 | [
"MIT"
] | 5 | 2018-02-23T22:08:28.000Z | 2020-08-19T08:31:47.000Z | x = input()
print 2**x
| 7.666667 | 11 | 0.565217 | x = input()
print 2**x
| 0 | 0 | 0 |
75ac623f7b66719ba7e41213f1ae301dee5d15a5 | 89 | py | Python | enthought/mayavi/tools/modules.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/mayavi/tools/modules.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/mayavi/tools/modules.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from __future__ import absolute_import
from mayavi.tools.modules import *
| 22.25 | 38 | 0.831461 | # proxy module
from __future__ import absolute_import
from mayavi.tools.modules import *
| 0 | 0 | 0 |
b20f312d2d730133f52e15d77c7b0a9506e0f4bd | 454 | py | Python | backend/urls.py | Rayman/fusic-django | a3bc19cb5d0a013df649e5f59941c98c7ffec159 | [
"MIT"
] | null | null | null | backend/urls.py | Rayman/fusic-django | a3bc19cb5d0a013df649e5f59941c98c7ffec159 | [
"MIT"
] | 14 | 2020-02-11T21:32:22.000Z | 2022-02-26T02:10:23.000Z | backend/urls.py | Rayman/fusic-django | a3bc19cb5d0a013df649e5f59941c98c7ffec159 | [
"MIT"
] | 1 | 2019-03-07T04:04:02.000Z | 2019-03-07T04:04:02.000Z | from django.conf.urls import url
from django.urls import include
from rest_framework.routers import DefaultRouter
from . import views
router = DefaultRouter()
router.register(r"users", views.UserViewSet)
router.register(r"playlists", views.PlaylistViewSet)
router.register(r"radios", views.RadioViewSet)
router.registe... | 25.222222 | 55 | 0.779736 | from django.conf.urls import url
from django.urls import include
from rest_framework.routers import DefaultRouter
from . import views
router = DefaultRouter()
router.register(r"users", views.UserViewSet)
router.register(r"playlists", views.PlaylistViewSet)
router.register(r"radios", views.RadioViewSet)
router.registe... | 0 | 0 | 0 |
a1c9431bd64c2749eaeedd18e74822b26b4497e1 | 2,007 | py | Python | minotaur/scripts/jsonl.py | csmith49/minotaur | 982e128b440e2c8fe96c450505dfdac9a37f9551 | [
"MIT"
] | null | null | null | minotaur/scripts/jsonl.py | csmith49/minotaur | 982e128b440e2c8fe96c450505dfdac9a37f9551 | [
"MIT"
] | null | null | null | minotaur/scripts/jsonl.py | csmith49/minotaur | 982e128b440e2c8fe96c450505dfdac9a37f9551 | [
"MIT"
] | null | null | null | import click
from .cli import cli
from ..maze import Maze
from ..interface import load, is_context, is_value
from json import dumps
from sys import stdout
from typing import Iterable, Callable, Tuple, TypeVar
from itertools import chain, filterfalse, tee
T = TypeVar("T")
def partition(iterable : Iterable[T], predic... | 30.876923 | 106 | 0.63727 | import click
from .cli import cli
from ..maze import Maze
from ..interface import load, is_context, is_value
from json import dumps
from sys import stdout
from typing import Iterable, Callable, Tuple, TypeVar
from itertools import chain, filterfalse, tee
T = TypeVar("T")
def partition(iterable : Iterable[T], predic... | 0 | 0 | 0 |
006cfef7d4a9b065e2e1a48f2fd3b717d9a8e288 | 1,356 | py | Python | gdsync/google/finished_folders.py | UUUM/backup-google-drive | ad632f5deb824237ca4a51af5e76a4261cc4759e | [
"MIT"
] | 6 | 2016-08-09T12:00:48.000Z | 2018-03-05T04:59:48.000Z | gdsync/google/finished_folders.py | UUUM/backup-google-drive | ad632f5deb824237ca4a51af5e76a4261cc4759e | [
"MIT"
] | null | null | null | gdsync/google/finished_folders.py | UUUM/backup-google-drive | ad632f5deb824237ca4a51af5e76a4261cc4759e | [
"MIT"
] | null | null | null | import os
import sqlite3
import gdsync
| 22.6 | 74 | 0.544985 | import os
import sqlite3
import gdsync
class FinishedFolders(set):
db_file_name = 'default.db'
db_file = None
table = 'finished_folders'
_conn = None
def __init__(self):
if self.db_file is None:
self.db_file = os.path.join(gdsync.VAR_DIR, self.db_file_name)
def __exit__... | 983 | 309 | 23 |
5b71d011d822f95ce25f55c2574551dc96b232fe | 1,860 | py | Python | examples/guidage.py | MaxLgy/Autoland | ca94eef0d2f3dafa56cc271751d72db91d704098 | [
"MIT"
] | null | null | null | examples/guidage.py | MaxLgy/Autoland | ca94eef0d2f3dafa56cc271751d72db91d704098 | [
"MIT"
] | null | null | null | examples/guidage.py | MaxLgy/Autoland | ca94eef0d2f3dafa56cc271751d72db91d704098 | [
"MIT"
] | 1 | 2021-05-16T15:20:19.000Z | 2021-05-16T15:20:19.000Z | from numpy import cross, array , vdot
from numpy.linalg import norm
import matplotlib.pyplot as plt
from roblib import *
def vct_nrm(a,b,c):
"""Soit a,b,c trois coin de la plateforme supossée carrée, n est un vecteur normal de cette platforme"""
V1 = a-b
V2 = a-c
n = cross(V1,V2).T
return n/norm(n)
def champ(p,n,... | 26.956522 | 127 | 0.604301 | from numpy import cross, array , vdot
from numpy.linalg import norm
import matplotlib.pyplot as plt
from roblib import *
def vct_nrm(a,b,c):
"""Soit a,b,c trois coin de la plateforme supossée carrée, n est un vecteur normal de cette platforme"""
V1 = a-b
V2 = a-c
n = cross(V1,V2).T
return n/norm(n)
def champ(p,n,... | 174 | 0 | 23 |
cd321a02147ac54d46cd08610302a2d2864aa096 | 493 | py | Python | GammaTorrent/main.py | Devam911/Gamma-Torrent | 42079c497f8ebdc7aa1a442f3e34770747217e5c | [
"MIT"
] | 1 | 2020-12-06T10:38:32.000Z | 2020-12-06T10:38:32.000Z | GammaTorrent/main.py | Devam911/Gamma-Torrent | 42079c497f8ebdc7aa1a442f3e34770747217e5c | [
"MIT"
] | null | null | null | GammaTorrent/main.py | Devam911/Gamma-Torrent | 42079c497f8ebdc7aa1a442f3e34770747217e5c | [
"MIT"
] | 2 | 2020-12-06T10:55:48.000Z | 2020-12-15T14:28:00.000Z | __author__ = ["Manav Vagrecha", "Shreyansh Shah", "Devam Shah"]
__email__ = ["manavkumar.v@ahduni.edu.in", "shreyansh.s1@ahduni.edu.in", "devam.s1@ahduni.edu.in"]
import logging
import sys
import main_manager
if __name__ == '__main__':
# configuring the log outputs to the debug level
logging.basicConfig(level... | 30.8125 | 98 | 0.726166 | __author__ = ["Manav Vagrecha", "Shreyansh Shah", "Devam Shah"]
__email__ = ["manavkumar.v@ahduni.edu.in", "shreyansh.s1@ahduni.edu.in", "devam.s1@ahduni.edu.in"]
import logging
import sys
import main_manager
if __name__ == '__main__':
# configuring the log outputs to the debug level
logging.basicConfig(level... | 0 | 0 | 0 |
c6734bf49760adf1241cdaa9c9fafc9ab5fe77b0 | 2,700 | py | Python | azrt2021/data_from_csv.py | vkola-lab/azrt2021 | a75c1302434c4578daf4cde119cfa50f552a9a43 | [
"MIT"
] | 2 | 2021-02-17T15:51:00.000Z | 2022-01-05T06:07:07.000Z | azrt2021/data_from_csv.py | vkola-lab/azrt2021 | a75c1302434c4578daf4cde119cfa50f552a9a43 | [
"MIT"
] | 1 | 2022-03-12T01:06:03.000Z | 2022-03-12T01:06:03.000Z | azrt2021/data_from_csv.py | vkola-lab/azrt2021 | a75c1302434c4578daf4cde119cfa50f552a9a43 | [
"MIT"
] | 1 | 2021-11-09T00:43:18.000Z | 2021-11-09T00:43:18.000Z | """
data_from_csv.py
audio dataset reading from CSV output file;
"""
from torch.utils.data import Dataset
import numpy as np
import pandas as pd
class AudioDatasetFromCsv(Dataset):
"""dVoice dataset."""
def __init__(self, csv_in, **kwargs):
"""
init
"""
self.csv_in = csv_in
... | 29.347826 | 97 | 0.564815 | """
data_from_csv.py
audio dataset reading from CSV output file;
"""
from torch.utils.data import Dataset
import numpy as np
import pandas as pd
class AudioDatasetFromCsv(Dataset):
"""dVoice dataset."""
def __init__(self, csv_in, **kwargs):
"""
init
"""
self.csv_in = csv_in
... | 0 | 0 | 0 |
4106d9cfc8b30f0a8cc972336e9629c09863a3a7 | 1,826 | py | Python | rflow/common.py | otaviog/rflow | 8594b9c3e9e1da61382f80b66e749cf7b8a33676 | [
"MIT"
] | 6 | 2019-08-26T11:36:58.000Z | 2020-12-15T21:01:24.000Z | rflow/common.py | otaviog/rflow | 8594b9c3e9e1da61382f80b66e749cf7b8a33676 | [
"MIT"
] | null | null | null | rflow/common.py | otaviog/rflow | 8594b9c3e9e1da61382f80b66e749cf7b8a33676 | [
"MIT"
] | 1 | 2020-04-13T08:05:27.000Z | 2020-04-13T08:05:27.000Z | """
Common definitions of the workflow module.
"""
WORKFLOW_DEFAULT_FILENAME = 'workflow.py'
DOT_DATABASE_FILENAME = '.workflow.lmdb'
class Uninit(object):
"""Sentinel for unitialized values on the framework context. Python's
`None` can't be used, because `None` can be a valid for the user.
"""
pas... | 23.714286 | 96 | 0.615005 | """
Common definitions of the workflow module.
"""
WORKFLOW_DEFAULT_FILENAME = 'workflow.py'
DOT_DATABASE_FILENAME = '.workflow.lmdb'
class Uninit(object):
"""Sentinel for unitialized values on the framework context. Python's
`None` can't be used, because `None` can be a valid for the user.
"""
pas... | 283 | 0 | 54 |
fc8c4080b50b28b1fb6ddd4a6aa9afb8009d26ed | 518 | py | Python | feedback_survey/migrations/0014_auto_20170510_1717.py | mushahid54/feedback_survey | a568008f0717b52649010286e55e242f083734be | [
"MIT"
] | null | null | null | feedback_survey/migrations/0014_auto_20170510_1717.py | mushahid54/feedback_survey | a568008f0717b52649010286e55e242f083734be | [
"MIT"
] | null | null | null | feedback_survey/migrations/0014_auto_20170510_1717.py | mushahid54/feedback_survey | a568008f0717b52649010286e55e242f083734be | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-05-10 17:17
from __future__ import unicode_literals
from django.db import migrations, models
| 24.666667 | 112 | 0.61583 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-05-10 17:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('feedback_survey', '0013_feedback_state'),
]
operations = [
migrations.Alter... | 0 | 339 | 23 |
f3df173c07598e604dee27e3ee7b95046ae4022c | 11,132 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/module_utils/network/nxos/config/l3_interfaces/l3_interfaces.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/module_utils/network/nxos/config/l3_interfaces/l3_interfaces.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/venv/lib/python2.7/site-packages/ansible/module_utils/network/nxos/config/l3_interfaces/l3_interfaces.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The nxos_l3_interfaces class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necessar... | 35.565495 | 120 | 0.590729 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The nxos_l3_interfaces class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necessar... | 4,146 | 0 | 297 |
c60315315b1b0a6ab3d7ae3c01b28dc0330bc248 | 286 | py | Python | src/startup_tasks.py | bbrietzke/amina-naidu | 728748aaaa5a8125215ebc47303ea32d983942ce | [
"BSD-3-Clause"
] | null | null | null | src/startup_tasks.py | bbrietzke/amina-naidu | 728748aaaa5a8125215ebc47303ea32d983942ce | [
"BSD-3-Clause"
] | null | null | null | src/startup_tasks.py | bbrietzke/amina-naidu | 728748aaaa5a8125215ebc47303ea32d983942ce | [
"BSD-3-Clause"
] | null | null | null | from discord.ext.commands import Cog
from discord.utils import get
from discord.ext import tasks
import logging
logger = logging.getLogger('tasks')
# https://discord.gg/C6AQaJcDdn | 22 | 48 | 0.737762 | from discord.ext.commands import Cog
from discord.utils import get
from discord.ext import tasks
import logging
logger = logging.getLogger('tasks')
class StartupTasks(Cog, name = 'Startup Tasks'):
def __init__(self, bot):
self.__bot = bot
# https://discord.gg/C6AQaJcDdn | 28 | 27 | 49 |
caba3cec1e39700147f2e9c58dd5f0d946b4fcb4 | 109 | py | Python | flask_authz/__init__.py | robotoer/flask-authz | 068cd6496e9a116cd6bc6ef21d2c8c4bfff0bb49 | [
"Apache-2.0"
] | 93 | 2019-06-26T03:32:34.000Z | 2022-03-28T03:26:33.000Z | flask_authz/__init__.py | robotoer/flask-authz | 068cd6496e9a116cd6bc6ef21d2c8c4bfff0bb49 | [
"Apache-2.0"
] | 42 | 2019-08-05T02:16:20.000Z | 2022-02-19T08:45:51.000Z | flask_authz/__init__.py | robotoer/flask-authz | 068cd6496e9a116cd6bc6ef21d2c8c4bfff0bb49 | [
"Apache-2.0"
] | 35 | 2019-07-19T18:04:22.000Z | 2022-03-04T00:14:27.000Z | from .casbin_enforcer import CasbinEnforcer # noqa: F401
from .casbin_enforcer import Watcher # noqa: F401
| 36.333333 | 57 | 0.798165 | from .casbin_enforcer import CasbinEnforcer # noqa: F401
from .casbin_enforcer import Watcher # noqa: F401
| 0 | 0 | 0 |
03f5aff96b74d6b68c9f99e6aa11c484f8ae98a2 | 4,376 | py | Python | devilry/devilry_admin/tests/cradminextensions/test_devilry_crmenu_admin.py | aless80/devilry-django | 416c262e75170d5662542f15e2d7fecf5ab84730 | [
"BSD-3-Clause"
] | null | null | null | devilry/devilry_admin/tests/cradminextensions/test_devilry_crmenu_admin.py | aless80/devilry-django | 416c262e75170d5662542f15e2d7fecf5ab84730 | [
"BSD-3-Clause"
] | null | null | null | devilry/devilry_admin/tests/cradminextensions/test_devilry_crmenu_admin.py | aless80/devilry-django | 416c262e75170d5662542f15e2d7fecf5ab84730 | [
"BSD-3-Clause"
] | null | null | null | import mock
from django import test
from model_mommy import mommy
from devilry.devilry_admin.cradminextensions import devilry_crmenu_admin
| 56.102564 | 94 | 0.747258 | import mock
from django import test
from model_mommy import mommy
from devilry.devilry_admin.cradminextensions import devilry_crmenu_admin
class TestMenu(test.TestCase):
def test_add_subject_breadcrumb_item_label(self):
testsubject = mommy.make('core.Subject', short_name='testsubject')
mock_cradm... | 3,988 | 9 | 238 |
fe1f740fd51bf888fbacf441f65fbe1a286f3389 | 9,577 | py | Python | flake8_prevent_fails/__init__.py | Atterratio/flake8-prevent-fails | 068502a1542d03e60d9d9a9853dfdc1f0883f9cb | [
"MIT"
] | null | null | null | flake8_prevent_fails/__init__.py | Atterratio/flake8-prevent-fails | 068502a1542d03e60d9d9a9853dfdc1f0883f9cb | [
"MIT"
] | null | null | null | flake8_prevent_fails/__init__.py | Atterratio/flake8-prevent-fails | 068502a1542d03e60d9d9a9853dfdc1f0883f9cb | [
"MIT"
] | null | null | null | import ast
__version__ = '0.0.5'
__all__ = ('FailsChecker', )
MESSAGES = {
'PF101': 'PF101 Potential IndexError fail.',
'PF102': 'PF102 Potential KeyError fail. You can replace this with `dict.get(key, failback_value)`',
'PF103': 'PF103 Potential IndexError or KeyError fail.',
}
| 41.280172 | 104 | 0.446695 | import ast
__version__ = '0.0.5'
__all__ = ('FailsChecker', )
MESSAGES = {
'PF101': 'PF101 Potential IndexError fail.',
'PF102': 'PF102 Potential KeyError fail. You can replace this with `dict.get(key, failback_value)`',
'PF103': 'PF103 Potential IndexError or KeyError fail.',
}
class PluginVisitor(ast.... | 8,830 | 163 | 288 |
9bfb7d2af35b5044c0b51f83cbd723b998930299 | 2,764 | py | Python | Cruise Control/Solution.py | YIWEI-CHEN/google_code_jam_practice_session_2018 | a0fd32911e10b69116c2923ab1c9e58e4e02fdde | [
"MIT"
] | null | null | null | Cruise Control/Solution.py | YIWEI-CHEN/google_code_jam_practice_session_2018 | a0fd32911e10b69116c2923ab1c9e58e4e02fdde | [
"MIT"
] | null | null | null | Cruise Control/Solution.py | YIWEI-CHEN/google_code_jam_practice_session_2018 | a0fd32911e10b69116c2923ab1c9e58e4e02fdde | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 1 15:18:09 2018
@author: yiwei
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 1 06:11:18 2018
@author: yiwei
"""
from copy import deepcopy
if __name__ == '__main__':
FROM_STDIN = True
# FROM_STDIN = False
... | 30.043478 | 111 | 0.58864 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 1 15:18:09 2018
@author: yiwei
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 1 06:11:18 2018
@author: yiwei
"""
from copy import deepcopy
class Horse(object):
def __init__(self, location, speed):
self.loca... | 1,628 | -1 | 121 |
2625845330bef60b1eb6182c371d9b13032bb229 | 8,576 | py | Python | measurexp/NMF.py | bcl-group/measurexp | 66ab471dad2534ec48d13d0546ee3a4f0eb46a91 | [
"MIT"
] | null | null | null | measurexp/NMF.py | bcl-group/measurexp | 66ab471dad2534ec48d13d0546ee3a4f0eb46a91 | [
"MIT"
] | null | null | null | measurexp/NMF.py | bcl-group/measurexp | 66ab471dad2534ec48d13d0546ee3a4f0eb46a91 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn import decomposition
# NMF
from sklearn._config import config_context
from sklearn.decomposition._nmf \
import _beta_divergence, \
_check_string_param, \
_check_init, \
_initialize_nmf, \
_compute_regularization
from sklearn.utils.validation \
import check_array,... | 38.285714 | 79 | 0.548158 | import numpy as np
from sklearn import decomposition
# NMF
from sklearn._config import config_context
from sklearn.decomposition._nmf \
import _beta_divergence, \
_check_string_param, \
_check_init, \
_initialize_nmf, \
_compute_regularization
from sklearn.utils.validation \
import check_array,... | 7,722 | 10 | 141 |
f9350d3119001689df5632afe7aa85da2f895288 | 221 | py | Python | big_data/bokeh_examples/function_example.py | paulhtremblay/big-data | dfa2aa9877300a57e7a9368af59c07fcc5841b4f | [
"MIT"
] | null | null | null | big_data/bokeh_examples/function_example.py | paulhtremblay/big-data | dfa2aa9877300a57e7a9368af59c07fcc5841b4f | [
"MIT"
] | 7 | 2020-06-05T18:13:25.000Z | 2022-03-11T23:19:48.000Z | big_data/bokeh_examples/function_example.py | paulhtremblay/big-data | dfa2aa9877300a57e7a9368af59c07fcc5841b4f | [
"MIT"
] | 1 | 2020-11-25T18:24:37.000Z | 2020-11-25T18:24:37.000Z | from bokeh.plotting import figure, show
import numpy as np
if __name__ == '__main__':
p = plot_func()
show(p)
| 15.785714 | 40 | 0.59276 | from bokeh.plotting import figure, show
import numpy as np
def plot_func():
x = np.linspace(0,1,100)
print(x)
y = [x * x for x in x]
print(y)
if __name__ == '__main__':
p = plot_func()
show(p)
| 77 | 0 | 23 |
2758200c7b9b4e23118e91e0e479902f4cc9a02c | 68 | py | Python | src/vessel-drift-analysis/vessel_drift_analysis/vessel_drift.py | yosoyjay/project-nps-vessel-drift | 1cdc14ef87db31fa03b0c3bdc1d60c332727ef57 | [
"MIT"
] | null | null | null | src/vessel-drift-analysis/vessel_drift_analysis/vessel_drift.py | yosoyjay/project-nps-vessel-drift | 1cdc14ef87db31fa03b0c3bdc1d60c332727ef57 | [
"MIT"
] | null | null | null | src/vessel-drift-analysis/vessel_drift_analysis/vessel_drift.py | yosoyjay/project-nps-vessel-drift | 1cdc14ef87db31fa03b0c3bdc1d60c332727ef57 | [
"MIT"
] | null | null | null | # Calculations related to estimate probability of a vessel drifting
| 34 | 67 | 0.838235 | # Calculations related to estimate probability of a vessel drifting
| 0 | 0 | 0 |
f678b30434cfbcab5a3a8a898d0a71ec304355f1 | 919 | py | Python | voteModels.py | TheaGao/SklearnModel | fe445cddd4fde9acdc87e7e7b3fbc356d1c586aa | [
"MIT"
] | 1 | 2017-12-22T08:51:43.000Z | 2017-12-22T08:51:43.000Z | voteModels.py | TheaGao/SklearnModel | fe445cddd4fde9acdc87e7e7b3fbc356d1c586aa | [
"MIT"
] | null | null | null | voteModels.py | TheaGao/SklearnModel | fe445cddd4fde9acdc87e7e7b3fbc356d1c586aa | [
"MIT"
] | null | null | null | from sklearn.externals import joblib
from preprocessData import getDataXY, get_accuracy
trainX, trainY, testX, testY, validX, validY = getDataXY()
print type(trainY)
models = ['Models/dt0.58.pkl', 'Models/NB0.59.pkl', 'Models/NC0.57.pkl',
'Models/NNP0.61.pkl', 'Models/sgd0.54.pkl']
all_pre = []
for model ... | 20.886364 | 83 | 0.644178 | from sklearn.externals import joblib
from preprocessData import getDataXY, get_accuracy
trainX, trainY, testX, testY, validX, validY = getDataXY()
print type(trainY)
models = ['Models/dt0.58.pkl', 'Models/NB0.59.pkl', 'Models/NC0.57.pkl',
'Models/NNP0.61.pkl', 'Models/sgd0.54.pkl']
all_pre = []
for model ... | 401 | 0 | 23 |
a1ab82d17d46b556b507ef9ff87a538c36628057 | 327 | py | Python | docs/source/examples/FB2.0/patch_subnets.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | docs/source/examples/FB2.0/patch_subnets.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | docs/source/examples/FB2.0/patch_subnets.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | from pypureclient.flashblade import Subnet
# update a subnet's gateway by name
res = client.patch_subnets(
names=['mysubnet'], subnet=Subnet(gateway='1.2.3.1'))
print(res)
if type(res) == pypureclient.responses.ValidResponse:
print(list(res.items))
# Other valid fields: ids
# See section "Common Fields" for ex... | 29.727273 | 57 | 0.743119 | from pypureclient.flashblade import Subnet
# update a subnet's gateway by name
res = client.patch_subnets(
names=['mysubnet'], subnet=Subnet(gateway='1.2.3.1'))
print(res)
if type(res) == pypureclient.responses.ValidResponse:
print(list(res.items))
# Other valid fields: ids
# See section "Common Fields" for ex... | 0 | 0 | 0 |
06f951e3283966b724d8baaa6c24390241496a9d | 667 | py | Python | dataset-processor2.py | Pawel762/class5-homework | 8e48dcda1ed91b7a5e28bea6db13b2a82182e074 | [
"MIT"
] | null | null | null | dataset-processor2.py | Pawel762/class5-homework | 8e48dcda1ed91b7a5e28bea6db13b2a82182e074 | [
"MIT"
] | null | null | null | dataset-processor2.py | Pawel762/class5-homework | 8e48dcda1ed91b7a5e28bea6db13b2a82182e074 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
wine_df = pd.read_csv(filepath_or_buffer='~/class5-homework/wine.data',
sep=',',
header=None)
wine_df.columns = ['Class','Alcohol','Malic_Acid','Ash','Alcalinity_of_Ash','Magnesium',
'Total_Phenols','Flavanoids','Nonfl... | 29 | 88 | 0.688156 | import pandas as pd
import matplotlib.pyplot as plt
wine_df = pd.read_csv(filepath_or_buffer='~/class5-homework/wine.data',
sep=',',
header=None)
wine_df.columns = ['Class','Alcohol','Malic_Acid','Ash','Alcalinity_of_Ash','Magnesium',
'Total_Phenols','Flavanoids','Nonfl... | 0 | 0 | 0 |
34447222ec8b637e61000a67d97c637fdcfc8fe1 | 12,689 | py | Python | fun.py | heixiaobai/adnmb-cli | da8701bf301e9199ec79a584617cd131a4c08611 | [
"MIT"
] | 1 | 2021-11-11T02:19:41.000Z | 2021-11-11T02:19:41.000Z | fun.py | heixiaobai/adnmb-cli | da8701bf301e9199ec79a584617cd131a4c08611 | [
"MIT"
] | null | null | null | fun.py | heixiaobai/adnmb-cli | da8701bf301e9199ec79a584617cd131a4c08611 | [
"MIT"
] | 1 | 2021-11-11T02:20:49.000Z | 2021-11-11T02:20:49.000Z | import re
import curses
import config
import time
import api
# 自定义的所有函数
# conf: 从config获取来自默认或者用户定义的配置信息
conf = config.config_info
# cont: 在运行过程中保存关于运行状态以及用于控制的信息
cont = config.control_info
# 全局使用,当前所访问版块的全部内容
thread_list = {}
# 全局使用,当前所访问的串的全部内容
post_list = {}
# TODO:注释
cont['browse_now_list'] = 0
# TODO: 需要把自定义版块,目前... | 27.465368 | 96 | 0.533691 | import re
import curses
import config
import time
import api
# 自定义的所有函数
# conf: 从config获取来自默认或者用户定义的配置信息
conf = config.config_info
# cont: 在运行过程中保存关于运行状态以及用于控制的信息
cont = config.control_info
# 全局使用,当前所访问版块的全部内容
thread_list = {}
# 全局使用,当前所访问的串的全部内容
post_list = {}
# TODO:注释
cont['browse_now_list'] = 0
# TODO: 需要把自定义版块,目前... | 573 | 0 | 46 |
51f226bec2148468c07bafa983dd37d9c64a9486 | 4,752 | py | Python | server/volumes/brain_src/test/test_control_handling.py | paul-felt/geppetto | 05596c37f63c1e89132cf3e07f9e8d7966766916 | [
"MIT"
] | null | null | null | server/volumes/brain_src/test/test_control_handling.py | paul-felt/geppetto | 05596c37f63c1e89132cf3e07f9e8d7966766916 | [
"MIT"
] | null | null | null | server/volumes/brain_src/test/test_control_handling.py | paul-felt/geppetto | 05596c37f63c1e89132cf3e07f9e8d7966766916 | [
"MIT"
] | null | null | null | import unittest
import numpy as np
import base64
from brain import control_handling
from brain import constants
claw_control_info = {
constants.SIGNAL_NAME: 'claw',
constants.SIGNAL_LIMITS: [100.0, 400.0],
constants.SIGNAL_CHANNEL_NAME: 'gp.robots.testrobot.controls.claw',
}
twist_control_info = {
co... | 39.932773 | 112 | 0.611742 | import unittest
import numpy as np
import base64
from brain import control_handling
from brain import constants
claw_control_info = {
constants.SIGNAL_NAME: 'claw',
constants.SIGNAL_LIMITS: [100.0, 400.0],
constants.SIGNAL_CHANNEL_NAME: 'gp.robots.testrobot.controls.claw',
}
twist_control_info = {
co... | 3,055 | 1,155 | 23 |
1b9f3e6d5112c9b28a120b41422bd49f725e07ba | 2,847 | py | Python | src/hardware_indep/multi/parser.stage.c.py | GEANT-DataPlaneProgramming/t4p4s | 334dec8e941ed7526d320fc1697ad7a30c3709fb | [
"Apache-2.0"
] | 4 | 2021-12-10T19:06:51.000Z | 2022-01-06T19:52:46.000Z | src/hardware_indep/multi/parser.stage.c.py | GEANT-DataPlaneProgramming/t4p4s | 334dec8e941ed7526d320fc1697ad7a30c3709fb | [
"Apache-2.0"
] | null | null | null | src/hardware_indep/multi/parser.stage.c.py | GEANT-DataPlaneProgramming/t4p4s | 334dec8e941ed7526d320fc1697ad7a30c3709fb | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
# Copyright 2021 Eotvos Lorand University, Budapest, Hungary
compiler_common.current_compilation['is_multicompiled'] = True
part_count = compiler_common.current_compilation['multi']
multi_idx = compiler_common.current_compilation['multi_idx']
table_names = (table.short_name + ("... | 44.484375 | 194 | 0.600281 | # SPDX-License-Identifier: Apache-2.0
# Copyright 2021 Eotvos Lorand University, Budapest, Hungary
compiler_common.current_compilation['is_multicompiled'] = True
part_count = compiler_common.current_compilation['multi']
multi_idx = compiler_common.current_compilation['multi_idx']
table_names = (table.short_name + ("... | 0 | 0 | 0 |
f01c40eda22ce2dbb9c545cd950b4f467984b666 | 285 | py | Python | venv/lib/python2.7/site-packages/pylint/test/input/func_newstyle___slots__.py | mutaihillary/mycalculator | 55685dd7c968861f18ae0701129f5af2bc682d67 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/pylint/test/input/func_newstyle___slots__.py | mutaihillary/mycalculator | 55685dd7c968861f18ae0701129f5af2bc682d67 | [
"MIT"
] | 7 | 2021-02-08T20:22:15.000Z | 2022-03-11T23:19:41.000Z | venv/lib/python2.7/site-packages/pylint/test/input/func_newstyle___slots__.py | mutaihillary/mycalculator | 55685dd7c968861f18ae0701129f5af2bc682d67 | [
"MIT"
] | null | null | null | # pylint: disable=R0903
"""test __slots__ on old style class"""
__revision__ = 1
class OkOk(object):
"""correct usage"""
__slots__ = ('a', 'b')
class HaNonNonNon:
"""bad usage"""
__slots__ = ('a', 'b')
__slots__ = 'hop' # pfff
| 15.833333 | 39 | 0.585965 | # pylint: disable=R0903
"""test __slots__ on old style class"""
__revision__ = 1
class OkOk(object):
"""correct usage"""
__slots__ = ('a', 'b')
class HaNonNonNon:
"""bad usage"""
__slots__ = ('a', 'b')
def __init__(self):
pass
__slots__ = 'hop' # pfff
| 11 | 0 | 27 |
4ae2d6e7ad5b3277cfeece0959766a37d3ee5322 | 3,576 | py | Python | redis_consumer/consumers/spot_consumer_test.py | vanvalenlab/tf-serving-redis-interface | f696c05ee622ac6cc38dc1afcef2379d2ea9d9f0 | [
"Apache-2.0"
] | null | null | null | redis_consumer/consumers/spot_consumer_test.py | vanvalenlab/tf-serving-redis-interface | f696c05ee622ac6cc38dc1afcef2379d2ea9d9f0 | [
"Apache-2.0"
] | null | null | null | redis_consumer/consumers/spot_consumer_test.py | vanvalenlab/tf-serving-redis-interface | f696c05ee622ac6cc38dc1afcef2379d2ea9d9f0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2022 The Van Valen Lab at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");... | 38.869565 | 86 | 0.675615 | # Copyright 2016-2022 The Van Valen Lab at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");... | 1,837 | 10 | 77 |