hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
97f1a9648949bb2ca82df660b430dbc9cca7835e | 1,200 | py | Python | bin/gff32gtf.py | Gaius-Augustus/TSEBRA-experiments | 6db9441b118fb2fe359a5c4eb36c99bab867358a | [
"ClArtistic"
] | null | null | null | bin/gff32gtf.py | Gaius-Augustus/TSEBRA-experiments | 6db9441b118fb2fe359a5c4eb36c99bab867358a | [
"ClArtistic"
] | null | null | null | bin/gff32gtf.py | Gaius-Augustus/TSEBRA-experiments | 6db9441b118fb2fe359a5c4eb36c99bab867358a | [
"ClArtistic"
] | 1 | 2021-05-06T19:22:11.000Z | 2021-05-06T19:22:11.000Z | #!/usr/bin/env python3
# ==============================================================
# author: Lars Gabriel
#
# gff32gtf.py: Convert gff3 to gtf
# ==============================================================
import argparse
def parseCmd():
"""Parse command line arguments
Returns:
dictionary: Dict... | 30.769231 | 82 | 0.498333 | #!/usr/bin/env python3
# ==============================================================
# author: Lars Gabriel
#
# gff32gtf.py: Convert gff3 to gtf
# ==============================================================
import argparse
def main():
result = []
args = parseCmd()
with open(args.gff, 'r') as file:
... | 515 | 0 | 23 |
6a48acafef1e1994f7cb4fe0505004774905b72e | 9,086 | py | Python | tests/test_preprocessing/test_datetime_features.py | ig248/timeserio | afc2a953a83e763418d417059493ef13a17d349c | [
"MIT"
] | 63 | 2019-07-12T17:16:27.000Z | 2022-02-22T11:06:50.000Z | tests/test_preprocessing/test_datetime_features.py | ig248/timeserio | afc2a953a83e763418d417059493ef13a17d349c | [
"MIT"
] | 34 | 2019-07-30T11:52:09.000Z | 2022-03-28T12:42:02.000Z | tests/test_preprocessing/test_datetime_features.py | ig248/timeserio | afc2a953a83e763418d417059493ef13a17d349c | [
"MIT"
] | 12 | 2019-08-14T05:51:22.000Z | 2021-03-15T09:34:15.000Z | import numpy as np
import numpy.testing as npt
import pandas as pd
import pandas.testing as pdt
import pytest
import datetime
from pandas.api.types import is_numeric_dtype
import timeserio.ini as ini
from timeserio.data.mock import mock_fit_data
from timeserio.preprocessing import PandasDateTimeFeaturizer
from timeser... | 32.33452 | 79 | 0.678737 | import numpy as np
import numpy.testing as npt
import pandas as pd
import pandas.testing as pdt
import pytest
import datetime
from pandas.api.types import is_numeric_dtype
import timeserio.ini as ini
from timeserio.data.mock import mock_fit_data
from timeserio.preprocessing import PandasDateTimeFeaturizer
from timeser... | 5,743 | 0 | 519 |
5dd77b1d6e11815d25518838c65952f5b3e27a23 | 1,273 | py | Python | mbbl_envs/mbbl/util/common/parallel_util.py | hbutsuak95/iv_rl | 0f72a8f077a238237027ea96b7d1160c35ac9959 | [
"MIT"
] | 9 | 2022-01-16T11:27:00.000Z | 2022-03-13T14:04:48.000Z | mbbl_envs/mbbl/util/common/parallel_util.py | hbutsuak95/iv_rl | 0f72a8f077a238237027ea96b7d1160c35ac9959 | [
"MIT"
] | null | null | null | mbbl_envs/mbbl/util/common/parallel_util.py | hbutsuak95/iv_rl | 0f72a8f077a238237027ea96b7d1160c35ac9959 | [
"MIT"
] | null | null | null | # -----------------------------------------------------------------------------
# @brief:
# Define some signals used during parallel
# @author:
# Tingwu Wang
# -----------------------------------------------------------------------------
TRAIN_SIGNAL = 1
SAVE_SIGNAL = 2
# it makes the main trpo agent ... | 23.574074 | 79 | 0.648075 | # -----------------------------------------------------------------------------
# @brief:
# Define some signals used during parallel
# @author:
# Tingwu Wang
# -----------------------------------------------------------------------------
TRAIN_SIGNAL = 1
SAVE_SIGNAL = 2
# it makes the main trpo agent ... | 0 | 0 | 0 |
5da216184231f1953daf0136aa0b96781700bc6b | 7,255 | py | Python | python/tests/spatial_operator/test_point_join.py | andreicovaliov/incubator-sedona | 3613a756d6e9a50fd2cb7cb0484e654249440598 | [
"Apache-2.0"
] | 747 | 2016-03-02T21:29:54.000Z | 2020-09-01T01:45:13.000Z | python/tests/spatial_operator/test_point_join.py | andreicovaliov/incubator-sedona | 3613a756d6e9a50fd2cb7cb0484e654249440598 | [
"Apache-2.0"
] | 329 | 2016-04-01T20:30:38.000Z | 2020-08-31T23:29:02.000Z | python/tests/spatial_operator/test_point_join.py | andreicovaliov/incubator-sedona | 3613a756d6e9a50fd2cb7cb0484e654249440598 | [
"Apache-2.0"
] | 401 | 2016-03-03T20:38:38.000Z | 2020-08-31T07:59:13.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 45.062112 | 119 | 0.764438 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 4,504 | 803 | 46 |
74df7800477d09fe6cb14dc956288216ddc2e5ce | 27,198 | py | Python | src/data/fields.py | hummat/convolutional_occupancy_networks | bb351edff59c196e01aa687943e19fee4ac11077 | [
"MIT"
] | null | null | null | src/data/fields.py | hummat/convolutional_occupancy_networks | bb351edff59c196e01aa687943e19fee4ac11077 | [
"MIT"
] | null | null | null | src/data/fields.py | hummat/convolutional_occupancy_networks | bb351edff59c196e01aa687943e19fee4ac11077 | [
"MIT"
] | null | null | null | import os
from typing import Union, Tuple
import numpy as np
import open3d as o3d
import trimesh
from easy_o3d.utils import get_camera_parameters_from_blenderproc_bopwriter, convert_depth_image_to_point_cloud
from scipy.spatial.transform import Rotation
from src.common import coord2index, normalize_coord, look_at, ge... | 36.953804 | 119 | 0.572395 | import os
from typing import Union, Tuple
import numpy as np
import open3d as o3d
import trimesh
from easy_o3d.utils import get_camera_parameters_from_blenderproc_bopwriter, convert_depth_image_to_point_cloud
from scipy.spatial.transform import Rotation
from src.common import coord2index, normalize_coord, look_at, ge... | 13,695 | 62 | 579 |
b59255e36eb058e5ad45b1c475a2bf131a121ea1 | 514 | py | Python | src/app/users/serialize.py | qinshuang/ITINFO-api | 4699035790d9184d1bf4e9b54455c8e2cdd0200f | [
"MIT"
] | null | null | null | src/app/users/serialize.py | qinshuang/ITINFO-api | 4699035790d9184d1bf4e9b54455c8e2cdd0200f | [
"MIT"
] | null | null | null | src/app/users/serialize.py | qinshuang/ITINFO-api | 4699035790d9184d1bf4e9b54455c8e2cdd0200f | [
"MIT"
] | null | null | null | #!usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author:sqin
@file: serializes.py
@time: 2019/01/02
"""
from flask_marshmallow import Schema
from marshmallow import fields
from .models import *
from . import ma
| 19.769231 | 90 | 0.636187 | #!usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author:sqin
@file: serializes.py
@time: 2019/01/02
"""
from flask_marshmallow import Schema
from marshmallow import fields
from .models import *
from . import ma
class RoleSchema(Schema):
class Meta:
model = Role
fields = ('id', 'name')
class User... | 0 | 255 | 46 |
8eb0707d2d7dedb71848ed46a79e4506014ee097 | 1,664 | py | Python | escola/tests/helpers/utils.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 1 | 2019-03-15T18:04:24.000Z | 2019-03-15T18:04:24.000Z | escola/tests/helpers/utils.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 22 | 2019-03-17T21:53:50.000Z | 2021-03-31T19:12:19.000Z | escola/tests/helpers/utils.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 1 | 2018-11-25T03:05:23.000Z | 2018-11-25T03:05:23.000Z | import pytest
from django.contrib.auth.models import User
from django.utils.datetime_safe import datetime
from mixer.backend.django import mixer
from escola.models import Turma, Profile, Aluno, Professor, MateriaDaTurma, CargoTurma, Horario
from escola.utils import dar_permissao_user
pytestmark = pytest.mark.django_d... | 28.689655 | 95 | 0.702524 | import pytest
from django.contrib.auth.models import User
from django.utils.datetime_safe import datetime
from mixer.backend.django import mixer
from escola.models import Turma, Profile, Aluno, Professor, MateriaDaTurma, CargoTurma, Horario
from escola.utils import dar_permissao_user
pytestmark = pytest.mark.django_d... | 1,199 | 0 | 138 |
f5aeb08fde8c92b7c2c77d83d6605b547ab2cb5c | 3,819 | py | Python | src/RESNets.py | basiralab/RESNets | 395360ecac7950ce52dcef21e19f555e3aafaea5 | [
"MIT"
] | 5 | 2020-09-27T03:49:24.000Z | 2021-07-30T09:13:52.000Z | src/RESNets.py | basiralab/RESNets | 395360ecac7950ce52dcef21e19f555e3aafaea5 | [
"MIT"
] | null | null | null | src/RESNets.py | basiralab/RESNets | 395360ecac7950ce52dcef21e19f555e3aafaea5 | [
"MIT"
] | 2 | 2020-09-22T10:11:21.000Z | 2021-01-04T00:20:38.000Z | from .ACE import settings as st
from .ACE.encoder import Encoder
from .netNormExtended import netNormExtended
from .utilities import *
"""
The implementation of RESNets framework.
Details can be found in the original paper: will be filled when accepted
-------------------------------------------------------------... | 47.148148 | 129 | 0.635245 | from .ACE import settings as st
from .ACE.encoder import Encoder
from .netNormExtended import netNormExtended
from .utilities import *
"""
The implementation of RESNets framework.
Details can be found in the original paper: will be filled when accepted
-------------------------------------------------------------... | 1,694 | 0 | 23 |
99b4d6a83db25ad7cebc85f12bbd2e4d12f7f7d2 | 319 | py | Python | molsysmt/item/freezer/openff_Molecule/__init__.py | uibcdf/MolModMTs | 4f6b6f671a9fa3e73008d1e9c48686d5f20a6573 | [
"MIT"
] | null | null | null | molsysmt/item/freezer/openff_Molecule/__init__.py | uibcdf/MolModMTs | 4f6b6f671a9fa3e73008d1e9c48686d5f20a6573 | [
"MIT"
] | null | null | null | molsysmt/item/freezer/openff_Molecule/__init__.py | uibcdf/MolModMTs | 4f6b6f671a9fa3e73008d1e9c48686d5f20a6573 | [
"MIT"
] | null | null | null | from .is_openff_Molecule import is_openff_Molecule
from .to_molsysmt_MolSys import to_molsysmt_MolSys
from .to_molsysmt_Topology import to_molsysmt_Topology
from .to_molsysmt_Structures import to_molsysmt_Structures
from .to_openff_Topology import to_openff_Topology
from .to_openmm_Topology import to_openmm_Topology
| 39.875 | 58 | 0.902821 | from .is_openff_Molecule import is_openff_Molecule
from .to_molsysmt_MolSys import to_molsysmt_MolSys
from .to_molsysmt_Topology import to_molsysmt_Topology
from .to_molsysmt_Structures import to_molsysmt_Structures
from .to_openff_Topology import to_openff_Topology
from .to_openmm_Topology import to_openmm_Topology
| 0 | 0 | 0 |
4d937efcbaddcc6348d264ae1dbdab47270fc1e9 | 175 | py | Python | my_app/__init__.py | pashaniaosi/flasky | daacbf81133106a79878bee77ec004baad912411 | [
"MIT"
] | null | null | null | my_app/__init__.py | pashaniaosi/flasky | daacbf81133106a79878bee77ec004baad912411 | [
"MIT"
] | null | null | null | my_app/__init__.py | pashaniaosi/flasky | daacbf81133106a79878bee77ec004baad912411 | [
"MIT"
] | null | null | null | from .my_api import test_api
from flask import Flask
| 19.444444 | 61 | 0.731429 | from .my_api import test_api
from flask import Flask
def createApp():
app = Flask(__name__)
app.register_blueprint(test_api, url_prefix='/test_api/')
return app
| 98 | 0 | 23 |
73de2c05efb1401f9cd34752afdab423431a7194 | 801 | py | Python | effects/uvmap/data/gradient.py | AltairQ/demoscene | 243b13f96263c238a7b8c68b59ac76b9cff4c337 | [
"Artistic-2.0"
] | 80 | 2015-02-10T19:33:04.000Z | 2022-02-12T10:29:43.000Z | effects/uvmap/data/gradient.py | AltairQ/demoscene | 243b13f96263c238a7b8c68b59ac76b9cff4c337 | [
"Artistic-2.0"
] | 30 | 2015-12-19T23:08:22.000Z | 2022-02-25T15:50:47.000Z | effects/uvmap/data/gradient.py | AltairQ/demoscene | 243b13f96263c238a7b8c68b59ac76b9cff4c337 | [
"Artistic-2.0"
] | 17 | 2015-02-10T19:33:31.000Z | 2022-02-24T07:10:57.000Z | #!/usr/bin/env python3 -B
from PIL import Image
from utils import lerp, ccir601
import sys
if __name__ == "__main__":
im1 = Image.open(sys.argv[1])
im2 = Image.open(sys.argv[2])
pal1 = sorted(getcolors(im1), key=ccir601)
pal2 = sorted(getcolors(im2), key=ccir601)
im = Image.new('RGB', (16, 16)... | 24.272727 | 59 | 0.52809 | #!/usr/bin/env python3 -B
from PIL import Image
from utils import lerp, ccir601
import sys
def getcolors(im):
pal = im.getpalette()
return [(pal[i * 3], pal[i * 3 + 1], pal[i * 3 + 2])
for _, i in im.getcolors()]
if __name__ == "__main__":
im1 = Image.open(sys.argv[1])
im2 = Image.open(... | 120 | 0 | 23 |
0881daa1cb9f4b2f71f80adb0abea3dfc0e8ce8a | 341 | py | Python | scripts/for_loop.py | arifulhaqueuc/python-multithreading-example | d986167399332e1839e5415266bb789350068c71 | [
"MIT"
] | 28 | 2019-08-06T18:31:24.000Z | 2021-11-28T19:05:46.000Z | scripts/for_loop.py | arifulhaqueuc/python-multithreading-example | d986167399332e1839e5415266bb789350068c71 | [
"MIT"
] | 7 | 2018-01-12T16:57:50.000Z | 2018-01-29T22:36:48.000Z | scripts/for_loop.py | arifulhaqueuc/python-multithreading-example | d986167399332e1839e5415266bb789350068c71 | [
"MIT"
] | 11 | 2019-10-17T21:45:49.000Z | 2021-09-21T10:08:39.000Z | import time
from threading import Thread
if __name__ == "__main__":
Main()
| 18.944444 | 57 | 0.642229 | import time
from threading import Thread
def ThreadFunction(x):
print "sleeping 5 sec from thread %d" % x
time.sleep(5)
print "finished sleeping from thread %d" % x
def Main():
for i in range(10):
myThread = Thread(target=ThreadFunction, args=(i,))
myThread.start()
if __name__ == "__... | 207 | 0 | 46 |
7c332e8658e7fc37c3280d68bb932872d098f789 | 1,828 | py | Python | chia/wallet/key_val_store.py | ForestCrazy/chia-blockchain-remote-plot | 0ba838b7a8ea2b5410d438ac70295df699a30dae | [
"Apache-2.0"
] | 11,902 | 2019-12-05T00:14:29.000Z | 2022-03-31T23:25:37.000Z | chia/wallet/key_val_store.py | ForestCrazy/chia-blockchain-remote-plot | 0ba838b7a8ea2b5410d438ac70295df699a30dae | [
"Apache-2.0"
] | 5,246 | 2019-12-05T04:00:03.000Z | 2022-03-31T21:33:30.000Z | chia/wallet/key_val_store.py | Devh4ox4d/silishitcoin | 4372d06aa4a54220f2bde29c8081410503679a82 | [
"Apache-2.0"
] | 2,149 | 2019-12-05T11:12:53.000Z | 2022-03-31T06:08:34.000Z | from typing import Any
import aiosqlite
from chia.util.byte_types import hexstr_to_bytes
from chia.util.db_wrapper import DBWrapper
from chia.util.streamable import Streamable
class KeyValStore:
"""
Multipurpose persistent key-value store
"""
db_connection: aiosqlite.Connection
db_wrapper: DBWr... | 29.483871 | 100 | 0.632932 | from typing import Any
import aiosqlite
from chia.util.byte_types import hexstr_to_bytes
from chia.util.db_wrapper import DBWrapper
from chia.util.streamable import Streamable
class KeyValStore:
"""
Multipurpose persistent key-value store
"""
db_connection: aiosqlite.Connection
db_wrapper: DBWr... | 598 | 0 | 53 |
c58b384a6b1a47463bfbe3332eca0f2a6bf3cddc | 3,799 | py | Python | src/gpt_utils/core.py | nelsonlove/gpt-utils | 1ce52a160c26b647f7674bf518a322b54b6080da | [
"MIT"
] | null | null | null | src/gpt_utils/core.py | nelsonlove/gpt-utils | 1ce52a160c26b647f7674bf518a322b54b6080da | [
"MIT"
] | null | null | null | src/gpt_utils/core.py | nelsonlove/gpt-utils | 1ce52a160c26b647f7674bf518a322b54b6080da | [
"MIT"
] | null | null | null | import os
import openai
class GPT:
"""Base object for GPT-3 completions"""
api_key = os.environ.get('OPENAI_API_KEY')
@classmethod
def requires_key(cls, func):
"""Decorator function which allows passing API key as keyword argument"""
return wrapped
| 33.919643 | 111 | 0.496183 | import os
import openai
class GPT:
"""Base object for GPT-3 completions"""
api_key = os.environ.get('OPENAI_API_KEY')
@classmethod
def requires_key(cls, func):
"""Decorator function which allows passing API key as keyword argument"""
def wrapped(*args, api_key=None, **kwargs):
... | 3,400 | 0 | 112 |
bbea06109d4d8af46127c9ed3f65ee511ef06c91 | 263 | py | Python | text.py | terrifyzhao/address_ner | 9d367be1c8c79a4915579c361d5833d4b476e30b | [
"Apache-2.0"
] | 1 | 2021-07-29T09:11:35.000Z | 2021-07-29T09:11:35.000Z | text.py | terrifyzhao/address_ner | 9d367be1c8c79a4915579c361d5833d4b476e30b | [
"Apache-2.0"
] | null | null | null | text.py | terrifyzhao/address_ner | 9d367be1c8c79a4915579c361d5833d4b476e30b | [
"Apache-2.0"
] | null | null | null | from transformers import BertTokenizerFast
model_path = '/Users/joezhao/Documents/pretrain model/chinese_roberta_wwm_ext_L-12_H-768_A-12'
tokenizer = BertTokenizerFast.from_pretrained(model_path)
print(tokenizer.decode(tokenizer('朝阳区嘉翔大厦A座0000室')['input_ids'])) | 52.6 | 94 | 0.844106 | from transformers import BertTokenizerFast
model_path = '/Users/joezhao/Documents/pretrain model/chinese_roberta_wwm_ext_L-12_H-768_A-12'
tokenizer = BertTokenizerFast.from_pretrained(model_path)
print(tokenizer.decode(tokenizer('朝阳区嘉翔大厦A座0000室')['input_ids'])) | 0 | 0 | 0 |
6d13f9308612699f64d88bcfc65784c82034851f | 1,399 | py | Python | hornet/hornet.py | bheklilr/hornet | 2ede630e08e65db703f3b3a3f4fb567f3e7647ec | [
"MIT"
] | null | null | null | hornet/hornet.py | bheklilr/hornet | 2ede630e08e65db703f3b3a3f4fb567f3e7647ec | [
"MIT"
] | null | null | null | hornet/hornet.py | bheklilr/hornet | 2ede630e08e65db703f3b3a3f4fb567f3e7647ec | [
"MIT"
] | null | null | null | from collections import Mapping, MutableMapping
| 26.903846 | 49 | 0.562545 | from collections import Mapping, MutableMapping
class Hornet(MutableMapping):
OBJECT_PAIRS_HOOK = dict
_underlying_mapping = OBJECT_PAIRS_HOOK()
def __init__(self, items=(), **kwargs):
if isinstance(items, Mapping):
items = items.items()
for k, v in items:
if isin... | 1,027 | 300 | 23 |
ec74872bf16841429da5381dddc80cad3078d72a | 3,183 | py | Python | leetcode_python/Stack/valid-parentheses.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Stack/valid-parentheses.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | null | null | null | leetcode_python/Stack/valid-parentheses.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | """
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
An input string is valid if:
Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order.
Note that an empty string is also considered valid.
E... | 23.753731 | 79 | 0.480993 | """
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
An input string is valid if:
Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order.
Note that an empty string is also considered valid.
E... | 1,270 | 705 | 236 |
c3fbfd68b81bd91db4d534cc82821e38718c0296 | 2,831 | py | Python | Counter.py | TPCD/DailyReadPaper | 4ee6cc77f4f7752ad14ec36a72cc1df5b5c373ed | [
"MIT"
] | 14 | 2019-01-18T10:01:02.000Z | 2021-05-10T14:14:19.000Z | Counter.py | TPCD/DailyReadPaper | 4ee6cc77f4f7752ad14ec36a72cc1df5b5c373ed | [
"MIT"
] | null | null | null | Counter.py | TPCD/DailyReadPaper | 4ee6cc77f4f7752ad14ec36a72cc1df5b5c373ed | [
"MIT"
] | null | null | null | import time
import os
import re
def counter(file = 'README.md'):
"""
read .md or .txt format file
:param file: .md or .txt format file
:return: data
"""
num = 0
with open(file, 'r', encoding='UTF-8') as f:
lines = f.readlines()
for line in lines:
p1 = re.compile(r'[{](.*... | 34.950617 | 101 | 0.456729 | import time
import os
import re
def counter(file = 'README.md'):
"""
read .md or .txt format file
:param file: .md or .txt format file
:return: data
"""
num = 0
with open(file, 'r', encoding='UTF-8') as f:
lines = f.readlines()
for line in lines:
p1 = re.compile(r'[{](.*... | 2,207 | 0 | 69 |
3536085a487b700759af749256bd8e79895a6608 | 4,021 | py | Python | symchar.py | chrisryba/symmetric-group | beffbda316c48958d067abd91ef6445c3fa04221 | [
"MIT"
] | 1 | 2021-11-09T14:56:28.000Z | 2021-11-09T14:56:28.000Z | symchar.py | chrisryba/symmetric-group | beffbda316c48958d067abd91ef6445c3fa04221 | [
"MIT"
] | null | null | null | symchar.py | chrisryba/symmetric-group | beffbda316c48958d067abd91ef6445c3fa04221 | [
"MIT"
] | null | null | null | # Christopher Ryba, 2016
# This code calculates the character values \chi_\mu^\lambda of the
# symmetric groups. Here \lambda and \mu are partitions of the same size,
# represented as either lists or tuples of integers without trailing zeros.
# The function that returns the character value is char_val, so an example
... | 34.076271 | 82 | 0.703059 | # Christopher Ryba, 2016
# This code calculates the character values \chi_\mu^\lambda of the
# symmetric groups. Here \lambda and \mu are partitions of the same size,
# represented as either lists or tuples of integers without trailing zeros.
# The function that returns the character value is char_val, so an example
... | 2,543 | 0 | 88 |
6e3d1ea7b5863385463aa80119a646e45b97f8e1 | 5,222 | py | Python | project_evolution/project_evol.py | Anonymous-double-blind/ReplicationTool | 38f6b13fd91e477f3b58c60725696cba3fc844f6 | [
"BSD-3-Clause"
] | null | null | null | project_evolution/project_evol.py | Anonymous-double-blind/ReplicationTool | 38f6b13fd91e477f3b58c60725696cba3fc844f6 | [
"BSD-3-Clause"
] | null | null | null | project_evolution/project_evol.py | Anonymous-double-blind/ReplicationTool | 38f6b13fd91e477f3b58c60725696cba3fc844f6 | [
"BSD-3-Clause"
] | null | null | null | import sqlite3
from sqlite3 import Error
import pathlib
import logging
import sys
import os, shutil
import time
from pydriller import GitRepository
from Model_commits_info import Model_commits_info_Controller
from Project_commits_info import Project_commits_info_Controller
from Project_commits_verbatim import Project... | 38.116788 | 148 | 0.675029 | import sqlite3
from sqlite3 import Error
import pathlib
import logging
import sys
import os, shutil
import time
from pydriller import GitRepository
from Model_commits_info import Model_commits_info_Controller
from Project_commits_info import Project_commits_info_Controller
from Project_commits_verbatim import Project... | 3,719 | 0 | 91 |
9c10636ce55f6757e281f8ecb92da1fa3d6e5b76 | 5,311 | py | Python | wappsto/data_operation/encoder.py | mads-slx/wappsto-python | 9ddc5cf0c3b761fb826baf00564da4e4d4048d7d | [
"Apache-2.0"
] | null | null | null | wappsto/data_operation/encoder.py | mads-slx/wappsto-python | 9ddc5cf0c3b761fb826baf00564da4e4d4048d7d | [
"Apache-2.0"
] | null | null | null | wappsto/data_operation/encoder.py | mads-slx/wappsto-python | 9ddc5cf0c3b761fb826baf00564da4e4d4048d7d | [
"Apache-2.0"
] | null | null | null | """
The wappsto encoding module.
Handles encoding object instances to a JSON file.
"""
import logging
from ..connection.seluxit_rpc import SeluxitRpc
class WappstoEncoder:
"""
The wappsto encoding class.
Handles encoding the current runtime object instances into JSON. This
allows the system to be sa... | 27.376289 | 76 | 0.528337 | """
The wappsto encoding module.
Handles encoding object instances to a JSON file.
"""
import logging
from ..connection.seluxit_rpc import SeluxitRpc
class WappstoEncoder:
"""
The wappsto encoding class.
Handles encoding the current runtime object instances into JSON. This
allows the system to be sa... | 0 | 0 | 0 |
2e06b61157077503b56b3e36f0b0a187aeeb0df3 | 717 | py | Python | rest/taskrouter/worker-reservations/accept/example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 2 | 2017-11-23T11:31:20.000Z | 2018-01-22T04:14:02.000Z | rest/taskrouter/worker-reservations/accept/example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | null | null | null | rest/taskrouter/worker-reservations/accept/example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 2 | 2020-05-22T23:31:21.000Z | 2021-06-10T18:33:45.000Z | # Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioTaskRouterClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
w... | 37.736842 | 72 | 0.835425 | # Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioTaskRouterClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
w... | 0 | 0 | 0 |
37cdcaa86634e81a02a7dec208ceaf45adc2d905 | 898 | py | Python | 2021-01-13/solution.py | ammardodin/daily-coding-problem | 8cdc335912ffe35a9e5b5f58d505541537878efb | [
"MIT"
] | null | null | null | 2021-01-13/solution.py | ammardodin/daily-coding-problem | 8cdc335912ffe35a9e5b5f58d505541537878efb | [
"MIT"
] | null | null | null | 2021-01-13/solution.py | ammardodin/daily-coding-problem | 8cdc335912ffe35a9e5b5f58d505541537878efb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from collections import OrderedDict
assert make_palindrome("") == ""
assert make_palindrome("a") == "a"
assert make_palindrome("aab") == "aba"
assert make_palindrome("aaa") == "aaa"
assert(make_palindrome("bbaa")) == "baab"
assert(make_palindrome("aaaabbc")) == "aabcbaa"
assert(make_palindrome(... | 24.27027 | 49 | 0.555679 | #!/usr/bin/env python3
from collections import OrderedDict
def make_palindrome(candidate):
freq = OrderedDict()
for c in candidate:
freq[c] = freq.get(c, 0) + 1
num_odd = 0
odd_char = ''
for c, f in freq.items():
if f & 1:
num_odd = num_odd + 1
odd_char = c
... | 538 | 0 | 23 |
1f4c385ecb2322a200728d566cb11ab9b1736625 | 912 | py | Python | setup.py | knyazz/py3-django-enriched-carton | 27d97388d8153f29a3c629cdcd3e734ad09dc52e | [
"MIT"
] | null | null | null | setup.py | knyazz/py3-django-enriched-carton | 27d97388d8153f29a3c629cdcd3e734ad09dc52e | [
"MIT"
] | null | null | null | setup.py | knyazz/py3-django-enriched-carton | 27d97388d8153f29a3c629cdcd3e734ad09dc52e | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
import carton
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name='py3-django-enriched-carton',
version=carton.__version__,
description=carton.__doc__,
packages=find_packages(),
url='https://github.com/kny... | 27.636364 | 71 | 0.658991 | from setuptools import setup, find_packages
import carton
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name='py3-django-enriched-carton',
version=carton.__version__,
description=carton.__doc__,
packages=find_packages(),
url='https://github.com/kny... | 0 | 0 | 0 |
9b9a96ec9f05a33ddd66edb2fc987a40856db6ce | 138 | py | Python | data/projects.py | OlgaSidortcova/python_training_mantis | 8854c6aa3cb5aaede161dafd22b04a9c69ce23f2 | [
"Apache-2.0"
] | null | null | null | data/projects.py | OlgaSidortcova/python_training_mantis | 8854c6aa3cb5aaede161dafd22b04a9c69ce23f2 | [
"Apache-2.0"
] | null | null | null | data/projects.py | OlgaSidortcova/python_training_mantis | 8854c6aa3cb5aaede161dafd22b04a9c69ce23f2 | [
"Apache-2.0"
] | null | null | null | from model.project import Project
testdata = [
Project(name="name1", description="1"),
Project(name="name2", description="2")
]
| 17.25 | 43 | 0.673913 | from model.project import Project
testdata = [
Project(name="name1", description="1"),
Project(name="name2", description="2")
]
| 0 | 0 | 0 |
dc25502ccebc37ea53b9519a66a4578f19a8c306 | 2,387 | py | Python | banner_merge_analysis/mutil_banner_extract.py | Achelics/mutil_device_recongition | be92835f6bf3fc7acd2e1d9f48ad883b7ccf55a2 | [
"Apache-2.0"
] | 3 | 2017-05-04T05:22:34.000Z | 2017-05-04T06:24:12.000Z | banner_merge_analysis/mutil_banner_extract.py | Achelics/mutil_device_recongition | be92835f6bf3fc7acd2e1d9f48ad883b7ccf55a2 | [
"Apache-2.0"
] | null | null | null | banner_merge_analysis/mutil_banner_extract.py | Achelics/mutil_device_recongition | be92835f6bf3fc7acd2e1d9f48ad883b7ccf55a2 | [
"Apache-2.0"
] | 1 | 2020-04-24T10:47:03.000Z | 2020-04-24T10:47:03.000Z | #!/usr/bin/env/ python
# coding=utf-8
__author__ = 'Achelics'
__Date__ = '2017/05/16'
from data_pre_process.split_banner_man import *
import os
import json as _json
def get_ip_banner(path, filename, protocol_validity_json):
"""
提取ip和标语
:param path: 标语文件所在路径
:param filename: 标语文件名称
:param prot... | 33.619718 | 133 | 0.639296 | #!/usr/bin/env/ python
# coding=utf-8
__author__ = 'Achelics'
__Date__ = '2017/05/16'
from data_pre_process.split_banner_man import *
import os
import json as _json
def get_ip_banner(path, filename, protocol_validity_json):
"""
提取ip和标语
:param path: 标语文件所在路径
:param filename: 标语文件名称
:param prot... | 0 | 0 | 0 |
f00b4aec052e786b16ff7f59a68f81fb4df137bf | 120 | py | Python | enceladus/progressbar.py | doublevcodes/Enceladus.py | 836d9928094b5a287c53667e63ebc7558aa70422 | [
"MIT"
] | null | null | null | enceladus/progressbar.py | doublevcodes/Enceladus.py | 836d9928094b5a287c53667e63ebc7558aa70422 | [
"MIT"
] | null | null | null | enceladus/progressbar.py | doublevcodes/Enceladus.py | 836d9928094b5a287c53667e63ebc7558aa70422 | [
"MIT"
] | null | null | null | import os | 20 | 62 | 0.675 | import os
class ProgressBar:
def __init__(self, max_width = os.get_terminal_size()[1]):
super().__init__() | 64 | -3 | 50 |
13a6fae8da1fa7a0392739a0f6188e36f1014e72 | 4,460 | py | Python | main.py | ajayreddychinthala/Python-Assistant | 060ad3efd713985df57a57863fe2d65a4b3de5eb | [
"MIT"
] | 3 | 2020-11-07T13:33:44.000Z | 2021-02-03T05:57:12.000Z | main.py | ajayreddychinthala/Jarvis | 060ad3efd713985df57a57863fe2d65a4b3de5eb | [
"MIT"
] | null | null | null | main.py | ajayreddychinthala/Jarvis | 060ad3efd713985df57a57863fe2d65a4b3de5eb | [
"MIT"
] | null | null | null | import requirements
from requirements import *
engine = pyttsx3.init('sapi5')
client = wolframalpha.Client('33UPA7-YGAUU4EYQA')
voices = engine.getProperty('voices')
#engine.setProperty('voice', voices[2].id)
engine.setProperty('voices',voices[len(voices)-1])
#engine.setProperty('voice', voices[1].id)
eng... | 34.573643 | 99 | 0.546861 | import requirements
from requirements import *
engine = pyttsx3.init('sapi5')
client = wolframalpha.Client('33UPA7-YGAUU4EYQA')
voices = engine.getProperty('voices')
#engine.setProperty('voice', voices[2].id)
engine.setProperty('voices',voices[len(voices)-1])
#engine.setProperty('voice', voices[1].id)
eng... | 741 | 0 | 73 |
c21d46ef93adca908adaa1dd261cbd4b98a31a90 | 504 | py | Python | sample/old/fx.py | Hyper-Devil/learn-python3 | c097158c48b9f6804c8c46aebf00025249089bf6 | [
"MIT"
] | null | null | null | sample/old/fx.py | Hyper-Devil/learn-python3 | c097158c48b9f6804c8c46aebf00025249089bf6 | [
"MIT"
] | null | null | null | sample/old/fx.py | Hyper-Devil/learn-python3 | c097158c48b9f6804c8c46aebf00025249089bf6 | [
"MIT"
] | null | null | null | # 无参数
print_hello()
# 带参数 fuckfuck
r = print_str("fuck")
print(r)
# 带默认参数
print_default()
print_default("default")
# 不定长参数
print_args("hello")
print_args("hello", "world", "1")
# 参数次序可以变
print_two(a="a", b="b")
print_two(b="b", a="a")
| 10.723404 | 33 | 0.597222 | # 无参数
def print_hello():
print("hello")
print_hello()
# 带参数 fuckfuck
def print_str(s):
print(s)
return s * 2
r = print_str("fuck")
print(r)
# 带默认参数
def print_default(s="hello"):
print(s)
print_default()
print_default("default")
# 不定长参数
def print_args(s, *arg):
print(s)
for a in arg:... | 140 | 0 | 110 |
6b595b2ab939856deaa60fba086d791d3431873f | 1,109 | py | Python | data/src/demos/coordinates_from_kml.py | blackradley/heathmynd | 4495f8fadef9d3a36a7d5b49fae2b61cceb158bc | [
"MIT"
] | null | null | null | data/src/demos/coordinates_from_kml.py | blackradley/heathmynd | 4495f8fadef9d3a36a7d5b49fae2b61cceb158bc | [
"MIT"
] | 4 | 2018-11-06T16:15:10.000Z | 2018-11-07T12:03:09.000Z | data/src/demos/coordinates_from_kml.py | blackradley/heathmynd | 4495f8fadef9d3a36a7d5b49fae2b61cceb158bc | [
"MIT"
] | null | null | null | '''
Get the coordinates of a wikipage from some KML.
Joe Collins
26 March 2011
'''
import re # for regular expressions
import string
kml = '''<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<name><![CDATA[Bedford Museum & Art Gallery]]></name>
<open>1</open>
<Folder>... | 27.725 | 172 | 0.65284 | '''
Get the coordinates of a wikipage from some KML.
Joe Collins
26 March 2011
'''
import re # for regular expressions
import string
kml = '''<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<name><![CDATA[Bedford Museum & Art Gallery]]></name>
<open>1</open>
<Folder>... | 0 | 0 | 0 |
0c45d33c85b30a831e100612f11bf2d2d5b5d889 | 314 | py | Python | ProjectEuler.Problem.031.py | jihunroh/ProjectEuler-Python | 2fceaf5c3dd61038004b6128c5d9ee7a76142bca | [
"MIT"
] | null | null | null | ProjectEuler.Problem.031.py | jihunroh/ProjectEuler-Python | 2fceaf5c3dd61038004b6128c5d9ee7a76142bca | [
"MIT"
] | null | null | null | ProjectEuler.Problem.031.py | jihunroh/ProjectEuler-Python | 2fceaf5c3dd61038004b6128c5d9ee7a76142bca | [
"MIT"
] | null | null | null | from ProjectEulerCommons.Base import *
Answer(
count_summation_way(200, [200, 100, 50, 20, 10, 5, 2, 1])
)
"""
------------------------------------------------
ProjectEuler.Problem.031.py
The Answer is: 73682
Time Elasped: 0.07277131080627441sec
------------------------------------------------
"""
| 22.428571 | 61 | 0.471338 | from ProjectEulerCommons.Base import *
Answer(
count_summation_way(200, [200, 100, 50, 20, 10, 5, 2, 1])
)
"""
------------------------------------------------
ProjectEuler.Problem.031.py
The Answer is: 73682
Time Elasped: 0.07277131080627441sec
------------------------------------------------
"""
| 0 | 0 | 0 |
6aad439b193dae598f60608dc43e734d67715e78 | 129 | py | Python | scraper/apps.py | Spferical/cure-alzheimers-fund-tracker | 1b3ad0e8c3fc29fb8640b3ffe525daa3fa5fcafb | [
"MIT"
] | null | null | null | scraper/apps.py | Spferical/cure-alzheimers-fund-tracker | 1b3ad0e8c3fc29fb8640b3ffe525daa3fa5fcafb | [
"MIT"
] | null | null | null | scraper/apps.py | Spferical/cure-alzheimers-fund-tracker | 1b3ad0e8c3fc29fb8640b3ffe525daa3fa5fcafb | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
| 18.428571 | 39 | 0.79845 | from __future__ import unicode_literals
from django.apps import AppConfig
class ScraperConfig(AppConfig):
name = 'scraper'
| 0 | 31 | 23 |
33d5fefcbcca63ab6fc4a2b2e21930f85104a8f0 | 482 | py | Python | tuna/__main__.py | kernelmachine/tuna | 7680efa522d0f97c80decb6555c721a413faba33 | [
"Apache-2.0"
] | 25 | 2019-01-30T13:01:08.000Z | 2020-10-01T15:00:05.000Z | tuna/__main__.py | kernelmachine/tuna | 7680efa522d0f97c80decb6555c721a413faba33 | [
"Apache-2.0"
] | null | null | null | tuna/__main__.py | kernelmachine/tuna | 7680efa522d0f97c80decb6555c721a413faba33 | [
"Apache-2.0"
] | 3 | 2019-02-20T22:02:46.000Z | 2019-07-18T11:54:10.000Z | #!/usr/bin/env python
import sys
import logging
import os
from tuna.runners import AllenNlpRunner
from tuna.executors import RayExecutor
if os.environ.get("TUNA_DEBUG"):
LEVEL = logging.DEBUG
else:
LEVEL = logging.INFO
logging.basicConfig(
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", le... | 17.851852 | 78 | 0.690871 | #!/usr/bin/env python
import sys
import logging
import os
from tuna.runners import AllenNlpRunner
from tuna.executors import RayExecutor
if os.environ.get("TUNA_DEBUG"):
LEVEL = logging.DEBUG
else:
LEVEL = logging.INFO
logging.basicConfig(
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", le... | 86 | 0 | 23 |
7c13f825e64f3e01124ab7b15de450da2308493d | 545 | py | Python | src/09/urls.py | rvalle71mx/PY201 | ac5cc75371c2f3a658dd6483da3f8effe4a492d7 | [
"MIT"
] | 9 | 2018-05-07T06:25:07.000Z | 2021-11-10T15:22:00.000Z | src/09/urls.py | rvalle71mx/PY201 | ac5cc75371c2f3a658dd6483da3f8effe4a492d7 | [
"MIT"
] | null | null | null | src/09/urls.py | rvalle71mx/PY201 | ac5cc75371c2f3a658dd6483da3f8effe4a492d7 | [
"MIT"
] | 4 | 2018-05-18T01:02:46.000Z | 2021-01-29T17:55:03.000Z | from django.urls import path, re_path
from . import views
urlpatterns = [path('', views.index, name="inicio"),
path('vista', views.vista),
re_path(r'^claves/(?P<clave>[0-9]{4}$)', views.clave),
path('claves/<int:numero>', views.numero),
path('clave... | 41.923077 | 70 | 0.526606 | from django.urls import path, re_path
from . import views
urlpatterns = [path('', views.index, name="inicio"),
path('vista', views.vista),
re_path(r'^claves/(?P<clave>[0-9]{4}$)', views.clave),
path('claves/<int:numero>', views.numero),
path('clave... | 0 | 0 | 0 |
5da4c52fd4ad3ef40280997a7b6626dcbf2df3e7 | 2,414 | py | Python | peers.py | Someguy123/steem-peers | b96845b682386cbe37601319daf8881bf1dd0254 | [
"Linux-OpenIB"
] | 7 | 2020-03-27T22:44:14.000Z | 2021-11-10T00:47:19.000Z | peers.py | Someguy123/steem-peers | b96845b682386cbe37601319daf8881bf1dd0254 | [
"Linux-OpenIB"
] | null | null | null | peers.py | Someguy123/steem-peers | b96845b682386cbe37601319daf8881bf1dd0254 | [
"Linux-OpenIB"
] | 2 | 2019-09-09T08:36:40.000Z | 2020-03-27T22:44:03.000Z | #!/usr/bin/env python3
######################################
# Steem Peers Scanner - Main Python Script
# Part of https://github.com/someguy123/steem-peers
#
# Usage:
#
# sudo -H pip3 install -r requirements.txt
# sudo ./update_geoip.sh
# sudo ./peers.py
#
#
# Environment Options (place in .env or pass on comma... | 36.575758 | 141 | 0.71541 | #!/usr/bin/env python3
######################################
# Steem Peers Scanner - Main Python Script
# Part of https://github.com/someguy123/steem-peers
#
# Usage:
#
# sudo -H pip3 install -r requirements.txt
# sudo ./update_geoip.sh
# sudo ./peers.py
#
#
# Environment Options (place in .env or pass on comma... | 0 | 0 | 0 |
4b5e74bae2f750805bbfc08bccdb2b2f77a16eda | 314 | py | Python | brick/ida/modules/postprocessor/uefi/smm/cpu/__init__.py | nstarke/brick | cab44da77458d6cd22411c1d3b5f3e9775db4a0b | [
"MIT"
] | 60 | 2021-06-20T15:12:41.000Z | 2022-03-29T10:47:01.000Z | brick/ida/modules/postprocessor/uefi/smm/cpu/__init__.py | nstarke/brick | cab44da77458d6cd22411c1d3b5f3e9775db4a0b | [
"MIT"
] | 3 | 2021-09-21T14:20:57.000Z | 2022-02-06T23:31:56.000Z | brick/ida/modules/postprocessor/uefi/smm/cpu/__init__.py | nstarke/brick | cab44da77458d6cd22411c1d3b5f3e9775db4a0b | [
"MIT"
] | 7 | 2021-06-20T16:31:28.000Z | 2022-03-29T10:47:03.000Z | from ...factory.factory import UefiCallFactory
from .ReadSaveState import ReadSaveStateCall
from .WriteSaveState import WriteSaveStateCall
SmmCpuCallsFactory = UefiCallFactory()
SmmCpuCallsFactory.register('ReadSaveState', ReadSaveStateCall)
SmmCpuCallsFactory.register('WriteSaveState', WriteSaveStateCall) | 39.25 | 67 | 0.853503 | from ...factory.factory import UefiCallFactory
from .ReadSaveState import ReadSaveStateCall
from .WriteSaveState import WriteSaveStateCall
SmmCpuCallsFactory = UefiCallFactory()
SmmCpuCallsFactory.register('ReadSaveState', ReadSaveStateCall)
SmmCpuCallsFactory.register('WriteSaveState', WriteSaveStateCall) | 0 | 0 | 0 |
91ae7bb083d2e1da851899441a176b3018e46916 | 1,337 | py | Python | platform_cli/protected_file_path.py | dtweet/platform_cli | 89c1c29096551f0490c3fb81b47d4f4cdaa3aca4 | [
"Apache-2.0"
] | 1 | 2017-05-03T07:16:17.000Z | 2017-05-03T07:16:17.000Z | platform_cli/protected_file_path.py | dtweet/platform_cli | 89c1c29096551f0490c3fb81b47d4f4cdaa3aca4 | [
"Apache-2.0"
] | null | null | null | platform_cli/protected_file_path.py | dtweet/platform_cli | 89c1c29096551f0490c3fb81b47d4f4cdaa3aca4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (C) 2013 Jive Software. All rights reserved.
"""Context manager marking a path with a .lock directory for exclusive access.
"""
import os
import time
class Error(Exception):
"""Base exception class for this module."""
class ProtectedFilePath(object):
"""Context manager for ex... | 27.854167 | 78 | 0.641735 | #!/usr/bin/env python
# Copyright (C) 2013 Jive Software. All rights reserved.
"""Context manager marking a path with a .lock directory for exclusive access.
"""
import os
import time
class Error(Exception):
"""Base exception class for this module."""
class ProtectedFilePath(object):
"""Context manager for ex... | 0 | 0 | 0 |
1986f17ebc4b8875227ef002aff84452591a4174 | 680 | py | Python | src/Maps/TerainCharacteristics/Rivers.py | blob-1/Worlds | c424ea18b867614214bc2f50e32538da30066f73 | [
"MIT"
] | null | null | null | src/Maps/TerainCharacteristics/Rivers.py | blob-1/Worlds | c424ea18b867614214bc2f50e32538da30066f73 | [
"MIT"
] | null | null | null | src/Maps/TerainCharacteristics/Rivers.py | blob-1/Worlds | c424ea18b867614214bc2f50e32538da30066f73 | [
"MIT"
] | null | null | null | from pygame.draw import aaline
from math import ceil | 20 | 56 | 0.582353 | from pygame.draw import aaline
from math import ceil
class River():
def __init__(self, start, end):
self.__start = start
self.__end = end
def draw(self, surface, x, y, w, h):
start_pos = self.__get_point(self.__start, x, y, w, h)
end_pos = self.__get_point(self.__end, x, y, w, h)
if start_pos[0] > end_p... | 537 | -7 | 98 |
0e89cf6ee03cfac2010e4277c0cc5038363e3a0d | 502 | py | Python | tests.py | spddb/spddb | f8156090026dee363b49203dfa920639fc44b7d7 | [
"MIT"
] | 1 | 2018-05-31T14:45:35.000Z | 2018-05-31T14:45:35.000Z | tests.py | spddb/spddb | f8156090026dee363b49203dfa920639fc44b7d7 | [
"MIT"
] | null | null | null | tests.py | spddb/spddb | f8156090026dee363b49203dfa920639fc44b7d7 | [
"MIT"
] | null | null | null | from spddb import *
db = ziverdb("hello.db")
db.insert("hello", "world")
print db.have("hello") == True
print db.get("hello") == "world"
print db.getsize() == 18
print db.getkeys() == ['hello']
db.delete("hello")
print db.have("hello") == False
print db.get("hello") == False
print db.getsize() == 2
o... | 11.674419 | 32 | 0.61753 | from spddb import *
db = ziverdb("hello.db")
db.insert("hello", "world")
print db.have("hello") == True
print db.get("hello") == "world"
print db.getsize() == 18
print db.getkeys() == ['hello']
db.delete("hello")
print db.have("hello") == False
print db.get("hello") == False
print db.getsize() == 2
o... | 0 | 0 | 0 |
1fa22fa53d695d91eb5244e3d09bdf7fd86abd49 | 4,062 | py | Python | experiments/ai2_auxiliary/trainer.py | jkulhanek/a2cat-vn | 6283c1f1f7c88e87387f606fddfb16d8e3f66906 | [
"MIT"
] | 1 | 2022-03-24T01:47:14.000Z | 2022-03-24T01:47:14.000Z | experiments/ai2_auxiliary/trainer.py | jkulhanek/a2cat-vn | 6283c1f1f7c88e87387f606fddfb16d8e3f66906 | [
"MIT"
] | null | null | null | experiments/ai2_auxiliary/trainer.py | jkulhanek/a2cat-vn | 6283c1f1f7c88e87387f606fddfb16d8e3f66906 | [
"MIT"
] | null | null | null | import os
from deep_rl.actor_critic import Unreal as UnrealTrainer, UnrealAgent
from deep_rl.actor_critic.unreal.unreal import without_last_item
from deep_rl.actor_critic.unreal.utils import autocrop_observations
from deep_rl.utils import KeepTensor, detach_all, expand_time_dimension, pytorch_call
from deep_rl.common.p... | 40.62 | 109 | 0.681438 | import os
from deep_rl.actor_critic import Unreal as UnrealTrainer, UnrealAgent
from deep_rl.actor_critic.unreal.unreal import without_last_item
from deep_rl.actor_critic.unreal.utils import autocrop_observations
from deep_rl.utils import KeepTensor, detach_all, expand_time_dimension, pytorch_call
from deep_rl.common.p... | 3,264 | 30 | 333 |
f28f4794270e60e2d93c11f604270b06bd3f6e8a | 934 | py | Python | src/example/getData.py | tedmundtan/Unicorn11 | 70657f227031d9e6e94e3fb98e71573c7e4ee9a9 | [
"Apache-2.0"
] | null | null | null | src/example/getData.py | tedmundtan/Unicorn11 | 70657f227031d9e6e94e3fb98e71573c7e4ee9a9 | [
"Apache-2.0"
] | null | null | null | src/example/getData.py | tedmundtan/Unicorn11 | 70657f227031d9e6e94e3fb98e71573c7e4ee9a9 | [
"Apache-2.0"
] | 1 | 2019-03-31T04:11:26.000Z | 2019-03-31T04:11:26.000Z | import requests
import json
import datetime
url = "http://api-gateway-dbs-techtrek.ap-southeast-1.elasticbeanstalk.com/transactions/10"
querystring = {"from":"01-01-2019","to":"01-31-2019"}
payload = ""
headers = {
'identity': "Group11",
'token': "bf38d9ac-fade-40ef-b7d2-eabdb183acce",
'cache-control': "... | 25.944444 | 91 | 0.67666 | import requests
import json
import datetime
url = "http://api-gateway-dbs-techtrek.ap-southeast-1.elasticbeanstalk.com/transactions/10"
querystring = {"from":"01-01-2019","to":"01-31-2019"}
payload = ""
headers = {
'identity': "Group11",
'token': "bf38d9ac-fade-40ef-b7d2-eabdb183acce",
'cache-control': "... | 0 | 0 | 0 |
808cfc412896d3017e6baf154486668b50e73754 | 160 | py | Python | GodwillOnyewuchi/Phase 1/Python Basic 2/day 3 task/task 2.py | nkem1010/python-challenge-solutions | 203cedc691094a83b110fc75764aac51dbbc1a03 | [
"MIT"
] | 1 | 2020-05-15T21:27:45.000Z | 2020-05-15T21:27:45.000Z | GodwillOnyewuchi/Phase 1/Python Basic 2/day 3 task/task 2.py | GREENFONTS/python-challenge-solutions | a9aad85a250892fe41961a7d5e77f67b8d14fc1b | [
"MIT"
] | null | null | null | GodwillOnyewuchi/Phase 1/Python Basic 2/day 3 task/task 2.py | GREENFONTS/python-challenge-solutions | a9aad85a250892fe41961a7d5e77f67b8d14fc1b | [
"MIT"
] | null | null | null | import calendar
month = int(input("Enter the month: "))
year = int(input("Enter the year: "))
Calendar = calendar.month(year, month)
print(Calendar) | 26.666667 | 43 | 0.66875 | import calendar
month = int(input("Enter the month: "))
year = int(input("Enter the year: "))
Calendar = calendar.month(year, month)
print(Calendar) | 0 | 0 | 0 |
662c2653232d2c1aaf5f7bb0e8e5194ff28b2deb | 2,739 | py | Python | pysimplegui/DemoPrograms/Demo_Script_Launcher.py | konsan1101/py-etc | bcca13119b0d2453866988404fd1c4976f55d4d5 | [
"MIT"
] | null | null | null | pysimplegui/DemoPrograms/Demo_Script_Launcher.py | konsan1101/py-etc | bcca13119b0d2453866988404fd1c4976f55d4d5 | [
"MIT"
] | 2 | 2020-06-06T00:30:56.000Z | 2021-06-10T22:30:37.000Z | pysimplegui/DemoPrograms/Demo_Script_Launcher.py | konsan1101/py-etc | bcca13119b0d2453866988404fd1c4976f55d4d5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import PySimpleGUI as sg
import glob
import ntpath
import subprocess
LOCATION_OF_YOUR_SCRIPTS = ''
# Execute the command. Will not see the output from the command until it completes.
# Executes command and immediately returns. Will not see anything the script outputs
if __name__ == '__ma... | 31.482759 | 97 | 0.581599 | #!/usr/bin/env python
import PySimpleGUI as sg
import glob
import ntpath
import subprocess
LOCATION_OF_YOUR_SCRIPTS = ''
# Execute the command. Will not see the output from the command until it completes.
def execute_command_blocking(command, *args):
expanded_args = []
for a in args:
expanded_args.... | 2,327 | 0 | 69 |
fe989b90d8372c6d7531553b906b561b05f3b23f | 4,239 | py | Python | library/src/webapp/editor/FCKeditor/editor/filemanager/connectors/py/connector.py | RyanAFinney/sakai | 872181852ddb27b503f1d614104d964bb56e7a6b | [
"ECL-2.0"
] | 7 | 2016-10-25T13:55:20.000Z | 2018-04-18T00:37:20.000Z | reference/library/src/webapp/editor/FCKeditor/editor/filemanager/connectors/py/connector.py | DukeLearningInnovation/sakai | b61a551fc9185366d790043770912c1c0874b8c4 | [
"ECL-2.0"
] | 216 | 2016-06-23T14:02:32.000Z | 2021-08-31T17:11:24.000Z | reference/library/src/webapp/editor/FCKeditor/editor/filemanager/connectors/py/connector.py | DukeLearningInnovation/sakai | b61a551fc9185366d790043770912c1c0874b8c4 | [
"ECL-2.0"
] | 4 | 2016-07-26T07:23:42.000Z | 2020-10-07T12:21:53.000Z | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | 34.745902 | 206 | 0.712904 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | 0 | 0 | 0 |
20b7ef9bd061d0a52a91d9fd42e0ed1297ca5332 | 1,476 | py | Python | dict_field.py | geekmoss/peewee_custom_fields | 91aa5d0f90b84955eb356d51016f72dee6b9c5da | [
"MIT"
] | null | null | null | dict_field.py | geekmoss/peewee_custom_fields | 91aa5d0f90b84955eb356d51016f72dee6b9c5da | [
"MIT"
] | null | null | null | dict_field.py | geekmoss/peewee_custom_fields | 91aa5d0f90b84955eb356d51016f72dee6b9c5da | [
"MIT"
] | null | null | null | class DictField(Field):
"""
MSG Pack in Blob field as Dict
"""
field_type = 'blob'
_dict = {}
pass
| 23.806452 | 94 | 0.51355 | class DictField(Field):
"""
MSG Pack in Blob field as Dict
"""
field_type = 'blob'
_dict = {}
class Dict:
def __init__(self, data=None, dct=None):
if dct:
self.data = dct
pass
else:
self.data: dict = msgpack.loads(d... | 867 | 405 | 81 |
9f5d722c43a70179580f6807ce9858f073789755 | 1,923 | py | Python | LIM_scripts/stationTimings/examples/save_pulseByLoc.py | Bhare8972/LOFAR-LIM | 89f25be8c02cb8980c2e237da3eaac279d40a06a | [
"MIT"
] | 3 | 2019-04-21T13:13:02.000Z | 2020-10-15T12:44:23.000Z | LIM_scripts/stationTimings/examples/save_pulseByLoc.py | Bhare8972/LOFAR-LIM | 89f25be8c02cb8980c2e237da3eaac279d40a06a | [
"MIT"
] | null | null | null | LIM_scripts/stationTimings/examples/save_pulseByLoc.py | Bhare8972/LOFAR-LIM | 89f25be8c02cb8980c2e237da3eaac279d40a06a | [
"MIT"
] | 2 | 2018-11-06T18:34:33.000Z | 2019-04-04T14:16:57.000Z | #!/usr/bin/env python3
from LoLIM.stationTimings.autoCorrelator3_fromLOC import save_EventByLoc
## these lines are anachronistic and should be fixed at some point
from LoLIM import utilities
utilities.default_raw_data_loc = "/exp_app2/appexp1/public/raw_data"
utilities.default_processed_data_loc = "/home/brian/proces... | 33.736842 | 101 | 0.630265 | #!/usr/bin/env python3
from LoLIM.stationTimings.autoCorrelator3_fromLOC import save_EventByLoc
## these lines are anachronistic and should be fixed at some point
from LoLIM import utilities
utilities.default_raw_data_loc = "/exp_app2/appexp1/public/raw_data"
utilities.default_processed_data_loc = "/home/brian/proces... | 0 | 0 | 0 |
4e29f31784652c9942427d7bedb5b1ac7b6ced3e | 1,560 | py | Python | tests/test_preconditioners.py | chendeheng611/pymatting | 06689a44e34eabc5edb81c7bd99e1f039796bd15 | [
"MIT"
] | 2 | 2021-02-22T12:15:23.000Z | 2021-05-02T15:22:03.000Z | tests/test_preconditioners.py | chendeheng611/pymatting | 06689a44e34eabc5edb81c7bd99e1f039796bd15 | [
"MIT"
] | null | null | null | tests/test_preconditioners.py | chendeheng611/pymatting | 06689a44e34eabc5edb81c7bd99e1f039796bd15 | [
"MIT"
] | null | null | null | import numpy as np
from pymatting import (
load_image,
cf_laplacian,
make_linear_system,
cg,
jacobi,
ichol,
vcycle,
CounterCallback,
)
| 21.666667 | 83 | 0.560897 | import numpy as np
from pymatting import (
load_image,
cf_laplacian,
make_linear_system,
cg,
jacobi,
ichol,
vcycle,
CounterCallback,
)
def test_preconditioners():
atol = 1e-6
index = 1
scale = 0.2
name = f"GT{index:02d}"
# print(name)
image_dir = "data"
i... | 1,369 | 0 | 23 |
347674bb1190a28786f2bed1e3677dedc099061f | 3,571 | py | Python | tmslack/cache.py | arodioukov/tmslack | 65ffc864b6a872b732ae56e9be82ddba31c3fc12 | [
"Apache-2.0"
] | 1 | 2019-01-22T17:36:04.000Z | 2019-01-22T17:36:04.000Z | tmslack/cache.py | arodioukov/tmslack | 65ffc864b6a872b732ae56e9be82ddba31c3fc12 | [
"Apache-2.0"
] | null | null | null | tmslack/cache.py | arodioukov/tmslack | 65ffc864b6a872b732ae56e9be82ddba31c3fc12 | [
"Apache-2.0"
] | 3 | 2019-01-22T17:37:08.000Z | 2019-02-16T18:12:38.000Z | """Maintains a cache in a file.
In general, the idea is that cache acts as a map. However, any time a modification to the map
is made, it is immediately saved to disk. The format of caches is considered an implementation
detail.
"""
from pathlib import Path
import pickle
def _ensure_cache_file(path: Path):
""... | 29.03252 | 95 | 0.588071 | """Maintains a cache in a file.
In general, the idea is that cache acts as a map. However, any time a modification to the map
is made, it is immediately saved to disk. The format of caches is considered an implementation
detail.
"""
from pathlib import Path
import pickle
def _ensure_cache_file(path: Path):
""... | 175 | 0 | 108 |
5d4714075d0412bc271152262685208e34bc592e | 22,730 | py | Python | tests.py | edaleeta/yet-another-twitch-toolkit | 48d7107cf606842ae77c7afcb92ad68cc4b3827c | [
"MIT"
] | 3 | 2018-02-22T04:59:12.000Z | 2018-04-18T17:42:24.000Z | tests.py | edaleeta/yet-another-twitch-toolkit | 48d7107cf606842ae77c7afcb92ad68cc4b3827c | [
"MIT"
] | 1 | 2020-07-07T20:10:11.000Z | 2020-07-07T20:10:11.000Z | tests.py | edaleeta/yet-another-twitch-toolkit | 48d7107cf606842ae77c7afcb92ad68cc4b3827c | [
"MIT"
] | null | null | null | """Tests for Yet Another Twitch Toolkit."""
from unittest import TestCase, mock
from io import StringIO
import datetime
import sqlalchemy
import server as s
import model as m
from model import connect_to_db, db
from seed_testdb import sample_data
import template_helpers as temp_help
import twitch_helpers
############... | 34.077961 | 79 | 0.592213 | """Tests for Yet Another Twitch Toolkit."""
from unittest import TestCase, mock
from io import StringIO
import datetime
import sqlalchemy
import server as s
import model as m
from model import connect_to_db, db
from seed_testdb import sample_data
import template_helpers as temp_help
import twitch_helpers
############... | 248 | 0 | 30 |
80be9e89d8ddbfc6c1bd55795a9a598952d9d260 | 15,555 | py | Python | profrage/structure/representation.py | federicoVS/ProFraGe | d8a653efae80af51e9a99f01268815c99fe62f84 | [
"MIT"
] | null | null | null | profrage/structure/representation.py | federicoVS/ProFraGe | d8a653efae80af51e9a99f01268815c99fe62f84 | [
"MIT"
] | null | null | null | profrage/structure/representation.py | federicoVS/ProFraGe | d8a653efae80af51e9a99f01268815c99fe62f84 | [
"MIT"
] | null | null | null | import os
import numpy as np
from scipy.spatial import distance
from scipy.stats import skew
from Bio.PDB.vectors import calc_dihedral
from utils.structure import get_atoms_coords, get_bb_atoms_coords
from utils.stride import SS_CODE_TO_INT, single_stride
class Representation:
"""An abstract class to implement... | 30.321637 | 110 | 0.543812 | import os
import numpy as np
from scipy.spatial import distance
from scipy.stats import skew
from Bio.PDB.vectors import calc_dihedral
from utils.structure import get_atoms_coords, get_bb_atoms_coords
from utils.stride import SS_CODE_TO_INT, single_stride
class Representation:
"""An abstract class to implement... | 742 | 0 | 31 |
fbe0ff65b523cbdcdbf96c28441823054fdb2b88 | 8,930 | py | Python | api/kme.py | JarryChou/etsi-qkd-api | 2b68a97707d081aec8fd488ddffb125f5ee2e7f2 | [
"MIT"
] | 1 | 2021-12-14T12:26:02.000Z | 2021-12-14T12:26:02.000Z | api/kme.py | JarryChou/etsi-qkd-api | 2b68a97707d081aec8fd488ddffb125f5ee2e7f2 | [
"MIT"
] | null | null | null | api/kme.py | JarryChou/etsi-qkd-api | 2b68a97707d081aec8fd488ddffb125f5ee2e7f2 | [
"MIT"
] | 2 | 2021-07-22T16:16:43.000Z | 2021-12-14T12:26:05.000Z | """Class implementing the Key Management Entity (KME).
"""
import random
from api import helper
import configparser
from typing import List
from api import crawler
class KME:
"""
Class for the KME on each node. This class also defines the related methods for manipulating
the keys. Most of the configuratio... | 37.521008 | 127 | 0.651512 | """Class implementing the Key Management Entity (KME).
"""
import random
from api import helper
import configparser
from typing import List
from api import crawler
class KME:
"""
Class for the KME on each node. This class also defines the related methods for manipulating
the keys. Most of the configuratio... | 1,433 | 0 | 27 |
a7c225b1217691fec49ffe83855cde6220ecc275 | 3,176 | py | Python | api/src/opentrons/broker.py | knownmed/opentrons | d02eb3c6cbf9f1c8c05c5e9e1dac30a92a8c5e6c | [
"Apache-2.0"
] | 235 | 2017-10-27T20:37:27.000Z | 2022-03-30T14:09:49.000Z | api/src/opentrons/broker.py | knownmed/opentrons | d02eb3c6cbf9f1c8c05c5e9e1dac30a92a8c5e6c | [
"Apache-2.0"
] | 8,425 | 2017-10-26T15:25:43.000Z | 2022-03-31T23:54:26.000Z | api/src/opentrons/broker.py | knownmed/opentrons | d02eb3c6cbf9f1c8c05c5e9e1dac30a92a8c5e6c | [
"Apache-2.0"
] | 130 | 2017-11-09T21:02:37.000Z | 2022-03-15T18:01:24.000Z | from __future__ import annotations
import asyncio
from asyncio import Queue
from contextlib import contextmanager
import logging
from typing import (
Any,
Callable,
Dict,
Sequence,
overload,
Generic,
TypeVar,
cast,
TYPE_CHECKING,
)
from typing_extensions import Literal
from opentron... | 24.620155 | 88 | 0.633186 | from __future__ import annotations
import asyncio
from asyncio import Queue
from contextlib import contextmanager
import logging
from typing import (
Any,
Callable,
Dict,
Sequence,
overload,
Generic,
TypeVar,
cast,
TYPE_CHECKING,
)
from typing_extensions import Literal
from opentron... | 1,884 | 607 | 46 |
b30977bfcb91bf408fd13991ae5a92b42fe009c5 | 1,208 | py | Python | sorting_algorithms/common/algorithms.py | digitalsquid7/sorting-algorithms | bca034bfdc7ed1e337ea1ac15848eee20e6421d2 | [
"MIT"
] | null | null | null | sorting_algorithms/common/algorithms.py | digitalsquid7/sorting-algorithms | bca034bfdc7ed1e337ea1ac15848eee20e6421d2 | [
"MIT"
] | null | null | null | sorting_algorithms/common/algorithms.py | digitalsquid7/sorting-algorithms | bca034bfdc7ed1e337ea1ac15848eee20e6421d2 | [
"MIT"
] | null | null | null | import abc
class SortingAlgorithm(abc.ABC):
"""Base class for all sorting algorithms."""
@abc.abstractmethod
def sort(self, unordered_list: list) -> list:
"""Sorts an unordered list of numbers.
Parameters
----------
unordered_list: an unordered list of numbers that needs ... | 24.653061 | 100 | 0.573675 | import abc
class SortingAlgorithm(abc.ABC):
"""Base class for all sorting algorithms."""
@abc.abstractmethod
def sort(self, unordered_list: list) -> list:
"""Sorts an unordered list of numbers.
Parameters
----------
unordered_list: an unordered list of numbers that needs ... | 498 | 0 | 27 |
b64d57a89c64ba0dd62ab0f32d57bb5c38b55ece | 1,054 | py | Python | utilityscripts/sqljson2commonnamelist.py | DanielBaird/climas-global | b5fa8079df2c7670b5bf36177e07991aeec13a84 | [
"Apache-2.0"
] | null | null | null | utilityscripts/sqljson2commonnamelist.py | DanielBaird/climas-global | b5fa8079df2c7670b5bf36177e07991aeec13a84 | [
"Apache-2.0"
] | null | null | null | utilityscripts/sqljson2commonnamelist.py | DanielBaird/climas-global | b5fa8079df2c7670b5bf36177e07991aeec13a84 | [
"Apache-2.0"
] | 1 | 2020-11-17T05:12:59.000Z | 2020-11-17T05:12:59.000Z |
import os
import json
import codecs
sqljson_file = './sqljson.json'
output_file = './commonnames.json'
# the sqljson.json file holds a giant array that
# looks like this:
# [
# { "spp": "Abrothrix_andinus",
# "commonNames": [
# "Andean Altiplano Mouse",
# "Andean Akodont"
# ... | 22.425532 | 80 | 0.620493 |
import os
import json
import codecs
sqljson_file = './sqljson.json'
output_file = './commonnames.json'
# the sqljson.json file holds a giant array that
# looks like this:
# [
# { "spp": "Abrothrix_andinus",
# "commonNames": [
# "Andean Altiplano Mouse",
# "Andean Akodont"
# ... | 0 | 0 | 0 |
e1cbb96e9395ddd9a0ba42675cba4903ba1f35b4 | 16,783 | py | Python | build/lib/sfcsim/classes/node.py | 1547591994/SFCSim | a5851a15daa19d136c4b57496dbace5ded7e4556 | [
"Apache-2.0"
] | 7 | 2021-01-05T13:00:01.000Z | 2022-03-06T07:40:35.000Z | sfcsim/classes/node.py | SkyShiS/SFCSim | 37e437ed7548a746c6dd8bd07b63c0b4b4f417bb | [
"Apache-2.0"
] | null | null | null | sfcsim/classes/node.py | SkyShiS/SFCSim | 37e437ed7548a746c6dd8bd07b63c0b4b4f417bb | [
"Apache-2.0"
] | 3 | 2021-02-18T17:40:08.000Z | 2022-03-06T07:40:37.000Z | import copy
from sfcsim.classes.vnf import *
class node():
'''
************************************************************************************************
node类,表示网络中的一个节点,包含接入节点和服务器节点两种类型,详情见network基础类设计文档
属性值:
id 节点id,节点唯一标识
atts 节点资源属性,可以有cpu、memory、... | 43.033333 | 204 | 0.489662 | import copy
from sfcsim.classes.vnf import *
class node():
'''
************************************************************************************************
node类,表示网络中的一个节点,包含接入节点和服务器节点两种类型,详情见network基础类设计文档
属性值:
id 节点id,节点唯一标识
atts 节点资源属性,可以有cpu、memory、... | 14,729 | 0 | 1,093 |
983442c89431425cf953cfcd89188bb1da14bc9f | 1,042 | py | Python | vocabs/dal_views.py | acdh-oeaw/fwm | b1c9b0100f3ddabc26e156711613e30959a569f4 | [
"MIT"
] | null | null | null | vocabs/dal_views.py | acdh-oeaw/fwm | b1c9b0100f3ddabc26e156711613e30959a569f4 | [
"MIT"
] | 2 | 2021-11-13T10:35:01.000Z | 2021-11-23T16:14:23.000Z | vocabs/dal_views.py | acdh-oeaw/fwm | b1c9b0100f3ddabc26e156711613e30959a569f4 | [
"MIT"
] | null | null | null | from django.db.models import Q
from dal import autocomplete
from django.core.exceptions import ObjectDoesNotExist
from vocabs.models import SkosConcept, SkosTechnicalCollection
| 31.575758 | 97 | 0.669866 | from django.db.models import Q
from dal import autocomplete
from django.core.exceptions import ObjectDoesNotExist
from vocabs.models import SkosConcept, SkosTechnicalCollection
class SkosConceptAC(autocomplete.Select2QuerySetView):
def get_queryset(self):
qs = SkosConcept.objects.all()
if self.q:
... | 695 | 69 | 99 |
0961c70b85eb83657f891331e990497760219b35 | 497 | py | Python | api/schemas/search_team.py | WicklowCD/server | 4657f4f64efc27abf10524eb6a03e61b79d4077f | [
"MIT"
] | null | null | null | api/schemas/search_team.py | WicklowCD/server | 4657f4f64efc27abf10524eb6a03e61b79d4077f | [
"MIT"
] | 2 | 2019-11-03T15:06:35.000Z | 2020-04-23T12:52:02.000Z | api/schemas/search_team.py | railto/WWCD-Management-Server | 4657f4f64efc27abf10524eb6a03e61b79d4077f | [
"MIT"
] | null | null | null | from api import ma
from api.models.SearchTeam import SearchTeam
search_team_schema = SearchTeamSchema()
search_teams_schema = SearchTeamSchema(many=True)
| 23.666667 | 49 | 0.716298 | from api import ma
from api.models.SearchTeam import SearchTeam
class SearchTeamSchema(ma.SQLAlchemySchema):
class Meta:
model = SearchTeam
uuid = ma.auto_field()
search_id = ma.auto_field()
team_leader = ma.auto_field()
name = ma.auto_field()
medic = ma.auto_field()
responder_1 =... | 0 | 317 | 23 |
3d4c6489e2c76276e653a4c840a98735774ef577 | 193 | py | Python | diagrams/ibm/migration.py | joshisa/diagrams | 27491295ed1ab824ca3179e80119deed9c0a976b | [
"MIT"
] | null | null | null | diagrams/ibm/migration.py | joshisa/diagrams | 27491295ed1ab824ca3179e80119deed9c0a976b | [
"MIT"
] | null | null | null | diagrams/ibm/migration.py | joshisa/diagrams | 27491295ed1ab824ca3179e80119deed9c0a976b | [
"MIT"
] | null | null | null | # This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _IBM
# Aliases
| 16.083333 | 68 | 0.715026 | # This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _IBM
class _Migration(_IBM):
_type = "migration"
_icon_dir = "resources/ibm/migration"
# Aliases
| 0 | 68 | 23 |
27102fc4639237454169e43cd968f57494e9a34d | 5,269 | py | Python | dffx_shotgun_plugins/shotgun_TS_DSD.py | dffxPipeline/shotgunEvents | a70a4d3b9be521e5c6a0c08514b934ed376b0fd1 | [
"MIT"
] | null | null | null | dffx_shotgun_plugins/shotgun_TS_DSD.py | dffxPipeline/shotgunEvents | a70a4d3b9be521e5c6a0c08514b934ed376b0fd1 | [
"MIT"
] | null | null | null | dffx_shotgun_plugins/shotgun_TS_DSD.py | dffxPipeline/shotgunEvents | a70a4d3b9be521e5c6a0c08514b934ed376b0fd1 | [
"MIT"
] | null | null | null | """
For detailed information please see
http://shotgunsoftware.github.com/shotgunEvents/api.html
## shotgun_logArgs: Logs all events that occur and generates a logfile in the specified directory found in the shotgun_logging.conf file ##
"""
rootSoftwareDir = [r'\\intrepid\Server\Tools']
dffxModulesExists = ''
config... | 35.843537 | 139 | 0.626115 | """
For detailed information please see
http://shotgunsoftware.github.com/shotgunEvents/api.html
## shotgun_logArgs: Logs all events that occur and generates a logfile in the specified directory found in the shotgun_logging.conf file ##
"""
rootSoftwareDir = [r'\\intrepid\Server\Tools']
dffxModulesExists = ''
config... | 950 | 0 | 69 |
67c1557deb597fa68bb67903ad98ede65eca4e62 | 6,753 | py | Python | apps/utils/encrypt/rsa.py | Chace-wang/bk-nodeman | ee49cd5105f0c97ef33f81e8bbf2d5eecd236c40 | [
"MIT"
] | 31 | 2021-07-28T13:06:11.000Z | 2022-03-10T12:16:44.000Z | apps/utils/encrypt/rsa.py | Chace-wang/bk-nodeman | ee49cd5105f0c97ef33f81e8bbf2d5eecd236c40 | [
"MIT"
] | 483 | 2021-07-29T03:17:44.000Z | 2022-03-31T13:03:04.000Z | apps/utils/encrypt/rsa.py | Chace-wang/bk-nodeman | ee49cd5105f0c97ef33f81e8bbf2d5eecd236c40 | [
"MIT"
] | 29 | 2021-07-28T13:06:21.000Z | 2022-03-25T06:18:18.000Z | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance ... | 34.106061 | 115 | 0.661928 | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance ... | 921 | 3,888 | 50 |
b2da9fbbc39f6b625ba2a04928e2ac48d20424cb | 684 | py | Python | ALPHABETS/CAPITAL_ALPHABETS/D.py | charansaim1819/Python_Patterns | 02e636855003346ec84c3d69f2be174dc9e9e3cb | [
"MIT"
] | null | null | null | ALPHABETS/CAPITAL_ALPHABETS/D.py | charansaim1819/Python_Patterns | 02e636855003346ec84c3d69f2be174dc9e9e3cb | [
"MIT"
] | null | null | null | ALPHABETS/CAPITAL_ALPHABETS/D.py | charansaim1819/Python_Patterns | 02e636855003346ec84c3d69f2be174dc9e9e3cb | [
"MIT"
] | null | null | null | #Shape of capital D:
def for_D():
"""printing capital 'D' using for loop"""
for row in range(5):
for col in range(5):
if col==1 or row in(0,4) and col!=4 or col==4 and row not in(0,4):
print("*",end=" ")
else:
print(" ",end=" ")
p... | 23.586207 | 81 | 0.393275 | #Shape of capital D:
def for_D():
"""printing capital 'D' using for loop"""
for row in range(5):
for col in range(5):
if col==1 or row in(0,4) and col!=4 or col==4 and row not in(0,4):
print("*",end=" ")
else:
print(" ",end=" ")
p... | 0 | 0 | 0 |
586d1928acc339e5938b9f91765e0064da0bdbd3 | 119 | py | Python | s3Backups/apps.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | s3Backups/apps.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | s3Backups/apps.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.apps import AppConfig
| 13.222222 | 33 | 0.680672 | # -*- coding: utf-8 -*-
from django.apps import AppConfig
class S3BackupsConfig(AppConfig):
name = 's3Backups'
| 0 | 35 | 23 |
1251459b56ee4f8e949ccec601c42dfee0d8cafe | 3,391 | py | Python | scripts/test_random_hash_sha1.py | kokke/tiny-HMAC-c | 93bdfa8114a32cf25ba70cb1f0957d3bf0f180af | [
"Unlicense"
] | 17 | 2021-07-20T00:23:54.000Z | 2022-03-17T08:26:08.000Z | scripts/test_random_hash_sha1.py | kokke/tiny-HMAC-c | 93bdfa8114a32cf25ba70cb1f0957d3bf0f180af | [
"Unlicense"
] | null | null | null | scripts/test_random_hash_sha1.py | kokke/tiny-HMAC-c | 93bdfa8114a32cf25ba70cb1f0957d3bf0f180af | [
"Unlicense"
] | null | null | null | import binascii
import hashlib
import os
import random
import string
import subprocess
import sys
import time
import threading
import Queue
BIN_PATH = "./build/test_random_sha1"
NTHREADS = 2
NTESTS = 10
NBYTES = 20
global still_making_input
still_making_input = True
tests = Queue.Queue()
failures = list()
#
# Help... | 23.068027 | 115 | 0.673548 | import binascii
import hashlib
import os
import random
import string
import subprocess
import sys
import time
import threading
import Queue
BIN_PATH = "./build/test_random_sha1"
NTHREADS = 2
NTESTS = 10
NBYTES = 20
global still_making_input
still_making_input = True
tests = Queue.Queue()
failures = list()
#
# Help... | 747 | 0 | 69 |
adc6a824cb325fc4e1166440a674b55e9e38cdf1 | 279 | py | Python | djusagi/core/views.py | carthage-college/django-djusagi | 8fb2fe0b9100ac4bd6ebd0ea7cf44d732f7fcc5a | [
"BSD-3-Clause"
] | null | null | null | djusagi/core/views.py | carthage-college/django-djusagi | 8fb2fe0b9100ac4bd6ebd0ea7cf44d732f7fcc5a | [
"BSD-3-Clause"
] | 2 | 2020-03-06T14:09:23.000Z | 2021-11-30T21:33:26.000Z | djusagi/core/views.py | carthage-college/django-djusagi | 8fb2fe0b9100ac4bd6ebd0ea7cf44d732f7fcc5a | [
"BSD-3-Clause"
] | null | null | null | from django.conf import settings
from django.shortcuts import render
from djtools.decorators.auth import group_required
@group_required(settings.ADMINISTRATORS_GROUP)
def home(request):
'''
Home page view
'''
return render(
request, 'home.html'
)
| 17.4375 | 50 | 0.713262 | from django.conf import settings
from django.shortcuts import render
from djtools.decorators.auth import group_required
@group_required(settings.ADMINISTRATORS_GROUP)
def home(request):
'''
Home page view
'''
return render(
request, 'home.html'
)
| 0 | 0 | 0 |
17361d2be3fdadfc2574c1e2c256e34f34235efb | 4,120 | py | Python | codigoTresEnderecos.py | quionee/analiseLexicaSintaticaC-- | eb28deb869b65fde0d3c9e1df57a2b0389701469 | [
"MIT"
] | null | null | null | codigoTresEnderecos.py | quionee/analiseLexicaSintaticaC-- | eb28deb869b65fde0d3c9e1df57a2b0389701469 | [
"MIT"
] | null | null | null | codigoTresEnderecos.py | quionee/analiseLexicaSintaticaC-- | eb28deb869b65fde0d3c9e1df57a2b0389701469 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# formata os comandos em quádruplas e insere na tabela | 49.047619 | 133 | 0.459223 | # -*- coding: utf-8 -*-
class CodigoTresEnderecos:
def __init__(self, tokens, tabelaDeSimbolos):
self.listaComandos = [] # lista para armazenar todos os comandos de atribuição
self.tabelaCodigos = [] # tabela final com os códigos de três endereços
self.percorreTokens(tokens, tabelaDeSimbo... | 3,942 | 5 | 106 |
f8261b858e0f85c9931e6d499d8a47e22d1c1b1e | 4,256 | py | Python | tkinter_savings.py | wileykestner/tkinter-savings-demo | fef898da546c01f82453f8d1f11f78427a0fb517 | [
"MIT"
] | null | null | null | tkinter_savings.py | wileykestner/tkinter-savings-demo | fef898da546c01f82453f8d1f11f78427a0fb517 | [
"MIT"
] | null | null | null | tkinter_savings.py | wileykestner/tkinter-savings-demo | fef898da546c01f82453f8d1f11f78427a0fb517 | [
"MIT"
] | null | null | null | from tkinter import Tk, StringVar, ttk, E, W, Event
from typing import Callable
from savings import SavingsObserver, PresentRequiredEarningsObserver
| 46.769231 | 111 | 0.638628 | from tkinter import Tk, StringVar, ttk, E, W, Event
from typing import Callable
from savings import SavingsObserver, PresentRequiredEarningsObserver
class TkinterSavings(SavingsObserver, PresentRequiredEarningsObserver):
def __init__(self):
super().__init__()
self._tk_application = Tk()
... | 3,907 | 175 | 23 |
fd62dfa13c3df8f790ee458497103dd2faaaec03 | 287 | py | Python | zenbot/zencyclopedia.py | underyx/zenbot | e96d07f62e3fd327e67a6365f1b7d3206f1abec3 | [
"MIT"
] | 2 | 2016-08-11T05:44:32.000Z | 2016-08-11T07:51:19.000Z | zenbot/zencyclopedia.py | underyx/zenbot | e96d07f62e3fd327e67a6365f1b7d3206f1abec3 | [
"MIT"
] | 10 | 2016-08-11T09:01:40.000Z | 2022-03-28T21:08:34.000Z | zenbot/zencyclopedia.py | underyx/zenbot | e96d07f62e3fd327e67a6365f1b7d3206f1abec3 | [
"MIT"
] | null | null | null | from collections import defaultdict
import re
from this import d, s
_zen = ''.join(d.get(c, c) for c in s)
_zen_lines = _zen.splitlines()[2:]
index = defaultdict(set)
for line in _zen_lines:
for word in line.split():
index[re.search(r'\w*', word.lower()).group()].add(line)
| 26.090909 | 64 | 0.675958 | from collections import defaultdict
import re
from this import d, s
_zen = ''.join(d.get(c, c) for c in s)
_zen_lines = _zen.splitlines()[2:]
index = defaultdict(set)
for line in _zen_lines:
for word in line.split():
index[re.search(r'\w*', word.lower()).group()].add(line)
| 0 | 0 | 0 |
f7318a7c9b9961d14143aebdcada5b709c5812c1 | 2,945 | py | Python | tests/integration/qbs/test_qbs_submission_data.py | nealedj/eq-survey-runner | b8e6cddae6068f6c8fd60e21d31d58aaa79bbb34 | [
"MIT"
] | null | null | null | tests/integration/qbs/test_qbs_submission_data.py | nealedj/eq-survey-runner | b8e6cddae6068f6c8fd60e21d31d58aaa79bbb34 | [
"MIT"
] | 1 | 2018-11-05T12:00:51.000Z | 2018-11-05T12:00:51.000Z | tests/integration/qbs/test_qbs_submission_data.py | nealedj/eq-survey-runner | b8e6cddae6068f6c8fd60e21d31d58aaa79bbb34 | [
"MIT"
] | null | null | null | from tests.integration.integration_test_case import IntegrationTestCase
| 38.75 | 84 | 0.529372 | from tests.integration.integration_test_case import IntegrationTestCase
class TestQbsSubmissionData(IntegrationTestCase):
def test_submission_data_2_0001(self):
self.submission_data('2', '0001')
def submission_data(self, eq_id, form_type_id):
self.launchSurvey(eq_id, form_type_id, roles=['dum... | 2,768 | 28 | 76 |
bf8171db4aa14a2f217d5e0279b1e06202036d2a | 221 | py | Python | Ex_Files_Python_EssT/Exercise Files/Chap04/conditional.py | cinthiatengan/Basic-Python | 9dbc280af2e9af9b79421018be814d0f178d8097 | [
"MIT"
] | null | null | null | Ex_Files_Python_EssT/Exercise Files/Chap04/conditional.py | cinthiatengan/Basic-Python | 9dbc280af2e9af9b79421018be814d0f178d8097 | [
"MIT"
] | null | null | null | Ex_Files_Python_EssT/Exercise Files/Chap04/conditional.py | cinthiatengan/Basic-Python | 9dbc280af2e9af9b79421018be814d0f178d8097 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2009-2017 BHG http://bw.org/
x = 1
if x>= 5:
print('verdadeiro porque {} >= 5'.format(x))
elif x == 3:
print('{} == 3'.format(x))
else:
print('{} é menor que 5'.format(x))
| 18.416667 | 48 | 0.565611 | #!/usr/bin/env python3
# Copyright 2009-2017 BHG http://bw.org/
x = 1
if x>= 5:
print('verdadeiro porque {} >= 5'.format(x))
elif x == 3:
print('{} == 3'.format(x))
else:
print('{} é menor que 5'.format(x))
| 0 | 0 | 0 |
0d412a9f88a508d64dc3acac6a1d8b4fbe2468bc | 3,448 | py | Python | Code/detection.py | lkamols/chess | fd78ffee46e9a9ab7db0e5e08edfd6e481a23665 | [
"Apache-2.0"
] | null | null | null | Code/detection.py | lkamols/chess | fd78ffee46e9a9ab7db0e5e08edfd6e481a23665 | [
"Apache-2.0"
] | null | null | null | Code/detection.py | lkamols/chess | fd78ffee46e9a9ab7db0e5e08edfd6e481a23665 | [
"Apache-2.0"
] | null | null | null | from gpiozero import LED, Button
import time
#decoder inputs
DEC_C = 17
DEC_B = 27
DEC_A = 22
#mux inputs
MUX_C = 23
MUX_B = 24
MUX_A = 25
#mux outputs
M1_OUT = 12 #output of multiplexer controlling columns 0-5
M2_OUT = 4 #output of multiplexer controlling columns 6-11
"""
generally set an output to a value, 0 for o... | 25.731343 | 73 | 0.603538 | from gpiozero import LED, Button
import time
#decoder inputs
DEC_C = 17
DEC_B = 27
DEC_A = 22
#mux inputs
MUX_C = 23
MUX_B = 24
MUX_A = 25
#mux outputs
M1_OUT = 12 #output of multiplexer controlling columns 0-5
M2_OUT = 4 #output of multiplexer controlling columns 6-11
"""
generally set an output to a value, 0 for o... | 1,791 | 0 | 274 |
84b0067d80cd4c2cef6d50a93094e5613e1b0d84 | 104 | py | Python | solutions/2018/prob_01.py | PolPtoAmo/HPCodeWarsBCN | 8a98b1feb6d8b7d2d5b8b4dace3e02af9e6bb4e8 | [
"MIT"
] | 1 | 2021-02-27T09:46:06.000Z | 2021-02-27T09:46:06.000Z | solutions/2018/prob_01.py | PolPtoAmo/HPCodeWarsBCN | 8a98b1feb6d8b7d2d5b8b4dace3e02af9e6bb4e8 | [
"MIT"
] | null | null | null | solutions/2018/prob_01.py | PolPtoAmo/HPCodeWarsBCN | 8a98b1feb6d8b7d2d5b8b4dace3e02af9e6bb4e8 | [
"MIT"
] | 1 | 2021-02-27T12:03:33.000Z | 2021-02-27T12:03:33.000Z | ida = int(input())
vuelta = int(input())
print('Ana tiene un total de {0} euros'.format((ida+vuelta)))
| 20.8 | 61 | 0.653846 | ida = int(input())
vuelta = int(input())
print('Ana tiene un total de {0} euros'.format((ida+vuelta)))
| 0 | 0 | 0 |
3efdc9c450cea291c16ad4d3f956ee76f79cfe70 | 3,636 | py | Python | accel/replay_buffers/prioritized_replay_buffer.py | waffoo/accel | 7aaa45af2d120f9ed49d10f8654ff5af03feb705 | [
"MIT"
] | 1 | 2020-05-09T15:32:40.000Z | 2020-05-09T15:32:40.000Z | accel/replay_buffers/prioritized_replay_buffer.py | waffoo/accel | 7aaa45af2d120f9ed49d10f8654ff5af03feb705 | [
"MIT"
] | 11 | 2020-09-21T20:49:12.000Z | 2021-06-17T09:38:45.000Z | accel/replay_buffers/prioritized_replay_buffer.py | waffoo/accel | 7aaa45af2d120f9ed49d10f8654ff5af03feb705 | [
"MIT"
] | 1 | 2020-09-29T06:59:56.000Z | 2020-09-29T06:59:56.000Z | import random
from collections import deque, namedtuple
import numpy as np
from accel.replay_buffers.binary_tree import MinTree, SumTree
Transition = namedtuple(
'Transition', ('state', 'action', 'next_state', 'reward', 'valid'))
| 29.803279 | 88 | 0.560781 | import random
from collections import deque, namedtuple
import numpy as np
from accel.replay_buffers.binary_tree import MinTree, SumTree
Transition = namedtuple(
'Transition', ('state', 'action', 'next_state', 'reward', 'valid'))
class PrioritizedReplayBuffer(object):
def __init__(self, capacity, alpha=0.6... | 3,197 | 17 | 184 |
3831c31c83c8a1d9661055c14bea4c314c15ddda | 39 | py | Python | app/views/__init__.py | PaluMacil/luton.danwolf.net | 75b605148a6921f03114702e5de33c47be2b96ae | [
"MIT"
] | null | null | null | app/views/__init__.py | PaluMacil/luton.danwolf.net | 75b605148a6921f03114702e5de33c47be2b96ae | [
"MIT"
] | null | null | null | app/views/__init__.py | PaluMacil/luton.danwolf.net | 75b605148a6921f03114702e5de33c47be2b96ae | [
"MIT"
] | null | null | null | from app.views.observer import observer | 39 | 39 | 0.871795 | from app.views.observer import observer | 0 | 0 | 0 |
ddefb222e1d39e5b5fb2b731252001085aa5fbb2 | 3,268 | py | Python | preprocess/align_images.py | yuhaoooo/FaceRecgnition | 3ce1e6a55dfe238bc2027fe954e70eae2048fa1f | [
"MIT"
] | null | null | null | preprocess/align_images.py | yuhaoooo/FaceRecgnition | 3ce1e6a55dfe238bc2027fe954e70eae2048fa1f | [
"MIT"
] | null | null | null | preprocess/align_images.py | yuhaoooo/FaceRecgnition | 3ce1e6a55dfe238bc2027fe954e70eae2048fa1f | [
"MIT"
] | 1 | 2021-12-30T08:56:25.000Z | 2021-12-30T08:56:25.000Z | import os
import sys
import torch
import argparse
import numpy as np
from PIL import Image
from mtcnn.mtcnn import MTCNN
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
from mtcnn.utils.align_trans import get_reference_facial_points, warp_and_crop_face
def save_landmark(landmark,... | 33.690722 | 147 | 0.650857 | import os
import sys
import torch
import argparse
import numpy as np
from PIL import Image
from mtcnn.mtcnn import MTCNN
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
from mtcnn.utils.align_trans import get_reference_facial_points, warp_and_crop_face
def collate_pil(x):
out_... | 2,466 | 0 | 69 |
8dbd46d1ac00ab6d41e5be8b24f85f3d76541844 | 423 | py | Python | support/cross/aio/atexit.py | pmp-p/python-wasm-plus | ccd34cf46fc00924e256a0ad1d8cf5061b9520ac | [
"MIT"
] | 3 | 2022-03-11T22:02:39.000Z | 2022-03-16T08:04:33.000Z | support/cross/aio/atexit.py | pmp-p/python-wasm-plus | ccd34cf46fc00924e256a0ad1d8cf5061b9520ac | [
"MIT"
] | null | null | null | support/cross/aio/atexit.py | pmp-p/python-wasm-plus | ccd34cf46fc00924e256a0ad1d8cf5061b9520ac | [
"MIT"
] | null | null | null | plan = []
# replace stock one
import sys
sys.modules['atexit'] = sys.modules['aio.atexit']
| 16.92 | 50 | 0.593381 | plan = []
def register(func, *args, **kwargs):
global plan
plan.append( (func,arg,kwargs,) )
def unregister(func):
global plan
todel = []
for i,elem in enumerate(plan)
if elem[0] is func:
todel.append(i)
while len(todel):
plan.pop( todel.pop() )
def exiting():
... | 259 | 0 | 69 |
67e011cb3343579a643a7bcad30d2da2f256fe34 | 9,217 | py | Python | screener/util.py | icedevil2001/pri_stock_screener | b700fe0a114cf3e9eef6eaa26b1137b4f6d4955e | [
"MIT"
] | null | null | null | screener/util.py | icedevil2001/pri_stock_screener | b700fe0a114cf3e9eef6eaa26b1137b4f6d4955e | [
"MIT"
] | null | null | null | screener/util.py | icedevil2001/pri_stock_screener | b700fe0a114cf3e9eef6eaa26b1137b4f6d4955e | [
"MIT"
] | null | null | null | #stock_screener.py
from pandas_datareader import data as pdr
from yahoo_fin import stock_info as si
# import yahoo_fin
#from pandas import ExcelWriter
import yfinance as yf
import pandas as pd
# import requests
import datetime
import time
from pprint import pprint
from collections import OrderedDict
import base64
# ... | 30.826087 | 138 | 0.619507 | #stock_screener.py
from pandas_datareader import data as pdr
from yahoo_fin import stock_info as si
# import yahoo_fin
#from pandas import ExcelWriter
import yfinance as yf
import pandas as pd
# import requests
import datetime
import time
from pprint import pprint
from collections import OrderedDict
import base64
# ... | 934 | 242 | 153 |
29209584e2963603bfa38c2ae530df93b611ae7a | 1,329 | py | Python | zeus/api/resources/revision_file_coverage.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 221 | 2017-07-03T17:29:21.000Z | 2021-12-07T19:56:59.000Z | zeus/api/resources/revision_file_coverage.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 298 | 2017-07-04T18:08:14.000Z | 2022-03-03T22:24:51.000Z | zeus/api/resources/revision_file_coverage.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 24 | 2017-07-15T13:46:45.000Z | 2020-08-16T16:14:45.000Z | from flask import request
from operator import or_
from zeus.models import FileCoverage, Revision
from zeus.utils.builds import fetch_build_for_revision
from .base_revision import BaseRevisionResource
from ..schemas import FileCoverageSchema
filecoverage_schema = FileCoverageSchema(many=True)
| 31.642857 | 87 | 0.645598 | from flask import request
from operator import or_
from zeus.models import FileCoverage, Revision
from zeus.utils.builds import fetch_build_for_revision
from .base_revision import BaseRevisionResource
from ..schemas import FileCoverageSchema
filecoverage_schema = FileCoverageSchema(many=True)
class RevisionFileCov... | 0 | 1,008 | 23 |
c700bcd851b749493cd3a00f8f7079e4b9ce7a36 | 4,142 | py | Python | build/lib.macosx-10.9-x86_64-3.9/gators/feature_generation_str/string_length.py | Aditya-Kapadiya/gators | d7c9967e3a8e304a601b6a92ad834d03d3e36338 | [
"Apache-2.0"
] | 4 | 2021-10-29T18:20:52.000Z | 2022-03-31T22:53:03.000Z | build/lib.macosx-10.9-x86_64-3.9/gators/feature_generation_str/string_length.py | Aditya-Kapadiya/gators | d7c9967e3a8e304a601b6a92ad834d03d3e36338 | [
"Apache-2.0"
] | 1 | 2022-01-19T12:16:19.000Z | 2022-01-19T12:16:19.000Z | build/lib.macosx-10.9-x86_64-3.9/gators/feature_generation_str/string_length.py | Aditya-Kapadiya/gators | d7c9967e3a8e304a601b6a92ad834d03d3e36338 | [
"Apache-2.0"
] | 5 | 2021-11-17T20:16:54.000Z | 2022-02-21T18:21:02.000Z | # License: Apache-2.0
from ..util import util
from feature_gen_str import string_length
from typing import List, Union
import numpy as np
import pandas as pd
import databricks.koalas as ks
from._base_string_feature import _BaseStringFeature
pd.options.mode.chained_assignment = None
class StringLength(_BaseStringFeatu... | 29.585714 | 75 | 0.530662 | # License: Apache-2.0
from ..util import util
from feature_gen_str import string_length
from typing import List, Union
import numpy as np
import pandas as pd
import databricks.koalas as ks
from._base_string_feature import _BaseStringFeature
pd.options.mode.chained_assignment = None
class StringLength(_BaseStringFeatu... | 222 | 0 | 27 |
2e724b4717fc2722837c1db869c255989b72244a | 1,034 | py | Python | dataframe.py | UWSEDS/homework-3-4-testing-exceptions-and-coding-style-JM88888 | 7899b0de80b2d07e9f63293821fab3fbdbe8d309 | [
"MIT"
] | null | null | null | dataframe.py | UWSEDS/homework-3-4-testing-exceptions-and-coding-style-JM88888 | 7899b0de80b2d07e9f63293821fab3fbdbe8d309 | [
"MIT"
] | null | null | null | dataframe.py | UWSEDS/homework-3-4-testing-exceptions-and-coding-style-JM88888 | 7899b0de80b2d07e9f63293821fab3fbdbe8d309 | [
"MIT"
] | null | null | null | """This module gets a dataframe of seattle building permits checks column names"""
import pandas as pd
import collections
def get_permits(data_frame=pd.read_csv("https://data.seattle.gov/api/views/76t5-zqzr/rows.csv?accessType=DOWNLOAD",
usecols=["PermitClass", "PermitTypeDesc",... | 35.655172 | 121 | 0.661509 | """This module gets a dataframe of seattle building permits checks column names"""
import pandas as pd
import collections
def get_permits(data_frame=pd.read_csv("https://data.seattle.gov/api/views/76t5-zqzr/rows.csv?accessType=DOWNLOAD",
usecols=["PermitClass", "PermitTypeDesc",... | 0 | 0 | 0 |
ed0bc74eeee568779b4bc62448b3a5dd6edc7497 | 2,908 | py | Python | vc_assistance/indico_vc_assistance/forms.py | bpedersen2/indico-plugins-cern | c4f06d11d981c316fc8de2892758484deb58e2f5 | [
"MIT"
] | null | null | null | vc_assistance/indico_vc_assistance/forms.py | bpedersen2/indico-plugins-cern | c4f06d11d981c316fc8de2892758484deb58e2f5 | [
"MIT"
] | null | null | null | vc_assistance/indico_vc_assistance/forms.py | bpedersen2/indico-plugins-cern | c4f06d11d981c316fc8de2892758484deb58e2f5 | [
"MIT"
] | null | null | null | # This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2022 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.
from datetime import date, timedelta
from flask import request
fro... | 46.15873 | 119 | 0.671939 | # This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2022 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.
from datetime import date, timedelta
from flask import request
fro... | 440 | 1,606 | 69 |
30494615504525876516bc1439538a1f558bd85b | 1,375 | py | Python | Part 04 - Clustering/Section 25 - Hierarchical Clustering/Hierarchical_Clustering/pythonHierarchicalClustering.py | Menosse/machineLearning_Study | e2f5490a9162427c274697be279bfb0c0a0bb305 | [
"MIT"
] | 1 | 2019-03-19T00:12:32.000Z | 2019-03-19T00:12:32.000Z | Part 04 - Clustering/Section 25 - Hierarchical Clustering/Hierarchical_Clustering/pythonHierarchicalClustering.py | Menosse/machineLearning | e2f5490a9162427c274697be279bfb0c0a0bb305 | [
"MIT"
] | null | null | null | Part 04 - Clustering/Section 25 - Hierarchical Clustering/Hierarchical_Clustering/pythonHierarchicalClustering.py | Menosse/machineLearning | e2f5490a9162427c274697be279bfb0c0a0bb305 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 27 08:17:57 2019
@author: ts-fernando.takada
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
consNumHc = 5
dataset = pd.read_csv("Mall_Customers.csv")
x = dataset.iloc[:,[3, 4]].values
# y = dataset.iloc[:,].values
# U... | 31.976744 | 86 | 0.668364 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 27 08:17:57 2019
@author: ts-fernando.takada
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
consNumHc = 5
dataset = pd.read_csv("Mall_Customers.csv")
x = dataset.iloc[:,[3, 4]].values
# y = dataset.iloc[:,].values
# U... | 0 | 0 | 0 |
68efc071423463e3ed9d5935428e71ae8bdccd09 | 2,085 | py | Python | tests/test_file_or_directory_renamer.py | appressoas/ievv_coderefactor | cc6b19283af88e1f6643db5926e51da06275d590 | [
"MIT"
] | 1 | 2020-11-24T06:05:34.000Z | 2020-11-24T06:05:34.000Z | tests/test_file_or_directory_renamer.py | appressoas/ievv_coderefactor | cc6b19283af88e1f6643db5926e51da06275d590 | [
"MIT"
] | null | null | null | tests/test_file_or_directory_renamer.py | appressoas/ievv_coderefactor | cc6b19283af88e1f6643db5926e51da06275d590 | [
"MIT"
] | null | null | null | import os
from unittest import TestCase
from ievv_coderefactor.file_or_directory_renamer import FileOrDirectoryRenamer
from ievv_coderefactor.replacer_registry import RegexReplacer
from tests.directory_and_file_mixin import DirectoryAndFileMixin
| 48.488372 | 105 | 0.665707 | import os
from unittest import TestCase
from ievv_coderefactor.file_or_directory_renamer import FileOrDirectoryRenamer
from ievv_coderefactor.replacer_registry import RegexReplacer
from tests.directory_and_file_mixin import DirectoryAndFileMixin
class TestFileOrDirectoryRenamer(DirectoryAndFileMixin, TestCase):
... | 1,716 | 45 | 76 |
acae9cd75c727ebf90243cd8655e47c1783df60e | 1,498 | py | Python | tests/test_py6.py | ahmet2mir/artron | 122f4a3d592945ccd0aa56a5445f5d2f3dd047dc | [
"Apache-2.0"
] | 1 | 2018-10-29T08:00:39.000Z | 2018-10-29T08:00:39.000Z | tests/test_py6.py | ahmet2mir/artron | 122f4a3d592945ccd0aa56a5445f5d2f3dd047dc | [
"Apache-2.0"
] | null | null | null | tests/test_py6.py | ahmet2mir/artron | 122f4a3d592945ccd0aa56a5445f5d2f3dd047dc | [
"Apache-2.0"
] | null | null | null |
from artron import _py6
| 22.029412 | 56 | 0.663551 |
from artron import _py6
def test_int_types():
_py6.PY2 = True
assert isinstance(1, _py6.int_types)
assert isinstance(-1, _py6.int_types)
assert isinstance(23, _py6.int_types)
assert not isinstance(.1, _py6.int_types)
def test_string_types():
_py6.PY2 = True
assert isinstance("hi", _py6.s... | 1,240 | 0 | 230 |
190af4ae51777b6fc1491d239e62d70882342e77 | 545 | py | Python | bots/bot_txt.py | Lytigas/snake-ai-battle | 45a09ef92b477a84b73937d459fcc74ad6626067 | [
"Apache-2.0"
] | null | null | null | bots/bot_txt.py | Lytigas/snake-ai-battle | 45a09ef92b477a84b73937d459fcc74ad6626067 | [
"Apache-2.0"
] | null | null | null | bots/bot_txt.py | Lytigas/snake-ai-battle | 45a09ef92b477a84b73937d459fcc74ad6626067 | [
"Apache-2.0"
] | null | null | null | import time
import sys
# Meant to be used with client-adapter to enable communicating via stdin/stdout.
seq = ["u"] * 3 + ["r"] * 20 + ["d"] * 5 + ["l"] * 5
print("seq_bot_txt")
counter = 0
while True:
data = input()
if data in ["WIN", "LOSS", "TIE"]:
print(data)
break
my_pos, their_pos = ... | 27.25 | 80 | 0.592661 | import time
import sys
# Meant to be used with client-adapter to enable communicating via stdin/stdout.
seq = ["u"] * 3 + ["r"] * 20 + ["d"] * 5 + ["l"] * 5
print("seq_bot_txt")
counter = 0
while True:
data = input()
if data in ["WIN", "LOSS", "TIE"]:
print(data)
break
my_pos, their_pos = ... | 0 | 0 | 0 |
534def22b60b3dc1580fce41ed1056b1b250741c | 50 | py | Python | profiles/__init__.py | Antony-me/Pixtagram | 65a64ffb1f054b4fe77a004bf67686cdcfddfded | [
"MIT"
] | 2 | 2020-12-03T11:16:51.000Z | 2021-02-16T13:51:44.000Z | profiles/__init__.py | Antony-me/Pixtagram | 65a64ffb1f054b4fe77a004bf67686cdcfddfded | [
"MIT"
] | null | null | null | profiles/__init__.py | Antony-me/Pixtagram | 65a64ffb1f054b4fe77a004bf67686cdcfddfded | [
"MIT"
] | null | null | null | default_app_config ='profiles.apps.ProfilesConfig' | 50 | 50 | 0.88 | default_app_config ='profiles.apps.ProfilesConfig' | 0 | 0 | 0 |
f176cf73dd4b31917dec112f9f1309164b6c65cc | 60 | py | Python | conf.py | wrathwolf/docs | d7f0891b5886c5ce018957a9d1317f6944ba43cb | [
"CC-BY-4.0"
] | 14 | 2018-05-16T01:01:04.000Z | 2022-03-13T06:31:11.000Z | conf.py | wrathwolf/docs | d7f0891b5886c5ce018957a9d1317f6944ba43cb | [
"CC-BY-4.0"
] | 88 | 2018-09-06T18:07:28.000Z | 2021-07-05T10:07:21.000Z | conf.py | wrathwolf/docs | d7f0891b5886c5ce018957a9d1317f6944ba43cb | [
"CC-BY-4.0"
] | 22 | 2018-05-16T01:01:06.000Z | 2022-01-06T03:41:27.000Z | from docs_conf.conf import *
#extensions = ['recommonmark'] | 20 | 30 | 0.75 | from docs_conf.conf import *
#extensions = ['recommonmark'] | 0 | 0 | 0 |
4448b062f21ec38aafb41286ce30fa7f7d57b60b | 1,095 | py | Python | fdk_client/application/ApplicationConfig.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/application/ApplicationConfig.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/application/ApplicationConfig.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | """Python code/sdk/application/ApplicationConfig.py."""
from typing import Dict
from ..common.constants import APPLICATION_MIN_TOKEN_LENGTH, DEFAULT_DOMAIN
from ..common.exceptions import FDKInvalidCredentialError
| 36.5 | 75 | 0.688584 | """Python code/sdk/application/ApplicationConfig.py."""
from typing import Dict
from ..common.constants import APPLICATION_MIN_TOKEN_LENGTH, DEFAULT_DOMAIN
from ..common.exceptions import FDKInvalidCredentialError
class ApplicationConfig:
def __init__(self, _conf: Dict, _opts: Dict = {}):
"""Defines app... | 0 | 855 | 23 |
ebd0cfc6cfc22d7cabfc860a3e892c2881b9ee1c | 341 | py | Python | CookieTTS/_3_generate_postnets/start_generate_postnets.py | AstraliteHeart/cookietts | c871f5f7b5790656d5b57bcd9e63946a2da52f0f | [
"BSD-3-Clause"
] | 25 | 2020-07-07T20:07:41.000Z | 2021-12-17T11:27:36.000Z | CookieTTS/_3_generate_postnets/start_generate_postnets.py | AstraliteHeart/cookietts | c871f5f7b5790656d5b57bcd9e63946a2da52f0f | [
"BSD-3-Clause"
] | 26 | 2020-07-04T00:06:25.000Z | 2022-02-10T03:28:35.000Z | CookieTTS/_3_generate_postnets/start_generate_postnets.py | AstraliteHeart/cookietts | c871f5f7b5790656d5b57bcd9e63946a2da52f0f | [
"BSD-3-Clause"
] | 11 | 2020-07-02T21:39:59.000Z | 2022-01-17T22:09:46.000Z |
# load TTM model and checkpoint of choice
# generate appropriate Ground-truth-aligned spectrograms from source dataset
# (maybe) use Dynamic-Time-Warping for cases where Teacher-Forcing cannot be used.
# write new "postnet_path|grapheme_transcript|phoneme_transcript|speaker_id|sample_rate|emotion_id|noise_level" oc... | 42.625 | 135 | 0.829912 |
# load TTM model and checkpoint of choice
# generate appropriate Ground-truth-aligned spectrograms from source dataset
# (maybe) use Dynamic-Time-Warping for cases where Teacher-Forcing cannot be used.
# write new "postnet_path|grapheme_transcript|phoneme_transcript|speaker_id|sample_rate|emotion_id|noise_level" oc... | 0 | 0 | 0 |
b0cafd66e4e8bee0de568d24e38490b702cd69c4 | 670 | py | Python | gsuite_activityevent_rules/gsuite_login_type.py | panther-labs/panther-cli | 4e5c0a21570e1a02dada990fd91e324416afac96 | [
"MIT"
] | 4 | 2019-10-17T19:33:29.000Z | 2019-10-21T15:23:30.000Z | gsuite_activityevent_rules/gsuite_login_type.py | jacknagz/panther-analysis | fceab78ba5624136776596ee1b25fa0dc8a02a42 | [
"Apache-2.0"
] | null | null | null | gsuite_activityevent_rules/gsuite_login_type.py | jacknagz/panther-analysis | fceab78ba5624136776596ee1b25fa0dc8a02a42 | [
"Apache-2.0"
] | null | null | null | from panther_base_helpers import deep_get
# Remove any unapproved login methods
APPROVED_LOGIN_TYPES = {
"exchange",
"google_password",
"reauth",
"saml",
"unknown",
}
| 20.9375 | 83 | 0.604478 | from panther_base_helpers import deep_get
# Remove any unapproved login methods
APPROVED_LOGIN_TYPES = {
"exchange",
"google_password",
"reauth",
"saml",
"unknown",
}
def rule(event):
if event.get("type") != "login":
return False
if (
event.get("type") == "login"
... | 434 | 0 | 46 |
140f23ee4c79b3d1aa9e1857840ccd2239d21411 | 437 | py | Python | scripts/clean_fw.py | proddy/MyESP | 7619bd91bd72a64791fe52a077ce9b7bfd6ad34b | [
"MIT"
] | null | null | null | scripts/clean_fw.py | proddy/MyESP | 7619bd91bd72a64791fe52a077ce9b7bfd6ad34b | [
"MIT"
] | null | null | null | scripts/clean_fw.py | proddy/MyESP | 7619bd91bd72a64791fe52a077ce9b7bfd6ad34b | [
"MIT"
] | 3 | 2019-12-28T20:09:46.000Z | 2020-11-28T09:40:16.000Z | #!/usr/bin/env python
from subprocess import call
import os
Import("env")
# built in targets: (buildprog, size, upload, program, buildfs, uploadfs, uploadfsota)
env.AddPreAction("buildprog", clean)
| 29.133333 | 92 | 0.647597 | #!/usr/bin/env python
from subprocess import call
import os
Import("env")
def clean(source, target, env):
print("\n** Starting clean...")
call(["pio", "run", "-t", "erase"])
call(["esptool.py", "-p COM6", "write_flash 0x00000", os.getcwd()+"../firmware/*.bin"])
print("\n** Finished clean.")
# built ... | 213 | 0 | 23 |
4469bb6b6cea5051bb568c03b2ab964880fc4923 | 4,983 | py | Python | client/commands/v2/tests/server_event_test.py | rcramblit/pyre-check | fa15d2021ab1bf5b52aae8c09d1520e2b7bcf6c9 | [
"MIT"
] | null | null | null | client/commands/v2/tests/server_event_test.py | rcramblit/pyre-check | fa15d2021ab1bf5b52aae8c09d1520e2b7bcf6c9 | [
"MIT"
] | null | null | null | client/commands/v2/tests/server_event_test.py | rcramblit/pyre-check | fa15d2021ab1bf5b52aae8c09d1520e2b7bcf6c9 | [
"MIT"
] | 1 | 2021-05-13T13:30:24.000Z | 2021-05-13T13:30:24.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import io
from pathlib import Path
import testslide
from ....tests import setup
from ..async_server_connection import create_memory_text_rea... | 39.547619 | 88 | 0.633554 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import io
from pathlib import Path
import testslide
from ....tests import setup
from ..async_server_connection import create_memory_text_rea... | 4,355 | 123 | 23 |
484ac44e461885cf91d2a3c9469c926e4b4ec662 | 1,091 | py | Python | infra/services/git_cache_updater/__main__.py | mithro/chromium-infra | d27ac0b230bedae4bc968515b02927cf9e17c2b7 | [
"BSD-3-Clause"
] | 1 | 2018-01-02T05:47:07.000Z | 2018-01-02T05:47:07.000Z | infra/services/git_cache_updater/__main__.py | mithro/chromium-infra | d27ac0b230bedae4bc968515b02927cf9e17c2b7 | [
"BSD-3-Clause"
] | null | null | null | infra/services/git_cache_updater/__main__.py | mithro/chromium-infra | d27ac0b230bedae4bc968515b02927cf9e17c2b7 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Updates the Git cache zips for a project.
Example invocation:
./run.py infra.tools.git_cache_updater --project <googlesource.com url>
"""
# This file is u... | 26.609756 | 72 | 0.778185 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Updates the Git cache zips for a project.
Example invocation:
./run.py infra.tools.git_cache_updater --project <googlesource.com url>
"""
# This file is u... | 467 | 0 | 23 |
4f5344773278784536fef50175911f4b1cea9ac1 | 922 | py | Python | PyStationB/projects/CellSignalling/cellsig_pipeline/pybckg/__init__.py | BrunoKM/station-b-libraries | ea3591837e4a33f0bef789d905467754c27913b3 | [
"MIT"
] | 6 | 2021-09-29T15:46:55.000Z | 2021-12-14T18:39:51.000Z | PyStationB/projects/CellSignalling/cellsig_pipeline/pybckg/__init__.py | BrunoKM/station-b-libraries | ea3591837e4a33f0bef789d905467754c27913b3 | [
"MIT"
] | null | null | null | PyStationB/projects/CellSignalling/cellsig_pipeline/pybckg/__init__.py | BrunoKM/station-b-libraries | ea3591837e4a33f0bef789d905467754c27913b3 | [
"MIT"
] | 3 | 2021-09-27T10:35:20.000Z | 2021-10-02T17:53:07.000Z | # -------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# ----------------------------------------------------------------------... | 57.625 | 103 | 0.646421 | # -------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# ----------------------------------------------------------------------... | 0 | 0 | 0 |
9d78e052189cb9c39a094671290bdc1094924515 | 295 | py | Python | netsim/simulator/core/sim_common.py | networmix/NetSim | 9a2804112895826c58399fbd47f496817916cd49 | [
"MIT"
] | null | null | null | netsim/simulator/core/sim_common.py | networmix/NetSim | 9a2804112895826c58399fbd47f496817916cd49 | [
"MIT"
] | 12 | 2021-11-20T22:50:46.000Z | 2022-01-07T02:00:38.000Z | netsim/simulator/core/sim_common.py | networmix/NetSim | 9a2804112895826c58399fbd47f496817916cd49 | [
"MIT"
] | null | null | null | # defining useful type aliases
from typing import Tuple, Union
# defining useful type aliases
SimTime = Union[int, float]
EventPriority = int
EventID = int
ProcessID = int
ProcessName = str
ResourceID = int
ResourceName = str
ResourceCapacity = Union[int, float]
TimeInterval = Tuple[SimTime]
| 19.666667 | 36 | 0.776271 | # defining useful type aliases
from typing import Tuple, Union
# defining useful type aliases
SimTime = Union[int, float]
EventPriority = int
EventID = int
ProcessID = int
ProcessName = str
ResourceID = int
ResourceName = str
ResourceCapacity = Union[int, float]
TimeInterval = Tuple[SimTime]
| 0 | 0 | 0 |
c092f2f64de19f9c77a90c3dfc7908242b77f9fe | 1,867 | py | Python | test/unit/test_endpoint.py | sporsh/carnifex | 82dd3bd2bc134dfb69a78f43171e227f2127060b | [
"MIT"
] | 4 | 2015-12-21T00:59:22.000Z | 2021-02-08T02:33:52.000Z | test/unit/test_endpoint.py | sporsh/carnifex | 82dd3bd2bc134dfb69a78f43171e227f2127060b | [
"MIT"
] | null | null | null | test/unit/test_endpoint.py | sporsh/carnifex | 82dd3bd2bc134dfb69a78f43171e227f2127060b | [
"MIT"
] | 1 | 2017-03-24T09:12:45.000Z | 2017-03-24T09:12:45.000Z | from twisted.trial.unittest import TestCase
from twisted.internet.error import ConnectionDone
from twisted.internet import protocol, defer, reactor
from carnifex.endpoint import InductorEndpoint
from .mocks import MockProcessInductor
stdout, stderr = 1, 2
class InductorEndpointTest(TestCase):
"""Test connecting ... | 35.903846 | 79 | 0.634708 | from twisted.trial.unittest import TestCase
from twisted.internet.error import ConnectionDone
from twisted.internet import protocol, defer, reactor
from carnifex.endpoint import InductorEndpoint
from .mocks import MockProcessInductor
stdout, stderr = 1, 2
class InductorEndpointTest(TestCase):
"""Test connecting ... | 1,479 | 0 | 27 |
94c6887fad9b8a466dc81fdcb80d34145f4fb549 | 2,201 | py | Python | minicup_photo_classifier/detection/object_detector.py | litovel-minicup/photo-classifier | 5fd87a36981a39166b6132cf4a2ddf1ca77ccda9 | [
"MIT"
] | null | null | null | minicup_photo_classifier/detection/object_detector.py | litovel-minicup/photo-classifier | 5fd87a36981a39166b6132cf4a2ddf1ca77ccda9 | [
"MIT"
] | 1 | 2018-03-23T10:41:11.000Z | 2018-03-23T10:41:11.000Z | minicup_photo_classifier/detection/object_detector.py | litovel-minicup/photo-classifier | 5fd87a36981a39166b6132cf4a2ddf1ca77ccda9 | [
"MIT"
] | null | null | null | # coding=utf-8
from os.path import join, dirname
from typing import List
import numpy as np
from .config import load_config
from .pose_detection.detections import extract_detections
from .pose_detection.mscoco import MSCOCO
from .pose_detection.nnet.predict import setup_pose_prediction, extract_cnn_output
from .pose_... | 34.936508 | 115 | 0.699682 | # coding=utf-8
from os.path import join, dirname
from typing import List
import numpy as np
from .config import load_config
from .pose_detection.detections import extract_detections
from .pose_detection.mscoco import MSCOCO
from .pose_detection.nnet.predict import setup_pose_prediction, extract_cnn_output
from .pose_... | 320 | 0 | 27 |
4f1f213a46b386e810fed13ab1b5b0c23dba7dc5 | 1,429 | py | Python | Other/server.py | radleap/dog-vision | 0862100b0d40592fdcc3430e498d40acc7014281 | [
"Unlicense",
"MIT"
] | 1 | 2020-02-10T20:43:31.000Z | 2020-02-10T20:43:31.000Z | Other/server.py | radleap/dog-vision | 0862100b0d40592fdcc3430e498d40acc7014281 | [
"Unlicense",
"MIT"
] | 16 | 2020-01-28T23:11:05.000Z | 2022-03-12T00:08:30.000Z | Other/server.py | radleap/dog-vision | 0862100b0d40592fdcc3430e498d40acc7014281 | [
"Unlicense",
"MIT"
] | null | null | null | import os
from flask import Flask, flash, render_template, redirect, request, url_for
APP_ROOT = os.path.dirname(os.path.abspath(__file__))
app = Flask(__name__)
app.config['SECRET_KEY'] = "supertopsecretprivatekey1234"
@app.route('/', methods=['GET', 'POST'])
if __name__ == "__main__":
app.run('127.0.0.1')
| 31.065217 | 75 | 0.573828 | import os
from flask import Flask, flash, render_template, redirect, request, url_for
APP_ROOT = os.path.dirname(os.path.abspath(__file__))
app = Flask(__name__)
app.config['SECRET_KEY'] = "supertopsecretprivatekey1234"
@app.route('/', methods=['GET', 'POST'])
def home():
if request.method == 'GET':
# sho... | 1,091 | 0 | 22 |
03a067f6f727f2e2f1c33d95cce8971095fc6332 | 14,214 | py | Python | setup.py | tylerjohnhaden/penguin-website-colors | f3c4585ebb333976d2e40e845bda22ec380b9aec | [
"MIT"
] | null | null | null | setup.py | tylerjohnhaden/penguin-website-colors | f3c4585ebb333976d2e40e845bda22ec380b9aec | [
"MIT"
] | 3 | 2017-03-29T00:43:14.000Z | 2017-03-29T00:50:19.000Z | setup.py | tylerjohnhaden/penguin-website-colors | f3c4585ebb333976d2e40e845bda22ec380b9aec | [
"MIT"
] | null | null | null | #! /usr/bin/python
# TODO: make chromedriver executable on linux systems
# TODO: finish this doc string:
"""The first script to be run in this project.
If this is the first time running in this directory,
it should look something like this:
penguin-website-colors/
examples/
...
.gitig... | 43.735385 | 120 | 0.6495 | #! /usr/bin/python
# TODO: make chromedriver executable on linux systems
# TODO: finish this doc string:
"""The first script to be run in this project.
If this is the first time running in this directory,
it should look something like this:
penguin-website-colors/
examples/
...
.gitig... | 0 | 0 | 0 |
a9acd1cbdecf785c719dc37ed56d9eae9ad87503 | 5,732 | py | Python | adv_lib/attacks/voting_folded_gaussian.py | Daulbaev/adversarial-library | 6f979a511ad78908374cd55855a9e2c5a874be7d | [
"BSD-3-Clause"
] | 55 | 2020-11-25T10:47:48.000Z | 2022-03-21T12:11:31.000Z | adv_lib/attacks/voting_folded_gaussian.py | Daulbaev/adversarial-library | 6f979a511ad78908374cd55855a9e2c5a874be7d | [
"BSD-3-Clause"
] | 4 | 2021-03-10T19:25:31.000Z | 2021-08-06T00:10:49.000Z | adv_lib/attacks/voting_folded_gaussian.py | Daulbaev/adversarial-library | 6f979a511ad78908374cd55855a9e2c5a874be7d | [
"BSD-3-Clause"
] | 8 | 2020-11-26T08:42:04.000Z | 2022-01-13T02:55:47.000Z | from typing import Optional
import torch
from torch import nn, Tensor
from torch.autograd import grad
def vfga(model: nn.Module,
inputs: Tensor,
labels: Tensor,
targeted: bool,
max_iter: Optional[int] = None,
n_samples: int = 10,
large_memory: bool = False) -> Te... | 46.601626 | 117 | 0.657362 | from typing import Optional
import torch
from torch import nn, Tensor
from torch.autograd import grad
def vfga(model: nn.Module,
inputs: Tensor,
labels: Tensor,
targeted: bool,
max_iter: Optional[int] = None,
n_samples: int = 10,
large_memory: bool = False) -> Te... | 0 | 0 | 0 |
3b44f5fe548b9ce87b7127c539705da79fe13b26 | 2,451 | py | Python | python/src/problem019.py | arturh85/projecteuler | c3685e302ea7c323193b18c105a7e02da01fd6b5 | [
"MIT"
] | 3 | 2015-02-04T08:37:01.000Z | 2015-11-28T03:10:15.000Z | python/src/problem019.py | arturh85/projecteuler | c3685e302ea7c323193b18c105a7e02da01fd6b5 | [
"MIT"
] | null | null | null | python/src/problem019.py | arturh85/projecteuler | c3685e302ea7c323193b18c105a7e02da01fd6b5 | [
"MIT"
] | null | null | null | '''
Problem 19
14 June 2002
You are given the following information, but you may prefer to do some research for yourself.
- 1 Jan 1900 was a Monday.
- Thirty days has September,
April, June and November.
All the rest have thirty-one,
Saving February alone,
Which has twenty-eight, rain o... | 27.852273 | 110 | 0.540596 | '''
Problem 19
14 June 2002
You are given the following information, but you may prefer to do some research for yourself.
- 1 Jan 1900 was a Monday.
- Thirty days has September,
April, June and November.
All the rest have thirty-one,
Saving February alone,
Which has twenty-eight, rain o... | 1,069 | 9 | 267 |