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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
486874391245b694cf9f6df6dc6390a37aaa9ee0 | 4,122 | py | Python | solutions/2nd-place/bbox_model/helper/keypoint_encoder.py | henriquesimoes/humpback | ba687a71f95ef9c9c30426eefae11a69efd6f942 | [
"BSD-3-Clause"
] | null | null | null | solutions/2nd-place/bbox_model/helper/keypoint_encoder.py | henriquesimoes/humpback | ba687a71f95ef9c9c30426eefae11a69efd6f942 | [
"BSD-3-Clause"
] | null | null | null | solutions/2nd-place/bbox_model/helper/keypoint_encoder.py | henriquesimoes/humpback | ba687a71f95ef9c9c30426eefae11a69efd6f942 | [
"BSD-3-Clause"
] | null | null | null | import torch
import numpy as np
import torch.nn.functional as F
import cv2
if __name__ == '__main__':
from bbox_model.kpda_parser import KPDA
import cv2
from bbox_model.config import Config
import numpy as np
config = Config('whale')
# db_path = '/home/storage/lsy/fashion/FashionAI_Keypoint_D... | 35.230769 | 102 | 0.522319 | import torch
import numpy as np
import torch.nn.functional as F
import cv2
class KeypointEncoder:
def _gaussian_keypoint(self, input_size, mu_x, mu_y, alpha, sigma):
mu_x = mu_x.float()
mu_y = mu_y.float()
h, w = input_size
x = torch.linspace(0, w-1, steps=w)
y = torch.li... | 782 | 2,418 | 23 |
e5ff47cdf2f7761a61241a9f6db36bdc3a7c9816 | 3,873 | py | Python | app/FileViewer/FileServer/misc/mmpython/disc/vcdinfo.py | benyaboy/sage-graphics | 090640167329ace4b6ad266d47db5bb2b0394232 | [
"Unlicense"
] | null | null | null | app/FileViewer/FileServer/misc/mmpython/disc/vcdinfo.py | benyaboy/sage-graphics | 090640167329ace4b6ad266d47db5bb2b0394232 | [
"Unlicense"
] | null | null | null | app/FileViewer/FileServer/misc/mmpython/disc/vcdinfo.py | benyaboy/sage-graphics | 090640167329ace4b6ad266d47db5bb2b0394232 | [
"Unlicense"
] | 1 | 2021-07-02T10:31:03.000Z | 2021-07-02T10:31:03.000Z | #if 0 /*
# -----------------------------------------------------------------------
# vcdinfo.py - parse vcd track informations
# -----------------------------------------------------------------------
# $Id: vcdinfo.py,v 1.8 2004/06/25 13:20:35 dischi Exp $
#
# $Log: vcdinfo.py,v $
# Revision 1.8 2004/06/25 13:20:35 ... | 33.973684 | 92 | 0.561838 | #if 0 /*
# -----------------------------------------------------------------------
# vcdinfo.py - parse vcd track informations
# -----------------------------------------------------------------------
# $Id: vcdinfo.py,v 1.8 2004/06/25 13:20:35 dischi Exp $
#
# $Log: vcdinfo.py,v $
# Revision 1.8 2004/06/25 13:20:35 ... | 1,845 | 3 | 76 |
a16e07ded87298b79341ea7538af5dcca315fe8c | 916 | py | Python | request_files_2_with-templates/main.py | Nivratti/fastapi | d3f8c750ae15201b50be80d998cfafe6e8d155e9 | [
"Apache-2.0"
] | null | null | null | request_files_2_with-templates/main.py | Nivratti/fastapi | d3f8c750ae15201b50be80d998cfafe6e8d155e9 | [
"Apache-2.0"
] | null | null | null | request_files_2_with-templates/main.py | Nivratti/fastapi | d3f8c750ae15201b50be80d998cfafe6e8d155e9 | [
"Apache-2.0"
] | null | null | null | import os
from typing import List
from fastapi import FastAPI, File, UploadFile
from fastapi.responses import HTMLResponse
from fastapi import Request
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
app = FastAPI()
app.mount("/static", StaticFiles(directory="static"), nam... | 26.171429 | 73 | 0.765284 | import os
from typing import List
from fastapi import FastAPI, File, UploadFile
from fastapi.responses import HTMLResponse
from fastapi import Request
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
app = FastAPI()
app.mount("/static", StaticFiles(directory="static"), nam... | 329 | 0 | 44 |
8edda587938a4902f384ca8e45b3c2514a6a7284 | 4,970 | py | Python | tracker.py | twosmallhands/BitTorrent | 7b707a92db774a6f643ae8e6008e7c99be804991 | [
"MIT"
] | null | null | null | tracker.py | twosmallhands/BitTorrent | 7b707a92db774a6f643ae8e6008e7c99be804991 | [
"MIT"
] | null | null | null | tracker.py | twosmallhands/BitTorrent | 7b707a92db774a6f643ae8e6008e7c99be804991 | [
"MIT"
] | null | null | null | import certifi
import urllib3
import asyncio
import aiohttp
import ipaddress
import time
from connection import Connection
from bencode import Parser
from torrent import Torrent
from block import Piece, Block
if __name__ == "__main__":
path = './test/ubuntu-20.10-desktop-amd64.iso.torrent'
torrent = To... | 32.48366 | 114 | 0.508652 | import certifi
import urllib3
import asyncio
import aiohttp
import ipaddress
import time
from connection import Connection
from bencode import Parser
from torrent import Torrent
from block import Piece, Block
class Tracker:
def __init__(self, torrent):
self.torrent = torrent
self.URL = ""
s... | 3,767 | 754 | 23 |
43b2fd1d102d87ae2a1a35772a9a87502bfbbd33 | 19,568 | py | Python | odoo/addons/base/tests/test_translate.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | odoo/addons/base/tests/test_translate.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | odoo/addons/base/tests/test_translate.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tools import pycompat
from odoo.tools import mute_logger
from odoo.tools.translate import quote, unquote, xml_translate, html_translate
from odoo.tests.common import TransactionCase, BaseCase
from psycopg2 impor... | 43.874439 | 258 | 0.5625 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tools import pycompat
from odoo.tools import mute_logger
from odoo.tools.translate import quote, unquote, xml_translate, html_translate
from odoo.tests.common import TransactionCase, BaseCase
from psycopg2 impor... | 3,260 | 15,901 | 69 |
912679b86d267d58fee00002fe898b793bd08a21 | 9,023 | py | Python | slender/dictionary.py | torokmark/slender | 3bf815e22f7802ba48706f31ba608cf609e23e68 | [
"Apache-2.0"
] | 1 | 2020-01-10T21:51:46.000Z | 2020-01-10T21:51:46.000Z | slender/dictionary.py | torokmark/slender | 3bf815e22f7802ba48706f31ba608cf609e23e68 | [
"Apache-2.0"
] | null | null | null | slender/dictionary.py | torokmark/slender | 3bf815e22f7802ba48706f31ba608cf609e23e68 | [
"Apache-2.0"
] | null | null | null |
import copy
import typing
from slender import List
KT = typing.TypeVar('KT')
VT = typing.TypeVar('VT')
| 26.934328 | 123 | 0.533304 |
import copy
import typing
from slender import List
KT = typing.TypeVar('KT')
VT = typing.TypeVar('VT')
class Dictionary(typing.Generic[KT, VT]):
def __init__(self, d={}) -> None:
'''
Create new instance of Dictionary
Parameters:
a (dicitonary): Dictionary of key-value pairs
... | 6,262 | 2,601 | 23 |
4ac2368ecb34a8ab0278249ddcb076807f9dc602 | 103,331 | py | Python | pirates/ship/ShipGlobals.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | 3 | 2021-02-25T06:38:13.000Z | 2022-03-22T07:00:15.000Z | pirates/ship/ShipGlobals.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | null | null | null | pirates/ship/ShipGlobals.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | 1 | 2021-02-25T06:38:17.000Z | 2021-02-25T06:38:17.000Z | # uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: pirates.ship.ShipGlobals
from pandac.PandaModules import *
from direct.showbase.PythonUtil import Enum
from pirates.uberdog.UberDogGloba... | 203.808679 | 71,299 | 0.707445 | # uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: pirates.ship.ShipGlobals
from pandac.PandaModules import *
from direct.showbase.PythonUtil import Enum
from pirates.uberdog.UberDogGloba... | 3,724 | 2,551 | 667 |
e6de9a7596354b1fc316fde0baae9659b902640c | 1,432 | py | Python | tests/test_client.py | Nadybot/nadypy | ae6cbb886d233fde491aee501cb72bf993f3a02f | [
"MIT"
] | null | null | null | tests/test_client.py | Nadybot/nadypy | ae6cbb886d233fde491aee501cb72bf993f3a02f | [
"MIT"
] | null | null | null | tests/test_client.py | Nadybot/nadypy | ae6cbb886d233fde491aee501cb72bf993f3a02f | [
"MIT"
] | null | null | null | import pytest
from nadypy.api.system import get_sysinfo
from nadypy.api.webserver import post_chat_web
from nadypy.client import BasicAuthClient, SignedAuthClient
from nadypy.models.system_information import SystemInformation
@pytest.fixture
@pytest.fixture
@pytest.mark.asyncio
@pytest.mark.asyncio
| 27.538462 | 102 | 0.780726 | import pytest
from nadypy.api.system import get_sysinfo
from nadypy.api.webserver import post_chat_web
from nadypy.client import BasicAuthClient, SignedAuthClient
from nadypy.models.system_information import SystemInformation
@pytest.fixture
async def basic_auth_client():
client = BasicAuthClient("http://localho... | 1,011 | 0 | 111 |
1450453320d6bdf64437a1505a8200afe5cabcc6 | 620 | py | Python | DataStructuresandAlgorithmsInPython/com/kranthi/Algorithms/Arrays/stockBuySell.py | kbaddepuri/DataStructuresInPython | fbd5222e175f07922ee944c612c6b516b8d55211 | [
"BSD-3-Clause"
] | null | null | null | DataStructuresandAlgorithmsInPython/com/kranthi/Algorithms/Arrays/stockBuySell.py | kbaddepuri/DataStructuresInPython | fbd5222e175f07922ee944c612c6b516b8d55211 | [
"BSD-3-Clause"
] | 1 | 2020-09-30T16:09:59.000Z | 2020-09-30T16:09:59.000Z | DataStructuresandAlgorithmsInPython/com/kranthi/Algorithms/Arrays/stockBuySell.py | kbaddepuri/DataStructuresInPython | fbd5222e175f07922ee944c612c6b516b8d55211 | [
"BSD-3-Clause"
] | 2 | 2020-09-30T14:18:47.000Z | 2021-09-30T16:07:27.000Z |
price = [100, 180, 260, 310, 40, 535, 695]
stockAndBySell(price) | 22.142857 | 59 | 0.453226 | def stockAndBySell(prices):
n = len(prices)
if n == 1:
return
i = 0
profit = 0
while i < (n-1):
# find local min
while i < (n-1) and prices[i + 1] <= prices[i]:
i += 1
if i == n-1:
break
buy = i
i += 1
# find lo... | 532 | 0 | 22 |
6a6ea1ffdcec2b7c521c0a3c82d556b28b151449 | 3,120 | py | Python | register.py | thhapke/workshop_registration | 99c3bf91c6da5bf8bc56ce15bb4f11f3d6fe5328 | [
"MIT"
] | null | null | null | register.py | thhapke/workshop_registration | 99c3bf91c6da5bf8bc56ce15bb4f11f3d6fe5328 | [
"MIT"
] | null | null | null | register.py | thhapke/workshop_registration | 99c3bf91c6da5bf8bc56ce15bb4f11f3d6fe5328 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, Blueprint, flash
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, SelectField
from wtforms.validators import DataRequired
from workshops_model import *
from users_model import *
... | 43.333333 | 132 | 0.639103 | from flask import Flask, render_template, Blueprint, flash
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, SelectField
from wtforms.validators import DataRequired
from workshops_model import *
from users_model import *
... | 2,147 | 193 | 45 |
4978c2185db81f3c0ea3ab2b2820e34016c557b7 | 584 | py | Python | torba/torba/tasks.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 4,076 | 2018-06-01T05:54:24.000Z | 2022-03-07T21:05:52.000Z | torba/torba/tasks.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 80 | 2018-06-14T01:02:03.000Z | 2019-06-19T10:45:39.000Z | torba/torba/tasks.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | 20 | 2018-06-27T21:52:22.000Z | 2022-03-08T11:25:23.000Z | from asyncio import Event, get_event_loop
| 23.36 | 48 | 0.599315 | from asyncio import Event, get_event_loop
class TaskGroup:
def __init__(self, loop=None):
self._loop = loop or get_event_loop()
self._tasks = set()
self.done = Event()
def add(self, coro):
task = self._loop.create_task(coro)
self._tasks.add(task)
self.done.cle... | 415 | -5 | 131 |
9b0a7af982dbe96326a612864d9213830426a43d | 8,180 | py | Python | father/father_old.py | JohnOmernik/pimeup | c68f84d699f67af71bb5561eb6c5885ccd8b4ac8 | [
"Apache-2.0"
] | 1 | 2017-10-21T16:52:21.000Z | 2017-10-21T16:52:21.000Z | father/father_old.py | JohnOmernik/pimeup | c68f84d699f67af71bb5561eb6c5885ccd8b4ac8 | [
"Apache-2.0"
] | null | null | null | father/father_old.py | JohnOmernik/pimeup | c68f84d699f67af71bb5561eb6c5885ccd8b4ac8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import cwiid
import sys
import gevent
import time
import json
import datetime
import atexit
from collections import OrderedDict
import random
from dotstar import Adafruit_DotStar
import socket
import alsaaudio
import wave
import sys
import struct
import math
WHOAMI = socket.gethostname()
import RP... | 25.642633 | 119 | 0.613814 | #!/usr/bin/python
import cwiid
import sys
import gevent
import time
import json
import datetime
import atexit
from collections import OrderedDict
import random
from dotstar import Adafruit_DotStar
import socket
import alsaaudio
import wave
import sys
import struct
import math
WHOAMI = socket.gethostname()
import RP... | 4,777 | 0 | 160 |
f05822d3678db99be77bcd6919f4b7f4d9fdfb83 | 4,565 | py | Python | Algorithm-Design/test_binomial.py | pabloriutort/Aula | 9c560fb76e94bf846120ec202c6e14e651a53844 | [
"MIT"
] | null | null | null | Algorithm-Design/test_binomial.py | pabloriutort/Aula | 9c560fb76e94bf846120ec202c6e14e651a53844 | [
"MIT"
] | 1 | 2015-07-12T00:17:08.000Z | 2017-06-03T16:17:35.000Z | Algorithm-Design/test_binomial.py | pabloriutort/Aula | 9c560fb76e94bf846120ec202c6e14e651a53844 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import unittest
from binomial_heap import Node
from binomial_heap import Tree, insert
from binomial_heap import Heap
unittest.main()
| 25.502793 | 83 | 0.573494 | #!/usr/bin/env python
import unittest
from binomial_heap import Node
from binomial_heap import Tree, insert
from binomial_heap import Heap
class TestNode(unittest.TestCase):
def test_create(self):
key = 1
node = Node(key)
self.assertEqual(node.key, key)
def test_parenthood(self):
... | 4,066 | 39 | 293 |
aac8b6444eaa836482839fafcecee344421e57a7 | 13,321 | py | Python | tests/test_battle_planner.py | benneyman/War | 622ccc0ae1bba36046c7c6b5e1757773a2e90773 | [
"MIT"
] | null | null | null | tests/test_battle_planner.py | benneyman/War | 622ccc0ae1bba36046c7c6b5e1757773a2e90773 | [
"MIT"
] | null | null | null | tests/test_battle_planner.py | benneyman/War | 622ccc0ae1bba36046c7c6b5e1757773a2e90773 | [
"MIT"
] | 1 | 2019-09-07T17:56:06.000Z | 2019-09-07T17:56:06.000Z | from battalion_processor import BattalionProcessor
from battalion_types import BattalionType
from battle_planner import BattlePlanner
from army import Army
from copy import deepcopy
| 65.945545 | 121 | 0.663764 | from battalion_processor import BattalionProcessor
from battalion_types import BattalionType
from battle_planner import BattlePlanner
from army import Army
from copy import deepcopy
class Test_BattlePlanner(object):
def test_apply_power_rule(self):
bp = BattlePlanner(BattalionProcessor(), Army())
... | 12,715 | 12 | 375 |
c7b7f2152f6d0785a0378288d9b538948ac0e9a7 | 1,149 | py | Python | src/server/utils/gencss.py | phanirithvij/color-theme | d7f53c69152548f977c0a141099b4f989a898480 | [
"CC0-1.0"
] | null | null | null | src/server/utils/gencss.py | phanirithvij/color-theme | d7f53c69152548f977c0a141099b4f989a898480 | [
"CC0-1.0"
] | 21 | 2019-05-11T04:13:31.000Z | 2021-10-06T22:42:29.000Z | src/server/utils/gencss.py | phanirithvij/color-theme | d7f53c69152548f977c0a141099b4f989a898480 | [
"CC0-1.0"
] | null | null | null | import os
import uuid
from server.utils import get_colors_colortheif
def get_colors_gen_css(filename: str, joiner: str, ex_colors=[], ex_uid=None):
"""
Pass filename, joiner, existing_colors, existing_uid
"""
temp_dir = os.path.abspath('server/tmp/')
file = os.path.abspath(f"server/img/{filename}... | 25.533333 | 78 | 0.605744 | import os
import uuid
from server.utils import get_colors_colortheif
def gen_css(colors):
colorstrings = f"""\
--bg-color : rgb({colors[0][0]},{colors[0][1]},{colors[0][2]});
"""
for i, col in enumerate(colors[1]):
colorstrings += f"""
--color-{i} : rgb({col[0]},{col[1]},{col[2]});
... | 319 | 0 | 23 |
aa0ff24f176be8a12bceeee84b9eca7f2b219363 | 6,044 | py | Python | generer_base_csv.py | frederic-junier/-foad-bloc4-mougeot-reynaud-junier | 24c41c3c8ddefc2836b858349b540f1fc37e17bc | [
"CC0-1.0"
] | null | null | null | generer_base_csv.py | frederic-junier/-foad-bloc4-mougeot-reynaud-junier | 24c41c3c8ddefc2836b858349b540f1fc37e17bc | [
"CC0-1.0"
] | null | null | null | generer_base_csv.py | frederic-junier/-foad-bloc4-mougeot-reynaud-junier | 24c41c3c8ddefc2836b858349b540f1fc37e17bc | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from faker import Faker # pour créer de faux noms, adresses,...
from random import * # pour des générateurs de nombres pseudo-aléatoires
import csv # pour parcourir des fichiers csv
from pathlib import ... | 51.65812 | 143 | 0.618961 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from faker import Faker # pour créer de faux noms, adresses,...
from random import * # pour des générateurs de nombres pseudo-aléatoires
import csv # pour parcourir des fichiers csv
from pathlib import ... | 5,431 | 0 | 140 |
efa916fa17c4fdbbe322919420289e58611f1ff7 | 122 | py | Python | elegy/model/__init__.py | SamuelMarks/elegy | 1e578e82ff042a76d19283325106b9b5ef7fd7e9 | [
"Apache-2.0"
] | null | null | null | elegy/model/__init__.py | SamuelMarks/elegy | 1e578e82ff042a76d19283325106b9b5ef7fd7e9 | [
"Apache-2.0"
] | null | null | null | elegy/model/__init__.py | SamuelMarks/elegy | 1e578e82ff042a76d19283325106b9b5ef7fd7e9 | [
"Apache-2.0"
] | null | null | null | from .model import Model, load
from .model_base import Optimizer
__all__ = [
"Model",
"Optimizer",
"load",
]
| 13.555556 | 33 | 0.639344 | from .model import Model, load
from .model_base import Optimizer
__all__ = [
"Model",
"Optimizer",
"load",
]
| 0 | 0 | 0 |
e5459b942851adffc106629b9f5f55ef70410640 | 9,340 | py | Python | ryven/example_nodes/linalg/nodes.py | sphh/Ryven | 4d8af8025c88c96dcee6248e38658e3f8a112795 | [
"MIT"
] | 13 | 2020-04-02T18:57:55.000Z | 2020-06-21T20:28:00.000Z | ryven/example_nodes/linalg/nodes.py | manuelding/Ryven | 9192b0220c304af6ecdf6d6e4fff09033d3dd7b0 | [
"MIT"
] | 1 | 2020-03-30T15:18:38.000Z | 2020-03-30T15:18:38.000Z | ryven/example_nodes/linalg/nodes.py | manuelding/Ryven | 9192b0220c304af6ecdf6d6e4fff09033d3dd7b0 | [
"MIT"
] | 6 | 2020-05-16T13:56:20.000Z | 2020-06-17T09:11:40.000Z | from ryven.NENV import *
widgets = import_widgets(__file__)
import numpy as np
class ShowMatrix(MatrixNodeBase):
"""Displays a matrix"""
title = 'Show Matrix'
# ------------------------------------------------------------------------------
class Matrix_Node(Node):
"""Evaluates a matrix"""
title ... | 24.840426 | 126 | 0.609315 | from ryven.NENV import *
widgets = import_widgets(__file__)
import numpy as np
class MatrixNodeBase(Node):
main_widget_class = widgets.MatrixWidget
main_widget_pos = 'below ports'
init_inputs = [
NodeInputBP()
]
init_outputs = [
NodeOutputBP()
]
color = '#3344ff'
def ... | 4,790 | 292 | 957 |
f597e0ec6e74db8f98a2d6042f5a8ee9c4bfc445 | 279 | py | Python | home_page/models.py | nh7881/my_newneek | 9bc234c1f0eeb2c3cfbd271ccbb8928877e15267 | [
"Apache-2.0"
] | null | null | null | home_page/models.py | nh7881/my_newneek | 9bc234c1f0eeb2c3cfbd271ccbb8928877e15267 | [
"Apache-2.0"
] | null | null | null | home_page/models.py | nh7881/my_newneek | 9bc234c1f0eeb2c3cfbd271ccbb8928877e15267 | [
"Apache-2.0"
] | null | null | null | from django.db import models
# Create your models here. | 31 | 56 | 0.727599 | from django.db import models
# Create your models here.
class User(models.Model) :
name = models.CharField(max_length = 50)
email = models.CharField(max_length = 100)
major = models.CharField(max_length = 50)
create_date = models.DateTimeField('date published') | 0 | 200 | 23 |
d30aff66965d7eb67b7168dfd87617ca21edce84 | 1,250 | py | Python | d12/d12_p2.py | ignekt/advent-of-code-2020 | ab223af23e6eb922d9019f0a9cc84bb256525647 | [
"MIT"
] | null | null | null | d12/d12_p2.py | ignekt/advent-of-code-2020 | ab223af23e6eb922d9019f0a9cc84bb256525647 | [
"MIT"
] | null | null | null | d12/d12_p2.py | ignekt/advent-of-code-2020 | ab223af23e6eb922d9019f0a9cc84bb256525647 | [
"MIT"
] | null | null | null | import re
f = open('input.txt')
east = 0
north = 0
waypoint = {'east': 10, 'north': 1}
for line in f:
m = re.match(r'([S|W|E|N|F|R|L]{1})(\d+)', line[:-1])
instruction = (m.group(1), int(m.group(2)))
if instruction[0] == 'F':
update_location(instruction[1])
elif instruction[0] == 'R':
... | 26.041667 | 57 | 0.5648 | import re
f = open('input.txt')
east = 0
north = 0
waypoint = {'east': 10, 'north': 1}
def turn_right():
global waypoint
tmp = waypoint['north']
waypoint['north'] = -waypoint['east']
waypoint['east'] = tmp
def turn_left():
global waypoint
tmp = waypoint['north']
waypoint['north'] = wayp... | 328 | 0 | 69 |
3ca0600b13fc003145b1db7f9a7e81cafd5795cc | 296 | py | Python | python/testData/debug/stepping/test_smart_step_into_condition.py | Sajaki/intellij-community | 6748af2c40567839d11fd652ec77ba263c074aad | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/debug/stepping/test_smart_step_into_condition.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2022-02-19T09:45:05.000Z | 2022-02-27T20:32:55.000Z | python/testData/debug/stepping/test_smart_step_into_condition.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | from __future__ import print_function
if __name__ == '__main__':
xs = [1, 2, 3]
if 2 in xs:
print("YES")
else:
print("NO")
if cond1() and cond2():
print("YES")
else:
print("NO")
| 12.869565 | 37 | 0.52027 | from __future__ import print_function
def cond1():
return True
def cond2():
return False
if __name__ == '__main__':
xs = [1, 2, 3]
if 2 in xs:
print("YES")
else:
print("NO")
if cond1() and cond2():
print("YES")
else:
print("NO")
| 15 | 0 | 46 |
cffab508d7e22b50a114f9e59de345a01cff6432 | 2,066 | py | Python | fabio/test/testopenheader.py | picca/fabio | bc3aae330bef6e1c983007562157edfe6d7daf91 | [
"Apache-2.0"
] | null | null | null | fabio/test/testopenheader.py | picca/fabio | bc3aae330bef6e1c983007562157edfe6d7daf91 | [
"Apache-2.0"
] | 2 | 2019-04-24T13:43:41.000Z | 2019-06-13T08:54:02.000Z | fabio/test/testopenheader.py | boesecke/fabio | 11350e445a6def4d02c6860aea3ae7f36652af6a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Fable Input Output
# https://github.com/silx-kit/fabio
#
# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
# This program is free software: you... | 31.784615 | 83 | 0.668441 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Fable Input Output
# https://github.com/silx-kit/fabio
#
# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
# This program is free software: you... | 233 | 0 | 49 |
43e78f402f69a55db37b4b92fa51674b4eb11aed | 494 | py | Python | python_teste/python_aulas/aula_65.py | BrunoDantasMoreira/projectsPython | bd73ab0b3c067456407f227ed2ece42e7f21ddfc | [
"MIT"
] | 1 | 2020-07-27T14:18:08.000Z | 2020-07-27T14:18:08.000Z | python_teste/python_aulas/aula_65.py | BrunoDantasMoreira/projectsPython | bd73ab0b3c067456407f227ed2ece42e7f21ddfc | [
"MIT"
] | null | null | null | python_teste/python_aulas/aula_65.py | BrunoDantasMoreira/projectsPython | bd73ab0b3c067456407f227ed2ece42e7f21ddfc | [
"MIT"
] | null | null | null | num = cont = soma = igual = maior = menor = 0
r = 'a'
while r != 'N':
num = int(input('Digite um número: '))
igual = num
soma += num
cont += 1
if cont == 1:
maior = menor = num
else:
if num > maior:
maior = num
elif num < menor:
menor = num
r =... | 26 | 74 | 0.520243 | num = cont = soma = igual = maior = menor = 0
r = 'a'
while r != 'N':
num = int(input('Digite um número: '))
igual = num
soma += num
cont += 1
if cont == 1:
maior = menor = num
else:
if num > maior:
maior = num
elif num < menor:
menor = num
r =... | 0 | 0 | 0 |
dbee6beca5bdd5b29440cc78976dee42c224cdc4 | 150 | py | Python | src/creator/__init__.py | Tiphereth-A/problems | 78724d2f559bf18b4999c89ef3bf9b8523fc6d49 | [
"MIT"
] | 1 | 2022-01-23T09:26:35.000Z | 2022-01-23T09:26:35.000Z | src/creator/__init__.py | Tiphereth-A/problems | 78724d2f559bf18b4999c89ef3bf9b8523fc6d49 | [
"MIT"
] | null | null | null | src/creator/__init__.py | Tiphereth-A/problems | 78724d2f559bf18b4999c89ef3bf9b8523fc6d49 | [
"MIT"
] | 1 | 2022-03-08T07:21:04.000Z | 2022-03-08T07:21:04.000Z | from src.creator.creator import Creator
from src.creator.luogu_creator import LuoguProblemCreator
problem_map = {
"luogu": LuoguProblemCreator
}
| 21.428571 | 57 | 0.806667 | from src.creator.creator import Creator
from src.creator.luogu_creator import LuoguProblemCreator
problem_map = {
"luogu": LuoguProblemCreator
}
| 0 | 0 | 0 |
548d3026232e9dc8ac35a891066ba4545777a44a | 6,098 | py | Python | solo/configurator/config/views.py | avanov/Solo | 53dd97a3b59e37b26a4be80d1cafd3fb64404163 | [
"MIT"
] | 5 | 2016-04-21T13:35:17.000Z | 2021-11-06T00:11:33.000Z | solo/configurator/config/views.py | avanov/Solo | 53dd97a3b59e37b26a4be80d1cafd3fb64404163 | [
"MIT"
] | 23 | 2016-03-06T16:11:00.000Z | 2020-04-19T20:12:02.000Z | solo/configurator/config/views.py | avanov/Solo | 53dd97a3b59e37b26a4be80d1cafd3fb64404163 | [
"MIT"
] | 1 | 2021-11-06T00:11:35.000Z | 2021-11-06T00:11:35.000Z | import inspect
from typing import Optional
from solo.server.definitions import HttpMethod
from . import predicates as default_predicates
from ..util import viewdefaults
from .routes import ViewMeta
from .util import PredicateList
from ..exceptions import ConfigurationError
from solo.server.app import App
| 37.875776 | 112 | 0.569859 | import inspect
from typing import Optional
from solo.server.definitions import HttpMethod
from . import predicates as default_predicates
from ..util import viewdefaults
from .routes import ViewMeta
from .util import PredicateList
from ..exceptions import ConfigurationError
from solo.server.app import App
class Views... | 621 | 5,147 | 23 |
72e5f7351890024560e6121a1593b0a73da73abf | 4,246 | py | Python | aiowamp/serializers/json.py | gieseladev/wampio | d0275dd0370718c96e9be1d27af60b560cd372be | [
"MIT"
] | null | null | null | aiowamp/serializers/json.py | gieseladev/wampio | d0275dd0370718c96e9be1d27af60b560cd372be | [
"MIT"
] | 2 | 2019-12-04T17:16:41.000Z | 2021-06-02T00:44:35.000Z | aiowamp/serializers/json.py | gieseladev/wampio | d0275dd0370718c96e9be1d27af60b560cd372be | [
"MIT"
] | null | null | null | import base64
import json
from typing import Any, ByteString, Iterable, Optional, Tuple
import aiowamp
from aiowamp import SerializerABC, build_message_from_list
__all__ = ["JSONSerializer", "JSONDecoder", "JSONEncoder"]
class JSONSerializer(SerializerABC):
"""Serializer for the JSON format.
Provides a cus... | 25.578313 | 81 | 0.626001 | import base64
import json
from typing import Any, ByteString, Iterable, Optional, Tuple
import aiowamp
from aiowamp import SerializerABC, build_message_from_list
__all__ = ["JSONSerializer", "JSONDecoder", "JSONEncoder"]
class JSONSerializer(SerializerABC):
"""Serializer for the JSON format.
Provides a cus... | 492 | 0 | 108 |
4fbf98d1474812864eee86b498f1a02f08f17c2f | 952 | py | Python | var/spack/repos/builtin/packages/r-sessioninfo/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-sessioninfo/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/r-sessioninfo/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class RSessioninfo(RPackage):
"""R Session Information.
Query and print information... | 36.615385 | 95 | 0.702731 | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class RSessioninfo(RPackage):
"""R Session Information.
Query and print information... | 0 | 0 | 0 |
b6bd5f4406909e0436d5b5568624ce24e4878370 | 359 | py | Python | crawler/crawler/treewalk/db_updater/interface.py | amosproj/amos-ss2020-metadata-hub | f8434b27b306332c117a8dd20a8a55a3104d0f89 | [
"MIT"
] | 9 | 2020-04-23T14:22:48.000Z | 2022-02-25T21:35:05.000Z | crawler/crawler/treewalk/db_updater/interface.py | amosproj/amos-ss2020-metadata-hub | f8434b27b306332c117a8dd20a8a55a3104d0f89 | [
"MIT"
] | 42 | 2020-04-24T17:59:33.000Z | 2022-02-16T01:09:23.000Z | crawler/crawler/treewalk/db_updater/interface.py | amosproj/amos-ss2020-metadata-hub | f8434b27b306332c117a8dd20a8a55a3104d0f89 | [
"MIT"
] | 2 | 2020-08-17T11:19:44.000Z | 2021-04-30T08:32:05.000Z | """Interface for the Database updater thread."""
# Local imports
import crawler.communication as communication
def shutdown() -> None:
"""Shutdown the database updater thread."""
command = communication.Command(
command=communication.DATABASE_UPDATER_SHUTDOWN,
data=None
)
communicati... | 23.933333 | 56 | 0.727019 | """Interface for the Database updater thread."""
# Local imports
import crawler.communication as communication
def shutdown() -> None:
"""Shutdown the database updater thread."""
command = communication.Command(
command=communication.DATABASE_UPDATER_SHUTDOWN,
data=None
)
communicati... | 0 | 0 | 0 |
1d58a7912d2402cc5e65d9d8181f74e1dab74739 | 626 | py | Python | adv/pinon.py | LorentzB/dl | c2af8498ba868abcd2ddb08eb9e4b4bb79594ba2 | [
"Apache-2.0"
] | null | null | null | adv/pinon.py | LorentzB/dl | c2af8498ba868abcd2ddb08eb9e4b4bb79594ba2 | [
"Apache-2.0"
] | null | null | null | adv/pinon.py | LorentzB/dl | c2af8498ba868abcd2ddb08eb9e4b4bb79594ba2 | [
"Apache-2.0"
] | null | null | null | from core.advbase import *
from module.template import SigilAdv
variants = {None: Pinon}
| 25.04 | 69 | 0.594249 | from core.advbase import *
from module.template import SigilAdv
class Pinon(SigilAdv):
def fs2_proc(self, e):
self.a_update_sigil(-13)
def prerun(self):
self.config_sigil(duration=300, x=True)
def x(self):
x_min = 1
prev = self.action.getprev()
if self.unlocked and... | 405 | 1 | 130 |
b1aea36f89f4238f15ead1c6c02761032f42683f | 5,734 | py | Python | asana/resources/gen/webhooks.py | FiyaFly/python-asana | ef9e6ff3e82e9f1ca18d526401f524698c7215c7 | [
"MIT"
] | 1 | 2020-05-28T03:47:23.000Z | 2020-05-28T03:47:23.000Z | asana/resources/gen/webhooks.py | FiyaFly/python-asana | ef9e6ff3e82e9f1ca18d526401f524698c7215c7 | [
"MIT"
] | null | null | null | asana/resources/gen/webhooks.py | FiyaFly/python-asana | ef9e6ff3e82e9f1ca18d526401f524698c7215c7 | [
"MIT"
] | null | null | null | # coding=utf-8
| 89.59375 | 517 | 0.712417 | # coding=utf-8
class _Webhooks:
def __init__(self, client=None):
self.client = client
def create_webhook(self, params=None, **options):
"""Establish a webhook
:param Object params: Parameters for the request
:param **options
- opt_fields {list[str]}: Defines fields... | 40 | 5,689 | 22 |
5421451ffbcf8c86a5b7097ccdc5af41af2fd79f | 11,504 | py | Python | termin_api.py | aestuans/munich-scripts | a401f6aced591a078e7fbc1c43db82cdf2c0e03d | [
"MIT"
] | null | null | null | termin_api.py | aestuans/munich-scripts | a401f6aced591a078e7fbc1c43db82cdf2c0e03d | [
"MIT"
] | null | null | null | termin_api.py | aestuans/munich-scripts | a401f6aced591a078e7fbc1c43db82cdf2c0e03d | [
"MIT"
] | null | null | null | import datetime
import requests
import re
import json
class Buro(metaclass=Meta):
"""
Base interface-like class for all departments providing appointments on ...muenchen.de/termin/index.php... page
"""
appointment_types = None
appointment_type_date = None
@classmethod
def get_available... | 31.867036 | 122 | 0.627955 | import datetime
import requests
import re
import json
class Meta(type):
def __repr__(cls):
return cls.get_name()
class Buro(metaclass=Meta):
"""
Base interface-like class for all departments providing appointments on ...muenchen.de/termin/index.php... page
"""
appointment_types = None
... | 5,149 | 1,615 | 213 |
47179a654e610b71749e991acdc2a4c1cad8895f | 16,987 | py | Python | scripts/prior_optimization.py | matthias-mayr/hypermapper | 59f7ba05a53fed5e8175effa13d1620bae16b83a | [
"MIT"
] | null | null | null | scripts/prior_optimization.py | matthias-mayr/hypermapper | 59f7ba05a53fed5e8175effa13d1620bae16b83a | [
"MIT"
] | null | null | null | scripts/prior_optimization.py | matthias-mayr/hypermapper | 59f7ba05a53fed5e8175effa13d1620bae16b83a | [
"MIT"
] | null | null | null | ###############################################################################################################################
# This script implements our Prior-guided Bayesian Optimization method, presented in: https://arxiv.org/abs/1805.12168. #
################################################################... | 55.513072 | 202 | 0.673986 | ###############################################################################################################################
# This script implements our Prior-guided Bayesian Optimization method, presented in: https://arxiv.org/abs/1805.12168. #
################################################################... | 0 | 0 | 0 |
a1327d19dfe950643c36d15e972d39c3fbce0a4b | 1,972 | py | Python | mysite/ct/migrations/0035_auto_20190814_2358.py | cjlee112/socraticqs2 | 2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820 | [
"Apache-2.0"
] | 8 | 2015-06-02T15:34:44.000Z | 2019-03-21T12:27:30.000Z | mysite/ct/migrations/0035_auto_20190814_2358.py | cjlee112/socraticqs2 | 2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820 | [
"Apache-2.0"
] | 761 | 2015-01-07T05:13:08.000Z | 2022-02-10T10:23:37.000Z | mysite/ct/migrations/0035_auto_20190814_2358.py | cjlee112/socraticqs2 | 2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820 | [
"Apache-2.0"
] | 12 | 2015-01-28T20:09:36.000Z | 2018-03-20T13:32:11.000Z | # Generated by Django 2.1.11 on 2019-08-15 06:58
import ct.models
from django.db import migrations, models
| 31.301587 | 103 | 0.578093 | # Generated by Django 2.1.11 on 2019-08-15 06:58
import ct.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ct', '0034_auto_20190814_1544'),
]
operations = [
migrations.RenameField(
model_name='unit',
old_n... | 0 | 1,840 | 23 |
72d8d6fb866560fdb17195646e03076bb69b956d | 1,888 | py | Python | kivy/tests/test_widget_walk.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 13,889 | 2015-01-01T06:43:41.000Z | 2022-03-31T17:37:56.000Z | kivy/tests/test_widget_walk.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 4,570 | 2015-01-01T17:58:52.000Z | 2022-03-31T18:42:16.000Z | kivy/tests/test_widget_walk.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 3,786 | 2015-01-01T09:20:45.000Z | 2022-03-30T21:15:05.000Z | import unittest
| 26.591549 | 78 | 0.533898 | import unittest
class FileWidgetWalk(unittest.TestCase):
def test_walk_large_tree(self):
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
''' the tree
BoxLayout
BoxLayout
Label
10 labels
BoxLayout
... | 1,775 | 19 | 77 |
6f4e61011c93f82f14cc820b47f604c5ae38113b | 529 | py | Python | init/member.py | fakegit/idol | 2e0ffedd290dbf3485c0fca7fbede999a452d1cc | [
"MIT"
] | 19 | 2017-07-02T11:13:05.000Z | 2021-12-28T07:45:42.000Z | init/member.py | fakegit/idol | 2e0ffedd290dbf3485c0fca7fbede999a452d1cc | [
"MIT"
] | 1 | 2019-11-03T14:32:08.000Z | 2019-11-03T14:43:05.000Z | init/member.py | fakegit/idol | 2e0ffedd290dbf3485c0fca7fbede999a452d1cc | [
"MIT"
] | 5 | 2019-05-19T02:32:44.000Z | 2022-01-01T02:54:06.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 10 14:30:07 2018
@author: Nzix
"""
with open('member.txt', 'r', encoding = 'utf-8') as f: data = f.readlines()
sql = ''
for line in data:
line = line.replace('\n', '')
if not line: continue
if line.startswith('#'): continue
id, name, furigana, romaji =... | 26.45 | 122 | 0.553875 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 10 14:30:07 2018
@author: Nzix
"""
with open('member.txt', 'r', encoding = 'utf-8') as f: data = f.readlines()
sql = ''
for line in data:
line = line.replace('\n', '')
if not line: continue
if line.startswith('#'): continue
id, name, furigana, romaji =... | 0 | 0 | 0 |
5c5cd153d2f003db69c5298e8838b2ddcb3502c4 | 2,305 | py | Python | mbci_lab/ui/popUp.py | chanhakim/RTGraph | 71a0054a574d1e23cc31420cc6f3124d4f8c2cc1 | [
"MIT"
] | null | null | null | mbci_lab/ui/popUp.py | chanhakim/RTGraph | 71a0054a574d1e23cc31420cc6f3124d4f8c2cc1 | [
"MIT"
] | null | null | null | mbci_lab/ui/popUp.py | chanhakim/RTGraph | 71a0054a574d1e23cc31420cc6f3124d4f8c2cc1 | [
"MIT"
] | null | null | null | from PyQt5 import QtGui
from pathlib import Path
import datetime | 37.177419 | 233 | 0.577007 | from PyQt5 import QtGui
from pathlib import Path
import datetime
class PopUp:
@staticmethod
def question_yes_no(parent, title, message):
"""
Shows a Pop up question dialog with yes and no buttons.
:param parent: Parent window for the dialog.
:param title: Title of the dialog.
... | 0 | 2,218 | 23 |
e8cff5ffc5ec203f89e283f77f281839e3b01e35 | 1,234 | py | Python | test/test.py | zheng-zy/ot_root | 920236b48458aeed72968bc7ec8e01a084b15951 | [
"Artistic-2.0"
] | null | null | null | test/test.py | zheng-zy/ot_root | 920236b48458aeed72968bc7ec8e01a084b15951 | [
"Artistic-2.0"
] | null | null | null | test/test.py | zheng-zy/ot_root | 920236b48458aeed72968bc7ec8e01a084b15951 | [
"Artistic-2.0"
] | null | null | null | #!usr/bin/env python
# coding=utf-8
# Author: zhezhiyong@163.com
# Created: 2016-03-09 09:11:10
# Python version:2.7.10
"""
# TODO(purpose):
"""
import uuid
import time
# 操作 etf代码 成份股代码
print uuid.uuid1(01510300000001)
print uuid.uuid1(01510300000001)
print uuid.uuid1(01510300000001)
# 10 1000 5 1000 6 1000
# 9.5... | 22.035714 | 99 | 0.567261 | #!usr/bin/env python
# coding=utf-8
# Author: zhezhiyong@163.com
# Created: 2016-03-09 09:11:10
# Python version:2.7.10
"""
# TODO(purpose):
"""
import uuid
import time
# 操作 etf代码 成份股代码
print uuid.uuid1(01510300000001)
print uuid.uuid1(01510300000001)
print uuid.uuid1(01510300000001)
# 10 1000 5 1000 6 1000
# 9.5... | 375 | -5 | 130 |
fa8b463febd54e48e78fceb3653e19c1b7eb2460 | 6,317 | py | Python | plots/pdrp.py | whatisnuclear/outreach-material | d7fbf7f39dc82b31f562c5171a9853cf8c1c2f40 | [
"Apache-2.0"
] | 5 | 2021-10-16T21:15:35.000Z | 2021-10-18T02:18:27.000Z | plots/pdrp.py | whatisnuclear/outreach-material | d7fbf7f39dc82b31f562c5171a9853cf8c1c2f40 | [
"Apache-2.0"
] | 1 | 2017-12-27T15:41:54.000Z | 2017-12-27T15:41:54.000Z | plots/pdrp.py | whatisnuclear/outreach-material | d7fbf7f39dc82b31f562c5171a9853cf8c1c2f40 | [
"Apache-2.0"
] | 2 | 2017-12-04T15:56:16.000Z | 2021-10-18T01:14:33.000Z | """Plot capacity factors."""
import os
from operator import itemgetter
import textwrap
import datetime
import yaml
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.dates import date2num
import matplotlib.dates as mdates
import matplotlib.patches as mpatches
from matplotlib... | 39.48125 | 128 | 0.608517 | """Plot capacity factors."""
import os
from operator import itemgetter
import textwrap
import datetime
import yaml
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.dates import date2num
import matplotlib.dates as mdates
import matplotlib.patches as mpatches
from matplotlib... | 5,575 | 0 | 46 |
110ce7e39ee0bcd151595319421bbbec19c7738c | 5,971 | py | Python | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/website/models/ir_ui_view.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/website/models/ir_ui_view.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/website/models/ir_ui_view.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: ascii -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from itertools import groupby
from lxml import etree
from odoo import api, fields, models
from odoo import tools
from odoo.addons.website.models import website
from odoo.http import request
_logger = lo... | 40.073826 | 135 | 0.620834 | # -*- coding: ascii -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from itertools import groupby
from lxml import etree
from odoo import api, fields, models
from odoo import tools
from odoo.addons.website.models import website
from odoo.http import request
_logger = lo... | 1,398 | 4,203 | 23 |
0de0022864924ca6f24d5a7e886939a49195e1b5 | 454 | py | Python | atcoder/virtual3/b.py | sugitanishi/competitive-programming | 51af65fdce514ece12f8afbf142b809d63eefb5d | [
"MIT"
] | null | null | null | atcoder/virtual3/b.py | sugitanishi/competitive-programming | 51af65fdce514ece12f8afbf142b809d63eefb5d | [
"MIT"
] | null | null | null | atcoder/virtual3/b.py | sugitanishi/competitive-programming | 51af65fdce514ece12f8afbf142b809d63eefb5d | [
"MIT"
] | null | null | null | #☆𝒐𝒎𝒂𝒋𝒊𝒏𝒂𝒊☆#
import sys
import math
from math import ceil, floor
import itertools
from functools import lru_cache
from collections import deque
inf=10**20
sys.setrecursionlimit(10000000)
input=lambda : sys.stdin.readline().rstrip()
'''''✂'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
a,b,c=map(int,i... | 19.73913 | 63 | 0.601322 | #☆𝒐𝒎𝒂𝒋𝒊𝒏𝒂𝒊☆#
import sys
import math
from math import ceil, floor
import itertools
from functools import lru_cache
from collections import deque
inf=10**20
sys.setrecursionlimit(10000000)
input=lambda : sys.stdin.readline().rstrip()
'''''✂'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
a,b,c=map(int,i... | 0 | 0 | 0 |
2018ec5876e704606365c49965d342c5e5dd0ab5 | 1,648 | py | Python | Week_2/7.8-7.14_NER/NER_model.py | EricZhu-42/NJU_NLP_SummerCamp_2019 | 56571e96030162d844cf9e769b7a5a41d3e0a7bc | [
"MIT"
] | 1 | 2020-08-29T07:41:26.000Z | 2020-08-29T07:41:26.000Z | Week_2/7.8-7.14_NER/NER_model.py | EricZhu-42/NJU_NLP_SummerCamp_2019 | 56571e96030162d844cf9e769b7a5a41d3e0a7bc | [
"MIT"
] | null | null | null | Week_2/7.8-7.14_NER/NER_model.py | EricZhu-42/NJU_NLP_SummerCamp_2019 | 56571e96030162d844cf9e769b7a5a41d3e0a7bc | [
"MIT"
] | null | null | null | import pickle
import numpy as np
from keras.preprocessing.sequence import pad_sequences
from keras import Sequential
from keras_contrib.layers import CRF
from keras.layers import Embedding ,Bidirectional,LSTM
from keras.models import load_model
BATCH_SIZE = 32
MODEL_PATH = "./model/crf.h5"
# 训练后保存模型 | 36.622222 | 99 | 0.678398 | import pickle
import numpy as np
from keras.preprocessing.sequence import pad_sequences
from keras import Sequential
from keras_contrib.layers import CRF
from keras.layers import Embedding ,Bidirectional,LSTM
from keras.models import load_model
BATCH_SIZE = 32
MODEL_PATH = "./model/crf.h5"
class Ner:
def __init__... | 1,224 | -11 | 129 |
2d02b736665a0c38b08f9b37e0a5c8c4808e6171 | 2,676 | py | Python | seizmeia/health.py | seizmeia/seizmeia | 8bdb5f9be832c56237e5684110ce30d1c322fc70 | [
"MIT"
] | null | null | null | seizmeia/health.py | seizmeia/seizmeia | 8bdb5f9be832c56237e5684110ce30d1c322fc70 | [
"MIT"
] | 12 | 2022-02-14T00:03:28.000Z | 2022-03-29T18:08:35.000Z | seizmeia/health.py | seizmeia/seizmeia | 8bdb5f9be832c56237e5684110ce30d1c322fc70 | [
"MIT"
] | 1 | 2022-02-27T17:57:56.000Z | 2022-02-27T17:57:56.000Z | from __future__ import annotations
import asyncio
from typing import Protocol
from fastapi import APIRouter, status
from fastapi.responses import JSONResponse, Response
class Healther(Protocol):
"""Any object implementing ^ can be checked for health status"""
class HealthCheckService(Protocol):
"""
De... | 26.235294 | 79 | 0.641256 | from __future__ import annotations
import asyncio
from typing import Protocol
from fastapi import APIRouter, status
from fastapi.responses import JSONResponse, Response
class Healther(Protocol):
"""Any object implementing ^ can be checked for health status"""
async def ready(self) -> str | None:
..... | 924 | 0 | 189 |
7bb4e261db641319a2a64522deee911cbf21571d | 17,373 | py | Python | data_cleaning/2016/clarity_live.py | NewsappAJC/precinct-election-map | 8237244043cb48dcc8704a43e009711add0c6382 | [
"MIT"
] | 5 | 2017-01-21T00:18:35.000Z | 2018-01-17T23:27:16.000Z | data_cleaning/2016/clarity_live.py | NewsappAJC/precinct-election-map | 8237244043cb48dcc8704a43e009711add0c6382 | [
"MIT"
] | null | null | null | data_cleaning/2016/clarity_live.py | NewsappAJC/precinct-election-map | 8237244043cb48dcc8704a43e009711add0c6382 | [
"MIT"
] | null | null | null | # Standard lib imports
from sys import argv
import os
from time import sleep
import re
import pdb
import logging
import datetime
import csv
import json
from collections import defaultdict
# Third-party imports
import pandas as pd
import requests
from selenium import webdriver
from selenium.webdriver.support.ui import ... | 38.952915 | 121 | 0.604098 | # Standard lib imports
from sys import argv
import os
from time import sleep
import re
import pdb
import logging
import datetime
import csv
import json
from collections import defaultdict
# Third-party imports
import pandas as pd
import requests
from selenium import webdriver
from selenium.webdriver.support.ui import ... | 970 | 0 | 162 |
85d7a307b2411b648cb95431aa5b330c0fd659a0 | 15,035 | py | Python | tests/test_views.py | gundotio/worf | 45268e3d04ba5a2549d3a4f511d876622c9e0cad | [
"MIT"
] | null | null | null | tests/test_views.py | gundotio/worf | 45268e3d04ba5a2549d3a4f511d876622c9e0cad | [
"MIT"
] | 33 | 2021-03-05T05:20:30.000Z | 2022-03-16T02:01:45.000Z | tests/test_views.py | gundotio/worf | 45268e3d04ba5a2549d3a4f511d876622c9e0cad | [
"MIT"
] | null | null | null | from datetime import timedelta
from unittest.mock import patch
from django.core.files.uploadedfile import SimpleUploadedFile
@patch('django.core.files.storage.FileSystemStorage.save')
@patch('django.core.files.storage.FileSystemStorage.save')
@patch('django.core.files.storage.FileSystemStorage.sav... | 39.565789 | 106 | 0.69418 | from datetime import timedelta
from unittest.mock import patch
from django.core.files.uploadedfile import SimpleUploadedFile
def test_profile_detail(client, db, profile, user):
response = client.get(f"/profiles/{profile.pk}/")
result = response.json()
assert response.status_code == 200, result
assert... | 13,772 | 0 | 917 |
b9d6057d2f32bba9641dd05cfd2cdaf046f67fcf | 6,736 | py | Python | code/preprocessing/p_e_m.py | kevinalexmathews/end2end_neural_el | e5fc0e7f884f9bcd9d7aaa9bd5724705cd5e3ca4 | [
"Apache-2.0"
] | 221 | 2018-09-11T07:51:09.000Z | 2022-03-30T01:37:07.000Z | code/preprocessing/p_e_m.py | kevinalexmathews/end2end_neural_el | e5fc0e7f884f9bcd9d7aaa9bd5724705cd5e3ca4 | [
"Apache-2.0"
] | 28 | 2018-09-18T16:42:21.000Z | 2022-02-22T09:48:35.000Z | code/preprocessing/p_e_m.py | kevinalexmathews/end2end_neural_el | e5fc0e7f884f9bcd9d7aaa9bd5724705cd5e3ca4 | [
"Apache-2.0"
] | 73 | 2018-09-12T10:02:23.000Z | 2022-02-24T21:27:57.000Z | import pickle
from collections import defaultdict
from nltk.tokenize import word_tokenize
import time
import sys
import os
import operator
import preprocessing.config as config
import preprocessing.util as util
# TODO delete this one, no longer usefull since there is another one that also handles the conflicts
def t... | 42.904459 | 100 | 0.582096 | import pickle
from collections import defaultdict
from nltk.tokenize import word_tokenize
import time
import sys
import os
import operator
import preprocessing.config as config
import preprocessing.util as util
# TODO delete this one, no longer usefull since there is another one that also handles the conflicts
def t... | 1,883 | 0 | 46 |
0ad7d27ad8f383f2b746a9d6365723541b71aef1 | 6,753 | py | Python | parsl/executors/ipp_controller.py | khurtado/parsl | 6ea461ccd7be83b51bf5384bf50b522e56fc46f1 | [
"Apache-2.0"
] | null | null | null | parsl/executors/ipp_controller.py | khurtado/parsl | 6ea461ccd7be83b51bf5384bf50b522e56fc46f1 | [
"Apache-2.0"
] | null | null | null | parsl/executors/ipp_controller.py | khurtado/parsl | 6ea461ccd7be83b51bf5384bf50b522e56fc46f1 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import random
import signal
import subprocess
import time
from parsl.executors.errors import *
from parsl.utils import RepresentationMixin
logger = logging.getLogger(__name__)
class Controller(RepresentationMixin):
"""Start and maintain a IPythonParallel controller.
Parameters
... | 40.437126 | 123 | 0.590552 | import logging
import os
import random
import signal
import subprocess
import time
from parsl.executors.errors import *
from parsl.utils import RepresentationMixin
logger = logging.getLogger(__name__)
class Controller(RepresentationMixin):
"""Start and maintain a IPythonParallel controller.
Parameters
... | 850 | 0 | 26 |
576e9899bbf1c5f044901aecaba091c579a85a66 | 272 | py | Python | lexirumah/assets.py | lessersunda/lexibank | a5fe1d925e9b1005cf1c97cc2111a9053f321973 | [
"Apache-2.0"
] | 1 | 2019-05-17T08:01:23.000Z | 2019-05-17T08:01:23.000Z | lexirumah/assets.py | lessersunda/lexibank | a5fe1d925e9b1005cf1c97cc2111a9053f321973 | [
"Apache-2.0"
] | 32 | 2018-01-11T14:23:39.000Z | 2022-01-27T16:22:30.000Z | lexirumah/assets.py | lessersunda/lexirumah | a5fe1d925e9b1005cf1c97cc2111a9053f321973 | [
"Apache-2.0"
] | null | null | null | from clld.web.assets import environment
from clldutils.path import Path
import lexirumah
environment.append_path(
Path(lexirumah.__file__).parent.joinpath('static').as_posix(), url='/lexirumah:static/')
environment.load_path = list(reversed(environment.load_path))
| 27.2 | 92 | 0.797794 | from clld.web.assets import environment
from clldutils.path import Path
import lexirumah
environment.append_path(
Path(lexirumah.__file__).parent.joinpath('static').as_posix(), url='/lexirumah:static/')
environment.load_path = list(reversed(environment.load_path))
| 0 | 0 | 0 |
db50631d59eea954f674d0eedb2cb2dbbdc73bd3 | 13,111 | py | Python | sktime/classification/dictionary_based/_muse.py | FilipBronic/sktime | d613d704cdc7263ad28fb4519d2d301f2ebd0779 | [
"BSD-3-Clause"
] | null | null | null | sktime/classification/dictionary_based/_muse.py | FilipBronic/sktime | d613d704cdc7263ad28fb4519d2d301f2ebd0779 | [
"BSD-3-Clause"
] | 2 | 2021-04-19T17:38:33.000Z | 2021-07-25T18:44:10.000Z | sktime/classification/dictionary_based/_muse.py | FilipBronic/sktime | d613d704cdc7263ad28fb4519d2d301f2ebd0779 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""WEASEL+MUSE classifier.
multivariate dictionary based classifier based on SFA transform, dictionaries
and logistic regression.
"""
__author__ = ["patrickzib", "BINAYKUMAR943"]
__all__ = ["MUSE"]
import math
import warnings
import numpy as np
from numba import njit
from sklearn.feature_ext... | 35.627717 | 88 | 0.58981 | # -*- coding: utf-8 -*-
"""WEASEL+MUSE classifier.
multivariate dictionary based classifier based on SFA transform, dictionaries
and logistic regression.
"""
__author__ = ["patrickzib", "BINAYKUMAR943"]
__all__ = ["MUSE"]
import math
import warnings
import numpy as np
from numba import njit
from sklearn.feature_ext... | 2,881 | 0 | 134 |
3843368e971e8bc60258ee094193bd6ed9309f87 | 7,986 | py | Python | src/python/views/demo_01_fancy/__init__.py | graphistry/streamlit-graphkit | 4122b36fac23879d52dec4f691ab94b71245e054 | [
"BSD-3-Clause"
] | null | null | null | src/python/views/demo_01_fancy/__init__.py | graphistry/streamlit-graphkit | 4122b36fac23879d52dec4f691ab94b71245e054 | [
"BSD-3-Clause"
] | null | null | null | src/python/views/demo_01_fancy/__init__.py | graphistry/streamlit-graphkit | 4122b36fac23879d52dec4f691ab94b71245e054 | [
"BSD-3-Clause"
] | null | null | null | import graphistry, os, pandas as pd, streamlit as st
from components import GraphistrySt, URLParam
from graphistry import PyGraphistry
from css import all_css
from time import sleep
from util import getChild
############################################
#
# DASHBOARD SETTINGS
#
#######################################... | 31.690476 | 116 | 0.573003 | import graphistry, os, pandas as pd, streamlit as st
from components import GraphistrySt, URLParam
from graphistry import PyGraphistry
from css import all_css
from time import sleep
from util import getChild
############################################
#
# DASHBOARD SETTINGS
#
#######################################... | 6,302 | 0 | 182 |
30846cabd5dcb36987c9366eb4e4e4a199ed4f23 | 6,342 | py | Python | recipe_system/cal_service/__init__.py | DBerke/DRAGONS | cecf9a03970af95126bd17a227bd5214a5d6c64b | [
"BSD-3-Clause"
] | 19 | 2017-10-23T14:52:51.000Z | 2022-03-28T04:49:00.000Z | recipe_system/cal_service/__init__.py | DBerke/DRAGONS | cecf9a03970af95126bd17a227bd5214a5d6c64b | [
"BSD-3-Clause"
] | 194 | 2017-11-01T17:32:45.000Z | 2022-03-31T21:32:59.000Z | recipe_system/cal_service/__init__.py | DBerke/DRAGONS | cecf9a03970af95126bd17a227bd5214a5d6c64b | [
"BSD-3-Clause"
] | 16 | 2017-11-01T05:18:04.000Z | 2021-12-14T23:08:57.000Z | #
# DRAGONS
#
# cal_service
# ------------------------------------------------------------------------------
from os import path
import warnings
from importlib import import_module
... | 33.03125 | 80 | 0.574109 | #
# DRAGONS
#
# cal_service
# ------------------------------------------------------------------------------
from os import path
import warnings
from importlib import import_module
... | 232 | 0 | 23 |
403abd62f485778bb2109fd5776fc5011fbb8411 | 1,675 | py | Python | tests/basics/builtin_property.py | peterson79/pycom-micropython-sigfox | 3f93fc2c02567c96f18cff4af9125db8fd7a6fb4 | [
"MIT"
] | 37 | 2017-12-07T15:49:29.000Z | 2022-03-16T16:01:38.000Z | tests/basics/builtin_property.py | peterson79/pycom-micropython-sigfox | 3f93fc2c02567c96f18cff4af9125db8fd7a6fb4 | [
"MIT"
] | 27 | 2015-01-02T16:17:37.000Z | 2015-09-07T19:21:26.000Z | tests/basics/builtin_property.py | peterson79/pycom-micropython-sigfox | 3f93fc2c02567c96f18cff4af9125db8fd7a6fb4 | [
"MIT"
] | 22 | 2016-08-01T01:35:30.000Z | 2022-03-22T18:12:23.000Z | # test builtin property
# create a property object explicitly
property()
property(1, 2, 3)
# use its accessor methods
p = property()
p.getter(1)
p.setter(2)
p.deleter(3)
# basic use as a decorator
a = A(1)
print(a.x)
try:
a.x = 2
except AttributeError:
print("AttributeError")
# explicit use within a class... | 16.262136 | 73 | 0.59403 | # test builtin property
# create a property object explicitly
property()
property(1, 2, 3)
# use its accessor methods
p = property()
p.getter(1)
p.setter(2)
p.deleter(3)
# basic use as a decorator
class A:
def __init__(self, x):
self._x = x
@property
def x(self):
print("x get")
r... | 301 | 511 | 110 |
53666bb3429802efc730fbf035ba1d2908726f6b | 1,525 | py | Python | prescience_client/bean/model_metric/base.py | ovh/prescience-client | a447d19f11c6739c4a4828b6072e80b39dc4cf13 | [
"BSD-3-Clause"
] | 15 | 2019-01-16T14:16:00.000Z | 2021-12-08T09:09:24.000Z | prescience_client/bean/model_metric/base.py | ovh/prescience-client | a447d19f11c6739c4a4828b6072e80b39dc4cf13 | [
"BSD-3-Clause"
] | 4 | 2019-03-28T15:12:46.000Z | 2019-11-20T10:47:37.000Z | prescience_client/bean/model_metric/base.py | ovh/prescience-client | a447d19f11c6739c4a4828b6072e80b39dc4cf13 | [
"BSD-3-Clause"
] | 1 | 2019-01-25T07:22:12.000Z | 2019-01-25T07:22:12.000Z | # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Copyright 2019 The Prescience-Client Authors. All rights reserved.
import copy
from abc import ABC, abstractmethod
from prescience_client.utils.table_printable import TablePrintable, DictPrintable
from prescience_c... | 31.122449 | 104 | 0.702295 | # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Copyright 2019 The Prescience-Client Authors. All rights reserved.
import copy
from abc import ABC, abstractmethod
from prescience_client.utils.table_printable import TablePrintable, DictPrintable
from prescience_c... | 435 | 0 | 160 |
601b6896b9e2ecf5a68936a6996c6c9d69d835fe | 2,405 | py | Python | zcommon/classes.py | LamaAni/zcommon.py | 4d2df1d431638edc439fff09981a0458c3a8dea8 | [
"MIT"
] | null | null | null | zcommon/classes.py | LamaAni/zcommon.py | 4d2df1d431638edc439fff09981a0458c3a8dea8 | [
"MIT"
] | null | null | null | zcommon/classes.py | LamaAni/zcommon.py | 4d2df1d431638edc439fff09981a0458c3a8dea8 | [
"MIT"
] | null | null | null | # FROM: https://gist.github.com/Skinner927/413c0e9cc8433123f426832f9fe8d931
class classproperty(object):
"""
Similar to @property but used on classes instead of instances.
The only caveat being that your class must use the
classproperty.meta metaclass.
Class properties will still work on class in... | 33.873239 | 111 | 0.648233 | # FROM: https://gist.github.com/Skinner927/413c0e9cc8433123f426832f9fe8d931
class ClassPropertyMeta(type):
def __setattr__(self, key, value):
obj = self.__dict__.get(key, None)
if type(obj) is classproperty:
return obj.__set__(self, value)
return super().__setattr__(key, value)... | 1,215 | 9 | 183 |
2d83d88a8f5ff7d00967da812e9d45fd321c7a33 | 199 | py | Python | generated-libraries/python/netapp/nfs/hostaddr.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | 2 | 2017-03-28T15:31:26.000Z | 2018-08-16T22:15:18.000Z | generated-libraries/python/netapp/nfs/hostaddr.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | generated-libraries/python/netapp/nfs/hostaddr.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | class Hostaddr(basestring):
"""
the individual client hosts. could be a hostname or an IP
address.
"""
@staticmethod
| 18.090909 | 61 | 0.58794 | class Hostaddr(basestring):
"""
the individual client hosts. could be a hostname or an IP
address.
"""
@staticmethod
def get_api_name():
return "hostaddr"
| 26 | 0 | 26 |
85ec61b3316086cf065d79bb886447aaa0b0f109 | 258 | py | Python | range.py | jiayoustone/high_performance_python | 63abb5e02bdbf086229b682b1768ed3afc63d8bb | [
"RSA-MD"
] | null | null | null | range.py | jiayoustone/high_performance_python | 63abb5e02bdbf086229b682b1768ed3afc63d8bb | [
"RSA-MD"
] | null | null | null | range.py | jiayoustone/high_performance_python | 63abb5e02bdbf086229b682b1768ed3afc63d8bb | [
"RSA-MD"
] | null | null | null | @profile
@profile
if __name__ == "__main__":
call()
| 16.125 | 31 | 0.577519 | @profile
def range(start, stop, step=1):
numbers = []
while start < stop:
numbers.append(start)
start += step
return numbers
@profile
def call():
for i in range(1,1000000):
pass
if __name__ == "__main__":
call()
| 156 | 0 | 44 |
092afed4e5d9ecf2f3e8f3c071a55560443a932d | 442 | py | Python | start.py | jonathanwelton/Teams-Presence | d8192cde33079f4bf199455e2db58c7f7e2bb13e | [
"MIT"
] | 5 | 2021-01-31T11:50:32.000Z | 2022-01-07T15:34:27.000Z | start.py | jonathanwelton/Teams-Presence | d8192cde33079f4bf199455e2db58c7f7e2bb13e | [
"MIT"
] | null | null | null | start.py | jonathanwelton/Teams-Presence | d8192cde33079f4bf199455e2db58c7f7e2bb13e | [
"MIT"
] | 1 | 2022-02-01T01:52:05.000Z | 2022-02-01T01:52:05.000Z | print("Please select which presence indicator to wish to use...")
print("Press 1 to run the Teams Presence Indicator")
print("Press 2 to run the Zoom Presence Indicator")
choice = input("Indicator: ")
if choice == '1':
print("Starting the Teams Presence Indicator...")
import teamsPresence
teamsPresence.run... | 29.466667 | 65 | 0.705882 | print("Please select which presence indicator to wish to use...")
print("Press 1 to run the Teams Presence Indicator")
print("Press 2 to run the Zoom Presence Indicator")
choice = input("Indicator: ")
if choice == '1':
print("Starting the Teams Presence Indicator...")
import teamsPresence
teamsPresence.run... | 0 | 0 | 0 |
41d294ae7cae8813561e29ee9e8e19f04973da6c | 259 | py | Python | pair/__init__.py | tumluliu/air-analyzer | a9b81f05fb2e69ac6af10c8400bc2a6b800be889 | [
"MIT"
] | null | null | null | pair/__init__.py | tumluliu/air-analyzer | a9b81f05fb2e69ac6af10c8400bc2a6b800be889 | [
"MIT"
] | null | null | null | pair/__init__.py | tumluliu/air-analyzer | a9b81f05fb2e69ac6af10c8400bc2a6b800be889 | [
"MIT"
] | null | null | null | """ module init """
__title__ = 'pair'
__version__ = '0.1.0'
__author__ = 'LIU Lu'
__contact__ = 'nudtlliu@gmail.com'
__license__ = 'MIT'
__all__ = [
'base', 'servicefactory', 'mapbox', 'ors', 'google'
]
from .servicefactory import RoutingServiceFactory
| 21.583333 | 55 | 0.687259 | """ module init """
__title__ = 'pair'
__version__ = '0.1.0'
__author__ = 'LIU Lu'
__contact__ = 'nudtlliu@gmail.com'
__license__ = 'MIT'
__all__ = [
'base', 'servicefactory', 'mapbox', 'ors', 'google'
]
from .servicefactory import RoutingServiceFactory
| 0 | 0 | 0 |
05b3dc9f6589f8881e702f5382fa7ead22528d9c | 2,231 | py | Python | dataprocessing/read_rdf.py | KBNLresearch/Demosaurus | 9235e315d9eef9d8d64f94a90ab4fc8220670ef2 | [
"Apache-2.0"
] | 1 | 2020-06-25T16:39:35.000Z | 2020-06-25T16:39:35.000Z | dataprocessing/read_rdf.py | KBNLresearch/Demosaurus | 9235e315d9eef9d8d64f94a90ab4fc8220670ef2 | [
"Apache-2.0"
] | 6 | 2020-03-06T12:31:38.000Z | 2021-09-20T15:08:17.000Z | dataprocessing/read_rdf.py | KBNLresearch/Demosaurus | 9235e315d9eef9d8d64f94a90ab4fc8220670ef2 | [
"Apache-2.0"
] | null | null | null | import rdflib
import os
import pandas as pd
import csv_db
from demosauruswebapp.demosaurus.link_thesaurus import normalize_name
| 41.314815 | 123 | 0.621694 | import rdflib
import os
import pandas as pd
import csv_db
from demosauruswebapp.demosaurus.link_thesaurus import normalize_name
def obtain_primary_name(graph):
name_query = """select ?uri ?label ?familyname ?name where {
?uri schema:mainEntityOfPage/schema:isPartOf <http://data.bibliotheken.nl/id/... | 2,031 | 0 | 69 |
f84bce7307f7f6c776e3a902fc6513a873a7d89e | 2,462 | py | Python | cgtools/array_utils.py | tneumann/cgtools | 8f77b6a4642fe79ac85b8449ebd3f72ea0e56032 | [
"MIT"
] | 10 | 2019-05-02T14:08:32.000Z | 2021-03-15T16:07:19.000Z | cgtools/array_utils.py | tneumann/cgtools | 8f77b6a4642fe79ac85b8449ebd3f72ea0e56032 | [
"MIT"
] | null | null | null | cgtools/array_utils.py | tneumann/cgtools | 8f77b6a4642fe79ac85b8449ebd3f72ea0e56032 | [
"MIT"
] | 3 | 2019-05-02T14:08:33.000Z | 2021-02-10T03:47:29.000Z | import numpy as np
def concatenate_fill(arrays, axis=0, fill_value=None):
"""
Appends to all the arrays so that they can be concatenated along the given axis (kwargs axis=0 by default).
The fill_value will be automatically determined from the dtype of arrays. For floating point types of arrays
it will ... | 38.46875 | 147 | 0.610073 | import numpy as np
def concatenate_fill(arrays, axis=0, fill_value=None):
"""
Appends to all the arrays so that they can be concatenated along the given axis (kwargs axis=0 by default).
The fill_value will be automatically determined from the dtype of arrays. For floating point types of arrays
it will ... | 0 | 0 | 0 |
f7abc4036e6849052f1ad734c829603c8746cd22 | 237 | py | Python | data/ck/check_data.py | jorgimello/meta-learning-fer | 793610ae8471f794a6837930d8bb51866c1f7c02 | [
"MIT"
] | 4 | 2020-10-10T03:33:15.000Z | 2022-01-17T08:00:32.000Z | data/ck/check_data.py | jorgimello/meta-learning-facial-expression-recognition | 793610ae8471f794a6837930d8bb51866c1f7c02 | [
"MIT"
] | null | null | null | data/ck/check_data.py | jorgimello/meta-learning-facial-expression-recognition | 793610ae8471f794a6837930d8bb51866c1f7c02 | [
"MIT"
] | null | null | null | import numpy as np
import os, cv2
imgs = np.load('test_set_ck_extended_no_resize.npy')
lbls = np.load('test_labels_ck_extended_no_resize.npy')
for i in range(imgs.shape[0]):
print (lbls[i])
cv2.imshow('img', imgs[i])
cv2.waitKey(0)
| 21.545455 | 55 | 0.734177 | import numpy as np
import os, cv2
imgs = np.load('test_set_ck_extended_no_resize.npy')
lbls = np.load('test_labels_ck_extended_no_resize.npy')
for i in range(imgs.shape[0]):
print (lbls[i])
cv2.imshow('img', imgs[i])
cv2.waitKey(0)
| 0 | 0 | 0 |
8bf24394c07c598dee798fcca291ed904ac4af54 | 359 | py | Python | hacker/arrays-left-rotation.py | jdc91/competitive-programming | c09c446681e707914438d6af8307ee9877396ceb | [
"MIT"
] | null | null | null | hacker/arrays-left-rotation.py | jdc91/competitive-programming | c09c446681e707914438d6af8307ee9877396ceb | [
"MIT"
] | null | null | null | hacker/arrays-left-rotation.py | jdc91/competitive-programming | c09c446681e707914438d6af8307ee9877396ceb | [
"MIT"
] | null | null | null |
n, k = map(int, raw_input().strip().split(' '))
a = map(int, raw_input().strip().split(' '))
array_left_rotation(a, n, k);
answer = array_left_rotation(a, n, k);
print ' '.join(map(str, answer))
| 23.933333 | 47 | 0.610028 | def array_left_rotation(a, n, k):
rotations = k % n
container = [0]*n
for i in range(n):
container[i-rotations] = a[i]
return container
n, k = map(int, raw_input().strip().split(' '))
a = map(int, raw_input().strip().split(' '))
array_left_rotation(a, n, k);
answer = array_left_rotation(a, n,... | 139 | 0 | 22 |
492d04b42c9c247a16f5dde5b663aa28b483f540 | 326 | py | Python | socialite/preprocess/verify_all_out.py | Wangqge/PowerLog_ae | 8546afbcb9a77d516e8c3f0dfbaf2041a4b888f9 | [
"Apache-2.0"
] | null | null | null | socialite/preprocess/verify_all_out.py | Wangqge/PowerLog_ae | 8546afbcb9a77d516e8c3f0dfbaf2041a4b888f9 | [
"Apache-2.0"
] | null | null | null | socialite/preprocess/verify_all_out.py | Wangqge/PowerLog_ae | 8546afbcb9a77d516e8c3f0dfbaf2041a4b888f9 | [
"Apache-2.0"
] | null | null | null | import sys
if len(sys.argv) != 2:
print 'usage: [input edge pair path]'
exit(1)
node_set = set()
with open(sys.argv[1], 'r') as fi:
for line in fi:
line = line.strip('\n').strip('\r')
tmp = line.split('\t')
src = int(tmp[0])
node_set.add(src)
print 'node size: %d' % len(node... | 23.285714 | 43 | 0.54908 | import sys
if len(sys.argv) != 2:
print 'usage: [input edge pair path]'
exit(1)
node_set = set()
with open(sys.argv[1], 'r') as fi:
for line in fi:
line = line.strip('\n').strip('\r')
tmp = line.split('\t')
src = int(tmp[0])
node_set.add(src)
print 'node size: %d' % len(node... | 0 | 0 | 0 |
40c32c97fffb2b758dc89882f8844f0e98182d7e | 8,950 | py | Python | integration-testing/casperlabs_local_net/docker_base.py | RitaatCasperLabs/CasperLabs | a81ce10078664d7ef68f4c55157b9afc5be45f3a | [
"Apache-2.0"
] | 1 | 2020-01-15T08:33:56.000Z | 2020-01-15T08:33:56.000Z | integration-testing/casperlabs_local_net/docker_base.py | mpapierski/CasperLabs | 1f8741f8ef28447f87f3844784b3c4291041df3b | [
"Apache-2.0"
] | 15 | 2019-05-03T17:41:49.000Z | 2020-03-17T16:54:45.000Z | integration-testing/casperlabs_local_net/docker_base.py | arcolife/CasperLabs | 91f839ff262dd7eae4d862a0501a05f1ab7c59f8 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import os
import threading
from multiprocessing import Process, Queue
from queue import Empty
from typing import Tuple, Union
from docker import DockerClient
from docker.models.containers import Container
from casperlabs_local_net.errors import CommandTimeoutError, NonZeroExitCodeError
from ... | 34.824903 | 443 | 0.652961 | import json
import logging
import os
import threading
from multiprocessing import Process, Queue
from queue import Empty
from typing import Tuple, Union
from docker import DockerClient
from docker.models.containers import Container
from casperlabs_local_net.errors import CommandTimeoutError, NonZeroExitCodeError
from ... | 6,093 | 17 | 926 |
13a93bffb50761b615a57531dd4e8f2370955a86 | 9,167 | py | Python | server/metrics/generate_docs.py | boost-entropy-golang/buildbuddy | 08f649f792b1bd5854fd0bb5eb1a12642330d678 | [
"MIT"
] | 315 | 2020-03-04T20:59:09.000Z | 2022-03-31T01:59:04.000Z | server/metrics/generate_docs.py | boost-entropy-golang/buildbuddy | 08f649f792b1bd5854fd0bb5eb1a12642330d678 | [
"MIT"
] | 338 | 2020-03-05T08:29:51.000Z | 2022-03-30T01:06:08.000Z | server/metrics/generate_docs.py | boost-entropy-golang/buildbuddy | 08f649f792b1bd5854fd0bb5eb1a12642330d678 | [
"MIT"
] | 50 | 2020-03-05T06:35:31.000Z | 2022-03-26T15:22:10.000Z | #!/usr/bin/env python3
import os
import re
import shlex
import subprocess
import sys
GENERATED_FILE_NAME = "prometheus-metrics.md"
FILE_HEADER = """<!--
{
"name": "Prometheus Metrics",
"category": "5fcfd1ede5ded705a0bf5fd0",
"priority": 1000
}
-->
<!--
============================
GENERATED FILE - DO NOT EDI... | 31.940767 | 119 | 0.498091 | #!/usr/bin/env python3
import os
import re
import shlex
import subprocess
import sys
GENERATED_FILE_NAME = "prometheus-metrics.md"
FILE_HEADER = """<!--
{
"name": "Prometheus Metrics",
"category": "5fcfd1ede5ded705a0bf5fd0",
"priority": 1000
}
-->
<!--
============================
GENERATED FILE - DO NOT EDI... | 8,065 | 7 | 253 |
f2ef46880085acd4b1a17813b497ed6b82cfe449 | 265 | py | Python | example/django/myapp/urls.py | Ax1an/uptrace | 40725435ac3cab751117413d5a9fd3dede6a2e3c | [
"Apache-2.0"
] | 627 | 2021-12-25T10:20:39.000Z | 2022-03-30T16:09:36.000Z | example/django/myapp/urls.py | Ax1an/uptrace | 40725435ac3cab751117413d5a9fd3dede6a2e3c | [
"Apache-2.0"
] | 13 | 2021-12-29T09:50:39.000Z | 2022-03-31T09:50:56.000Z | example/django/myapp/urls.py | Ax1an/uptrace | 40725435ac3cab751117413d5a9fd3dede6a2e3c | [
"Apache-2.0"
] | 35 | 2021-12-27T11:07:53.000Z | 2022-03-19T07:00:39.000Z | from django.urls import path
from . import views
urlpatterns = [
path("", views.IndexView.as_view(), name="index"),
path("hello/<str:username>", views.HelloView.as_view(), name="hello"),
path("failing", views.FailingView.as_view(), name="failing"),
]
| 26.5 | 74 | 0.675472 | from django.urls import path
from . import views
urlpatterns = [
path("", views.IndexView.as_view(), name="index"),
path("hello/<str:username>", views.HelloView.as_view(), name="hello"),
path("failing", views.FailingView.as_view(), name="failing"),
]
| 0 | 0 | 0 |
1dc7d92b9906065a8ceb605e13977e49113ed25e | 3,158 | py | Python | src/data_interface/model.py | ericdaat/notflix | 0d8697e13f28d658d6777b7c854e4fd0b207ca11 | [
"MIT"
] | null | null | null | src/data_interface/model.py | ericdaat/notflix | 0d8697e13f28d658d6777b7c854e4fd0b207ca11 | [
"MIT"
] | 1 | 2022-01-20T16:48:50.000Z | 2022-01-20T16:48:50.000Z | src/data_interface/model.py | ericdaat/notflix | 0d8697e13f28d658d6777b7c854e4fd0b207ca11 | [
"MIT"
] | null | null | null | import os
import logging
from sqlalchemy_utils import database_exists, create_database
from datetime import datetime
from sqlalchemy.dialects import postgresql
from flask_sqlalchemy import SQLAlchemy
from config import SQLALCHEMY_DATABASE_URI
db = SQLAlchemy()
| 29.792453 | 78 | 0.700127 | import os
import logging
from sqlalchemy_utils import database_exists, create_database
from datetime import datetime
from sqlalchemy.dialects import postgresql
from flask_sqlalchemy import SQLAlchemy
from config import SQLALCHEMY_DATABASE_URI
db = SQLAlchemy()
def init():
if not database_exists(SQLALCHEMY_DATAB... | 561 | 2,094 | 230 |
a9a9c487315ca7fd2bd769a72cb0090237b1e49b | 1,159 | py | Python | face_and_eye_detection.py | aquib-sh/opencv | 0793cfc9ce1b7acd58f983108978b358a911b1e6 | [
"CC0-1.0"
] | null | null | null | face_and_eye_detection.py | aquib-sh/opencv | 0793cfc9ce1b7acd58f983108978b358a911b1e6 | [
"CC0-1.0"
] | null | null | null | face_and_eye_detection.py | aquib-sh/opencv | 0793cfc9ce1b7acd58f983108978b358a911b1e6 | [
"CC0-1.0"
] | null | null | null | # Capture multi video from webcam
# Display the frame 4 times on canvas
import numpy
import cv2
# 0 means 1st webcam
cap = cv2.VideoCapture(0)
face_cascade = cv2.CascadeClassifier(
cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
eye_cascade = cv2.CascadeClassifier(
cv2.data.haarcascad... | 23.18 | 71 | 0.529767 | # Capture multi video from webcam
# Display the frame 4 times on canvas
import numpy
import cv2
# 0 means 1st webcam
cap = cv2.VideoCapture(0)
face_cascade = cv2.CascadeClassifier(
cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
eye_cascade = cv2.CascadeClassifier(
cv2.data.haarcascad... | 0 | 0 | 0 |
fcc44e3d996804365e318ea1ce859065b96ac86e | 1,115 | py | Python | src/test_items_setup.py | dciliberto/DarkSoulsItemRandomizer | 433ee7d1b0345e4ce9e3da1cff6e809ed7b22ece | [
"MIT"
] | null | null | null | src/test_items_setup.py | dciliberto/DarkSoulsItemRandomizer | 433ee7d1b0345e4ce9e3da1cff6e809ed7b22ece | [
"MIT"
] | null | null | null | src/test_items_setup.py | dciliberto/DarkSoulsItemRandomizer | 433ee7d1b0345e4ce9e3da1cff6e809ed7b22ece | [
"MIT"
] | null | null | null | import items_setup
import unittest
if __name__ == "__main__":
unittest.main()
| 33.787879 | 76 | 0.678027 | import items_setup
import unittest
class boss_weapon_list_helper_unit_tests(unittest.TestCase):
def setUp(self):
self.boss_weapon_list_instance = items_setup.boss_weapon_list_helper
def tearDown(self):
return super().tearDown()
class list_of_five(boss_weapon_list_helper_unit_tests):
def ru... | 583 | 178 | 271 |
b42125020b8ae14bf0f539310fc68868f1f3f8da | 1,390 | py | Python | Projects/Online Workouts/w3resource/Lambda/program-9.py | ivenpoker/Python-Projects | 2975e1bd687ec8dbcc7a4842c13466cb86292679 | [
"MIT"
] | 1 | 2019-09-23T15:51:45.000Z | 2019-09-23T15:51:45.000Z | Projects/Online Workouts/w3resource/Lambda/program-9.py | ivenpoker/Python-Projects | 2975e1bd687ec8dbcc7a4842c13466cb86292679 | [
"MIT"
] | 5 | 2021-02-08T20:47:19.000Z | 2022-03-12T00:35:44.000Z | Projects/Online Workouts/w3resource/Lambda/program-9.py | ivenpoker/Python-Projects | 2975e1bd687ec8dbcc7a4842c13466cb86292679 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
############################################################################################
# #
# Program purpose: Checks whether a given string is number or not using Lambda. #
# Program ... | 40.882353 | 92 | 0.425899 | #!/usr/bin/env python3
############################################################################################
# #
# Program purpose: Checks whether a given string is number or not using Lambda. #
# Program ... | 422 | 0 | 46 |
2c66a36d659ad8c767eeaa13a94c48b998f80676 | 671 | py | Python | heroku_api/commands.py | Nicholas-Chong/COVID-19-Twitter-Bot | 6ffda538e429250d6daf9585926385c379757a12 | [
"MIT"
] | 4 | 2020-07-22T04:03:00.000Z | 2021-01-04T16:00:40.000Z | heroku_api/commands.py | Nicholas-Chong/COVID-19-Twitter-Bot | 6ffda538e429250d6daf9585926385c379757a12 | [
"MIT"
] | 1 | 2020-08-01T14:30:50.000Z | 2020-08-01T17:53:56.000Z | heroku_api/commands.py | Nicholas-Chong/COVID-19-Twitter-Bot | 6ffda538e429250d6daf9585926385c379757a12 | [
"MIT"
] | 1 | 2020-08-13T21:20:37.000Z | 2020-08-13T21:20:37.000Z | '''----------------------------------------------------------------------------
Name: Heroku API Commands (commands.py)
Purpose: To setup a connection with the Heroku API and denote functions
that carry out various tasks.
Author: Nicholas Chong
Created: 2020-06-24 (YYYY/MM/DD)
-------... | 30.5 | 79 | 0.518629 | '''----------------------------------------------------------------------------
Name: Heroku API Commands (commands.py)
Purpose: To setup a connection with the Heroku API and denote functions
that carry out various tasks.
Author: Nicholas Chong
Created: 2020-06-24 (YYYY/MM/DD)
-------... | 170 | 0 | 23 |
d86d88f387457a805ced5a7869758e8ddbad9ff0 | 490 | py | Python | pyXcode/__init__.py | samdmarshall/pyXcode | 5898ec4ad7d02f2d92d80eac78b9fc0746da600d | [
"BSD-3-Clause"
] | 8 | 2015-10-31T23:05:35.000Z | 2016-05-16T16:16:02.000Z | pyXcode/__init__.py | samdmarshall/pyXcode | 5898ec4ad7d02f2d92d80eac78b9fc0746da600d | [
"BSD-3-Clause"
] | null | null | null | pyXcode/__init__.py | samdmarshall/pyXcode | 5898ec4ad7d02f2d92d80eac78b9fc0746da600d | [
"BSD-3-Clause"
] | null | null | null | from Helpers import Logger
from Helpers import xcrun
# This is initial setup that should be done so the xcrun helper module doesn't have to be used everywhere.
import os
DEVELOPER_DIR = os.environ.get('DEVELOPER_DIR')
if DEVELOPER_DIR:
Logger.write().info('DEVELOPER_DIR environment variable is already set, existin... | 32.666667 | 129 | 0.783673 | from Helpers import Logger
from Helpers import xcrun
# This is initial setup that should be done so the xcrun helper module doesn't have to be used everywhere.
import os
DEVELOPER_DIR = os.environ.get('DEVELOPER_DIR')
if DEVELOPER_DIR:
Logger.write().info('DEVELOPER_DIR environment variable is already set, existin... | 0 | 0 | 0 |
5067957a6efe04c700e833bf13298b47e397c6f1 | 1,571 | py | Python | Q/questionnaire/signals/signals_sites.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | null | null | null | Q/questionnaire/signals/signals_sites.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | 477 | 2015-01-07T18:22:27.000Z | 2017-07-17T15:05:48.000Z | Q/questionnaire/signals/signals_sites.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | null | null | null | ####################
# ES-DOC CIM Questionnaire
# Copyright (c) 2017 ES-DOC. All rights reserved.
#
# University of Colorado, Boulder
# http://cires.colorado.edu/
#
# This project is distributed according to the terms of the MIT license [http://www.opensource.org/licenses/MIT].
####################
__author_... | 35.704545 | 117 | 0.681095 | ####################
# ES-DOC CIM Questionnaire
# Copyright (c) 2017 ES-DOC. All rights reserved.
#
# University of Colorado, Boulder
# http://cires.colorado.edu/
#
# This project is distributed according to the terms of the MIT license [http://www.opensource.org/licenses/MIT].
####################
__author_... | 0 | 0 | 0 |
5df9f80ef70a0cb558aede7f6ac4f02766074b5e | 3,181 | py | Python | infer_spleen.py | vanziaa/aHVPG | 886b4b0efee30f1beb079b0226f46e4dd1919594 | [
"MIT"
] | null | null | null | infer_spleen.py | vanziaa/aHVPG | 886b4b0efee30f1beb079b0226f46e4dd1919594 | [
"MIT"
] | null | null | null | infer_spleen.py | vanziaa/aHVPG | 886b4b0efee30f1beb079b0226f46e4dd1919594 | [
"MIT"
] | null | null | null | import os
from time import time
import torch
import torch.nn.functional as F
import numpy as np
import SimpleITK as sitk
import xlsxwriter as xw
import scipy.ndimage as ndimage
from net.ResUnet_dice import Net
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
val_ct_dir = './Path of original images/'
#val_seg_dir = './Trai... | 24.851563 | 111 | 0.653568 | import os
from time import time
import torch
import torch.nn.functional as F
import numpy as np
import SimpleITK as sitk
import xlsxwriter as xw
import scipy.ndimage as ndimage
from net.ResUnet_dice import Net
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
val_ct_dir = './Path of original images/'
#val_seg_dir = './Trai... | 0 | 0 | 0 |
1054fef9cea14c90edd5a63284f97ea508a33e73 | 4,161 | py | Python | tests/test_main.py | coreygirard/foldr | ac6894c02a8a5a3f40bdec2c5bd7895182b807ba | [
"MIT"
] | 1 | 2018-07-12T19:05:32.000Z | 2018-07-12T19:05:32.000Z | tests/test_main.py | coreygirard/foldr | ac6894c02a8a5a3f40bdec2c5bd7895182b807ba | [
"MIT"
] | null | null | null | tests/test_main.py | coreygirard/foldr | ac6894c02a8a5a3f40bdec2c5bd7895182b807ba | [
"MIT"
] | null | null | null | import doctest
import unittest
from hypothesis import given
from hypothesis.strategies import (builds, from_regex, integers, just, lists,
recursive, tuples)
from src.main import *
strat_codeline = from_regex(r"\A[a-z]{3}\Z")
strat_nochildren = just([])
strat_children = re... | 23.24581 | 87 | 0.461908 | import doctest
import unittest
from hypothesis import given
from hypothesis.strategies import (builds, from_regex, integers, just, lists,
recursive, tuples)
from src.main import *
def test__from_list():
data = [(0, "aaa"), (1, "bbb"), (2, "ccc"), (1, "ddd"), (2, "eee"), (2, "f... | 3,478 | 0 | 251 |
9fac3347b412379b1b262cadfb11da00e80b26bc | 8,795 | py | Python | infirunner/watch.py | zh217/infirunner | ceb4b7b3a7ca9c080d537f2e601d1be197e27395 | [
"MIT"
] | 1 | 2020-01-15T02:52:04.000Z | 2020-01-15T02:52:04.000Z | infirunner/watch.py | zh217/infirunner | ceb4b7b3a7ca9c080d537f2e601d1be197e27395 | [
"MIT"
] | null | null | null | infirunner/watch.py | zh217/infirunner | ceb4b7b3a7ca9c080d537f2e601d1be197e27395 | [
"MIT"
] | null | null | null | import json
import math
import os
import sys
import time
import colorama
from colorama import Style, Fore, Back
colorama.init()
import click
@click.command()
@click.option('--fields', default='')
@click.option('--hide-inactive/--no-hide-inactive', default=False)
@click.option('--only')
@click.option('--watch',... | 33.957529 | 112 | 0.549403 | import json
import math
import os
import sys
import time
import colorama
from colorama import Style, Fore, Back
colorama.init()
import click
def clear_screen():
print('\x1b[2J', file=sys.stderr)
class FastTSVTail:
def __init__(self, filepath, seek_length=128):
self.filepath = filepath
self... | 7,692 | 200 | 324 |
532cf843d6ff4cfff92c5cc88cc98f2b83c9cac9 | 2,696 | py | Python | taskflow/migrations/versions/6ef79b56ad4a_rename_status_retry.py | awm33/taskflow | 5c86b50c6d8bce43a04fba1b856b1d56f3c36b6a | [
"MIT"
] | 22 | 2017-07-02T08:13:48.000Z | 2021-03-16T16:55:41.000Z | taskflow/migrations/versions/6ef79b56ad4a_rename_status_retry.py | awm33/taskflow | 5c86b50c6d8bce43a04fba1b856b1d56f3c36b6a | [
"MIT"
] | 14 | 2017-06-27T19:43:45.000Z | 2017-12-22T16:16:11.000Z | taskflow/migrations/versions/6ef79b56ad4a_rename_status_retry.py | awm33/taskflow | 5c86b50c6d8bce43a04fba1b856b1d56f3c36b6a | [
"MIT"
] | 1 | 2020-03-31T10:05:26.000Z | 2020-03-31T10:05:26.000Z | """rename status retry
Revision ID: 6ef79b56ad4a
Revises: 94e7b91d83d5
Create Date: 2017-06-19 15:06:50.441524+00:00
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6ef79b56ad4a'
down_revision = '94e7b91d83d5'
branch_labels = None
depends_on = None
## ref htt... | 47.298246 | 132 | 0.732196 | """rename status retry
Revision ID: 6ef79b56ad4a
Revises: 94e7b91d83d5
Create Date: 2017-06-19 15:06:50.441524+00:00
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6ef79b56ad4a'
down_revision = '94e7b91d83d5'
branch_labels = None
depends_on = None
## ref htt... | 2,255 | 0 | 46 |
a55ab9d25fa4b976b2a3f85e81e6a6604f24d452 | 15,679 | py | Python | python/nbdb/store/sparse_series_writer_base.py | rubrikinc/nbdb2 | 359db63a39e016e3eb197b8ea511d6e8cffa1853 | [
"Apache-2.0"
] | 2 | 2022-03-21T15:48:33.000Z | 2022-03-27T00:43:12.000Z | python/nbdb/store/sparse_series_writer_base.py | rubrikinc/nbdb2 | 359db63a39e016e3eb197b8ea511d6e8cffa1853 | [
"Apache-2.0"
] | null | null | null | python/nbdb/store/sparse_series_writer_base.py | rubrikinc/nbdb2 | 359db63a39e016e3eb197b8ea511d6e8cffa1853 | [
"Apache-2.0"
] | 1 | 2022-03-27T00:43:31.000Z | 2022-03-27T00:43:31.000Z | """
SparseSeriesData
"""
from __future__ import annotations
import logging
import sys
import time
import copy
from typing import Dict
# Its there not sure why pylint is unable to find it
# pylint: disable-msg=E0611 # No Name In Module
from lru import LRU
from nbdb.common.context import Context
from nbdb.common.data... | 42.147849 | 83 | 0.615792 | """
SparseSeriesData
"""
from __future__ import annotations
import logging
import sys
import time
import copy
from typing import Dict
# Its there not sure why pylint is unable to find it
# pylint: disable-msg=E0611 # No Name In Module
from lru import LRU
from nbdb.common.context import Context
from nbdb.common.data... | 1,104 | 0 | 26 |
46014f286995e226ea6b45ac533f420fee094576 | 6,373 | py | Python | NodeCheck/check_nodes.py | abutala/water-tracking | 6affde9fdd94b0430c09e9e097153548096813c6 | [
"MIT"
] | 1 | 2019-01-15T18:10:22.000Z | 2019-01-15T18:10:22.000Z | NodeCheck/check_nodes.py | abutala/water-tracking | 6affde9fdd94b0430c09e9e097153548096813c6 | [
"MIT"
] | null | null | null | NodeCheck/check_nodes.py | abutala/water-tracking | 6affde9fdd94b0430c09e9e097153548096813c6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import logging
import os
import re
import sys
import time
import traceback
import Constants
import FoscamImager
import Mailer
import NetHelpers
system_healthy = True
state = dict()
message = ""
#### Helper Functions ####
# Note: For windows nodes only
# Note: For Foscam node... | 35.405556 | 102 | 0.647576 | #!/usr/bin/env python3
import argparse
import logging
import os
import re
import sys
import time
import traceback
import Constants
import FoscamImager
import Mailer
import NetHelpers
system_healthy = True
state = dict()
message = ""
#### Helper Functions ####
def reboot_foscam(nodeName):
node = Constants.FOSCAM_NO... | 2,372 | 0 | 136 |
1466f341b25298856e16f6aec6a1214271b6ebd7 | 4,593 | py | Python | autograph/lib/envs/connfourenv.py | bb912/MATS-DRS | 6e1ae9ba3b865e321d6a2d100d29693b776e1d36 | [
"MIT"
] | null | null | null | autograph/lib/envs/connfourenv.py | bb912/MATS-DRS | 6e1ae9ba3b865e321d6a2d100d29693b776e1d36 | [
"MIT"
] | null | null | null | autograph/lib/envs/connfourenv.py | bb912/MATS-DRS | 6e1ae9ba3b865e321d6a2d100d29693b776e1d36 | [
"MIT"
] | null | null | null | from typing import Tuple, Union
import gym.spaces as spaces
import numpy as np
from gym.spaces import Box
from autograph.lib.envs.adversarialenv import AdversarialEnv, PlayerID
from autograph.lib.envs.saveloadenv import SaveLoadEnv
from autograph.lib.util import element_add, element_neg
PATTERNS = ((0, 1), (1, 0), (... | 31.458904 | 117 | 0.613542 | from typing import Tuple, Union
import gym.spaces as spaces
import numpy as np
from gym.spaces import Box
from autograph.lib.envs.adversarialenv import AdversarialEnv, PlayerID
from autograph.lib.envs.saveloadenv import SaveLoadEnv
from autograph.lib.util import element_add, element_neg
PATTERNS = ((0, 1), (1, 0), (... | 3,453 | 780 | 23 |
f3e567b187d0bed07e9fbc2dfc963f5668d99ad4 | 661 | py | Python | offer/bubbleSort.py | ZymHedy/code_practice | add07e8c964004f95da3be5311e54283e2b87d36 | [
"MIT"
] | null | null | null | offer/bubbleSort.py | ZymHedy/code_practice | add07e8c964004f95da3be5311e54283e2b87d36 | [
"MIT"
] | null | null | null | offer/bubbleSort.py | ZymHedy/code_practice | add07e8c964004f95da3be5311e54283e2b87d36 | [
"MIT"
] | null | null | null |
arr = [64, 34, 25, 12, 22, 11, 90]
test_arr = [2, 1, 5, 3, 4, 7]
bubbleSort(test_arr)
print("排序后的数组:")
for i in range(len(test_arr)):
print("%d" % test_arr[i]),
print(bubble(test_arr)) | 18.885714 | 55 | 0.485628 | def bubble(arr):
for i in range(len(arr)):
j = i + 1
while j < len(arr) and arr[j] < arr[i]:
temp = arr[i]
arr[i] = arr[j]
arr[j] = temp
return arr
def bubbleSort(arr):
n = len(arr)
# 遍历所有数组元素
for i in range(n):
# Last i elements are a... | 437 | 0 | 45 |
97c88b6bb1a18926d3c0bb3c92805ed409e26108 | 203 | py | Python | exp2/tcp_n_messages_cli.py | sekharkaredla/cnlab | 8e1ef9a904dea5260f6b6cf968508a2847f9f15c | [
"MIT"
] | null | null | null | exp2/tcp_n_messages_cli.py | sekharkaredla/cnlab | 8e1ef9a904dea5260f6b6cf968508a2847f9f15c | [
"MIT"
] | null | null | null | exp2/tcp_n_messages_cli.py | sekharkaredla/cnlab | 8e1ef9a904dea5260f6b6cf968508a2847f9f15c | [
"MIT"
] | 2 | 2018-04-16T13:25:12.000Z | 2018-04-16T14:49:38.000Z | import socket
s=socket.socket()
n=int(raw_input("enter n:"))
s.connect(('127.0.0.1',2222))
for k in range(0,n):
input=raw_input()
#s.connect(('127.0.0.1',2222))
s.send(input)
k=s.recv(1024)
print k
| 18.454545 | 31 | 0.655172 | import socket
s=socket.socket()
n=int(raw_input("enter n:"))
s.connect(('127.0.0.1',2222))
for k in range(0,n):
input=raw_input()
#s.connect(('127.0.0.1',2222))
s.send(input)
k=s.recv(1024)
print k
| 0 | 0 | 0 |
0748b242aa925303ec1e4cb9fad885f1af83592d | 2,556 | py | Python | tests/functional/gtcs/test_external_file_04_d.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2022-02-05T11:37:13.000Z | 2022-02-05T11:37:13.000Z | tests/functional/gtcs/test_external_file_04_d.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-09-03T11:47:00.000Z | 2021-09-03T12:42:10.000Z | tests/functional/gtcs/test_external_file_04_d.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-06-30T14:14:16.000Z | 2021-06-30T14:14:16.000Z | #coding:utf-8
#
# id: functional.gtcs.external_file_04_d
# title: GTCS/tests/external-file-04-d. Test for external table with field of INTEGER datatype
# decription:
# Original test see in:
# https://github.com/FirebirdSQL/fbtcs/blob/master/GTCS/tests/EXT_REL_0_4... | 26.350515 | 104 | 0.636933 | #coding:utf-8
#
# id: functional.gtcs.external_file_04_d
# title: GTCS/tests/external-file-04-d. Test for external table with field of INTEGER datatype
# decription:
# Original test see in:
# https://github.com/FirebirdSQL/fbtcs/blob/master/GTCS/tests/EXT_REL_0_4... | 45 | 0 | 22 |
9880b0b72274a5f90c266dd9b36f5c33a844dce2 | 3,286 | py | Python | src/ekpmeasure/analysis/functions_on_data.py | marwahaha/ekpmeasure | 8a0e52f0393849b496d9df13d84fcef11b733f59 | [
"MIT"
] | null | null | null | src/ekpmeasure/analysis/functions_on_data.py | marwahaha/ekpmeasure | 8a0e52f0393849b496d9df13d84fcef11b733f59 | [
"MIT"
] | null | null | null | src/ekpmeasure/analysis/functions_on_data.py | marwahaha/ekpmeasure | 8a0e52f0393849b496d9df13d84fcef11b733f59 | [
"MIT"
] | null | null | null | import numpy as np
__all__ = ('_fod_dimensionality_fixer', 'iterable_data_array', 'data_array_builder')
def _fod_dimensionality_fixer(data_dict, check_key, keys_to_fix):
"""
Checks the dimensionality of data in data_dict for function on data and reshapes them if their shape is 1d.
args:
data_... | 27.157025 | 112 | 0.52252 | import numpy as np
__all__ = ('_fod_dimensionality_fixer', 'iterable_data_array', 'data_array_builder')
class iterable_data_array():
def __init__(self, data_dict, key):
"""
Iterable for usage building functions on data.
args:
data_dict (dict): data
key (str ... | 200 | 1,857 | 46 |
80ca7c85c7faa916625d19f08c5badd55b5933e9 | 463 | py | Python | 2renderers/app2.py | carlotamartin/Pr-ctica-4--Bases-de-Datos | b9a40f0acb0b6f2f7946c7c924c3c91a3af318b5 | [
"Apache-2.0"
] | null | null | null | 2renderers/app2.py | carlotamartin/Pr-ctica-4--Bases-de-Datos | b9a40f0acb0b6f2f7946c7c924c3c91a3af318b5 | [
"Apache-2.0"
] | null | null | null | 2renderers/app2.py | carlotamartin/Pr-ctica-4--Bases-de-Datos | b9a40f0acb0b6f2f7946c7c924c3c91a3af318b5 | [
"Apache-2.0"
] | null | null | null | from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.view import view_config
@view_config(
route_name = 'home'
renderer = 'json')
if __name__ == '__main__':
with Configurator() as config:
config.add_route('home', '/')
config.scan()
app ... | 25.722222 | 46 | 0.667387 | from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.view import view_config
@view_config(
route_name = 'home'
renderer = 'json')
def home(request):
return{'a':1, 'b':2}
if __name__ == '__main__':
with Configurator() as config:
config.add_route('h... | 22 | 0 | 23 |
ed7bed1862228a50bf020c414f5210633cef5499 | 2,033 | py | Python | src/core/api/record.py | ruoyi0531/Yearning | 50ff6b14477ff8d03e6b455d5014b99983518719 | [
"Apache-2.0"
] | 1 | 2018-02-27T03:23:54.000Z | 2018-02-27T03:23:54.000Z | src/core/api/record.py | ruoyi0531/Yearning | 50ff6b14477ff8d03e6b455d5014b99983518719 | [
"Apache-2.0"
] | null | null | null | src/core/api/record.py | ruoyi0531/Yearning | 50ff6b14477ff8d03e6b455d5014b99983518719 | [
"Apache-2.0"
] | null | null | null | import logging
from libs import baseview
from rest_framework.response import Response
from django.http import HttpResponse
from core.models import (
SqlRecord,
SqlOrder
)
CUSTOM_ERROR = logging.getLogger('Yearning.core.views')
class recordorder(baseview.SuperUserpermissions):
'''
审核记录相关
'''
... | 39.096154 | 102 | 0.496803 | import logging
from libs import baseview
from rest_framework.response import Response
from django.http import HttpResponse
from core.models import (
SqlRecord,
SqlOrder
)
CUSTOM_ERROR = logging.getLogger('Yearning.core.views')
class recordorder(baseview.SuperUserpermissions):
'''
审核记录相关
'''
... | 1,678 | 0 | 27 |
e4fcea1b38b39f04fb0ec3cebf84202888d66feb | 42 | py | Python | app/blueprints/user/__init__.py | eduardmelnychenko/make_your_own_url | bfe140198f05faddf6bf908f2c5fcce25105c15a | [
"MIT"
] | null | null | null | app/blueprints/user/__init__.py | eduardmelnychenko/make_your_own_url | bfe140198f05faddf6bf908f2c5fcce25105c15a | [
"MIT"
] | null | null | null | app/blueprints/user/__init__.py | eduardmelnychenko/make_your_own_url | bfe140198f05faddf6bf908f2c5fcce25105c15a | [
"MIT"
] | null | null | null | from app.blueprints.user.views import user | 42 | 42 | 0.857143 | from app.blueprints.user.views import user | 0 | 0 | 0 |
23568867a266b35e43389764b353ce6af41ea3d3 | 468 | py | Python | setup.py | FebruaryBreeze/mobile-block | 7d201417df4cd8f046f23d28548efd817a3ac053 | [
"MIT"
] | null | null | null | setup.py | FebruaryBreeze/mobile-block | 7d201417df4cd8f046f23d28548efd817a3ac053 | [
"MIT"
] | null | null | null | setup.py | FebruaryBreeze/mobile-block | 7d201417df4cd8f046f23d28548efd817a3ac053 | [
"MIT"
] | null | null | null | """
mobile-block
MobileNet-style blocks for PyTorch
Author: SF-Zhou
Date: 2019-01-15
"""
from setuptools import setup
name = 'mobile_block'
setup(
name=name,
version='0.0.6',
description='MobileNet-style blocks for PyTorch',
url=f'https://github.com/SF-Zhou/{name.replace("_", "-")}',
author='SF-Zh... | 21.272727 | 63 | 0.668803 | """
mobile-block
MobileNet-style blocks for PyTorch
Author: SF-Zhou
Date: 2019-01-15
"""
from setuptools import setup
name = 'mobile_block'
setup(
name=name,
version='0.0.6',
description='MobileNet-style blocks for PyTorch',
url=f'https://github.com/SF-Zhou/{name.replace("_", "-")}',
author='SF-Zh... | 0 | 0 | 0 |
2970f80fc9528c0b1b13373f13a8346aaead3d12 | 793 | py | Python | json_checker/app.py | DKorytkin/JsonChecker | 1a803c3d873db5a1139a55b7efb3b40d9c1b6891 | [
"MIT"
] | 5 | 2017-08-17T11:24:13.000Z | 2017-08-21T09:45:29.000Z | json_checker/app.py | DKorytkin/JsonChecker | 1a803c3d873db5a1139a55b7efb3b40d9c1b6891 | [
"MIT"
] | 179 | 2017-09-05T09:18:41.000Z | 2022-03-31T17:20:03.000Z | json_checker/app.py | DKorytkin/json_checker | 1a803c3d873db5a1139a55b7efb3b40d9c1b6891 | [
"MIT"
] | null | null | null | import logging
from typing import Any
from json_checker.core.base import Base
from json_checker.core.exceptions import CheckerError
from json_checker.core.checkers import Validator
from json_checker.core.reports import Report
log = logging.getLogger(__name__)
| 26.433333 | 61 | 0.662043 | import logging
from typing import Any
from json_checker.core.base import Base
from json_checker.core.exceptions import CheckerError
from json_checker.core.checkers import Validator
from json_checker.core.reports import Report
log = logging.getLogger(__name__)
class Checker(Base):
def validate(self, data: Any)... | 480 | -1 | 49 |
a2a4694920801b6bf687c67c7a817612983d7dfb | 299 | py | Python | tests/conftest.py | cristianMeli/ubatch | fb3c6dccf0a9e25e25f5956e2e91ed70e9ea01ee | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | cristianMeli/ubatch | fb3c6dccf0a9e25e25f5956e2e91ed70e9ea01ee | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | cristianMeli/ubatch | fb3c6dccf0a9e25e25f5956e2e91ed70e9ea01ee | [
"Apache-2.0"
] | null | null | null | import pytest
from ubatch.ubatch import UBatch
@pytest.fixture
| 18.6875 | 63 | 0.762542 | import pytest
from ubatch.ubatch import UBatch
def calculate_squared_batch(xs):
return [x ** 2 for x in xs]
@pytest.fixture
def squared_ubatch():
squared_ubatch = UBatch(max_size=10, timeout=10)
squared_ubatch.set_handler(handler=calculate_squared_batch)
return squared_ubatch
| 187 | 0 | 45 |
d9cb23a9ea3c6e08eefedd54102f29eec5a2ccc6 | 3,295 | py | Python | src/oci/core/models/udp_options.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/core/models/udp_options.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/core/models/udp_options.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 34.684211 | 245 | 0.687709 | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 177 | 0 | 81 |
c48edc84dfe346a757d4e91b8fa61926c28cd8f6 | 2,852 | py | Python | examples/python/grib_set_keys.py | bbakernoaa/eccodes | 61eb6daac46f6f2b9959b506df5565fb9e763c40 | [
"Apache-2.0"
] | null | null | null | examples/python/grib_set_keys.py | bbakernoaa/eccodes | 61eb6daac46f6f2b9959b506df5565fb9e763c40 | [
"Apache-2.0"
] | null | null | null | examples/python/grib_set_keys.py | bbakernoaa/eccodes | 61eb6daac46f6f2b9959b506df5565fb9e763c40 | [
"Apache-2.0"
] | null | null | null | # (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernme... | 31 | 78 | 0.66094 | # (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernme... | 2,001 | 0 | 46 |
39915cb08f5f39d81b07a8377bd503ab57482d06 | 1,283 | py | Python | config.py | SonyCSL/apis-tester | 330fb0a23081dc7d99c7e0af3c897ff1bd88e55c | [
"Apache-2.0"
] | null | null | null | config.py | SonyCSL/apis-tester | 330fb0a23081dc7d99c7e0af3c897ff1bd88e55c | [
"Apache-2.0"
] | null | null | null | config.py | SonyCSL/apis-tester | 330fb0a23081dc7d99c7e0af3c897ff1bd88e55c | [
"Apache-2.0"
] | null | null | null |
my_host = 'localhost'
my_port = 10000
is_emulation = False
emulator_host = '0.0.0.0'
emulator_port = 4390
apis_web_host = '0.0.0.0'
apis_web_budo_emulator_port = 43830
apis_web_api_server_port = 9999
#apis_log_group_address = 'FF02:0:0:0:0:0:0:1'
apis_log_group_address = '224.2.2.4'
apis_log_port = 8888
units = [... | 18.328571 | 46 | 0.679657 |
my_host = 'localhost'
my_port = 10000
is_emulation = False
emulator_host = '0.0.0.0'
emulator_port = 4390
apis_web_host = '0.0.0.0'
apis_web_budo_emulator_port = 43830
apis_web_api_server_port = 9999
#apis_log_group_address = 'FF02:0:0:0:0:0:0:1'
apis_log_group_address = '224.2.2.4'
apis_log_port = 8888
units = [... | 0 | 0 | 0 |
c76cd5fed5e778a2cfca6db41ba3854c963f21fe | 5,187 | py | Python | tests/unit/garden/test_models.py | e-dang/Autogarden | b15217e5d4755fc028b8dc4255cbdcb77ead80f4 | [
"MIT"
] | null | null | null | tests/unit/garden/test_models.py | e-dang/Autogarden | b15217e5d4755fc028b8dc4255cbdcb77ead80f4 | [
"MIT"
] | null | null | null | tests/unit/garden/test_models.py | e-dang/Autogarden | b15217e5d4755fc028b8dc4255cbdcb77ead80f4 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
import pytest
import pytz
from tests.assertions import assert_durations_are_eq
from garden import models
from garden.formatters import WateringStationFormatter
@pytest.mark.unit
@pytest.mark.unit
@pytest.mark.unit
@pytest.mark.unit
| 40.209302 | 131 | 0.757663 | from datetime import datetime, timedelta
import pytest
import pytz
from tests.assertions import assert_durations_are_eq
from garden import models
from garden.formatters import WateringStationFormatter
@pytest.mark.unit
class TestGardenModel:
@pytest.mark.parametrize('field, get_default', [
('is_connecte... | 3,883 | 881 | 140 |
941cd9f54df141dff4f4ac42daeca5576f19db6d | 2,528 | py | Python | slides/snippets/slides_create_slide.py | himanshupr2627/python-samples | 4a04e3aee1068dc1f1402e9e9c90044ff101a6c8 | [
"Apache-2.0"
] | 479 | 2018-03-16T16:45:11.000Z | 2020-10-13T11:32:02.000Z | slides/snippets/slides_create_slide.py | himanshupr2627/python-samples | 4a04e3aee1068dc1f1402e9e9c90044ff101a6c8 | [
"Apache-2.0"
] | 159 | 2018-03-28T20:03:56.000Z | 2020-10-13T06:00:08.000Z | slides/snippets/slides_create_slide.py | himanshupr2627/python-samples | 4a04e3aee1068dc1f1402e9e9c90044ff101a6c8 | [
"Apache-2.0"
] | 493 | 2018-03-21T01:07:21.000Z | 2020-10-14T10:31:00.000Z | """
Copyright 2022 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | 33.706667 | 77 | 0.655459 | """
Copyright 2022 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | 0 | 0 | 0 |
96439a10d17586a2372419642c67ac67b71de6fc | 4,094 | py | Python | netbox/secrets/tests/test_views.py | aslafy-z/netbox | a5512dd4c46c005df8752fc330c1382ac22b31ea | [
"Apache-2.0"
] | 1 | 2021-09-23T00:06:51.000Z | 2021-09-23T00:06:51.000Z | netbox/secrets/tests/test_views.py | aslafy-z/netbox | a5512dd4c46c005df8752fc330c1382ac22b31ea | [
"Apache-2.0"
] | 4 | 2021-06-08T22:29:06.000Z | 2022-03-12T00:48:51.000Z | netbox/secrets/tests/test_views.py | aslafy-z/netbox | a5512dd4c46c005df8752fc330c1382ac22b31ea | [
"Apache-2.0"
] | null | null | null | import base64
from django.urls import reverse
from dcim.models import Device, DeviceRole, DeviceType, Manufacturer, Site
from secrets.models import Secret, SecretRole, SessionKey, UserKey
from utilities.testing import ViewTestCases
from .constants import PRIVATE_KEY, PUBLIC_KEY
| 35.293103 | 108 | 0.629213 | import base64
from django.urls import reverse
from dcim.models import Device, DeviceRole, DeviceType, Manufacturer, Site
from secrets.models import Secret, SecretRole, SessionKey, UserKey
from utilities.testing import ViewTestCases
from .constants import PRIVATE_KEY, PUBLIC_KEY
class SecretRoleTestCase(ViewTestCase... | 3,324 | 441 | 46 |
188cf77aae4d2909d4b80bf6330603f178e101ec | 1,366 | py | Python | python_practices/rotation_of_array.py | hoanhan101/Algorithms-Playground | c9641d3f3b7c4c778c14179cbb2039dbc40ae71a | [
"MIT"
] | 2 | 2019-08-15T06:19:31.000Z | 2020-02-19T09:46:46.000Z | python_practices/rotation_of_array.py | hoanhan101/Algorithms-Playground | c9641d3f3b7c4c778c14179cbb2039dbc40ae71a | [
"MIT"
] | null | null | null | python_practices/rotation_of_array.py | hoanhan101/Algorithms-Playground | c9641d3f3b7c4c778c14179cbb2039dbc40ae71a | [
"MIT"
] | null | null | null | """
Is One Array a Rotation of Another? (Python)
Write a function that returns True if one array is a rotation of another.
Example: [1, 2, 3, 4, 5, 6, 7] is a rotation of [4, 5, 6, 7, 1, 2, 3].
NOTE: There are no duplicates in each of these arrays.
REMINDER: We're going to use lists instead of arr... | 25.296296 | 82 | 0.565154 | """
Is One Array a Rotation of Another? (Python)
Write a function that returns True if one array is a rotation of another.
Example: [1, 2, 3, 4, 5, 6, 7] is a rotation of [4, 5, 6, 7, 1, 2, 3].
NOTE: There are no duplicates in each of these arrays.
REMINDER: We're going to use lists instead of arr... | 519 | 0 | 23 |
8dcfc847dd83cf2aed7c285b81e77cdf0de08a3a | 6,194 | py | Python | scripts/maskAlignment.py | stylekilla/syncmrt | 816bb57d80d6595719b8b9d7f027f4f17d0a6c0a | [
"Apache-2.0"
] | null | null | null | scripts/maskAlignment.py | stylekilla/syncmrt | 816bb57d80d6595719b8b9d7f027f4f17d0a6c0a | [
"Apache-2.0"
] | 25 | 2019-03-05T05:56:35.000Z | 2019-07-24T13:11:57.000Z | scripts/maskAlignment.py | stylekilla/syncmrt | 816bb57d80d6595719b8b9d7f027f4f17d0a6c0a | [
"Apache-2.0"
] | 1 | 2019-11-27T05:10:47.000Z | 2019-11-27T05:10:47.000Z | import numpy as np
from matplotlib import pyplot as plt
from scipy.ndimage import median_filter, gaussian_filter
import epics
import time
import imageio
import logging, coloredlogs
coloredlogs.install(fmt='%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s',datefmt='%H:%M:%S',level=logging.INF... | 34.032967 | 140 | 0.696642 | import numpy as np
from matplotlib import pyplot as plt
from scipy.ndimage import median_filter, gaussian_filter
import epics
import time
import imageio
import logging, coloredlogs
coloredlogs.install(fmt='%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s',datefmt='%H:%M:%S',level=logging.INF... | 767 | 0 | 69 |
b4c4c827cd21cee6fa1011f1e41cf754b6187c95 | 289 | py | Python | abc/104/B.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/104/B.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/104/B.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | S = input()
flag1 = True
flag2 = True
flag3 = True
flag1 = S[0] == "A" and S.count("A") == 1
flag2 = S.count("C") == 1 and 2 <= S.index("C") <= len(S)-2
S = S.replace("A", "")
S = S.replace("C", "")
flag3 = S.islower()
if all([flag1, flag2, flag3]):
print("AC")
else:
print("WA") | 19.266667 | 59 | 0.525952 | S = input()
flag1 = True
flag2 = True
flag3 = True
flag1 = S[0] == "A" and S.count("A") == 1
flag2 = S.count("C") == 1 and 2 <= S.index("C") <= len(S)-2
S = S.replace("A", "")
S = S.replace("C", "")
flag3 = S.islower()
if all([flag1, flag2, flag3]):
print("AC")
else:
print("WA") | 0 | 0 | 0 |
6b3906da0682543babc55a99851c57b9dabb2fac | 2,386 | py | Python | setup.py | vinta/pangu.py | 89407cf08dedf9d895c13053dd518d11a20f6c95 | [
"MIT"
] | 188 | 2015-02-11T04:16:45.000Z | 2022-03-15T03:35:25.000Z | pangu_anki/pangu/setup.py | ayuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu/anki-pangu | a5026f6706a460c4582ce5c12406c817fc68e971 | [
"MIT"
] | 9 | 2015-05-04T06:12:50.000Z | 2022-01-06T02:11:59.000Z | pangu_anki/pangu/setup.py | ayuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu/anki-pangu | a5026f6706a460c4582ce5c12406c817fc68e971 | [
"MIT"
] | 29 | 2015-02-14T07:25:16.000Z | 2021-11-29T00:01:30.000Z | #!/usr/bin/env python
# coding: utf-8
import os
import re
from setuptools import setup
_VERSION_RE = re.compile(r"__version__\s*?=\s*?'(.*?)'", flags=re.M)
setup(
name='pangu',
version=get_version(),
description='Paranoid text spacing for good readability, to automatically insert whitespace between CJ... | 36.707692 | 217 | 0.630763 | #!/usr/bin/env python
# coding: utf-8
import os
import re
from setuptools import setup
_VERSION_RE = re.compile(r"__version__\s*?=\s*?'(.*?)'", flags=re.M)
def get_version():
path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), 'pangu.py')
with open(path) as f:
return _VERSION_R... | 161 | 0 | 23 |
469ab0b8ef70c397ba6a1d627a505281fb810a54 | 1,779 | py | Python | klanad/migrations/0006_auto_20190606_1220.py | lancea-development/product-showcase | 32bdafaa5aa474f08db1a41e4d54b215d43ca6e6 | [
"MIT"
] | 1 | 2021-08-02T12:50:04.000Z | 2021-08-02T12:50:04.000Z | klanad/migrations/0006_auto_20190606_1220.py | wlansu/product-showcase | a0589f7e79eacfc70b3b66ced08a0890c4cc39c5 | [
"MIT"
] | 11 | 2019-06-09T12:01:02.000Z | 2022-01-13T01:22:52.000Z | klanad/migrations/0006_auto_20190606_1220.py | wlansu/product-showcase | a0589f7e79eacfc70b3b66ced08a0890c4cc39c5 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.2 on 2019-06-06 12:20
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import uuid
| 31.767857 | 70 | 0.442383 | # Generated by Django 2.2.2 on 2019-06-06 12:20
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import uuid
class Migration(migrations.Migration):
dependencies = [("klanad", "0005_auto_20190606_1214")]
operations = [
m... | 0 | 1,565 | 23 |