hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
173b1c09a24ba29b73e806482460e8a77d27c133 | 4,051 | py | Python | alipay/aop/api/domain/AlipayOverseasTaxNeworderStatusSyncModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayOverseasTaxNeworderStatusSyncModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayOverseasTaxNeworderStatusSyncModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| 30.923664 | 87 | 0.602567 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOverseasTaxNeworderStatusSyncModel(object):
def __init__(self):
self._doc_id = None
self._extend_param = None
self._status = None
self._status_change_time = ... | 0 | 1,473 | 0 | 2,440 | 0 | 0 | 0 | 21 | 68 |
dd0d1e45a6b03586912ed2af58c3ca9521a86418 | 618 | py | Python | migrations/versions/4b01613bfbed_.py | J4LP/J4OAuth | ca757958f1e7069f08e0dae3becd70b90507c871 | [
"MIT"
] | 1 | 2015-12-15T03:17:15.000Z | 2015-12-15T03:17:15.000Z | migrations/versions/4b01613bfbed_.py | J4LP/J4OAuth | ca757958f1e7069f08e0dae3becd70b90507c871 | [
"MIT"
] | null | null | null | migrations/versions/4b01613bfbed_.py | J4LP/J4OAuth | ca757958f1e7069f08e0dae3becd70b90507c871 | [
"MIT"
] | 1 | 2015-12-15T03:17:19.000Z | 2015-12-15T03:17:19.000Z | """empty message
Revision ID: 4b01613bfbed
Revises: 406cccb640c3
Create Date: 2014-02-07 00:29:22.150808
"""
# revision identifiers, used by Alembic.
revision = '4b01613bfbed'
down_revision = '406cccb640c3'
| 22.888889 | 88 | 0.697411 | """empty message
Revision ID: 4b01613bfbed
Revises: 406cccb640c3
Create Date: 2014-02-07 00:29:22.150808
"""
# revision identifiers, used by Alembic.
revision = '4b01613bfbed'
down_revision = '406cccb640c3'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | 0 | 0 | 0 | 0 | 0 | 312 | 0 | 3 | 91 |
963b388fd46ae6be2ff0ea7cc00541ff85694744 | 529 | py | Python | django_auth2/tasks.py | Nick1994209/django-auth2 | b8678f06ade985d2b5b0606e6e49bd9d2a49931a | [
"MIT"
] | null | null | null | django_auth2/tasks.py | Nick1994209/django-auth2 | b8678f06ade985d2b5b0606e6e49bd9d2a49931a | [
"MIT"
] | null | null | null | django_auth2/tasks.py | Nick1994209/django-auth2 | b8678f06ade985d2b5b0606e6e49bd9d2a49931a | [
"MIT"
] | null | null | null | from __future__ import absolute_import # for python 2.7
try:
from celery.task import task
except ImportError:
task = func_add_delay
| 24.045455 | 78 | 0.720227 | from __future__ import absolute_import # for python 2.7
from django.conf import settings
from django.core.mail import send_mail as django_send_mail
try:
from celery.task import task
except ImportError:
def func_add_delay(func):
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
... | 0 | 107 | 0 | 0 | 0 | 136 | 0 | 48 | 94 |
c603a2f92a55764ce391c8c6d64d7603bd21bea4 | 2,938 | py | Python | main/summary.py | tucan9389/MobileHumanPose | 94183778c8384a2412729fec179e66ca2cd15b60 | [
"MIT"
] | 137 | 2021-04-13T14:33:32.000Z | 2022-03-24T22:28:15.000Z | main/summary.py | tucan9389/MobileHumanPose | 94183778c8384a2412729fec179e66ca2cd15b60 | [
"MIT"
] | 27 | 2021-05-16T08:52:03.000Z | 2022-03-30T11:49:38.000Z | main/summary.py | tucan9389/MobileHumanPose | 94183778c8384a2412729fec179e66ca2cd15b60 | [
"MIT"
] | 13 | 2021-04-13T17:18:28.000Z | 2022-03-22T12:49:03.000Z | import torch
import os
import os.path as osp
import torch.backends.cudnn as cudnn
from torchsummary import summary
from torch.nn.parallel.data_parallel import DataParallel
from config import cfg
from model import get_pose_net
from thop import profile
from thop import clever_format
from ptflops import get_model_complexi... | 41.971429 | 233 | 0.642954 | import torch
import argparse
import os
import os.path as osp
import torch.backends.cudnn as cudnn
from torchsummary import summary
from torch.nn.parallel.data_parallel import DataParallel
from config import cfg
from model import get_pose_net
from thop import profile
from thop import clever_format
from ptflops import ge... | 0 | 0 | 0 | 0 | 0 | 792 | 0 | -6 | 45 |
eadd411cee7bade1921682585bda0bf351b1063a | 3,302 | py | Python | fastflix/models/encode.py | benedicteb/FastFlix | 45208b7c74a21758cb528c949422effcd0c01f44 | [
"MIT"
] | null | null | null | fastflix/models/encode.py | benedicteb/FastFlix | 45208b7c74a21758cb528c949422effcd0c01f44 | [
"MIT"
] | null | null | null | fastflix/models/encode.py | benedicteb/FastFlix | 45208b7c74a21758cb528c949422effcd0c01f44 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 22.161074 | 56 | 0.633253 | # -*- coding: utf-8 -*-
from dataclasses import dataclass, field
from pathlib import Path
from typing import List, Union
from fastflix.models.base import BaseDataClass
@dataclass
class AudioTrack(BaseDataClass):
index: int
outdex: int
codec: str = ""
downmix: int = 0
title: str = ""
language:... | 0 | 2,821 | 0 | 0 | 0 | 0 | 0 | 56 | 388 |
8929dca934368386b0442cdca9cb8e9309b1777f | 17,130 | py | Python | scripts/featureGenerator.py | dcompgriff/cs839_Entity_Extractor | a117256061cc75850c1da1ce837a2992c15db0fb | [
"MIT"
] | null | null | null | scripts/featureGenerator.py | dcompgriff/cs839_Entity_Extractor | a117256061cc75850c1da1ce837a2992c15db0fb | [
"MIT"
] | null | null | null | scripts/featureGenerator.py | dcompgriff/cs839_Entity_Extractor | a117256061cc75850c1da1ce837a2992c15db0fb | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import argparse
import glob
import os
import time
import re
from multiprocessing import Pool
'''
****************************************************************
GLOBAL VARIABLES
****************************************************************
'''
MAX_ENTITY_LENGTH = 20
MAX_ENTI... | 39.837209 | 167 | 0.588266 | import numpy as np
import pandas as pd
import argparse
import glob
import os
import time
import re
from multiprocessing import Pool
'''
****************************************************************
GLOBAL VARIABLES
****************************************************************
'''
MAX_ENTITY_LENGTH = 20
MAX_ENTI... | 6 | 0 | 0 | 0 | 0 | 12,141 | 0 | 0 | 503 |
27ea8f89b590262da723db9961dd54d30a7fc92d | 9,134 | py | Python | zodiacy/corpus.py | greenify/zodiacy | faf46a10b9b70869cb4caca02027921f1418cfcf | [
"MIT"
] | 1 | 2015-10-16T10:24:53.000Z | 2015-10-16T10:24:53.000Z | zodiacy/corpus.py | greenify/zodiacy | faf46a10b9b70869cb4caca02027921f1418cfcf | [
"MIT"
] | null | null | null | zodiacy/corpus.py | greenify/zodiacy | faf46a10b9b70869cb4caca02027921f1418cfcf | [
"MIT"
] | null | null | null | import logging
"""corpus.py: Generates horoscopes based provided corpuses"""
__author__ = "Project Zodiacy"
__copyright__ = "Copyright 2015, Project Zodiacy"
logger = logging.getLogger('root')
| 38.868085 | 115 | 0.600285 | import collections
import logging
from math import sqrt
from wordnik import swagger, WordApi
from .utils import weighted_choice
"""corpus.py: Generates horoscopes based provided corpuses"""
__author__ = "Project Zodiacy"
__copyright__ = "Copyright 2015, Project Zodiacy"
logger = logging.getLogger('root')
class Cor... | 0 | 0 | 0 | 8,801 | 0 | 0 | 0 | 25 | 111 |
f49d473cc0d800aa406361c6dce4b00757bccf54 | 2,906 | py | Python | remedy/remedy.py | 4n6ir/remedy-delete-default-vpcs | ce1250140c7f3c967646c9be5ef09dde88c191b0 | [
"Apache-2.0"
] | null | null | null | remedy/remedy.py | 4n6ir/remedy-delete-default-vpcs | ce1250140c7f3c967646c9be5ef09dde88c191b0 | [
"Apache-2.0"
] | null | null | null | remedy/remedy.py | 4n6ir/remedy-delete-default-vpcs | ce1250140c7f3c967646c9be5ef09dde88c191b0 | [
"Apache-2.0"
] | null | null | null | import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
| 44.707692 | 93 | 0.399862 | import boto3
import json
import logging
import os
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def handler(event, context):
client = boto3.client('ec2')
regions = client.describe_regions()
for region in regions['Regions']:
ec2_client = boto3.client('ec2', region_name=region... | 0 | 0 | 0 | 0 | 0 | 2,773 | 0 | -31 | 89 |
39869b293ee78812692ef8612d361826ac2281dd | 5,815 | py | Python | papers/BLS/BLSBasic/BLS.py | mindspore-ai/contrib | 85dccac7a2ba6e962092ecd51aefd962d7f2aeac | [
"Apache-2.0"
] | 2 | 2021-11-10T06:16:55.000Z | 2022-02-22T11:30:04.000Z | papers/BLS/BLSBasic/BLS.py | mindspore-ai/contrib | 85dccac7a2ba6e962092ecd51aefd962d7f2aeac | [
"Apache-2.0"
] | null | null | null | papers/BLS/BLSBasic/BLS.py | mindspore-ai/contrib | 85dccac7a2ba6e962092ecd51aefd962d7f2aeac | [
"Apache-2.0"
] | 1 | 2022-03-22T06:03:15.000Z | 2022-03-22T06:03:15.000Z | import mindspore.context as context
import mindspore.ops as ops
| 44.389313 | 115 | 0.692863 | import numpy
import numpy as np
from mindspore import Tensor, dtype
from mindspore.train.serialization import export, save_checkpoint
import mindspore.dataset as ds
import mindspore.context as context
import mindspore.ops as ops
import mindspore.nn as N
import mindspore.numpy as mnp
class BLSBasicTrain(N.Cell):
d... | 261 | 0 | 0 | 5,420 | 0 | 0 | 0 | 66 | 177 |
ced8f7377ff6afeb026e4db4b64351647f6b9de4 | 8,333 | py | Python | tests/zquantum/core/wip/circuits/_gates_test.py | bartubisgin/z-quantum-core | b61aef12cc86f0a8234229b9b26b21cde950d6f1 | [
"Apache-2.0"
] | null | null | null | tests/zquantum/core/wip/circuits/_gates_test.py | bartubisgin/z-quantum-core | b61aef12cc86f0a8234229b9b26b21cde950d6f1 | [
"Apache-2.0"
] | null | null | null | tests/zquantum/core/wip/circuits/_gates_test.py | bartubisgin/z-quantum-core | b61aef12cc86f0a8234229b9b26b21cde950d6f1 | [
"Apache-2.0"
] | 1 | 2022-03-19T02:23:53.000Z | 2022-03-19T02:23:53.000Z | """Test cases for _gates module."""
import sympy
from zquantum.core.wip.circuits import _builtin_gates
GATES_REPRESENTATIVES = [
_builtin_gates.X,
_builtin_gates.Y,
_builtin_gates.Z,
_builtin_gates.T,
_builtin_gates.H,
_builtin_gates.I,
_builtin_gates.RX(sympy.Symbol("theta")),
_builtin... | 37.200893 | 88 | 0.677667 | """Test cases for _gates module."""
from unittest.mock import Mock
import pytest
import sympy
from zquantum.core.wip.circuits import _builtin_gates
from zquantum.core.wip.circuits._gates import GateOperation, MatrixFactoryGate
GATES_REPRESENTATIVES = [
_builtin_gates.X,
_builtin_gates.Y,
_builtin_gates.Z,... | 0 | 3,628 | 0 | 3,604 | 0 | 171 | 0 | 58 | 182 |
5a4509ded52d8b17265869fdb30826814374cffa | 2,138 | py | Python | 8-puzzle-game/manhattan.py | itepifanio/jogo-dos-8-numeros | 692b84f9b48fef5d8da9afba67adb1a1f9c13b28 | [
"MIT"
] | null | null | null | 8-puzzle-game/manhattan.py | itepifanio/jogo-dos-8-numeros | 692b84f9b48fef5d8da9afba67adb1a1f9c13b28 | [
"MIT"
] | null | null | null | 8-puzzle-game/manhattan.py | itepifanio/jogo-dos-8-numeros | 692b84f9b48fef5d8da9afba67adb1a1f9c13b28 | [
"MIT"
] | null | null | null | import time
if __name__ == '__main__':
algorithm = Manhanttan()
algorithm.run()
| 30.542857 | 89 | 0.563143 | from game.game import Game
from heapq import heappush, heappop
import time
import itertools
import time
class Manhanttan(Game):
def heuristic(self, a):
result = 0
node = list(itertools.chain(*a))
for current, target in enumerate(node):
currentRow = int(current/3)
c... | 0 | 0 | 0 | 1,925 | 0 | 0 | 0 | 4 | 115 |
8747cd2d839a44ad5113082afaedeed9aa0cc8f8 | 9,839 | py | Python | benchmark_utils.py | neyudin/AcceleratedGNMethodEquations | b5606f98221d72ff3e9ebb8ce0709981db08cefd | [
"BSD-3-Clause"
] | null | null | null | benchmark_utils.py | neyudin/AcceleratedGNMethodEquations | b5606f98221d72ff3e9ebb8ce0709981db08cefd | [
"BSD-3-Clause"
] | null | null | null | benchmark_utils.py | neyudin/AcceleratedGNMethodEquations | b5606f98221d72ff3e9ebb8ce0709981db08cefd | [
"BSD-3-Clause"
] | null | null | null | import gc
import time
def experiment_runner(args, x_0_dict):
"""
Runner routine which performs the whole experiment set.
Parameters
----------
args : populated namespace object from ArgumentParser
The system of equations evaluated at point x.
x_0_dict : dict
The dictionary of i... | 53.472826 | 195 | 0.476979 | from optimizers import *
import gc
import time
def experiment_runner(args, x_0_dict):
"""
Runner routine which performs the whole experiment set.
Parameters
----------
args : populated namespace object from ArgumentParser
The system of equations evaluated at point x.
x_0_dict : dict
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 22 |
51311d98800bb3f9984f334fadd5802ed4789387 | 509 | py | Python | docs/components_page/components/button/usage.py | glsdown/dash-bootstrap-components | 0ebea4f7de43975f6e3a2958359c4480ae1d4927 | [
"Apache-2.0"
] | 776 | 2019-02-07T19:36:59.000Z | 2022-03-31T05:53:04.000Z | docs/components_page/components/button/usage.py | glsdown/dash-bootstrap-components | 0ebea4f7de43975f6e3a2958359c4480ae1d4927 | [
"Apache-2.0"
] | 350 | 2019-02-05T10:42:19.000Z | 2022-03-31T19:23:35.000Z | docs/components_page/components/button/usage.py | glsdown/dash-bootstrap-components | 0ebea4f7de43975f6e3a2958359c4480ae1d4927 | [
"Apache-2.0"
] | 219 | 2019-02-10T13:46:25.000Z | 2022-03-23T17:03:39.000Z | import dash_bootstrap_components as dbc
from dash import html
button = html.Div(
[
dbc.Button(
"Click me", id="example-button", className="me-2", n_clicks=0
),
html.Span(id="example-output", style={"verticalAlign": "middle"}),
]
)
| 23.136364 | 79 | 0.607073 | import dash_bootstrap_components as dbc
from dash import Input, Output, html
button = html.Div(
[
dbc.Button(
"Click me", id="example-button", className="me-2", n_clicks=0
),
html.Span(id="example-output", style={"verticalAlign": "middle"}),
]
)
@app.callback(
Output("... | 0 | 194 | 0 | 0 | 0 | 0 | 0 | 15 | 23 |
4fef830c6935b201ebe3270607f09b48471f7f26 | 4,094 | py | Python | python/functions/calculateInterest.py | Z88897050/emulateSamples | 57a519422e0e15aadc301470ac6a8397848d93c3 | [
"Apache-2.0"
] | null | null | null | python/functions/calculateInterest.py | Z88897050/emulateSamples | 57a519422e0e15aadc301470ac6a8397848d93c3 | [
"Apache-2.0"
] | 1 | 2021-09-21T14:38:33.000Z | 2021-09-21T14:38:33.000Z | python/functions/calculateInterest.py | Z88897050/emulateSamples | 57a519422e0e15aadc301470ac6a8397848d93c3 | [
"Apache-2.0"
] | 1 | 2019-05-17T11:31:47.000Z | 2019-05-17T11:31:47.000Z | #
area = float(input('(m^2): '))
unit_price = float(input('(): '))
year_interest = float(input('(%): '))
# '''
#
# 1,5700.79()
# 2,5691.69()
# 3,5682.59()
# 4,5673.5()
# ......
#
# '''
#
#
# #
# def get_average_capital():
# file_path = input(': ')
# average_capital_data = []
# file_object = open(file_... | 27.662162 | 118 | 0.610405 | # 等额本金和等额本息贷款计算
import math
area = float(input('请输入房屋面积(m^2): '))
unit_price = float(input('请输入单价(元): '))
year_interest = float(input('请输入贷款利率(%): '))
# '''
# 等额本金的每月还款情况文件,格式如下:
# 1月,5700.79(元)
# 2月,5691.69(元)
# 3月,5682.59(元)
# 4月,5673.5(元)
# ......
#
# '''
#
#
# # 读取文件内容,即每个月的还款数据
# def get_average_capital():
# ... | 2,007 | 0 | 0 | 0 | 0 | 789 | 0 | -10 | 91 |
10f7ff6712dc6b5dcc4a16b9b8b4446dac1019fe | 4,949 | py | Python | cmsplugin_blog_categories/migrations/0001_initial.py | bitmazk/cmsplugin-blog-categories | 05e2fa3d50a8501f3f3f9cab784269838079cc37 | [
"MIT"
] | null | null | null | cmsplugin_blog_categories/migrations/0001_initial.py | bitmazk/cmsplugin-blog-categories | 05e2fa3d50a8501f3f3f9cab784269838079cc37 | [
"MIT"
] | 3 | 2020-02-11T22:01:45.000Z | 2021-06-10T17:38:13.000Z | cmsplugin_blog_categories/migrations/0001_initial.py | bitmazk/cmsplugin-blog-categories | 05e2fa3d50a8501f3f3f9cab784269838079cc37 | [
"MIT"
] | null | null | null | # flake8: noqa
# -*- coding: utf-8 -*-
| 53.793478 | 137 | 0.62255 | # flake8: noqa
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Category'
db.create_table('cmsplugin_blog_categories_category', (
... | 0 | 0 | 0 | 4,780 | 0 | 0 | 0 | 18 | 111 |
715bfc9c37739cc5dc1ee47ee653d0ae23d340ef | 5,326 | py | Python | src/analyze/track/analyze_race.py | kishorekolli/deep_racer_guru | 0a0a56103f395f958e8177ee0bd5ae1481f93d98 | [
"MIT"
] | 9 | 2020-07-31T03:04:24.000Z | 2021-11-02T13:44:11.000Z | src/analyze/track/analyze_race.py | kishorekolli/deep_racer_guru | 0a0a56103f395f958e8177ee0bd5ae1481f93d98 | [
"MIT"
] | 137 | 2020-08-04T08:04:11.000Z | 2021-11-10T10:35:58.000Z | src/analyze/track/analyze_race.py | kishorekolli/deep_racer_guru | 0a0a56103f395f958e8177ee0bd5ae1481f93d98 | [
"MIT"
] | 11 | 2020-06-24T23:38:38.000Z | 2021-11-02T14:42:31.000Z | #
# DeepRacer Guru
#
# Version 3.0 onwards
#
# Copyright (c) 2021 dmh23
#
import src.utils.geometry as geometry
| 37.507042 | 111 | 0.665039 | #
# DeepRacer Guru
#
# Version 3.0 onwards
#
# Copyright (c) 2021 dmh23
#
import threading
import time
import src.utils.geometry as geometry
import tkinter as tk
from src.analyze.track.track_analyzer import TrackAnalyzer
from src.episode.episode import Episode
from src.graphics.track_graphics import TrackGraphics
f... | 0 | 0 | 0 | 4,849 | 0 | 0 | 0 | 161 | 203 |
f0e86e901437c0295d3035b8e8488571c49c3943 | 1,821 | py | Python | algospot/lec11/[cutz]gamecover.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | 3 | 2019-11-26T14:31:01.000Z | 2020-01-10T18:19:46.000Z | algospot/lec11/[cutz]gamecover.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | null | null | null | algospot/lec11/[cutz]gamecover.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | null | null | null |
cover = [[[0, 0], [1, 0], [0, 1]],
[[0, 0], [0, 1], [1, 1]],
[[0, 0], [1, 0], [1, 1]],
[[0, 0], [1, 0], [1, -1]]]
#rl = lambda: sys.stdin.readline()
rl = input
C = int(rl())
for _ in range(C):
H, W = map(int, rl().split())
block_list = []
white, black = ... | 21.939759 | 62 | 0.409665 | import sys
cover = [[[0, 0], [1, 0], [0, 1]],
[[0, 0], [0, 1], [1, 1]],
[[0, 0], [1, 0], [1, 1]],
[[0, 0], [1, 0], [1, -1]]]
def set_block(board, y, x, cover_type, delta):
# delta 1 --> cover // -1 --> clear
ok = True
for i in range(3):
new_x = x + cover[cover_type]... | 93 | 0 | 0 | 0 | 0 | 933 | 0 | -11 | 68 |
64c67a4ed2acbb4051af77291436c1f297af4078 | 1,167 | py | Python | cmsplugin_soundcloud/cms_plugins.py | misli/cmsplugin-soundcloud | d50e6fd1fd95916eb5a396fd9a437483d96626b3 | [
"BSD-3-Clause"
] | null | null | null | cmsplugin_soundcloud/cms_plugins.py | misli/cmsplugin-soundcloud | d50e6fd1fd95916eb5a396fd9a437483d96626b3 | [
"BSD-3-Clause"
] | 1 | 2021-05-13T15:23:09.000Z | 2021-06-29T09:25:36.000Z | cmsplugin_soundcloud/cms_plugins.py | misli/cmsplugin-soundcloud | d50e6fd1fd95916eb5a396fd9a437483d96626b3 | [
"BSD-3-Clause"
] | 1 | 2017-06-01T15:46:46.000Z | 2017-06-01T15:46:46.000Z | from cms.plugin_pool import plugin_pool
from django.conf import settings
# use CMSPLUGIN_SOUNDCLOUD_PARAMS to override PARAMS
PARAMS = getattr(settings, 'CMSPLUGIN_SOUNDCLOUD_PARAMS',
'width="100%" height="166" scrolling="no" frameborder="no"')
plugin_pool.register_plugin(SoundCloudPlugin)
| 30.710526 | 78 | 0.709512 | from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from .models import SoundCloud, COLORS
from django.conf import settings
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
# use CMSPLUGIN_SOUNDCLOUD_PARAMS to override PARAMS
PARAMS = geta... | 0 | 0 | 0 | 651 | 0 | 0 | 0 | 90 | 112 |
43cbe788101c59dea633374ac2936b60b77131a3 | 408 | py | Python | 1/find_inimum_in_rotated_sorted_array.py | IronCore864/leetcode | a62a4cdde9814ae48997176debcaad537f7ad01f | [
"Apache-2.0"
] | 4 | 2018-03-07T02:56:03.000Z | 2021-06-15T05:43:31.000Z | 1/find_inimum_in_rotated_sorted_array.py | IronCore864/leetcode | a62a4cdde9814ae48997176debcaad537f7ad01f | [
"Apache-2.0"
] | null | null | null | 1/find_inimum_in_rotated_sorted_array.py | IronCore864/leetcode | a62a4cdde9814ae48997176debcaad537f7ad01f | [
"Apache-2.0"
] | 1 | 2021-09-02T12:05:15.000Z | 2021-09-02T12:05:15.000Z |
s = Solution()
print s.findMin([4, 5, 5, 6, 7, 0, 1, 2, 2, 2])
| 20.4 | 47 | 0.360294 | class Solution(object):
def findMin(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
i = 0
j = len(nums) - 1
while i < j:
m = i + (j - i) / 2
if nums[m] > nums[j]:
i = m + 1
else:
j = m
... | 0 | 0 | 0 | 321 | 0 | 0 | 0 | 0 | 22 |
e965a8d33c910c1887e79ac768c1271d3fda827c | 3,711 | py | Python | qiling/qiling/os/posix/syscall/fcntl.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:01.000Z | 2021-06-04T14:27:15.000Z | qiling/qiling/os/posix/syscall/fcntl.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | null | null | null | qiling/qiling/os/posix/syscall/fcntl.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:09.000Z | 2021-06-04T14:27:21.000Z | #!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
#
| 27.488889 | 118 | 0.61924 | #!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
#
from qiling.const import *
from qiling.os.linux.thread import *
from qiling.const import *
from qiling.os.posix.filestruct import *
from qiling.os.filestruct import *
from qiling.os.posix.const_mapping import *
from... | 0 | 0 | 0 | 0 | 0 | 3,245 | 0 | 88 | 270 |
4e431cabe02f617dd38da093c80ad9c5404af08a | 2,904 | py | Python | test/unit/mysql_rep_admin/add_miss_slaves.py | mjpernot/mysql-rep-admin | 08b8f5daf28bc3e462bd72968842f2c44161c084 | [
"MIT"
] | null | null | null | test/unit/mysql_rep_admin/add_miss_slaves.py | mjpernot/mysql-rep-admin | 08b8f5daf28bc3e462bd72968842f2c44161c084 | [
"MIT"
] | null | null | null | test/unit/mysql_rep_admin/add_miss_slaves.py | mjpernot/mysql-rep-admin | 08b8f5daf28bc3e462bd72968842f2c44161c084 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Classification (U)
"""Program: add_miss_slaves.py
Description: Unit testing of add_miss_slaves in mysql_rep_admin.py.
Usage:
test/unit/mysql_rep_admin/add_miss_slaves.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info ... | 20.892086 | 75 | 0.539945 | #!/usr/bin/python
# Classification (U)
"""Program: add_miss_slaves.py
Description: Unit testing of add_miss_slaves in mysql_rep_admin.py.
Usage:
test/unit/mysql_rep_admin/add_miss_slaves.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info ... | 0 | 0 | 0 | 2,292 | 0 | 0 | 0 | 1 | 68 |
99017e06c8585e5388a22a35b7a3f448afce5ddd | 9,116 | py | Python | SUnCNN_DC2.py | BehnoodRasti/SUnCNN | f19245cd7fc0e142bfc66c9a809444d22ed7da36 | [
"Apache-2.0"
] | 3 | 2021-11-17T09:34:15.000Z | 2022-03-26T11:51:48.000Z | SUnCNN_DC2.py | BehnoodRasti/SUnCNN | f19245cd7fc0e142bfc66c9a809444d22ed7da36 | [
"Apache-2.0"
] | null | null | null | SUnCNN_DC2.py | BehnoodRasti/SUnCNN | f19245cd7fc0e142bfc66c9a809444d22ed7da36 | [
"Apache-2.0"
] | 2 | 2022-02-24T12:41:02.000Z | 2022-03-30T12:26:21.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 4 17:53:50 2020
@author: behnood
"""
from __future__ import print_function
#%matplotlib inline
#os.environ['CUDA_VISIBLE_DEVICES'] = '3'
import numpy as np
import torch
import torch.optim
from numpy import linalg as LA
torch.backends.cudnn.enabled ... | 41.625571 | 213 | 0.554739 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 4 17:53:50 2020
@author: behnood
"""
from __future__ import print_function
import matplotlib.pyplot as plt
#%matplotlib inline
import os
#os.environ['CUDA_VISIBLE_DEVICES'] = '3'
import numpy as np
from models import *
import torch
import torch.opti... | 0 | 0 | 0 | 1,055 | 0 | 3,057 | 0 | 140 | 369 |
75b9590a65adb6b1e657e5a4109bd8c90e601615 | 379 | py | Python | Curso de Python/numeros_primos.py | Cazcode/Curso_python | cbaaedacec8801da2d62da4c3aadce052f04bd64 | [
"MIT"
] | null | null | null | Curso de Python/numeros_primos.py | Cazcode/Curso_python | cbaaedacec8801da2d62da4c3aadce052f04bd64 | [
"MIT"
] | null | null | null | Curso de Python/numeros_primos.py | Cazcode/Curso_python | cbaaedacec8801da2d62da4c3aadce052f04bd64 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
run() | 18.047619 | 46 | 0.522427 | def es_primo(number):
if number < 2 or number % 2 == 0:
return False
for i in range(3, number):
if number % i == 0:
return False
return True
def run():
number = int(input('Ingrese un número: '))
if es_primo(number):
print('Es Primo')
else:
... | 2 | 0 | 0 | 0 | 0 | 294 | 0 | 0 | 45 |
813f1d0c8d016d91369c44e1d9a6e6b88e01a527 | 23,140 | py | Python | fdc/fdc.py | alexandreday/Fast_Density_Clustering | 91e7ee0ccf2b297b40747823302a21cd70d59dc9 | [
"BSD-3-Clause"
] | 7 | 2019-11-02T02:07:17.000Z | 2022-01-25T10:50:09.000Z | fdc/fdc.py | alexandreday/Fast_Density_Clustering | 91e7ee0ccf2b297b40747823302a21cd70d59dc9 | [
"BSD-3-Clause"
] | 1 | 2021-09-21T16:47:37.000Z | 2022-01-30T00:58:11.000Z | fdc/fdc.py | alexandreday/Fast_Density_Clustering | 91e7ee0ccf2b297b40747823302a21cd70d59dc9 | [
"BSD-3-Clause"
] | 7 | 2017-12-05T03:18:08.000Z | 2021-12-20T19:10:49.000Z | '''
Created : Jan 16, 2017
Last major update : June 29, 2017
@author: Alexandre Day
Purpose:
Fast density clustering
'''
import numpy as np
import sys, os
#####################################################
#####################################################
############ utility functions below ###... | 34.485842 | 158 | 0.591357 | '''
Created : Jan 16, 2017
Last major update : June 29, 2017
@author: Alexandre Day
Purpose:
Fast density clustering
'''
import numpy as np
import time
from numpy.random import random
import sys, os
from .density_estimation import KDE
import pickle
from collections import OrderedDict as OD
from sklearn.... | 0 | 0 | 0 | 18,788 | 0 | 321 | 0 | 52 | 204 |
f3302cd3e06d5ffb2be99f117180800962602ad7 | 1,021 | py | Python | src/start_stop_timer.py | MarioMey/OBS-Studio-Python-Scripting-Cheatsheet-obspython-Examples-of-API | 7f1f2a00c2731c558f6b9fd75edb697fc0719a7c | [
"MIT"
] | 4 | 2021-03-23T05:25:24.000Z | 2021-12-29T16:46:01.000Z | src/start_stop_timer.py | MarioMey/OBS-Studio-Python-Scripting-Cheatsheet-obspython-Examples-of-API | 7f1f2a00c2731c558f6b9fd75edb697fc0719a7c | [
"MIT"
] | null | null | null | src/start_stop_timer.py | MarioMey/OBS-Studio-Python-Scripting-Cheatsheet-obspython-Examples-of-API | 7f1f2a00c2731c558f6b9fd75edb697fc0719a7c | [
"MIT"
] | null | null | null |
FLAG = True
INTERVAL = 100
eg = Example() # class created ,obs part starts
| 22.688889 | 76 | 0.624878 | import obspython as obs
from random import choices
FLAG = True
INTERVAL = 100
class Example:
def __init__(self):
self.lock = True
def random_numbers(self):
print(choices(range(1,10),k=3))
def ticker(self):
""" how fast update.One callback at time with lock"""
... | 0 | 0 | 0 | 334 | 0 | 441 | 0 | 7 | 146 |
6f8866f4896b6cf29e177021809a4addfceb41c6 | 3,582 | py | Python | esp32/sensor_identifikation/ntc.py | phofmeier/wifi_temp_sensor | 93ebc466b6913842cac6eb9385272c79651d2479 | [
"MIT"
] | null | null | null | esp32/sensor_identifikation/ntc.py | phofmeier/wifi_temp_sensor | 93ebc466b6913842cac6eb9385272c79651d2479 | [
"MIT"
] | null | null | null | esp32/sensor_identifikation/ntc.py | phofmeier/wifi_temp_sensor | 93ebc466b6913842cac6eb9385272c79651d2479 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import casadi as cas
# define functions
# Check if Sensor is a NTC and find out the Resistance
R_measured = [103e3, 120e3, 70e3, 15.2e3]
T_measured_C = [25, 20, 33, 74]
R_N = 103e3
T_N = 298.15
U_ges = 3.3
T_range_C = [0, 200]
# Kelvin from Temp
T_range = [i + 2... | 27.343511 | 255 | 0.650475 | import numpy as np
import matplotlib.pyplot as plt
import casadi as cas
# define functions
def R_ntc(R_N, B, T, T_N):
return R_N * np.exp(B*(1/T-1/T_N))
def U_meas(U_ges, R_1, R_2):
return U_ges/(R_1+R_2) * R_2
def Temp(U_meas, R_1, U_ges, B, R_N, T_N):
R_NTC = U_meas * R_1 / (U_ges - U_meas)
T_kelv... | 0 | 0 | 0 | 0 | 0 | 327 | 0 | 0 | 91 |
11b074486878ba17beb24bb3f56ff683fc015de8 | 2,698 | py | Python | tools/diff_filter.py | caizhanjin/deepseg | 5e91a387683ad73075b51b49da8957d8f4bb6b7f | [
"Apache-2.0"
] | null | null | null | tools/diff_filter.py | caizhanjin/deepseg | 5e91a387683ad73075b51b49da8957d8f4bb6b7f | [
"Apache-2.0"
] | null | null | null | tools/diff_filter.py | caizhanjin/deepseg | 5e91a387683ad73075b51b49da8957d8f4bb6b7f | [
"Apache-2.0"
] | null | null | null |
if __name__ == "__main__":
filters = [SingleChineseFilter()]
diff_file = "C:\\Users\\allen.luo\\Desktop\\diff_filter\\test.diff.txt"
differ = DiffFilter(diff_file)
differ.filter(filters)
| 32.506024 | 92 | 0.490734 | import os
import re
class Filter(object):
def accept(self, line):
raise NotImplementedError()
class SingleChineseFilter(Filter):
def __init__(self):
self.pattern = re.compile("[\u4e00-\u9fa5]+")
self.key_words = ['号', '层', '幢', '与', '栋', '旁', '室', '楼']
def accept(self, line):
... | 24 | 0 | 0 | 2,393 | 0 | 0 | 0 | -24 | 113 |
8b67b98d8ea2d3b839bcd5bef3e02df81aed5aca | 1,142 | py | Python | instances/apps.py | glzjin/webvirtcloud | ecaf11e02aeb57654257ed502d3da6fd8405f21b | [
"Apache-2.0"
] | null | null | null | instances/apps.py | glzjin/webvirtcloud | ecaf11e02aeb57654257ed502d3da6fd8405f21b | [
"Apache-2.0"
] | null | null | null | instances/apps.py | glzjin/webvirtcloud | ecaf11e02aeb57654257ed502d3da6fd8405f21b | [
"Apache-2.0"
] | null | null | null |
def migrate_can_clone_instances(sender, **kwargs):
'''
Migrate can clone instances user attribute to permission
'''
from django.contrib.auth.models import User, Permission
plan = kwargs['plan']
for migration, rolled_back in plan:
if migration.app_label == 'instances' and migration.nam... | 35.6875 | 109 | 0.683888 | from django.apps import AppConfig
from django.db.models.signals import post_migrate
def migrate_can_clone_instances(sender, **kwargs):
'''
Migrate can clone instances user attribute to permission
'''
from django.conf import settings
from django.contrib.auth.models import User, Permission
from ... | 0 | 0 | 0 | 159 | 0 | 0 | 0 | 72 | 119 |
db9b52b59816ce2444968110f44841a8d37eb201 | 9,759 | py | Python | tests/opc/test_rel.py | revvsales/python-docx-1 | 5b3ff2b828cc30f1567cb1682a8cb399143732d7 | [
"MIT"
] | 3,031 | 2015-01-02T11:11:24.000Z | 2022-03-30T00:57:17.000Z | tests/opc/test_rel.py | revvsales/python-docx-1 | 5b3ff2b828cc30f1567cb1682a8cb399143732d7 | [
"MIT"
] | 934 | 2015-01-06T20:53:56.000Z | 2022-03-28T10:08:03.000Z | tests/opc/test_rel.py | revvsales/python-docx-1 | 5b3ff2b828cc30f1567cb1682a8cb399143732d7 | [
"MIT"
] | 901 | 2015-01-07T18:22:07.000Z | 2022-03-31T18:38:51.000Z | # encoding: utf-8
"""
Unit test suite for the docx.opc.rel module
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
| 34.242105 | 77 | 0.630905 | # encoding: utf-8
"""
Unit test suite for the docx.opc.rel module
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import pytest
from docx.opc.oxml import CT_Relationships
from docx.opc.packuri import PackURI
from docx.opc.part import Part
from docx.opc.rel import _Rela... | 0 | 4,282 | 0 | 4,989 | 0 | 0 | 0 | 142 | 181 |
5d363713f0c567c72f60e40b049c1d6047d88f04 | 4,873 | py | Python | python/plugins/broker/mqtt/tests/test_params.py | ulen2000/sinetstream | efbd1688be0754c38b0ea88f0f253f91b44689be | [
"Apache-2.0"
] | 1 | 2020-03-24T15:29:23.000Z | 2020-03-24T15:29:23.000Z | python/plugins/broker/mqtt/tests/test_params.py | ulen2000/sinetstream | efbd1688be0754c38b0ea88f0f253f91b44689be | [
"Apache-2.0"
] | null | null | null | python/plugins/broker/mqtt/tests/test_params.py | ulen2000/sinetstream | efbd1688be0754c38b0ea88f0f253f91b44689be | [
"Apache-2.0"
] | null | null | null | #!/usr/local/bin/python3.6
# vim: expandtab shiftwidth=4
# Copyright (C) 2020 National Institute of Informatics
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright own... | 26.058824 | 77 | 0.682742 | #!/usr/local/bin/python3.6
# vim: expandtab shiftwidth=4
# Copyright (C) 2020 National Institute of Informatics
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright own... | 0 | 2,917 | 0 | 0 | 0 | 0 | 0 | 108 | 343 |
3d601cf4bfe04df1b7cde903f2017afd1f54a428 | 407 | py | Python | test/backup_setup.py | jinyiabc/china_stock_lib | d580b9f2a3f20ca9f87c7a4d42aeedccfa450f4f | [
"MIT"
] | null | null | null | test/backup_setup.py | jinyiabc/china_stock_lib | d580b9f2a3f20ca9f87c7a4d42aeedccfa450f4f | [
"MIT"
] | null | null | null | test/backup_setup.py | jinyiabc/china_stock_lib | d580b9f2a3f20ca9f87c7a4d42aeedccfa450f4f | [
"MIT"
] | 2 | 2021-12-30T23:53:55.000Z | 2022-02-01T18:10:42.000Z | # from distutils.core import setup
# setup(name='helper',
# version='0.1.1',
# py_modules=['upload_github'],
# data_files=[('config', ['mysql.cfg'])],
# )
# from setuptools import setup
#
# setup(
# name='mypackage',
# version='0.0.1',
# packages=['mypackage'],
# install_requir... | 22.611111 | 47 | 0.538084 | # from distutils.core import setup
# setup(name='helper',
# version='0.1.1',
# py_modules=['upload_github'],
# data_files=[('config', ['mysql.cfg'])],
# )
# from setuptools import setup
#
# setup(
# name='mypackage',
# version='0.0.1',
# packages=['mypackage'],
# install_requir... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
79225c470cde861cd7490495560ca1243733a6b2 | 4,223 | py | Python | tests/unit_tests/test_units/test_core.py | radical-project/radical.dreamer | 74bb2a9a705fc90b0dc773963f2bfd48af6e1b84 | [
"MIT"
] | 4 | 2021-04-30T04:25:12.000Z | 2021-12-16T19:53:37.000Z | tests/unit_tests/test_units/test_core.py | radical-project/radical.dreamer | 74bb2a9a705fc90b0dc773963f2bfd48af6e1b84 | [
"MIT"
] | 1 | 2021-04-20T22:08:24.000Z | 2021-04-20T22:08:24.000Z | tests/unit_tests/test_units/test_core.py | radical-project/radical.dreamer | 74bb2a9a705fc90b0dc773963f2bfd48af6e1b84 | [
"MIT"
] | 1 | 2021-01-10T20:09:19.000Z | 2021-01-10T20:09:19.000Z |
__copyright__ = 'Copyright 2021, The RADICAL-Cybertools Team'
__license__ = 'MIT'
TEST_CASES_PATH = 'tests/unit_tests/test_units/test_cases/core.*.json'
| 35.487395 | 76 | 0.600047 |
__copyright__ = 'Copyright 2021, The RADICAL-Cybertools Team'
__license__ = 'MIT'
import glob
import radical.utils as ru
from radical.dreamer.units import Core, Task, CORE_STATE
from unittest import TestCase
TEST_CASES_PATH = 'tests/unit_tests/test_units/test_cases/core.*.json'
class CoreTestClass(TestCase):
... | 0 | 142 | 0 | 3,770 | 0 | 0 | 0 | 38 | 115 |
bcf1f57f33b1cf0327c51d531ce1989a4096bd93 | 24,349 | py | Python | LivSim Processing/event.py | kbui1993/LivSim-Codes | 5317fa6ea773d5967871dfb67dec1a0118ec2f5e | [
"MIT"
] | 2 | 2018-05-07T03:31:54.000Z | 2019-07-02T18:30:41.000Z | LivSim Processing/event.py | kbui1993/LivSim-Codes | 5317fa6ea773d5967871dfb67dec1a0118ec2f5e | [
"MIT"
] | null | null | null | LivSim Processing/event.py | kbui1993/LivSim-Codes | 5317fa6ea773d5967871dfb67dec1a0118ec2f5e | [
"MIT"
] | 1 | 2019-01-19T19:56:43.000Z | 2019-01-19T19:56:43.000Z | import entity, allocate
import numpy as nump
import datetime
from copy import deepcopy
ndsa = 58
#######################################################################Event Processes####################################################################################
def Arrival(arrivalinfo, Sim, Stat, OPTN):
"""
... | 51.153361 | 213 | 0.611278 | import entity, allocate
import numpy as nump
import datetime
from copy import deepcopy
ndsa = 58
#######################################################################Event Processes####################################################################################
def Arrival(arrivalinfo, Sim, Stat, OPTN):
"""
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
89b6a5aacdae170197bc3ceae867aa296d074173 | 594 | py | Python | Algorithms/Searching & Sorting/Counting Sort/counting_sort.py | sol4ik/interview-techdev-guide | 2f1c755df3f34125850a2d6322edc24dc097c1fb | [
"MIT"
] | null | null | null | Algorithms/Searching & Sorting/Counting Sort/counting_sort.py | sol4ik/interview-techdev-guide | 2f1c755df3f34125850a2d6322edc24dc097c1fb | [
"MIT"
] | null | null | null | Algorithms/Searching & Sorting/Counting Sort/counting_sort.py | sol4ik/interview-techdev-guide | 2f1c755df3f34125850a2d6322edc24dc097c1fb | [
"MIT"
] | null | null | null | def countSort(array):
"""
Counting Sort algorithm implementation on Python.
:param array: array that need to be sorted
:return: resulting sorted array
"""
output = [0 for i in range(256)]
count = [0 for i in range(256)]
result = ["" for element in array]
for i in array:
resul... | 29.7 | 53 | 0.574074 | def countSort(array):
"""
Counting Sort algorithm implementation on Python.
:param array: array that need to be sorted
:return: resulting sorted array
"""
output = [0 for i in range(256)]
count = [0 for i in range(256)]
result = ["" for element in array]
for i in array:
resul... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
159c632f19d51c0cb382b2c9ba57cbb71f415051 | 96 | py | Python | samtranslator/public/models.py | eugeniosu/serverless-application-model | d93e15232a1921fa51667389d83aeabbf1ff72d3 | [
"Apache-2.0"
] | 6 | 2019-03-29T02:56:59.000Z | 2021-03-28T22:07:02.000Z | samtranslator/public/models.py | eugeniosu/serverless-application-model | d93e15232a1921fa51667389d83aeabbf1ff72d3 | [
"Apache-2.0"
] | 18 | 2019-10-09T23:27:48.000Z | 2021-06-25T15:18:24.000Z | samtranslator/public/models.py | Mattlk13/serverless-application-model | 27b5934de46c42d47ba1484d5432310cac694b25 | [
"Apache-2.0"
] | 15 | 2019-05-27T01:04:30.000Z | 2021-10-01T05:54:45.000Z | # flake8: noqa
| 24 | 79 | 0.854167 | # flake8: noqa
from samtranslator.model.function_policies import FunctionPolicies, PolicyTypes
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 58 | 23 |
43c0f69870ce566bd19cef135e12fb3a3b95c79c | 32,952 | py | Python | src/shared_gui.py | NicholasPSnow/99-CapstoneProject-201920 | ca3baa3b3c53ae6c5af70cd93b3af450a1da41ad | [
"MIT"
] | null | null | null | src/shared_gui.py | NicholasPSnow/99-CapstoneProject-201920 | ca3baa3b3c53ae6c5af70cd93b3af450a1da41ad | [
"MIT"
] | null | null | null | src/shared_gui.py | NicholasPSnow/99-CapstoneProject-201920 | ca3baa3b3c53ae6c5af70cd93b3af450a1da41ad | [
"MIT"
] | null | null | null | """
Capstone Project. Code to run on a LAPTOP (NOT the robot).
Constructs and returns Frame objects for the basics:
-- teleoperation
-- arm movement
-- stopping the robot program
This code is SHARED by all team members. It contains both:
-- High-level, general-purpose methods for a Snatch3r EV3 robot... | 41.711392 | 160 | 0.689306 | """
Capstone Project. Code to run on a LAPTOP (NOT the robot).
Constructs and returns Frame objects for the basics:
-- teleoperation
-- arm movement
-- stopping the robot program
This code is SHARED by all team members. It contains both:
-- High-level, general-purpose methods for a Snatch3r EV3 robot... | 0 | 0 | 0 | 0 | 0 | 3,703 | 0 | -10 | 474 |
1825f4b23a74762f04636ac05fc56fa9252aa0dc | 1,765 | py | Python | segmentation_models/encoders/__init__.py | jmerkow/segmentation_models.pytorch | d33fb5ea4a66da1ed0006eaca4dbfa88aa986925 | [
"MIT"
] | null | null | null | segmentation_models/encoders/__init__.py | jmerkow/segmentation_models.pytorch | d33fb5ea4a66da1ed0006eaca4dbfa88aa986925 | [
"MIT"
] | null | null | null | segmentation_models/encoders/__init__.py | jmerkow/segmentation_models.pytorch | d33fb5ea4a66da1ed0006eaca4dbfa88aa986925 | [
"MIT"
] | 2 | 2019-07-25T16:52:29.000Z | 2019-08-19T17:44:46.000Z |
import torch.utils.model_zoo as model_zoo
from .densenet import densenet_encoders
from .dpn import dpn_encoders
from .efficientnet import efficientnet_encoders
from .inceptionresnetv2 import inception_encoders
from .resnet import resnet_encoders
from .senet import senet_encoders
from .vgg import vgg_encoders
from .xce... | 32.685185 | 116 | 0.782436 | import functools
import torch.utils.model_zoo as model_zoo
from ._preprocessing import preprocess_input
from .densenet import densenet_encoders
from .dpn import dpn_encoders
from .efficientnet import efficientnet_encoders
from .inceptionresnetv2 import inception_encoders
from .resnet import resnet_encoders
from .sene... | 0 | 0 | 0 | 0 | 0 | 994 | 0 | 18 | 114 |
eebfc13ced21d7e77e7aebf9405251558b6a72e0 | 284 | py | Python | exercicios/vestibular.py | IgoPereiraBarros/maratona-data-science-brasil | cc07476579134a2764f00d229d415657555dcdd1 | [
"MIT"
] | null | null | null | exercicios/vestibular.py | IgoPereiraBarros/maratona-data-science-brasil | cc07476579134a2764f00d229d415657555dcdd1 | [
"MIT"
] | null | null | null | exercicios/vestibular.py | IgoPereiraBarros/maratona-data-science-brasil | cc07476579134a2764f00d229d415657555dcdd1 | [
"MIT"
] | null | null | null | N = int(input())
gabarito_prova = input().split()
gabarito_aluno = input().split()
list_aluno = []
list_prova = []
count = 0
for i in range(gabarito_aluno):
for j in range(gabarito_prova):
if gabarito_aluno[i] == gabarito_prova[j]:
count += 1
print(count)
| 17.75 | 50 | 0.637324 | N = int(input())
gabarito_prova = input().split()
gabarito_aluno = input().split()
list_aluno = []
list_prova = []
count = 0
for i in range(gabarito_aluno):
for j in range(gabarito_prova):
if gabarito_aluno[i] == gabarito_prova[j]:
count += 1
print(count)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
616305a77276e725923fc24a8acb3ff30c156348 | 194 | py | Python | apps/contact/urls.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 32 | 2017-02-22T13:38:38.000Z | 2022-03-31T23:29:54.000Z | apps/contact/urls.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 694 | 2017-02-15T23:09:52.000Z | 2022-03-31T23:16:07.000Z | apps/contact/urls.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 35 | 2017-09-02T21:13:09.000Z | 2022-02-21T11:30:30.000Z | from django.conf.urls import url
from apps.contact import views
urlpatterns = [
url(r"^$", views.index, name="contact_index"),
url(r"^submit/", views.contact_submit, name="submit"),
]
| 21.555556 | 58 | 0.690722 | from django.conf.urls import url
from apps.contact import views
urlpatterns = [
url(r"^$", views.index, name="contact_index"),
url(r"^submit/", views.contact_submit, name="submit"),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
60b9f934da6221160ed9c0661e0ab963f52e38f1 | 2,993 | py | Python | src/plugins/nonebot_plugin_picsearcher/iqdb.py | ltyec/Kiba | 1c7db0939151aaa46ef865638b8b347ceebb71a1 | [
"MIT"
] | null | null | null | src/plugins/nonebot_plugin_picsearcher/iqdb.py | ltyec/Kiba | 1c7db0939151aaa46ef865638b8b347ceebb71a1 | [
"MIT"
] | null | null | null | src/plugins/nonebot_plugin_picsearcher/iqdb.py | ltyec/Kiba | 1c7db0939151aaa46ef865638b8b347ceebb71a1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
headers = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'zh-CN,zh;q=0.9', 'Cache-Control': 'max-age=0',
'Connection': 'keep-alive',
... | 37.4125 | 141 | 0.625459 | # -*- coding: utf-8 -*-
import asyncio
from typing import List, Tuple
import io
from urllib.parse import urljoin
from lxml.html import fromstring
import aiohttp
from nonebot.adapters.cqhttp import MessageSegment
from .formdata import FormData
headers = {
'Accept': 'text/html,application/xhtml+xml,application/xml... | 147 | 0 | 1,238 | 0 | 626 | 0 | 0 | 43 | 247 |
4cecb8040d2df98220d60255b7529141552cd38a | 2,703 | py | Python | explorer/api/inner_api.py | AthenaExplorer/xm_s_explorer_v2 | 203f7b5d129552f5b7c977c4247d2060956f8add | [
"MIT"
] | null | null | null | explorer/api/inner_api.py | AthenaExplorer/xm_s_explorer_v2 | 203f7b5d129552f5b7c977c4247d2060956f8add | [
"MIT"
] | null | null | null | explorer/api/inner_api.py | AthenaExplorer/xm_s_explorer_v2 | 203f7b5d129552f5b7c977c4247d2060956f8add | [
"MIT"
] | 1 | 2022-03-02T19:20:52.000Z | 2022-03-02T19:20:52.000Z | import datetime
from flask import request
from explorer.services.message import MessageService
from explorer.services.miner import MinerService
from explorer.services.wallets import WalletsService
from explorer.services.blocks import BlocksService
from base.utils.fil import datetime_to_height
from base.response import ... | 25.027778 | 92 | 0.699593 | import datetime
from flask import request
from explorer.services.message import MessageService
from explorer.services.miner import MinerService
from explorer.services.wallets import WalletsService
from explorer.services.blocks import BlocksService
from base.utils.fil import datetime_to_height
from base.response import ... | 267 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d2832ef568cd65320be37ac0297b38c2de6deae9 | 3,743 | py | Python | starter_code/student_utils.py | ykhiari/Patient-Selection-for-Diabetes-Drug-Testing | ce8e698bff4cbf5a9319607404edada539c5c099 | [
"MIT"
] | null | null | null | starter_code/student_utils.py | ykhiari/Patient-Selection-for-Diabetes-Drug-Testing | ce8e698bff4cbf5a9319607404edada539c5c099 | [
"MIT"
] | null | null | null | starter_code/student_utils.py | ykhiari/Patient-Selection-for-Diabetes-Drug-Testing | ce8e698bff4cbf5a9319607404edada539c5c099 | [
"MIT"
] | null | null | null | import numpy as np
import os
import tensorflow as tf
from functools import partial
####### STUDENTS FILL THIS OUT ######
#Question 3
def reduce_dimension_ndc(df, ndc_code_df):
'''
df: pandas dataframe, input dataset
ndc_df: pandas dataframe, drug code dataset used for mapping in generic names
return:
... | 36.339806 | 111 | 0.678333 | import pandas as pd
import numpy as np
import os
import tensorflow as tf
from functools import partial
####### STUDENTS FILL THIS OUT ######
#Question 3
def reduce_dimension_ndc(df, ndc_code_df):
'''
df: pandas dataframe, input dataset
ndc_df: pandas dataframe, drug code dataset used for mapping in generic... | 0 | 0 | 0 | 0 | 0 | 65 | 0 | -2 | 44 |
455bb28e06d1af0c76eed9c4216798bb512e32a8 | 1,115 | py | Python | snake.py | junio-firmino/snake_game | fd78695406a55d057c2db54a126f46d552e77865 | [
"MIT"
] | null | null | null | snake.py | junio-firmino/snake_game | fd78695406a55d057c2db54a126f46d552e77865 | [
"MIT"
] | null | null | null | snake.py | junio-firmino/snake_game | fd78695406a55d057c2db54a126f46d552e77865 | [
"MIT"
] | null | null | null | from turtle import Screen
import time
from food import Food
from snake_shape import Snake
from snake_scoreboard import Scoreboard
screen = Screen()
screen.setup(width=600, height=600)
screen.bgcolor('black')
screen.title('My snake game for desktop.')
screen.tracer(0)
snake = Snake()
food = Food()
scoreb... | 25.340909 | 139 | 0.650224 | from turtle import Screen
import time
from food import Food
from snake_shape import Snake
from snake_scoreboard import Scoreboard
screen = Screen()
screen.setup(width=600, height=600)
screen.bgcolor('black')
screen.title('My snake game for desktop.')
screen.tracer(0)
snake = Snake()
food = Food()
scoreb... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8db4e0a2b4356561beec71bf632f2ecd064965c3 | 5,060 | py | Python | tests/test_nelson_siegel_svensson.py | luphord/nelson_siegel_svensson | e2437a9bf924d6cd54181de018ed8af8214a6055 | [
"MIT"
] | 55 | 2019-02-13T21:23:43.000Z | 2022-03-19T13:15:35.000Z | tests/test_nelson_siegel_svensson.py | musacan1300/nelson_siegel_svensson | b5c652f5f6d134457571467055fa12cd7df57213 | [
"MIT"
] | 10 | 2019-04-06T12:46:33.000Z | 2022-03-30T13:00:27.000Z | tests/test_nelson_siegel_svensson.py | musacan1300/nelson_siegel_svensson | b5c652f5f6d134457571467055fa12cd7df57213 | [
"MIT"
] | 33 | 2019-05-20T22:42:22.000Z | 2022-02-03T12:20:26.000Z | # -*- coding: utf-8 -*-
| 43.62069 | 79 | 0.538933 | # -*- coding: utf-8 -*-
import unittest
import os
import json
from dataclasses import asdict
import numpy as np
import click
from click.testing import CliRunner
from nelson_siegel_svensson import cli, NelsonSiegelCurve, \
NelsonSiegelSvenssonCurve
class TestNelson_siegel_svensson(unittest.TestCase):
'''Tes... | 0 | 0 | 0 | 4,781 | 0 | 0 | 0 | 52 | 202 |
05b83b0f032b96f78decc11085191dfb8bd3a7f2 | 2,114 | py | Python | Data Management Tools/reproject_shp.py | MBoustani/Geothon | 07a499d4ac0bb767677cd59b301022ad2ab16136 | [
"Apache-2.0"
] | 60 | 2015-01-12T08:36:19.000Z | 2021-12-20T11:06:25.000Z | Data Management Tools/reproject_shp.py | MBoustani/Geothon | 07a499d4ac0bb767677cd59b301022ad2ab16136 | [
"Apache-2.0"
] | null | null | null | Data Management Tools/reproject_shp.py | MBoustani/Geothon | 07a499d4ac0bb767677cd59b301022ad2ab16136 | [
"Apache-2.0"
] | 20 | 2015-02-20T03:05:17.000Z | 2021-12-27T16:18:45.000Z | #!/usr/bin/env python
'''
Project: Geothon (https://github.com/MBoustani/Geothon)
File: Vector/reproject_shp.py
Description: This code reprojects Shapefile.
Author: Maziyar Boustani (github.com/MBoustani)
'''
import os
try:
import ogr
except ImportError:
from osgeo import ogr
try:
... | 27.102564 | 100 | 0.784295 | #!/usr/bin/env python
'''
Project: Geothon (https://github.com/MBoustani/Geothon)
File: Vector/reproject_shp.py
Description: This code reprojects Shapefile.
Author: Maziyar Boustani (github.com/MBoustani)
'''
import os
try:
import ogr
except ImportError:
from osgeo import ogr
try:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13e23dc0a6662a0f1c60b6e0b4542b80784914e5 | 275 | py | Python | proj02/proj02_01.py | scienceman44/SAVY | 5a9781a9d08288c40f883602dc3b6bab4d6c63c1 | [
"MIT"
] | null | null | null | proj02/proj02_01.py | scienceman44/SAVY | 5a9781a9d08288c40f883602dc3b6bab4d6c63c1 | [
"MIT"
] | null | null | null | proj02/proj02_01.py | scienceman44/SAVY | 5a9781a9d08288c40f883602dc3b6bab4d6c63c1 | [
"MIT"
] | null | null | null | # Name:
# Date:
result = 0
loop_control = True
while loop_control == True:
b = int(raw_input('Enter a number to add, or 0 to indicate you are finished:'))
if b == 0:
loop_control = False
result = result + b
print 'your result is:'
print result
| 18.333333 | 83 | 0.621818 | # Name:
# Date:
result = 0
loop_control = True
while loop_control == True:
b = int(raw_input('Enter a number to add, or 0 to indicate you are finished:'))
if b == 0:
loop_control = False
result = result + b
print 'your result is:'
print result
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
04b3ca56fafcb17962d19c797e31c3700c6e41b8 | 9,753 | py | Python | generate_qumulo_cloudformation_template_test.py | Qumulo/Cloud-Deployment-Samples | a1ed1850b80ec14ea7520c5829421209efce8382 | [
"MIT"
] | 4 | 2019-12-25T22:09:37.000Z | 2022-02-07T19:46:03.000Z | generate_qumulo_cloudformation_template_test.py | Qumulo/Cloud-Deployment-Samples | a1ed1850b80ec14ea7520c5829421209efce8382 | [
"MIT"
] | 1 | 2020-07-10T22:24:53.000Z | 2020-07-10T22:24:53.000Z | generate_qumulo_cloudformation_template_test.py | Qumulo/cloud-samples | a1ed1850b80ec14ea7520c5829421209efce8382 | [
"MIT"
] | 3 | 2020-07-10T22:05:14.000Z | 2022-02-07T19:46:04.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 34.708185 | 86 | 0.58177 | import os
import json
import unittest
from troposphere import ec2, Template
from generate_qumulo_cloudformation_template import *
class ChassisSpecTest(unittest.TestCase):
def test_init(self) -> None:
spec = ChassisSpec(
volume_count=20,
pairing_ratio=4,
working_spec={... | 0 | 0 | 0 | 9,458 | 0 | 0 | 0 | 26 | 205 |
86d20c2cd0960aaa6593f882e80973ad808bffa1 | 23,886 | py | Python | sdk/python/pulumi_azure_native/notificationhubs/v20160301/notification_hub.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/notificationhubs/v20160301/notification_hub.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/notificationhubs/v20160301/notification_hub.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
from ... import _utilities
__all__ = ['NotificationHubArgs', 'NotificationHub']
| 46.111969 | 590 | 0.668174 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 0 | 18,313 | 0 | 5,087 | 0 | 0 | 0 | 42 | 179 |
ff0414b799e8f6504673a326a43404552c0e74fc | 12,480 | py | Python | sts_auth/stsauth.py | cshamrick/stsauth | f30cc37ed1d5e18cb47a250bf4c67a5d6332478e | [
"MIT"
] | 20 | 2018-05-21T21:21:47.000Z | 2022-02-09T04:11:06.000Z | sts_auth/stsauth.py | cshamrick/stsauth | f30cc37ed1d5e18cb47a250bf4c67a5d6332478e | [
"MIT"
] | 15 | 2018-07-04T02:57:14.000Z | 2021-08-09T18:03:12.000Z | sts_auth/stsauth.py | cshamrick/stsauth | f30cc37ed1d5e18cb47a250bf4c67a5d6332478e | [
"MIT"
] | 6 | 2018-09-04T05:07:09.000Z | 2021-06-30T19:49:21.000Z | import sys
from typing import Optional, Mapping
import boto3 # type: ignore[import]
import click # type: ignore[import]
from botocore.exceptions import ProfileNotFound, ClientError # type: ignore[import]
def fetch_aws_sts_token(
role_arn: str,
principal_arn: str,
assertion: str,
duration_seconds:... | 43.034483 | 110 | 0.634936 | import os
import re
import sys
from datetime import datetime
from typing import Optional, Mapping
from urllib.parse import urlparse, urlunparse
import boto3 # type: ignore[import]
import click # type: ignore[import]
import requests
from requests_ntlm import HttpNtlmAuth # type: ignore[import]
from bs4 import Beauti... | 0 | 0 | 0 | 10,399 | 0 | 0 | 0 | 66 | 314 |
f8b6c498aceb5c6cd20a8bd5c69808fe4c7a6870 | 561 | py | Python | src/unittest/python/rds_utils_tests.py | ImmobilienScout24/rds_log_dog | f8df42b78f24856358db15b20675f0a155a02f19 | [
"MIT"
] | 1 | 2018-01-11T18:36:28.000Z | 2018-01-11T18:36:28.000Z | src/unittest/python/rds_utils_tests.py | ImmobilienScout24/rds_log_dog | f8df42b78f24856358db15b20675f0a155a02f19 | [
"MIT"
] | 2 | 2017-01-05T15:45:47.000Z | 2018-04-16T11:12:01.000Z | src/unittest/python/rds_utils_tests.py | ImmobilienScout24/rds_log_dog | f8df42b78f24856358db15b20675f0a155a02f19 | [
"MIT"
] | 5 | 2017-01-05T15:39:02.000Z | 2018-04-16T10:37:44.000Z | from __future__ import print_function, absolute_import, division
| 33 | 65 | 0.741533 | from __future__ import print_function, absolute_import, division
import unittest2 as unittest
from mock import patch
from rds_log_dog.rds_utils import get_size
class Test(unittest.TestCase):
@patch('rds_log_dog.rds_utils.describe_logfiles_of_instance')
def test_get_size(self, describe_logfiles_of_instance)... | 0 | 339 | 0 | 9 | 0 | 0 | 0 | 29 | 118 |
32833472f753245d568128df8a1f79f7efbe1fb7 | 549 | py | Python | Scripts/hello_world.py | hasauino/Python | c94ea3a15f8310c95b7aaabaaa82f59dbf748a85 | [
"MIT"
] | null | null | null | Scripts/hello_world.py | hasauino/Python | c94ea3a15f8310c95b7aaabaaa82f59dbf748a85 | [
"MIT"
] | null | null | null | Scripts/hello_world.py | hasauino/Python | c94ea3a15f8310c95b7aaabaaa82f59dbf748a85 | [
"MIT"
] | null | null | null | print "Salam Alaikom !"
import sys
# if statement -------------------------------
if False:
print "hi"
print "Hello Wolrd!"
if True:
print "1"
print "2"
# array --------------------------------------
days = ["Monday", 'Tuesday', 'Wednesday',
'Thursday', 'Friday']
print days[0]; a=1; b=2
# -----------------... | 14.837838 | 46 | 0.500911 | print "Salam Alaikom !"
import sys
# if statement -------------------------------
if False:
print "hi"
print "Hello Wolrd!"
if True:
print "1"
print "2"
# array --------------------------------------
days = ["Monday", 'Tuesday', 'Wednesday',
'Thursday', 'Friday']
print days[0]; a=1; b=2
# -----------------... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a365a4252c5d814005389ed06e5f4dcda0f48f17 | 504 | py | Python | tests/test.py | rose-okoth/News-API | 1c19fe74903105599a40c53e68de61eccd993a46 | [
"Unlicense",
"MIT"
] | null | null | null | tests/test.py | rose-okoth/News-API | 1c19fe74903105599a40c53e68de61eccd993a46 | [
"Unlicense",
"MIT"
] | null | null | null | tests/test.py | rose-okoth/News-API | 1c19fe74903105599a40c53e68de61eccd993a46 | [
"Unlicense",
"MIT"
] | null | null | null | import unittest
from app.models import News
News=news.News
if __name__ == '__main__':
unittest.main() | 26.526316 | 180 | 0.68254 | import unittest
from app.models import News
News=news.News
class NewsTest(unittest.TestCase):
'''
Test class to test the behaviour of the news class
'''
def setUp(self):
self.new_news = News('CNN','CNN','Surviving in a pandemic','Effects of Covid 19 in the past year',2021-2-22,'https://cnn.co... | 0 | 0 | 0 | 373 | 0 | 0 | 0 | 0 | 23 |
b155700b84e2bb0d3b9d155501dd2186f8955f11 | 2,095 | py | Python | pygraph/functions/searching/astar.py | schlpbch/pygraph | 037bb2f32503fecb60d62921f9766d54109f15e2 | [
"MIT"
] | 62 | 2015-08-24T14:51:17.000Z | 2021-08-03T03:19:15.000Z | pygraph/functions/searching/astar.py | schlpbch/pygraph | 037bb2f32503fecb60d62921f9766d54109f15e2 | [
"MIT"
] | 3 | 2017-10-31T16:41:51.000Z | 2020-04-13T20:49:39.000Z | pygraph/functions/searching/astar.py | schlpbch/pygraph | 037bb2f32503fecb60d62921f9766d54109f15e2 | [
"MIT"
] | 30 | 2017-04-18T01:42:56.000Z | 2021-09-06T09:49:07.000Z | """Implements A* Search functionality."""
from ...helpers import PriorityQueue
from ...exceptions import NonexistentNodeError
def a_star_search(graph, start, goal):
"""Runs an A* search on the specified graph to find a path from the ''start'' node to the ''goal'' node.
Returns a list of nodes specifying a min... | 31.742424 | 108 | 0.663962 | """Implements A* Search functionality."""
from ...helpers import PriorityQueue
from ...exceptions import NonexistentNodeError
def a_star_search(graph, start, goal):
"""Runs an A* search on the specified graph to find a path from the ''start'' node to the ''goal'' node.
Returns a list of nodes specifying a min... | 0 | 0 | 0 | 0 | 0 | 186 | 0 | 0 | 45 |
e1d9d2d9a20f6919f3eaa0b19980f164fdc47b5f | 30,254 | py | Python | addons/survey/models/survey_question.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/survey/models/survey_question.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/survey/models/survey_question.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
| 53.928699 | 162 | 0.658888 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import collections
import json
import itertools
import operator
from odoo import api, fields, models, tools, _
from odoo.exceptions import ValidationError
class SurveyQuestion(models.Model):
""" Questions that wil... | 0 | 5,268 | 0 | 24,682 | 0 | 0 | 0 | 23 | 180 |
64bcde3e3778f24206da1450da29a5bf8fcaeb50 | 1,448 | py | Python | gcloud_dataproc/submit.py | macarthur-lab/hail-elasticsearch-pipelines | 7082681fd125e4f23a512aeff49853c5fc0f3136 | [
"MIT"
] | 15 | 2017-11-22T14:48:04.000Z | 2020-10-05T18:22:24.000Z | gcloud_dataproc/submit.py | macarthur-lab/hail-elasticsearch-pipelines | 7082681fd125e4f23a512aeff49853c5fc0f3136 | [
"MIT"
] | 86 | 2017-12-14T23:45:29.000Z | 2020-10-13T18:15:54.000Z | gcloud_dataproc/submit.py | macarthur-lab/hail-elasticsearch-pipelines | 7082681fd125e4f23a512aeff49853c5fc0f3136 | [
"MIT"
] | 7 | 2019-01-29T09:08:10.000Z | 2020-02-25T16:22:57.000Z | #!/usr/bin/env python
import argparse
if __name__ == '__main__':
p = argparse.ArgumentParser()
p.add_argument("-c", "--cluster", default="no-vep")
p.add_argument("script")
args, unparsed_args = p.parse_known_args()
submit(args.script, unparsed_args, cluster=args.cluster)
| 33.674419 | 148 | 0.674724 | #!/usr/bin/env python
import argparse
import os
import subprocess
import tempfile
def submit(script, script_args_list, cluster='no-vep', wait_for_job=True, use_existing_scripts_zip=False, region=None, spark_env=None, job_id=None):
script_args = " ".join(['"%s"' % arg for arg in script_args_list])
hail_scrip... | 0 | 0 | 0 | 0 | 0 | 1,083 | 0 | -22 | 89 |
309813fa77ab295af0296cf9deb86684b7f31eaa | 1,827 | py | Python | wavelet/compression/compressor_magnitude.py | AP-Atul/wavelets-ext | 00ced22462c369584ebd32f9b5f357f092de0142 | [
"MIT"
] | 4 | 2021-02-01T07:43:10.000Z | 2021-04-27T06:58:54.000Z | wavelet/compression/compressor_magnitude.py | AP-Atul/wavelets-ext | 00ced22462c369584ebd32f9b5f357f092de0142 | [
"MIT"
] | null | null | null | wavelet/compression/compressor_magnitude.py | AP-Atul/wavelets-ext | 00ced22462c369584ebd32f9b5f357f092de0142 | [
"MIT"
] | null | null | null | """ Compression using the average of signal as a magnitude """
| 25.375 | 84 | 0.605911 | """ Compression using the average of signal as a magnitude """
import numpy as np
from .compressor import Compressor
class CompressorMagnitude:
"""
The average of the signal is used to perform the compression on the input
data signal. Check the Compressor class on how the thresholding is done
with t... | 0 | 0 | 0 | 1,684 | 0 | 0 | 0 | 10 | 69 |
96186744d6789db434bb6817cc7c93a3fee17ace | 2,246 | py | Python | mkcloud.py | JunhoYeo/mkcloud | 2a4629fdbbf954a55283f8d3ba5e430a221e4b94 | [
"MIT"
] | 1 | 2018-08-13T23:51:57.000Z | 2018-08-13T23:51:57.000Z | mkcloud.py | JunhoYeo/mkcloud | 2a4629fdbbf954a55283f8d3ba5e430a221e4b94 | [
"MIT"
] | null | null | null | mkcloud.py | JunhoYeo/mkcloud | 2a4629fdbbf954a55283f8d3ba5e430a221e4b94 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
if __name__ == '__main__':
import multidict as multidict
text = getFrequencyDictForText(open('lorem-ipsum.txt').read())
mkcloud('lorem-ipsum.png', text, '#FFF2CC', '#F030A8')
| 35.09375 | 94 | 0.601514 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from wordcloud import WordCloud, ImageColorGenerator
from PIL import Image
import numpy as np
import random
def mkcloud(filename, dic, theme_start, theme_end):
def linear_gradient(n=10):
''' returns a gradient list of (n) colors between
two hex colors... | 0 | 0 | 0 | 0 | 0 | 1,833 | 0 | 8 | 165 |
8119d973649690caaf8fc15259c7a1f12bccb05a | 289 | py | Python | fe_cipher/constants/areas.py | uakihir0/fecipher | dd5c2a0d47d2701570b43f4906bdec993f4d571c | [
"MIT"
] | 3 | 2020-01-16T10:53:26.000Z | 2020-01-16T10:53:40.000Z | fe_cipher/constants/areas.py | uakihir0/fecipher | dd5c2a0d47d2701570b43f4906bdec993f4d571c | [
"MIT"
] | null | null | null | fe_cipher/constants/areas.py | uakihir0/fecipher | dd5c2a0d47d2701570b43f4906bdec993f4d571c | [
"MIT"
] | 1 | 2020-01-16T11:08:15.000Z | 2020-01-16T11:08:15.000Z | # -*- coding: utf-8 -*-
#
| 11.56 | 23 | 0.435986 | # -*- coding: utf-8 -*-
from enum import Enum
# エリア定義
class Areas(Enum):
# デッキ
Deck = 1
# 手札
Hand = 2
# 絆
Bond = 3
# 前衛
FrontLine = 4
# 後衛
BackLine = 5
# 退避
Retreat = 6
# 支援
Support = 7
# オーブ
Orb = 8
# 無限
Mugen = 9
| 72 | 0 | 0 | 192 | 0 | 0 | 0 | 0 | 44 |
395b142680f5cde9c72f9f6f5f6119c63915dae1 | 4,052 | py | Python | attention.py | dsj96/TITS | c84f04bdb9f1f0af5f6cca1e6a10151e4dae162d | [
"MIT"
] | 2 | 2021-12-05T16:34:05.000Z | 2021-12-30T00:25:29.000Z | attention.py | dsj96/CTVI-master | ea9c4dc812ff871c7ccb2e3748e35d3b634920d0 | [
"MIT"
] | null | null | null | attention.py | dsj96/CTVI-master | ea9c4dc812ff871c7ccb2e3748e35d3b634920d0 | [
"MIT"
] | null | null | null |
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
if __name__ == "__main__":
'''self-attention'''
input_data = torch.tensor(np.arange(24.).reshape(2,3,4),dtype=torch.float32)
attention = Multi_Head_SelfAttention(num_head=3,num_vocab=3,input_dim=4,hidden_dim=5... | 37.174312 | 121 | 0.628825 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.functional import softmax
import torch.optim as optim
from torch.autograd import Variable
import math
import numpy as np
from utils import write_pkl, read_pkl
class SelfAttention(nn.Module):
def __init__(self, num... | 63 | 0 | 0 | 3,024 | 0 | 0 | 0 | 48 | 196 |
f2f782820b6e0361ff854c10c04a57c67e53f14a | 3,489 | py | Python | bot.py | victor-tsai/discord-bot | 44ef9bcaa69c5ea682be56efe88df091dc0784c3 | [
"MIT"
] | null | null | null | bot.py | victor-tsai/discord-bot | 44ef9bcaa69c5ea682be56efe88df091dc0784c3 | [
"MIT"
] | null | null | null | bot.py | victor-tsai/discord-bot | 44ef9bcaa69c5ea682be56efe88df091dc0784c3 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from discord.ext import commands
TOKEN = "Your Discord token here"
OWNER_ID = 0 # Your user ID here
RTT_USERNAME = "Realtime Trains API username"
RTT_PASSWORD = "Realtime Trains API password"
## BOT SETUP
bot = commands.Bot(command_prefix = ">")
# Comment to respond to messages from anyone
## UTI... | 37.117021 | 109 | 0.518487 | #!/usr/bin/python3
import requests
from discord.ext import commands
TOKEN = "Your Discord token here"
OWNER_ID = 0 # Your user ID here
RTT_USERNAME = "Realtime Trains API username"
RTT_PASSWORD = "Realtime Trains API password"
## BOT SETUP
bot = commands.Bot(command_prefix = ">")
# Comment to respond to messages from... | 0 | 267 | 0 | 0 | 0 | 2,724 | 0 | -6 | 138 |
42e8e2aaaeb8d0c7280bc8c0f0d4326303a7a369 | 558 | py | Python | Mundo_1/aula07.py | GabrielProdi/Python_CursoEmVideo | 8bfff1b9a73d09c8f42dc3778f895525f1bc946d | [
"MIT"
] | null | null | null | Mundo_1/aula07.py | GabrielProdi/Python_CursoEmVideo | 8bfff1b9a73d09c8f42dc3778f895525f1bc946d | [
"MIT"
] | null | null | null | Mundo_1/aula07.py | GabrielProdi/Python_CursoEmVideo | 8bfff1b9a73d09c8f42dc3778f895525f1bc946d | [
"MIT"
] | null | null | null | #Operadores Aritmeticos
n1 = int( input('Digite um nmero: ' ) )
n2 = int( input('Digite outro nmero: ' ) )
soma = n1 + n2
prod = n1 * n2
div = n1 / n2
divint = n1 // n2
exp = n1 ** n2
resto = n1 % n2
# {: } os dois pontos formatam o valor da mascara conforme as diretrizes
#quebra de linha \n
# end= escrever o con... | 32.823529 | 112 | 0.629032 | #Operadores Aritmeticos
n1 = int( input('Digite um número: ' ) )
n2 = int( input('Digite outro número: ' ) )
soma = n1 + n2
prod = n1 * n2
div = n1 / n2
divint = n1 // n2
exp = n1 ** n2
resto = n1 % n2
# {: } os dois pontos formatam o valor da mascara conforme as diretrizes
#quebra de linha é \n
# end= escrever o ... | 28 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
596d64b56e4d8d8991ebc5da5fab0164bcddc3e1 | 3,156 | py | Python | regression/gallery/contour9.py | b8raoult/magics | eb2c86ec6e392e89c90044128dc671f22283d6ad | [
"ECL-2.0",
"Apache-2.0"
] | 41 | 2018-12-07T23:10:50.000Z | 2022-02-19T03:01:49.000Z | regression/gallery/contour9.py | b8raoult/magics | eb2c86ec6e392e89c90044128dc671f22283d6ad | [
"ECL-2.0",
"Apache-2.0"
] | 59 | 2019-01-04T15:43:30.000Z | 2022-03-31T09:48:15.000Z | regression/gallery/contour9.py | b8raoult/magics | eb2c86ec6e392e89c90044128dc671f22283d6ad | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2019-01-07T14:36:33.000Z | 2021-09-06T14:48:36.000Z | # (C) Copyright 1996-2016 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 intergov... | 43.232877 | 709 | 0.606781 | # (C) Copyright 1996-2016 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 intergov... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 23 |
2a71651e70b4a7528bd63355ddd1957a197426fa | 154,019 | py | Python | ui/psychsim_rc.py | richardyang/psychsim | 191497d72077fe95cde94a2004a8be6e926c121f | [
"MIT"
] | 1 | 2016-07-19T16:56:46.000Z | 2016-07-19T16:56:46.000Z | ui/psychsim_rc.py | richardyang/psychsim | 191497d72077fe95cde94a2004a8be6e926c121f | [
"MIT"
] | 1 | 2018-08-27T22:31:16.000Z | 2018-08-27T22:31:16.000Z | ui/psychsim_rc.py | richardyang/psychsim | 191497d72077fe95cde94a2004a8be6e926c121f | [
"MIT"
] | 1 | 2019-09-06T03:05:35.000Z | 2019-09-06T03:05:35.000Z | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Mon Dec 22 15:59:06 2014
# by: The Resource Compiler for PyQt (Qt v4.8.6)
#
# WARNING! All changes made in this file will be lost!
qt_resource_data = "\
\x00\x00\x91\x12\
\x47\
\x49\x46\x38\x39\x61\xca\x00\xec\x00\xe7\xe7\x00\x18\x18\x18\x19\
\x19\x19\x... | 65.317642 | 96 | 0.727274 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Mon Dec 22 15:59:06 2014
# by: The Resource Compiler for PyQt (Qt v4.8.6)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x91\x12\
\x47\
\x49\x46\x38\x39\x61\xca\x00\xec\x00\xe7\xe7\x00\x... | 0 | 0 | 0 | 0 | 0 | 195 | 0 | 3 | 69 |
ec4441541b2c6be31fc394effb8172bbc4f5104c | 457 | py | Python | moreover/base/config.py | moriW/moreover | 330b49f4888211d2502208c13c3fff49a24124ad | [
"MIT"
] | null | null | null | moreover/base/config.py | moriW/moreover | 330b49f4888211d2502208c13c3fff49a24124ad | [
"MIT"
] | null | null | null | moreover/base/config.py | moriW/moreover | 330b49f4888211d2502208c13c3fff49a24124ad | [
"MIT"
] | null | null | null | #! /bin/python
# config store & parse
#
# @file: config
# @time: 2022/02/05
# @author: Mori
#
from tornado.util import ObjectDict
global_config = ObjectDict()
| 19.041667 | 50 | 0.691466 | #! /bin/python
# config store & parse
#
# @file: config
# @time: 2022/02/05
# @author: Mori
#
import json
from tornado.util import ObjectDict
global_config = ObjectDict()
def define(config: str, default_value: str):
if config in global_config:
raise KeyError(f"{config} already exists")
global_config... | 0 | 0 | 0 | 0 | 0 | 236 | 0 | -10 | 69 |
536db5165bdc70a8820e97cc1b002c271c3566b3 | 4,824 | py | Python | noolite/noolite/noolite.py | andvikt/ha_addons | 98343e6465516b821008abd58c38f5f4306e0d41 | [
"Apache-2.0"
] | null | null | null | noolite/noolite/noolite.py | andvikt/ha_addons | 98343e6465516b821008abd58c38f5f4306e0d41 | [
"Apache-2.0"
] | null | null | null | noolite/noolite/noolite.py | andvikt/ha_addons | 98343e6465516b821008abd58c38f5f4306e0d41 | [
"Apache-2.0"
] | null | null | null |
import serial
from logger import root_logger
lg = root_logger.getChild('noolite')
def _get_tty(tty_name) -> serial.Serial:
"""
:param tty_name:
:return:
"""
serial_port = serial.Serial(tty_name, 9600, timeout=2)
if not serial_port.is_open:
serial_port.open()
serial_p... | 33.041096 | 119 | 0.583126 | import asyncio
from datetime import datetime
import serial
from logger import root_logger
from . import const
from .typing import NooliteCommand, BaseNooliteRemote, MotionSensor
from typing import Dict, Callable
import typing
lg = root_logger.getChild('noolite')
class NotApprovedError(Exception):
pass
class ... | 1,066 | 141 | 1,969 | 1,564 | 0 | 0 | 0 | 49 | 178 |
07baeeac2fe71021abc2ba135d5e09a36888cf1c | 2,416 | py | Python | jom/freq.py | JoM-Lab/JoM | cd03fd401ebbd8133c8b4816115bb87e2fd24690 | [
"MIT"
] | 1 | 2016-03-10T04:52:56.000Z | 2016-03-10T04:52:56.000Z | jom/freq.py | JoM-Lab/JoM | cd03fd401ebbd8133c8b4816115bb87e2fd24690 | [
"MIT"
] | null | null | null | jom/freq.py | JoM-Lab/JoM | cd03fd401ebbd8133c8b4816115bb87e2fd24690 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
from __future__ import unicode_literals, print_function
from collections import Counter
from .db import new_session, Tweet
import string
import re
zh = re.compile(r"[\u4e00-\u9fa5]+")
other = re.compile(r"[a-zA-Z0-9_]+")
bad = ("_ 1 2 3 4 5 I O RT The a and are be bit co com for ... | 34.514286 | 88 | 0.579056 | #!/usr/bin/env python3
# coding: utf-8
from __future__ import unicode_literals, print_function
from collections import Counter
from .db import new_session, Tweet
import string
import re
zh = re.compile(r"[\u4e00-\u9fa5]+")
other = re.compile(r"[a-zA-Z0-9_]+")
bad = ("_ 1 2 3 4 5 I O RT The a and are be bit co com for ... | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6fdd4da2f419ff8d134e23b97de8a08353bf1a3a | 429 | py | Python | utils/sms.py | ljygit/12306 | 3de32a7046a2cfef35c1a2793172607237bc7ef7 | [
"MIT"
] | 1 | 2020-06-22T10:18:09.000Z | 2020-06-22T10:18:09.000Z | utils/sms.py | ljygit/12306 | 3de32a7046a2cfef35c1a2793172607237bc7ef7 | [
"MIT"
] | 8 | 2021-03-19T03:19:50.000Z | 2022-03-11T23:58:15.000Z | utils/sms.py | Mr-Mei/12306- | ff6f027497962c34c8ad6df0138e617a7dc8be71 | [
"MIT"
] | 1 | 2019-11-18T23:17:07.000Z | 2019-11-18T23:17:07.000Z |
if __name__ == '__main__':
from configure import ACCOUNT_SID, AUTO_TOKEN, FROM_NUM, TO_NUM
msg = ''
send_sms(ACCOUNT_SID,AUTO_TOKEN,FROM_NUM,TO_NUM,msg) | 30.642857 | 64 | 0.72028 | from twilio.rest import Client
def send_sms(account_sid,auth_token,from_man,to_man,msg):
client = Client(account_sid, auth_token)
message = client.messages.create(
to=to_man,
from_=from_man,
body=msg)
return message.sid
if __name__ == '__main__':
from configure import ACCOUNT_S... | 30 | 0 | 0 | 0 | 0 | 203 | 0 | 6 | 45 |
a8b0a4469467b3bf1e3dba6386f211a25e5876c2 | 1,513 | py | Python | revolve.py | safsaf150/revolve | ff12ac6992c99116b9d571dc277165362d8d5602 | [
"Apache-2.0"
] | null | null | null | revolve.py | safsaf150/revolve | ff12ac6992c99116b9d571dc277165362d8d5602 | [
"Apache-2.0"
] | null | null | null | revolve.py | safsaf150/revolve | ff12ac6992c99116b9d571dc277165362d8d5602 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
from pyrevolve import parser
here = os.path.dirname(os.path.abspath(__file__))
rvpath = os.path.abspath(os.path.join(here, '..', 'revolve'))
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
if __name__ == "__main__":
settings = parser.parse_args()
mana... | 27.509091 | 72 | 0.636484 | #!/usr/bin/env python3
import os
import sys
from pyrevolve import parser
from pyrevolve.util import Supervisor
here = os.path.dirname(os.path.abspath(__file__))
rvpath = os.path.abspath(os.path.join(here, '..', 'revolve'))
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
class OnlineEvolutionSupervisor(S... | 0 | 0 | 0 | 600 | 0 | 0 | 0 | 16 | 45 |
5a6c067c4c899f822dcfbcf61b4d8154e18f0052 | 509 | py | Python | src/jvm/io/fsq/twofishes/scripts/refresh-store.py | jglesner/fsqio | 436dd3a7667fd23f638bf96bdcd9ec83266a2319 | [
"Apache-2.0"
] | 252 | 2016-01-08T23:12:13.000Z | 2022-01-17T16:31:49.000Z | src/jvm/io/fsq/twofishes/scripts/refresh-store.py | jglesner/fsqio | 436dd3a7667fd23f638bf96bdcd9ec83266a2319 | [
"Apache-2.0"
] | 67 | 2016-01-13T17:34:12.000Z | 2021-08-04T18:50:24.000Z | src/jvm/io/fsq/twofishes/scripts/refresh-store.py | jglesner/fsqio | 436dd3a7667fd23f638bf96bdcd9ec83266a2319 | [
"Apache-2.0"
] | 59 | 2016-03-25T20:49:03.000Z | 2021-08-04T05:36:38.000Z | #!/usr/bin/python
import urllib2
import json
import sys
from optparse import OptionParser
usage = "usage: %prog [options] host"
parser = OptionParser(usage = usage)
parser.add_option("-t", "--token", dest="token", default="", type='string',
help="token")
(options, args) = parser.parse_args()
if len(args) != 1:
p... | 24.238095 | 78 | 0.695481 | #!/usr/bin/python
import urllib2
import json
import sys
from optparse import OptionParser
usage = "usage: %prog [options] host"
parser = OptionParser(usage = usage)
parser.add_option("-t", "--token", dest="token", default="", type='string',
help="token")
(options, args) = parser.parse_args()
if len(args) != 1:
p... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9dbd5ad7e1294e12a9fb2519e92fbb06c8562dc1 | 4,723 | py | Python | eplist/web_sources/anidb.py | djt5019/episode_renamer | 84d3dda24b54c70a489c2a6bcb9c7c2c2dadfba9 | [
"Unlicense"
] | null | null | null | eplist/web_sources/anidb.py | djt5019/episode_renamer | 84d3dda24b54c70a489c2a6bcb9c7c2c2dadfba9 | [
"Unlicense"
] | null | null | null | eplist/web_sources/anidb.py | djt5019/episode_renamer | 84d3dda24b54c70a489c2a6bcb9c7c2c2dadfba9 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import difflib
import logging
import functools
from string import punctuation as punct
from eplist import utils
from eplist.episode import Episode
try:
from bs4 import BeautifulSoup
Soup = functools.partial(BeautifulSoup)
except Impo... | 27.619883 | 109 | 0.629261 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import difflib
import logging
import functools
from string import punctuation as punct
from eplist import utils
from eplist.episode import Episode
from eplist.settings import Settings
try:
from bs4 import BeautifulSoup
Soup = functoo... | 0 | 0 | 0 | 0 | 0 | 650 | 0 | 15 | 68 |
d2fdf77b2d8c1bb4d3bf7464c2a44161dda68f02 | 1,284 | py | Python | replot.py | MQSchleich/dylightful | 6abbb690c8387c522c9bff21c72b5c66aab77ede | [
"MIT"
] | null | null | null | replot.py | MQSchleich/dylightful | 6abbb690c8387c522c9bff21c72b5c66aab77ede | [
"MIT"
] | 5 | 2022-02-05T12:47:42.000Z | 2022-03-16T11:42:20.000Z | replot.py | MQSchleich/dylightful | 6abbb690c8387c522c9bff21c72b5c66aab77ede | [
"MIT"
] | null | null | null | import os
import numpy as np
from dylightful.utilities import load_parsed_dyno, get_dir
from dylightful.bar_plot import make_barplot
dirname = os.path.dirname(__file__)
save_dir = "/media/julian/INTENSO/ZIKV/"
name = "ZIKV-Pro-427-1_dynophore"
traj_path = save_dir + name + ".json"
prefix = "ligand"
pml = save_dir + n... | 29.181818 | 61 | 0.760125 | import os
import numpy as np
from dylightful.utilities import load_parsed_dyno, get_dir
from dylightful.parser import load_env_partners_mixed
from dylightful.bar_plot import make_barplot
dirname = os.path.dirname(__file__)
save_dir = "/media/julian/INTENSO/ZIKV/"
name = "ZIKV-Pro-427-1_dynophore"
traj_path = save_dir... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 32 | 22 |
05c583400c5f51e6d3818158d9d2a62630174a12 | 1,286 | py | Python | codereviewr/urls.py | percyperez/codereviewr | d7bc927455559389354f615cf7c130e7122e04ef | [
"MIT"
] | 2 | 2015-12-08T13:40:32.000Z | 2016-05-08T06:22:14.000Z | codereviewr/urls.py | na/codereviewr | c1045f2e9a16d64398306dbf9124b4f59ef2fdbb | [
"MIT"
] | null | null | null | codereviewr/urls.py | na/codereviewr | c1045f2e9a16d64398306dbf9124b4f59ef2fdbb | [
"MIT"
] | null | null | null | from django.contrib.comments.feeds import LatestCommentsFeed
from django.views.generic.simple import direct_to_template
from codereviewr.settings import PROJECT_PATH, DEBUG
#feeds dictionary
feeds = {
'code': CodeFeed,
'comments': LatestCommentsFeed,
'language': LanguageFeed,
'latest': LatestFeed,
'user': UserFee... | 30.619048 | 105 | 0.662519 | from django.conf.urls.defaults import *
from django.contrib.comments.feeds import LatestCommentsFeed
from django.views.generic.simple import direct_to_template, redirect_to
from codereviewr.settings import PROJECT_PATH, DEBUG
from codereviewr.feeds import *
#feeds dictionary
feeds = {
'code': CodeFeed,
'comments': ... | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 41 | 44 |
41c0d02a489f00ea9b52cab70a55f753870dba52 | 2,483 | py | Python | save_preds.py | somepago/dbViz | aeea84c42a32efafebbb29c3d944204aa74963cf | [
"Apache-2.0"
] | 22 | 2022-03-16T10:04:43.000Z | 2022-03-24T22:57:23.000Z | save_preds.py | somepago/dbViz | aeea84c42a32efafebbb29c3d944204aa74963cf | [
"Apache-2.0"
] | null | null | null | save_preds.py | somepago/dbViz | aeea84c42a32efafebbb29c3d944204aa74963cf | [
"Apache-2.0"
] | 2 | 2022-03-19T07:13:39.000Z | 2022-03-29T06:09:53.000Z | '''Train CIFAR10 with PyTorch.'''
import torch
import random
import os
from model import get_model
from data import get_data, make_planeloader
from utils import get_random_images
from evaluation import decision_boundary
from options import options
'''
This module calculates and saves prediction arrays for different ... | 37.059701 | 147 | 0.664921 | '''Train CIFAR10 with PyTorch.'''
import torch
import random
import os
import argparse
from model import get_model
from data import get_data, make_planeloader
from utils import get_loss_function, get_scheduler, get_random_images, produce_plot, get_noisy_images, AttackPGD
from evaluation import decision_boundary
from ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 86 | 44 |
aa2541d0b8aba2e6c7ed95ea73a4a7d1006eb805 | 7,820 | py | Python | data_preprocessing/flatten.py | billylegota/ECE-380L-Term-Project | 9838449e7e4b40e4444fdcb0f7e23cf43e87e0f1 | [
"MIT"
] | null | null | null | data_preprocessing/flatten.py | billylegota/ECE-380L-Term-Project | 9838449e7e4b40e4444fdcb0f7e23cf43e87e0f1 | [
"MIT"
] | null | null | null | data_preprocessing/flatten.py | billylegota/ECE-380L-Term-Project | 9838449e7e4b40e4444fdcb0f7e23cf43e87e0f1 | [
"MIT"
] | null | null | null | """flatten.py -- Flattens HDF5 dataset.
"""
import glob
import math
import os
import h5py
import numpy as np
import scipy.io
def flatten(source: str, dest: str, packets_per_chunk: int = 1000, synthetic: bool = False,
silent: bool = True, constant_features_path: str = 'constant_features.mat') -> (int, in... | 42.27027 | 120 | 0.649105 | """flatten.py -- Flattens HDF5 dataset.
"""
import glob
import math
import os
import h5py
import numpy as np
import scipy.io
def flatten(source: str, dest: str, packets_per_chunk: int = 1000, synthetic: bool = False,
silent: bool = True, constant_features_path: str = 'constant_features.mat') -> (int, in... | 0 | 0 | 0 | 0 | 0 | 509 | 0 | 0 | 23 |
79f8e6aa646486ac4177d50c3694c1c7632c0a4a | 461 | py | Python | lpbm/lib/slugify.py | fmichea/lpbm | 172772d562e2f1aa4aba72599150f95f89bdf6ce | [
"BSD-3-Clause"
] | 1 | 2015-11-09T11:30:41.000Z | 2015-11-09T11:30:41.000Z | lpbm/lib/slugify.py | fmichea/lpbm | 172772d562e2f1aa4aba72599150f95f89bdf6ce | [
"BSD-3-Clause"
] | 1 | 2015-04-28T07:02:21.000Z | 2016-01-23T19:12:11.000Z | lpbm/lib/slugify.py | fmichea/lpbm | 172772d562e2f1aa4aba72599150f95f89bdf6ce | [
"BSD-3-Clause"
] | 2 | 2016-01-11T17:55:42.000Z | 2018-03-19T19:03:15.000Z | import string
import unicodedata
SLUG_CHARS_DISPLAY = '[a-z0-9-]'
_SLUG_CHARS = string.ascii_lowercase + string.digits + '-'
_SLUG_SIZE = 50
def slugify(text):
'''Returns the slug of a string (that can be used in an URL for example.'''
slug = unicodedata.normalize('NFKD', text).encode('ascii', 'ignore')
... | 27.117647 | 79 | 0.668113 | import string
import unicodedata
SLUG_CHARS_DISPLAY = '[a-z0-9-]'
_SLUG_CHARS = string.ascii_lowercase + string.digits + '-'
_SLUG_SIZE = 50
def slugify(text):
'''Returns the slug of a string (that can be used in an URL for example.'''
slug = unicodedata.normalize('NFKD', text).encode('ascii', 'ignore')
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5427b466a12fe41de8c9198002e141c9edef8f1f | 610 | py | Python | Chapter09/wifi-sniff.py | PacktPublishing/Python-Penetration-Testing-Cookbook | 74eba54a5d9921db0c4679cb4374a742118d4be8 | [
"MIT"
] | 48 | 2017-12-08T16:38:09.000Z | 2022-03-20T12:49:31.000Z | Chapter09/wifi-sniff.py | shamiul94/Python-Penetration-Testing-Cookbook | a152f14bf7eb1fde2612808f47d7609b58d48980 | [
"MIT"
] | null | null | null | Chapter09/wifi-sniff.py | shamiul94/Python-Penetration-Testing-Cookbook | a152f14bf7eb1fde2612808f47d7609b58d48980 | [
"MIT"
] | 34 | 2017-12-28T14:01:10.000Z | 2022-03-16T15:54:30.000Z |
ap_list = []
sniff(iface='en0', prn=ssid, count=10, timeout=3, store=0)
# for packet in sniff(offline='sample.pcap', prn=changePacketParameters):
# packets.append(packet)
# for packet in packets:
# if packet.haslayer(TCP):
# writeToPcapFile(packet)
# print(packet.show()) | 30.5 | 73 | 0.595082 | from scapy.all import *
ap_list = []
def ssid(pkt):
# print(pkt.show())
if pkt.haslayer(Dot11):
print(pkt.show())
if pkt.type == 0 and pkt.subtype == 8:
if pkt.addr2 not in ap_list:
ap_list.append(pkt.addr2)
print("AP: %s SSID: %s" % (pkt.addr2, pkt.i... | 0 | 0 | 0 | 0 | 0 | 266 | 0 | 2 | 44 |
072d438eba683fe36f066d77044cc9fbcf982237 | 6,298 | py | Python | python/rain/client/data.py | aimof/rain | 86b77666e1310888ad483c7976c2c99f3d5bfeaa | [
"MIT"
] | null | null | null | python/rain/client/data.py | aimof/rain | 86b77666e1310888ad483c7976c2c99f3d5bfeaa | [
"MIT"
] | null | null | null | python/rain/client/data.py | aimof/rain | 86b77666e1310888ad483c7976c2c99f3d5bfeaa | [
"MIT"
] | null | null | null | from ..common import RainException
from ..common.content_type import check_content_type, encode_value
def blob(value, label="const", content_type=None, encode=None):
"""
Create a constant data object with accompanying data.
Given `value` may be either `bytes` or any object to be encoded with
`encodi... | 31.49 | 93 | 0.618292 | import capnp
import tarfile
import io
from .session import get_active_session
from ..common import RainException, ids, ID
from ..common.attributes import attributes_to_capnp
from ..common.content_type import check_content_type, encode_value
from ..common import DataType
class DataObject:
id = None
# Flag i... | 0 | 71 | 0 | 3,290 | 0 | 253 | 0 | 37 | 179 |
0e8a820f45484929c8266b2b20f11189f4b1fe60 | 3,211 | py | Python | legate/pandas/core/bitmask.py | marcinz/legate.pandas | 94c21c436f59c06cfba454c6569e9f5d7109d839 | [
"Apache-2.0"
] | 67 | 2021-04-12T18:06:55.000Z | 2022-03-28T06:51:05.000Z | legate/pandas/core/bitmask.py | marcinz/legate.pandas | 94c21c436f59c06cfba454c6569e9f5d7109d839 | [
"Apache-2.0"
] | 2 | 2021-06-22T00:30:36.000Z | 2021-07-01T22:12:43.000Z | legate/pandas/core/bitmask.py | marcinz/legate.pandas | 94c21c436f59c06cfba454c6569e9f5d7109d839 | [
"Apache-2.0"
] | 6 | 2021-04-14T21:28:00.000Z | 2022-03-22T09:45:25.000Z | # Copyright 2021 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 28.669643 | 74 | 0.678293 | # Copyright 2021 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 0 | 1,167 | 0 | 1,284 | 0 | 0 | 0 | 85 | 90 |
0a2586d7e1874e8ca79ba94674abca86141dfa90 | 5,066 | py | Python | backend/config/settings/base.py | code-for-canada/django-nginx-reactjs-docker | 12b2f79872273bb0ac4736d709b8e0904bc54258 | [
"MIT"
] | 3 | 2019-01-04T10:53:03.000Z | 2020-01-29T16:20:38.000Z | backend/config/settings/base.py | code-for-canada/django-nginx-reactjs-docker | 12b2f79872273bb0ac4736d709b8e0904bc54258 | [
"MIT"
] | 215 | 2019-01-04T11:34:03.000Z | 2019-07-22T13:36:18.000Z | backend/config/settings/base.py | code-for-canada/django-nginx-reactjs-docker | 12b2f79872273bb0ac4736d709b8e0904bc54258 | [
"MIT"
] | 8 | 2019-01-08T22:45:11.000Z | 2020-01-29T16:20:40.000Z | """
Django settings for backend project.
Generated by 'django-admin startproject' using Django 2.1.4.
Since the start of the project, we have upgraded the version to 2.1.7
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their va... | 32.267516 | 91 | 0.681603 | """
Django settings for backend project.
Generated by 'django-admin startproject' using Django 2.1.4.
Since the start of the project, we have upgraded the version to 2.1.7
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their va... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
708f01c2e192ca13b47544b19668cfceb08b35f7 | 18,306 | py | Python | project/src/main/python/backTest/factorAnalysis/updateStockPool.py | daifengqi/big-data-hft | 013747ca3c2ca984eeac723fd5d8f8e3458b840c | [
"MIT"
] | 1 | 2022-03-07T09:32:40.000Z | 2022-03-07T09:32:40.000Z | project/src/main/python/backTest/factorAnalysis/updateStockPool.py | daifengqi/big-data-hft | 013747ca3c2ca984eeac723fd5d8f8e3458b840c | [
"MIT"
] | null | null | null | project/src/main/python/backTest/factorAnalysis/updateStockPool.py | daifengqi/big-data-hft | 013747ca3c2ca984eeac723fd5d8f8e3458b840c | [
"MIT"
] | 1 | 2022-03-03T16:22:37.000Z | 2022-03-03T16:22:37.000Z |
if __name__ == '__main__':
config_path = r"D:\HX_proj\factorAnalysis\updateStockPoolConfig.yaml"
updateSP = UpdateStockPool(config_path)
updateSP.update_stock_info()
updateSP.update_stock_pool_basic()
updateSP.update_stock_HS300()
updateSP.update_stock_ZZ500()
updateSP.update_stoc... | 54.159763 | 149 | 0.689282 | import copy
import itertools
import os
import time
import numpy as np
import pandas as pd
import scipy.io as scio
import yaml
import factorAnalysisIOTools as IOTools
from factorAnalysisCalTools import prepare_RET_dict, time_horizon_dict
def save_df(this: pd.DataFrame,config: dict,file_name):
file_path = os.path.... | 1,098 | 0 | 0 | 15,653 | 0 | 1,352 | 0 | 17 | 342 |
5dd0ee9d6513012c54587e1dc2268e195652a1f7 | 2,585 | py | Python | examples/PyGame/orientation_control_osc.py | elsuizo/abr_control | d7d47a1c152dfcb8d1a3093083d53f19cc4922d6 | [
"BSD-3-Clause"
] | 1 | 2021-07-07T13:26:38.000Z | 2021-07-07T13:26:38.000Z | examples/PyGame/orientation_control_osc.py | elsuizo/abr_control | d7d47a1c152dfcb8d1a3093083d53f19cc4922d6 | [
"BSD-3-Clause"
] | null | null | null | examples/PyGame/orientation_control_osc.py | elsuizo/abr_control | d7d47a1c152dfcb8d1a3093083d53f19cc4922d6 | [
"BSD-3-Clause"
] | null | null | null | """
Running operational space control with the PyGame display. The arm will
move the end-effector to a target orientation, which can be changed by
pressing the left/right arrow keys.
"""
import numpy as np
from os import environ
environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1'
from abr_control.arms import threejoint as arm... | 30.05814 | 76 | 0.670019 | """
Running operational space control with the PyGame display. The arm will
move the end-effector to a target orientation, which can be changed by
pressing the left/right arrow keys.
"""
import numpy as np
from os import environ
environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1'
import pygame
from abr_control.arms import thr... | 0 | 0 | 0 | 0 | 0 | 551 | 0 | 16 | 67 |
ec3070556999b4b313c77a9f09b9213babe68567 | 419 | py | Python | test/test_utils/test_next_version/test_get_current_calver_tags.py | 132nd-etcher/epab | 5226d3a36580f8cc50cf5dcac426adb1350a2c9b | [
"MIT"
] | 2 | 2018-12-13T06:49:10.000Z | 2018-12-13T07:37:49.000Z | test/test_utils/test_next_version/test_get_current_calver_tags.py | etcher-be/epab | 5226d3a36580f8cc50cf5dcac426adb1350a2c9b | [
"MIT"
] | 109 | 2018-08-22T04:25:56.000Z | 2019-10-17T05:10:21.000Z | test/test_utils/test_next_version/test_get_current_calver_tags.py | etcher-be/epab | 5226d3a36580f8cc50cf5dcac426adb1350a2c9b | [
"MIT"
] | 1 | 2018-02-25T05:53:18.000Z | 2018-02-25T05:53:18.000Z | # coding=utf-8
| 26.1875 | 56 | 0.72315 | # coding=utf-8
import pytest
import epab.utils
from epab.utils import _next_version as nv
@pytest.mark.long
def test_get_current_calver_tags(repo: epab.utils.Repo):
calver = '2018.1.1'
assert len(nv._get_current_calver_tags(calver)) == 0
repo.tag(f'{calver}.1')
assert len(nv._get_current_calver_tags(... | 0 | 304 | 0 | 0 | 0 | 0 | 0 | 9 | 90 |
ff5902120c035db34bdcd8cb1814c2eb99ed8af1 | 3,843 | py | Python | irods/rule.py | MaastrichtUniversity/python-irodsclient | e6e8b37205edeb94c57f3d30786b56cccd91d985 | [
"Xnet",
"X11"
] | null | null | null | irods/rule.py | MaastrichtUniversity/python-irodsclient | e6e8b37205edeb94c57f3d30786b56cccd91d985 | [
"Xnet",
"X11"
] | null | null | null | irods/rule.py | MaastrichtUniversity/python-irodsclient | e6e8b37205edeb94c57f3d30786b56cccd91d985 | [
"Xnet",
"X11"
] | null | null | null | from __future__ import absolute_import
| 38.049505 | 148 | 0.577934 | from __future__ import absolute_import
from irods.message import iRODSMessage, StringStringMap, RodsHostAddress, STR_PI, MsParam, MsParamArray, RuleExecutionRequest
from irods.api_number import api_number
from io import open as io_open
from irods.message import Message, StringProperty
class RemoveRuleMessage(Message):... | 0 | 0 | 0 | 3,511 | 0 | 0 | 0 | 159 | 134 |
8a090a8ec15b5e802b163d342a26be6e4d9b7783 | 786 | py | Python | guitab_knn/midi.py | bestvibes/guitab | b3491bab9bc7390eb3722ada44e0284731abf521 | [
"MIT"
] | 1 | 2022-03-02T09:36:28.000Z | 2022-03-02T09:36:28.000Z | guitab_container/webapp/webapp/midi.py | bestvibes/guitab | b3491bab9bc7390eb3722ada44e0284731abf521 | [
"MIT"
] | 3 | 2020-02-12T00:40:58.000Z | 2021-06-10T20:15:45.000Z | guitab_container/webapp/webapp/midi.py | bestvibes/guitab | b3491bab9bc7390eb3722ada44e0284731abf521 | [
"MIT"
] | 2 | 2020-09-23T16:26:46.000Z | 2022-02-16T23:57:39.000Z | # Array showing guitar string's relative pitches, in semi-tones, with "0" being low E
# ["Low E", "A", "D", "G", "B", "High E"]
strings = [40, 45, 50, 55, 60, 65]; | 30.230769 | 93 | 0.577608 | # Array showing guitar string's relative pitches, in semi-tones, with "0" being low E
# ["Low E", "A", "D", "G", "B", "High E"]
strings = [40, 45, 50, 55, 60, 65];
def midi_to_label(midi):
if (midi < strings[0]):
raise ValueError("Note " + note + " is not playable on a guitar in standard tuning.")
ide... | 0 | 0 | 0 | 0 | 0 | 577 | 0 | 0 | 46 |
9a8f0064512347b712e42bdfed88fe249599ba83 | 6,616 | py | Python | Lib/turtledemo/nim.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | 1 | 2018-06-21T18:21:24.000Z | 2018-06-21T18:21:24.000Z | Lib/turtledemo/nim.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | Lib/turtledemo/nim.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | """ turtle-example-suite:
tdemo_nim.py
Play nim against the computer. The player
who takes the last stick jest the winner.
Implements the model-view-controller
design pattern.
"""
zaimportuj turtle
zaimportuj random
zaimportuj time
SCREENWIDTH = 640
SCREENHEIGHT = 480
MINSTICKS = 7
MAXSTICKS = 3... | 29.145374 | 83 | 0.57104 | """ turtle-example-suite:
tdemo_nim.py
Play nim against the computer. The player
who takes the last stick jest the winner.
Implements the model-view-controller
design pattern.
"""
zaimportuj turtle
zaimportuj random
zaimportuj time
SCREENWIDTH = 640
SCREENHEIGHT = 480
MINSTICKS = 7
MAXSTICKS = 3... | 76 | 0 | 0 | 0 | 0 | 2,211 | 0 | 0 | 285 |
528cf1b59e68183f561c087b20046483ff243394 | 918 | py | Python | port_scanner.py | nemzyxt/port-scanner | 52378c2d5e5c6ff7f7b74018a27a6dee1f566c54 | [
"MIT"
] | null | null | null | port_scanner.py | nemzyxt/port-scanner | 52378c2d5e5c6ff7f7b74018a27a6dee1f566c54 | [
"MIT"
] | null | null | null | port_scanner.py | nemzyxt/port-scanner | 52378c2d5e5c6ff7f7b74018a27a6dee1f566c54 | [
"MIT"
] | null | null | null | #Author : Nemuel Wainaina
import socket
from colorama import init, Fore
#some color, haha
init()
GREEN = Fore.GREEN
BLUE = Fore.BLUE
RED = Fore.RED
GRAY = Fore.LIGHTBLACK_EX
RESET = Fore.RESET
def is_port_open(target, port):
'''
This function simply attempts to create a connection
to the ... | 24.810811 | 79 | 0.611111 | #Author : Nemuel Wainaina
import socket
from colorama import init, Fore
#some color, haha
init()
GREEN = Fore.GREEN
BLUE = Fore.BLUE
RED = Fore.RED
GRAY = Fore.LIGHTBLACK_EX
RESET = Fore.RESET
def is_port_open(target, port):
'''
This function simply attempts to create a connection
to the ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a83c3aaee2d1d702fdd7e9f3c5ea7dd431a4b156 | 2,290 | py | Python | generate_split.py | ruoyunz/caltech-ee148-spring2020-hw02 | 671b08cd914134f06db2c1eeec3fa4d4d3e0cd5f | [
"MIT"
] | null | null | null | generate_split.py | ruoyunz/caltech-ee148-spring2020-hw02 | 671b08cd914134f06db2c1eeec3fa4d4d3e0cd5f | [
"MIT"
] | null | null | null | generate_split.py | ruoyunz/caltech-ee148-spring2020-hw02 | 671b08cd914134f06db2c1eeec3fa4d4d3e0cd5f | [
"MIT"
] | null | null | null | import numpy as np
import os
import json
np.random.seed(2020) # to ensure you always get the same train/test split
data_path = '../data/RedLights2011_Medium'
gts_path = '../data/hw02_annotations'
split_path = '../data/hw02_splits'
os.makedirs(split_path, exist_ok=True) # create directory if needed
split_test = True ... | 30.945946 | 86 | 0.676419 | import numpy as np
import os
import json
import cv2
import sys
np.random.seed(2020) # to ensure you always get the same train/test split
data_path = '../data/RedLights2011_Medium'
gts_path = '../data/hw02_annotations'
split_path = '../data/hw02_splits'
os.makedirs(split_path, exist_ok=True) # create directory if nee... | 0 | 0 | 0 | 0 | 0 | 403 | 0 | -22 | 67 |
1431c36367740490b243f3436653ce18816364f6 | 2,356 | py | Python | src/ygopro/urldecode.py | o7878x/pytoolk | eb5edfbd5a8907b9705c4042013bf7c828e2fdf3 | [
"MIT"
] | null | null | null | src/ygopro/urldecode.py | o7878x/pytoolk | eb5edfbd5a8907b9705c4042013bf7c828e2fdf3 | [
"MIT"
] | null | null | null | src/ygopro/urldecode.py | o7878x/pytoolk | eb5edfbd5a8907b9705c4042013bf7c828e2fdf3 | [
"MIT"
] | null | null | null | import time
import fire
YGO_SCHEME = 'ygo'
YGO_NETLOC = 'deck'
DEFAULT_HEADER = '#created by ...\n'
CARD_SEP_SYM = '_'
CARD_MULTI_SYM = '*'
DEFAULT_SYM = '#'
NO_SYM = '!'
MAIN_HEADER = 'main\n'
EXTRA_HEADER = 'extra\n'
SIDE_HEADER = 'side\n'
DEFAULT_YDK_NAME: str = "default" + "_" + str(int(time.time()))
i... | 23.79798 | 91 | 0.64983 | import logging
import time
import typing
from urllib.parse import urlparse, parse_qs
import fire
YGO_SCHEME = 'ygo'
YGO_NETLOC = 'deck'
DEFAULT_HEADER = '#created by ...\n'
CARD_SEP_SYM = '_'
CARD_MULTI_SYM = '*'
DEFAULT_SYM = '#'
NO_SYM = '!'
MAIN_HEADER = 'main\n'
EXTRA_HEADER = 'extra\n'
SIDE_HEADER = 'side\n'
... | 0 | 0 | 0 | 0 | 0 | 1,797 | 0 | 7 | 181 |
7b1edf412d6711b1edca18fb5738889669261b6e | 21,465 | py | Python | tests/test_page.py | crempp/mdweb | ce3c26e4b7b2dfba0ac793534a06581a8c214570 | [
"MIT"
] | 12 | 2015-07-31T07:53:57.000Z | 2021-08-09T18:05:55.000Z | tests/test_page.py | crempp/mdweb | ce3c26e4b7b2dfba0ac793534a06581a8c214570 | [
"MIT"
] | 59 | 2015-07-31T07:44:16.000Z | 2020-08-20T19:54:22.000Z | tests/test_page.py | crempp/mdweb | ce3c26e4b7b2dfba0ac793534a06581a8c214570 | [
"MIT"
] | 1 | 2016-02-22T22:57:17.000Z | 2016-02-22T22:57:17.000Z | # -*- coding: utf-8 -*-
"""Tests for the MDWeb Navigation parser.
Tests to write
* Handle symlinks
* File already open
* Non supported extension (.xls)
* Permissions
Maybe test?
* atime, mtime
* large file
"""
try:
# Python >= 3.3
from unittest import mock
except ImportError:
# Python < 3.3
| 29.283765 | 259 | 0.646261 | # -*- coding: utf-8 -*-
"""Tests for the MDWeb Navigation parser.
Tests to write
* Handle symlinks
* File already open
* Non supported extension (.xls)
* Permissions
Maybe test?
* atime, mtime
* large file
"""
import datetime
from pyfakefs import fake_filesystem_unittest
from unittest import skip
try:
... | 300 | 13,100 | 0 | 7,619 | 0 | 0 | 0 | 130 | 183 |
2d857a8f033972ecd5bd933956e549a665614872 | 1,080 | py | Python | day13/shuttlebus2.py | fpeterek/aoc-2020 | ae08a96c2213e94d204fc11051e2a9f535d62973 | [
"MIT"
] | null | null | null | day13/shuttlebus2.py | fpeterek/aoc-2020 | ae08a96c2213e94d204fc11051e2a9f535d62973 | [
"MIT"
] | null | null | null | day13/shuttlebus2.py | fpeterek/aoc-2020 | ae08a96c2213e94d204fc11051e2a9f535d62973 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
run()
| 26.341463 | 96 | 0.591667 |
class Bus:
def __init__(self, number: int, offset: int, begin: int = 0):
self.number = number
self.offset = offset
self.begin = begin
def load_file(filename: str) -> tuple[int, list[int]]:
with open(filename) as f:
timestamp = int(f.readline())
buses = f.readline().spl... | 0 | 0 | 0 | 140 | 0 | 780 | 0 | 0 | 116 |
2467cce351ee3950d6051b279111c2511b02732a | 76 | py | Python | pytest_harvest/tests_raw/conftest.py | keszybz/python-pytest-harvest | ef11d3addeae51168ab892b7806c2b4c270e2a82 | [
"BSD-3-Clause"
] | 36 | 2018-11-07T19:32:08.000Z | 2022-03-19T10:24:48.000Z | pytest_harvest/tests_raw/conftest.py | keszybz/python-pytest-harvest | ef11d3addeae51168ab892b7806c2b4c270e2a82 | [
"BSD-3-Clause"
] | 55 | 2018-11-13T10:58:30.000Z | 2022-01-06T10:32:53.000Z | pytest_harvest/tests_raw/conftest.py | keszybz/python-pytest-harvest | ef11d3addeae51168ab892b7806c2b4c270e2a82 | [
"BSD-3-Clause"
] | 4 | 2019-10-05T09:50:09.000Z | 2021-03-31T20:33:16.000Z | # This is actually not even needed apparently
# pytest_plugins = ["harvest"] | 38 | 45 | 0.763158 | # This is actually not even needed apparently
# pytest_plugins = ["harvest"] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0cab310479ab3cc6d73dc8671b51f36e59625a28 | 456 | py | Python | fly/ModelCreate.py | cheburakshu/fly | d452af4b83e4cb0f8d0094bf1e0c1b407d39bdf5 | [
"Apache-2.0"
] | null | null | null | fly/ModelCreate.py | cheburakshu/fly | d452af4b83e4cb0f8d0094bf1e0c1b407d39bdf5 | [
"Apache-2.0"
] | null | null | null | fly/ModelCreate.py | cheburakshu/fly | d452af4b83e4cb0f8d0094bf1e0c1b407d39bdf5 | [
"Apache-2.0"
] | null | null | null | #fly
| 26.823529 | 81 | 0.64693 | #fly
from .ModelIO import ModelIO
from .ModelConfig import ModelConfig
class ModelCreate(object):
def __init__(self,*args,**kwargs):
self._ModelConfig = ModelConfig(kwargs.get('filename')) #*args,**kwargs)
self._modelNames = self._ModelConfig.getModels()
self._model = None
de... | 0 | 0 | 0 | 355 | 0 | 0 | 0 | 22 | 71 |
d4aeef5e3912b8f3cd0610d8270c456d1f413716 | 17,328 | py | Python | pedal/core/feedback.py | acbart/python-analysis | 3cd2cc22d50a414ae6b62c74d2643be4742238d4 | [
"MIT"
] | 14 | 2019-08-22T03:40:23.000Z | 2022-03-13T00:30:53.000Z | pedal/core/feedback.py | pedal-edu/pedal | 3cd2cc22d50a414ae6b62c74d2643be4742238d4 | [
"MIT"
] | 74 | 2019-09-12T04:35:56.000Z | 2022-01-26T19:21:32.000Z | pedal/core/feedback.py | acbart/python-analysis | 3cd2cc22d50a414ae6b62c74d2643be4742238d4 | [
"MIT"
] | 2 | 2018-09-16T22:39:15.000Z | 2018-09-17T12:53:28.000Z | """
Simple data classes for storing feedback to present to learners.
"""
__all__ = ['Feedback', 'FeedbackKind', 'FeedbackCategory',
"CompositeFeedbackFunction",
"FeedbackResponse"]
from pedal.core.feedback_category import FeedbackKind, FeedbackCategory
PEDAL_DEVELOPERS = ["Austin Cory Bart <acba... | 39.381818 | 118 | 0.627539 | """
Simple data classes for storing feedback to present to learners.
"""
__all__ = ['Feedback', 'FeedbackKind', 'FeedbackCategory',
"CompositeFeedbackFunction",
"FeedbackResponse"]
from pedal.core.formatting import FeedbackFieldWrapper
from pedal.core.location import Location
from pedal.core.rep... | 0 | 0 | 0 | 15,732 | 0 | 0 | 0 | 88 | 136 |
25d93ebd57650e95d922e302d78dcc9e2626544e | 1,501 | py | Python | oops_fhir/r4/code_system/precision_estimate_type.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/code_system/precision_estimate_type.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/code_system/precision_estimate_type.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | from pathlib import Path
from fhir.resources.codesystem import CodeSystem
__all__ = ["PrecisionEstimateType"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
| 19.493506 | 84 | 0.588274 | from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["PrecisionEstimateType"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class PrecisionEstimateType:
"""
PrecisionEstimateType
Method of reportin... | 0 | 0 | 0 | 1,245 | 0 | 0 | 0 | 24 | 46 |
b9dac44e185c9b124e9894a09b40bf74c9e25e50 | 43,059 | py | Python | onezone/zone.py | aemerick/onezone | 3a3c9a6542d0d8b9de7d18b94f866205dd3210b6 | [
"MIT"
] | null | null | null | onezone/zone.py | aemerick/onezone | 3a3c9a6542d0d8b9de7d18b94f866205dd3210b6 | [
"MIT"
] | null | null | null | onezone/zone.py | aemerick/onezone | 3a3c9a6542d0d8b9de7d18b94f866205dd3210b6 | [
"MIT"
] | 1 | 2021-05-10T20:15:16.000Z | 2021-05-10T20:15:16.000Z | """
Author : A. Emerick
Date : May 2016
Purpose:
"""
__author__ = "aemerick <emerick@astro.columbia.edu>"
# external
#from collections import OrderedDict
try:
import dill as pickle
except:
print("WARNING: Dill unavailable, attempting to use pickle, which may crash")
try:
import ... | 37.837434 | 167 | 0.564853 | """
Author : A. Emerick
Date : May 2016
Purpose:
"""
__author__ = "aemerick <emerick@astro.columbia.edu>"
# external
import numpy as np
#from collections import OrderedDict
import os, h5py
from scipy.interpolate import interp1d
try:
import dill as pickle
except:
print("WARNING: Dill unavail... | 0 | 937 | 0 | 41,112 | 0 | 32 | 0 | 71 | 178 |
5613da50aa1d3dd12fedcbd4b7b022564dee7bea | 5,965 | py | Python | graph.py | cbsteh/PySawit | fcec4f19270b9ddef0530c3e22f41aea2dd0153e | [
"MIT"
] | 15 | 2017-10-20T23:57:57.000Z | 2021-09-04T00:34:27.000Z | graph.py | cbsteh/PySawit | fcec4f19270b9ddef0530c3e22f41aea2dd0153e | [
"MIT"
] | 3 | 2017-10-23T14:47:26.000Z | 2019-02-22T00:37:20.000Z | graph.py | cbsteh/PySawit | fcec4f19270b9ddef0530c3e22f41aea2dd0153e | [
"MIT"
] | 6 | 2019-01-13T02:20:26.000Z | 2021-11-02T15:55:09.000Z | """
Graphing the program flow module.
This module aids in understanding the flow of program by creating a visual map (network graph or
map) of the program flow path. The graph map is in DOT and GML (XML) types.
!!! warning "Required installation"
* pycallgraph (run `pip install pycallgraph`)
* [Graphviz](http... | 29.529703 | 99 | 0.555407 | """
Graphing the program flow module.
This module aids in understanding the flow of program by creating a visual map (network graph or
map) of the program flow path. The graph map is in DOT and GML (XML) types.
!!! warning "Required installation"
* pycallgraph (run `pip install pycallgraph`)
* [Graphviz](http... | 0 | 712 | 0 | 4,697 | 0 | 0 | 0 | -3 | 113 |
ef2e3c6b09aa1fe3a4d3f5db2221c153a8e6b8df | 5,728 | py | Python | main.py | HJaen/dad-bot | 7ccfa7cf84f0eb5e6c42e8a4cbef56aeb11520b0 | [
"MIT"
] | null | null | null | main.py | HJaen/dad-bot | 7ccfa7cf84f0eb5e6c42e8a4cbef56aeb11520b0 | [
"MIT"
] | null | null | null | main.py | HJaen/dad-bot | 7ccfa7cf84f0eb5e6c42e8a4cbef56aeb11520b0 | [
"MIT"
] | null | null | null | # A Discord bot that does typical dad things
# By Jason Saini and James Nguyen
# Created: January 31, 2021
# Modified: January 20, 2022
import discord
from os import getenv
from requests import Session
from pyowm import OWM
from dotenv import load_dotenv
# setup client and tokens
load_dotenv('token.env')
client = di... | 30.306878 | 181 | 0.678247 | # A Discord bot that does typical dad things
# By Jason Saini and James Nguyen
# Created: January 31, 2021
# Modified: January 20, 2022
import discord
from os import getenv
from requests import get, Session
from dadjokes import Dadjoke
from pyowm import OWM
from dotenv import load_dotenv
import yfinance as yf
# setup... | 0 | 2,363 | 266 | 0 | 0 | 2,153 | 0 | 12 | 228 |
85051de1f6a5e87b6148a3d81c6e5f3a6fea82ef | 3,160 | py | Python | dogbot/bot/listeners/material.py | moondropx/dogbot | 4883b558e92c8fdcdbef97240cfa8252ec343eb4 | [
"Apache-2.0"
] | 6 | 2017-08-01T09:06:59.000Z | 2018-06-23T11:28:51.000Z | dogbot/bot/listeners/material.py | moondropx/dogbot | 4883b558e92c8fdcdbef97240cfa8252ec343eb4 | [
"Apache-2.0"
] | null | null | null | dogbot/bot/listeners/material.py | moondropx/dogbot | 4883b558e92c8fdcdbef97240cfa8252ec343eb4 | [
"Apache-2.0"
] | 2 | 2017-08-14T04:35:57.000Z | 2019-05-26T05:57:58.000Z | import getopt
import shlex
from config import config
from dogbot.cqsdk.utils import reply
def material(bot, message):
""": -material [-h] [-r [-o]]
-h :
-r :
-o :
: , . cc. .
:
-matrial
-matrial -r
-matrial -r -o
"""
try:
cmd, *args = s... | 25.691057 | 108 | 0.496203 | import getopt
import shlex
from config import config
from dogbot.cqsdk.utils import reply
from dogbot.models import *
def material(bot, message):
"""用法: -material [-h] [-r [-o]] 职业
-h : 打印本帮助
-r : 逆查
-o : 珠子逆查
职业 : 职业名, 可以是日文原文或者黑话. 原文一概采用未cc的初始职业名. 也接受单位的日文原文或者黑话.
例:
-matrial... | 495 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 22 |
74dd66fe68b737ebf12160e8d8200121aab64bd4 | 7,981 | py | Python | controlimcap/decoders/cfattention.py | SikandarBakht/asg2cap | d8a6360eaccdb8c3add5f9c4f6fd72764e47e762 | [
"MIT"
] | 169 | 2020-03-15T08:41:39.000Z | 2022-03-30T09:36:17.000Z | controlimcap/decoders/cfattention.py | wtr850/asg2cap | 97a1d866d4a2b86c1f474bb168518f97eb2f8b96 | [
"MIT"
] | 25 | 2020-05-23T15:14:00.000Z | 2022-03-10T06:20:31.000Z | controlimcap/decoders/cfattention.py | wtr850/asg2cap | 97a1d866d4a2b86c1f474bb168518f97eb2f8b96 | [
"MIT"
] | 25 | 2020-04-02T10:08:01.000Z | 2021-12-09T12:10:10.000Z | import torch.nn as nn
import caption.utils.inference
| 40.719388 | 109 | 0.712943 | import torch
import torch.nn as nn
import torch.nn.functional as F
import caption.utils.inference
import caption.decoders.vanilla
from framework.modules.embeddings import Embedding
from framework.modules.global_attention import GlobalAttention
class ContentFlowAttentionDecoder(caption.decoders.attention.BUTDAttnDec... | 0 | 0 | 0 | 7,711 | 0 | 0 | 0 | 81 | 134 |
35dd4db4651fde50d5a6898decf9c51ba241f80d | 713 | py | Python | xml/parse_xml.py | bruce-webber/python-intro | 78881eb65951e2c4451df1d62da1b7d79f5b1970 | [
"CC-BY-4.0"
] | null | null | null | xml/parse_xml.py | bruce-webber/python-intro | 78881eb65951e2c4451df1d62da1b7d79f5b1970 | [
"CC-BY-4.0"
] | null | null | null | xml/parse_xml.py | bruce-webber/python-intro | 78881eb65951e2c4451df1d62da1b7d79f5b1970 | [
"CC-BY-4.0"
] | null | null | null | """
This is a demonstration of xml.etree (part of the standard library), which is used
to parse, modify and create XML files.
"""
import xml.etree.ElementTree as ET
tree = ET.parse('country_data.xml')
root = tree.getroot()
# The top level tag.
print(root.tag)
# The tag of the first sub-element.
print(root[0].tag)
#... | 25.464286 | 82 | 0.650771 | """
This is a demonstration of xml.etree (part of the standard library), which is used
to parse, modify and create XML files.
"""
import xml.etree.ElementTree as ET
tree = ET.parse('country_data.xml')
root = tree.getroot()
# The top level tag.
print(root.tag)
# The tag of the first sub-element.
print(root[0].tag)
#... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |