hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a5ed3b336bf9f20cb77799f38ee5d60cd1216026 | 7,239 | py | Python | src/config/cmssh_extension.py | dmwm/cmssh | 0cd6e104185938d21b10b053479e890c9f4f3b57 | [
"Apache-2.0"
] | 2 | 2016-07-26T18:36:03.000Z | 2017-05-09T08:34:41.000Z | src/config/cmssh_extension.py | dmwm/cmssh | 0cd6e104185938d21b10b053479e890c9f4f3b57 | [
"Apache-2.0"
] | 1 | 2015-01-30T16:00:13.000Z | 2015-01-31T21:59:29.000Z | src/config/cmssh_extension.py | dmwm/cmssh | 0cd6e104185938d21b10b053479e890c9f4f3b57 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*- coding: ISO-8859-1 -*-
#pylint: disable-msg=E1101,C0103,R0902
# system modules
import os
import sys
import stat
import time
import thread
import traceback
from types import GeneratorType
# ipython modules
import IPython
from IPython import release
# cmssh modules
import cmssh
from cmssh.ip... | 31.473913 | 86 | 0.6226 | #!/usr/bin/env python
#-*- coding: ISO-8859-1 -*-
#pylint: disable-msg=E1101,C0103,R0902
# system modules
import os
import sys
import stat
import time
import thread
import traceback
from types import GeneratorType
# ipython modules
import IPython
from IPython import release
# cmssh modules
import cmssh
from cm... | 0 | 0 | 0 | 195 | 0 | 0 | 0 | 26 | 23 |
ed259b12f038032d8c8c3e7e6c607d1791e80efe | 8,191 | py | Python | python/paddle/fluid/tests/unittests/test_program_prune_backward.py | frankwhzhang/Paddle | 131b1dc3240e53ea295cc49323bb2a7e7dcc717f | [
"Apache-2.0"
] | 3 | 2019-07-17T09:30:31.000Z | 2021-12-27T03:16:55.000Z | python/paddle/fluid/tests/unittests/test_program_prune_backward.py | frankwhzhang/Paddle | 131b1dc3240e53ea295cc49323bb2a7e7dcc717f | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_program_prune_backward.py | frankwhzhang/Paddle | 131b1dc3240e53ea295cc49323bb2a7e7dcc717f | [
"Apache-2.0"
] | 4 | 2019-09-30T02:15:34.000Z | 2019-09-30T02:41:30.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 38.455399 | 85 | 0.626297 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 0 | 264 | 0 | 5,182 | 0 | 1,645 | 0 | 116 | 202 |
3fd42fb31955c495edab37fede8ea45acb1c582c | 910 | py | Python | docs/conf.py | comforx/spray | b880f41e6afeb69f9ad3b2257965f39411a53f03 | [
"Apache-2.0"
] | 1 | 2019-01-19T15:53:06.000Z | 2019-01-19T15:53:06.000Z | docs/conf.py | comforx/spray | b880f41e6afeb69f9ad3b2257965f39411a53f03 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | comforx/spray | b880f41e6afeb69f9ad3b2257965f39411a53f03 | [
"Apache-2.0"
] | null | null | null |
# -- General configuration -----------------------------------------------------
extensions = ['sphinx.ext.todo']
source_suffix = '.rst'
source_encoding = 'utf-8'
master_doc = 'index'
project = u'spray'
copyright = u'2011-2012 spray.cc.'
version = '$VERSION$'
release = '$VERSION$'
exclude_patterns = []
# -- Options ... | 26 | 80 | 0.586813 | import sys, os
# -- General configuration -----------------------------------------------------
extensions = ['sphinx.ext.todo']
source_suffix = '.rst'
source_encoding = 'utf-8'
master_doc = 'index'
project = u'spray'
copyright = u'2011-2012 spray.cc.'
version = '$VERSION$'
release = '$VERSION$'
exclude_patterns = []... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -7 | 22 |
f08fff9e914531c2eaf0d3773e4791d72fb39839 | 913 | py | Python | primes.py | amacuga/pands-problem-set | ac7461f17f7e5e5d5b6e43db675d9c16a2808d3e | [
"Apache-2.0"
] | null | null | null | primes.py | amacuga/pands-problem-set | ac7461f17f7e5e5d5b6e43db675d9c16a2808d3e | [
"Apache-2.0"
] | null | null | null | primes.py | amacuga/pands-problem-set | ac7461f17f7e5e5d5b6e43db675d9c16a2808d3e | [
"Apache-2.0"
] | null | null | null | # Alexandra Macuga, 2019-03-26
# Write a program that asks the user to input a positive integer and tells the user whether or not the number is a prime.
# Adapted from: https://web.microsoftstream.com/video/3ef695e3-9155-4487-b48e-0867834c76ad
# Ask the user for a value of i (positive integer)
i = int(input('Please en... | 48.052632 | 121 | 0.732749 | # Alexandra Macuga, 2019-03-26
# Write a program that asks the user to input a positive integer and tells the user whether or not the number is a prime.
# Adapted from: https://web.microsoftstream.com/video/3ef695e3-9155-4487-b48e-0867834c76ad
# Ask the user for a value of i (positive integer)
i = int(input('Please en... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f69b0bb6253043a918c780725e986c1292cd16ae | 1,446 | py | Python | model/utils/similarity_scorer.py | KasparPeterson/A-Hierarchical-Latent-Structure-for-Variational-Conversation-Modeling | 86a9cebe4f24d2397d81c4c263d57d48d17ea76d | [
"MIT"
] | null | null | null | model/utils/similarity_scorer.py | KasparPeterson/A-Hierarchical-Latent-Structure-for-Variational-Conversation-Modeling | 86a9cebe4f24d2397d81c4c263d57d48d17ea76d | [
"MIT"
] | null | null | null | model/utils/similarity_scorer.py | KasparPeterson/A-Hierarchical-Latent-Structure-for-Variational-Conversation-Modeling | 86a9cebe4f24d2397d81c4c263d57d48d17ea76d | [
"MIT"
] | 1 | 2018-07-03T07:47:46.000Z | 2018-07-03T07:47:46.000Z | from nltk.translate.bleu_score import SmoothingFunction
smoothie = SmoothingFunction().method4
# The higher the better
if __name__ == '__main__':
hypothesis = 'It is a cat at the room'
reference = 'It is a cat inside the room'
print("Bleu:", get_bleu_score(hypothesis, reference))
print("Secquenc... | 30.765957 | 74 | 0.623098 | import nltk
import difflib
from nltk.translate.bleu_score import SmoothingFunction
smoothie = SmoothingFunction().method4
# The higher the better
def get_bleu_score(hypothesis, reference):
try:
return nltk.translate.bleu_score.sentence_bleu(
[reference.split()],
hypothesis.split()... | 0 | 0 | 0 | 0 | 0 | 903 | 0 | -17 | 112 |
93e2d415765ad9ccffdebc7e31e8dc3e85bd50ab | 2,052 | py | Python | test/test_page.py | aspose-diagram-cloud/aspose-diagram-cloud-python | 58254fccb833fb7e3a0453407e21b55edb96b81c | [
"MIT"
] | 3 | 2019-12-10T08:42:21.000Z | 2022-02-04T19:14:02.000Z | test/test_page.py | aspose-diagram-cloud/aspose-diagram-cloud-python | 58254fccb833fb7e3a0453407e21b55edb96b81c | [
"MIT"
] | null | null | null | test/test_page.py | aspose-diagram-cloud/aspose-diagram-cloud-python | 58254fccb833fb7e3a0453407e21b55edb96b81c | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Aspose.Diagram Cloud API Reference
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
#f... | 26.307692 | 105 | 0.698343 | # coding: utf-8
"""
Aspose.Diagram Cloud API Reference
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
#f... | 0 | 0 | 0 | 1,214 | 0 | 0 | 0 | 13 | 68 |
db0f1d7eb5314ad8755c331f7baacae6965c2ce5 | 775 | py | Python | basics/word_vector_data_frame.py | eshanMewantha/natural-language-processing | 0071d96106d43e2c263d179cc78ba82e3450fda4 | [
"MIT"
] | 1 | 2019-07-06T05:17:08.000Z | 2019-07-06T05:17:08.000Z | basics/word_vector_data_frame.py | eshanMewantha/natural-language-processing | 0071d96106d43e2c263d179cc78ba82e3450fda4 | [
"MIT"
] | null | null | null | basics/word_vector_data_frame.py | eshanMewantha/natural-language-processing | 0071d96106d43e2c263d179cc78ba82e3450fda4 | [
"MIT"
] | null | null | null | # Simple python implementation of creating a pandas data frame with word vectors
import pandas as pd
from collections import Counter
sayings = [
"Rose is a rose is a rose is a rose.",
"We are going to need a bigger boat.",
"Huston, we have a problem"
]
unique_words = set()
for saying in sayings:
uniq... | 25 | 80 | 0.676129 | # Simple python implementation of creating a pandas data frame with word vectors
import pandas as pd
from collections import Counter
sayings = [
"Rose is a rose is a rose is a rose.",
"We are going to need a bigger boat.",
"Huston, we have a problem"
]
unique_words = set()
for saying in sayings:
uniq... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e834ca743ecf2afb241c4a48ffc0d0700d49053c | 811 | py | Python | script/CompanyX-Problem.py | Ingenjoy/Linear-Programming-With-Python | 320a8956baa369dd83f5963230aafadcddded3b4 | [
"MIT"
] | 1 | 2022-03-19T16:19:53.000Z | 2022-03-19T16:19:53.000Z | script/CompanyX-Problem.py | Ingenjoy/Linear-Programming-With-Python | 320a8956baa369dd83f5963230aafadcddded3b4 | [
"MIT"
] | null | null | null | script/CompanyX-Problem.py | Ingenjoy/Linear-Programming-With-Python | 320a8956baa369dd83f5963230aafadcddded3b4 | [
"MIT"
] | null | null | null | from scipy.optimize import linprog
import numpy as np
# Objective function
z = np.array([300,500,200])
expense = 75000
# Constraints
C = np.array([
[ 10, 7.5, 4], #C1
[ 0, 10, 0], #C2
[0.5, 0.4, 0.5], #C3
[ 0, 0.4, 0], #C4
[0.5, 0.1, 0.5], #C5
[0.4, ... | 23.171429 | 78 | 0.448829 | from scipy.optimize import linprog
import numpy as np
# Objective function
z = np.array([300,500,200])
expense = 75000
# Constraints
C = np.array([
[ 10, 7.5, 4], #C1
[ 0, 10, 0], #C2
[0.5, 0.4, 0.5], #C3
[ 0, 0.4, 0], #C4
[0.5, 0.1, 0.5], #C5
[0.4, ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4326f7a82279646c6831b022a3b6cce31baade64 | 4,638 | py | Python | src/real_estate_scrapers/concrete_items/__init__.py | tuw-eeg/real-estate-scrapers | d86e304119f7abc5a9702044fcc08a2387c7e5ac | [
"MIT"
] | null | null | null | src/real_estate_scrapers/concrete_items/__init__.py | tuw-eeg/real-estate-scrapers | d86e304119f7abc5a9702044fcc08a2387c7e5ac | [
"MIT"
] | null | null | null | src/real_estate_scrapers/concrete_items/__init__.py | tuw-eeg/real-estate-scrapers | d86e304119f7abc5a9702044fcc08a2387c7e5ac | [
"MIT"
] | null | null | null | """
Exposing concrete items dynamically.
Makes it possible to add support for a new website just by
creating a new Python module under this package, and declaring
a concrete implementation for ``RealEstateHomePage``, ``RealEstateListPage`` and ``RealEstatePage``.
"""
import importlib.util
import inspect
import pkgutil
... | 42.163636 | 119 | 0.744071 | """
Exposing concrete items dynamically.
Makes it possible to add support for a new website just by
creating a new Python module under this package, and declaring
a concrete implementation for ``RealEstateHomePage``, ``RealEstateListPage`` and ``RealEstatePage``.
"""
import importlib.util
import inspect
import pkgutil
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1fb6382f646275852ac011441c74f5fb2ad358f9 | 643 | py | Python | alembic/versions/11b80498abeb_add_foreign_key.py | JuanDM93/fcc-fastapi-demo | 7d20f91fa96989d22426632c1ab2550f62898789 | [
"MIT"
] | null | null | null | alembic/versions/11b80498abeb_add_foreign_key.py | JuanDM93/fcc-fastapi-demo | 7d20f91fa96989d22426632c1ab2550f62898789 | [
"MIT"
] | null | null | null | alembic/versions/11b80498abeb_add_foreign_key.py | JuanDM93/fcc-fastapi-demo | 7d20f91fa96989d22426632c1ab2550f62898789 | [
"MIT"
] | null | null | null | """add foreign key
Revision ID: 11b80498abeb
Revises: bce514e0541f
Create Date: 2021-11-08 18:26:51.860396
"""
# revision identifiers, used by Alembic.
revision = '11b80498abeb'
down_revision = 'bce514e0541f'
branch_labels = None
depends_on = None
| 20.09375 | 77 | 0.679627 | """add foreign key
Revision ID: 11b80498abeb
Revises: bce514e0541f
Create Date: 2021-11-08 18:26:51.860396
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '11b80498abeb'
down_revision = 'bce514e0541f'
branch_labels = None
depends_on = None
def upgrade():
... | 0 | 0 | 0 | 0 | 0 | 296 | 0 | 3 | 90 |
6be9c0d4bcb7421cc79e552d36238a9c6a75fcb0 | 13,128 | py | Python | bak_to_fossil_3.py | wmelvin/bak-to-git | 1ebea7d4b3c14cabc5981dc8d87fe920f30e0b56 | [
"MIT"
] | null | null | null | bak_to_fossil_3.py | wmelvin/bak-to-git | 1ebea7d4b3c14cabc5981dc8d87fe920f30e0b56 | [
"MIT"
] | null | null | null | bak_to_fossil_3.py | wmelvin/bak-to-git | 1ebea7d4b3c14cabc5981dc8d87fe920f30e0b56 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# ---------------------------------------------------------------------
# bak_to_fossil_3.py
#
# Step 3 (alternate): Read data from a CSV file that was edited in
# step 2, where commit messages were added and files to be skipped
# were flagged. Run fossil (instead of git) to commit each cha... | 29.108647 | 79 | 0.555683 | #!/usr/bin/env python3
# ---------------------------------------------------------------------
# bak_to_fossil_3.py
#
# Step 3 (alternate): Read data from a CSV file that was edited in
# step 2, where commit messages were added and files to be skipped
# were flagged. Run fossil (instead of git) to commit each cha... | 0 | 0 | 0 | 0 | 0 | 11,336 | 0 | 105 | 386 |
8812f60cfa1d071ac53c689d76eee185cf18bbbd | 8,319 | py | Python | opexebo/analysis/population_vector_correlation.py | simon-ball/opexebo | 8e44a4890efa60a6ed8c2e9e0df7cc9ab2d80d31 | [
"MIT"
] | 4 | 2019-06-12T07:50:42.000Z | 2021-11-19T12:55:47.000Z | opexebo/analysis/population_vector_correlation.py | simon-ball/opexebo | 8e44a4890efa60a6ed8c2e9e0df7cc9ab2d80d31 | [
"MIT"
] | 12 | 2019-06-12T07:26:40.000Z | 2021-08-11T15:10:47.000Z | opexebo/analysis/population_vector_correlation.py | simon-ball/opexebo | 8e44a4890efa60a6ed8c2e9e0df7cc9ab2d80d31 | [
"MIT"
] | 4 | 2019-11-21T10:44:37.000Z | 2022-01-07T14:21:07.000Z | """
Provide function for population vector correlation calculation
"""
import numpy as np
from .. import errors as err
def population_vector_correlation(stack_0, stack_1, **kwargs):
"""Calculates the bin-wise correlation between two stacks of rate maps
Each stack corresponds to a separate Task, or trial... | 38.513889 | 97 | 0.617502 | """
Provide function for population vector correlation calculation
"""
import numpy as np
from .. import errors as err
def population_vector_correlation(stack_0, stack_1, **kwargs):
"""Calculates the bin-wise correlation between two stacks of rate maps
Each stack corresponds to a separate Task, or trial... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
43dfff0b11f9abecb2f386dab390d2464fef68ca | 4,700 | py | Python | openslides_backend/http/application.py | FinnStutzenstein/openslides-backend | fffc152f79d3446591e07a6913d9fdf30b46f577 | [
"MIT"
] | 5 | 2020-01-20T13:57:15.000Z | 2021-03-27T14:14:44.000Z | openslides_backend/http/application.py | FinnStutzenstein/openslides-backend | fffc152f79d3446591e07a6913d9fdf30b46f577 | [
"MIT"
] | 859 | 2020-01-11T22:58:37.000Z | 2022-03-30T14:54:06.000Z | openslides_backend/http/application.py | FinnStutzenstein/openslides-backend | fffc152f79d3446591e07a6913d9fdf30b46f577 | [
"MIT"
] | 16 | 2020-01-04T20:28:57.000Z | 2022-02-10T12:06:54.000Z | import re
health_route = re.compile("^/health$")
| 38.52459 | 87 | 0.649149 | import os
import re
from typing import Any, Iterable, Union
import simplejson as json
from werkzeug.exceptions import BadRequest as WerkzeugBadRequest
from werkzeug.wrappers import Response
from ..services.auth.adapter import HEADER_NAME
from ..shared.env import is_truthy
from ..shared.exceptions import ViewException... | 0 | 0 | 0 | 4,134 | 0 | 0 | 0 | 248 | 267 |
a8867f5403bb99f5bcbae491f8268e1b65d87f58 | 1,572 | py | Python | aulaspythonintermediario/aula08/aula08.py | lel352/Curso-Python | d65484c807db52d57042eee20ccbd3131825fa98 | [
"MIT"
] | 1 | 2021-09-04T14:34:34.000Z | 2021-09-04T14:34:34.000Z | aulaspythonintermediario/aula08/aula08.py | lel352/Curso-Python | d65484c807db52d57042eee20ccbd3131825fa98 | [
"MIT"
] | null | null | null | aulaspythonintermediario/aula08/aula08.py | lel352/Curso-Python | d65484c807db52d57042eee20ccbd3131825fa98 | [
"MIT"
] | null | null | null | perguntas = {
'Pergunta 1': {
'pergunta': 'Quanto 2+2?',
'respostas': {
'a': '1',
'b': '4',
'c': '8'
},
'resposta_certa': 'b',
},
'Pergunta 2': {
'pergunta': 'Quanto 3*2?',
'respostas': {
'a': '4',
... | 22.782609 | 60 | 0.41285 | perguntas = {
'Pergunta 1': {
'pergunta': 'Quanto é 2+2?',
'respostas': {
'a': '1',
'b': '4',
'c': '8'
},
'resposta_certa': 'b',
},
'Pergunta 2': {
'pergunta': 'Quanto é 3*2?',
'respostas': {
'a': '4',
... | 16 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3d0e051a57e016d558884a4d3a81a6b8c4bc541a | 2,521 | py | Python | api.py | dwyer/kvstore | d28e5d30e87663fc659dabd1186f65f7bcc72e7a | [
"BSD-2-Clause"
] | null | null | null | api.py | dwyer/kvstore | d28e5d30e87663fc659dabd1186f65f7bcc72e7a | [
"BSD-2-Clause"
] | null | null | null | api.py | dwyer/kvstore | d28e5d30e87663fc659dabd1186f65f7bcc72e7a | [
"BSD-2-Clause"
] | null | null | null | # -*-coding:utf-8-*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
| 29.313953 | 74 | 0.571599 | # -*-coding:utf-8-*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import contextlib
import json
import urllib
import urllib2
class NotAuthorized(Exception):
pass
class NotFound(Exception):
pass
class A... | 0 | 0 | 0 | 2,219 | 0 | 0 | 0 | -29 | 158 |
3630eaadfd408312b2a07a52e5f3950986ace3b4 | 9,328 | py | Python | appyter/ext/urllib.py | MaayanLab/jupyter-template | dd05bfcb95c9eafb1a9df845b5d8fecae1d6b9d5 | [
"Apache-2.0"
] | null | null | null | appyter/ext/urllib.py | MaayanLab/jupyter-template | dd05bfcb95c9eafb1a9df845b5d8fecae1d6b9d5 | [
"Apache-2.0"
] | 24 | 2020-04-07T17:04:47.000Z | 2020-05-27T00:51:25.000Z | appyter/ext/urllib.py | MaayanLab/jupyter-template | dd05bfcb95c9eafb1a9df845b5d8fecae1d6b9d5 | [
"Apache-2.0"
] | null | null | null | import re
url_expr = re.compile(
r'^((?P<scheme>.+?)://(?P<authority>((?P<username>[^/:@\?#]+?)(:(?P<password>[^/@\?#]+?))?@)?(?P<netloc>(?P<hostname>[^:/\?#]+)(:(?P<port>\d+))?))?)?(?P<path>.*?)(\?(?P<query_string>.*?))?(#(?P<fragment>.*?))?$'
)
fragment_expr = re.compile(
r'^(?P<path>.*?)(\?(?P<query_string>.*?... | 31.836177 | 213 | 0.690502 | import re
import itertools
import dataclasses
import typing as t
import urllib.parse
from appyter.ext.pathlib.chroot import ChrootPurePosixPath
from appyter.ext.dict import dict_merge, expand_dotmap
def parent_url(url):
parent, *filename = url.rsplit('/', maxsplit=1)
return parent if filename else ''
def url_file... | 0 | 8,050 | 0 | 0 | 0 | 623 | 0 | 57 | 270 |
6aa46ba15af9c90cd4de963e915ab8711d8d1291 | 4,891 | py | Python | tensorflow_federated/python/research/optimization/stackoverflow_lr/run_federated.py | matech96/federated | b30a26d66162bd02a89a12f119e17925d161a26b | [
"Apache-2.0"
] | 1 | 2020-05-02T05:08:14.000Z | 2020-05-02T05:08:14.000Z | tensorflow_federated/python/research/optimization/stackoverflow_lr/run_federated.py | RITESG/STATIC | cfe9d3e35ba033b1c4e47d347427a83f682f41de | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/research/optimization/stackoverflow_lr/run_federated.py | RITESG/STATIC | cfe9d3e35ba033b1c4e47d347427a83f682f41de | [
"Apache-2.0"
] | null | null | null | # Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 38.511811 | 105 | 0.771212 | # Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 0 | 0 | 0 | 0 | 0 | 2,275 | 0 | 359 | 201 |
02df5335e8a3f3d4d358a0212ca07a5e325681d9 | 3,839 | py | Python | rlo/src/rlo/plot_empirical_predicted_values.py | tomjaguarpaw/knossos-ksc | 8fa75e67c0db8f632b135379740051cd10ff31f2 | [
"MIT"
] | 31 | 2021-09-09T16:09:55.000Z | 2022-02-20T02:15:19.000Z | rlo/src/rlo/plot_empirical_predicted_values.py | tomjaguarpaw/knossos-ksc | 8fa75e67c0db8f632b135379740051cd10ff31f2 | [
"MIT"
] | 40 | 2021-08-06T14:30:08.000Z | 2022-01-19T08:49:52.000Z | rlo/src/rlo/plot_empirical_predicted_values.py | tomjaguarpaw/knossos-ksc | 8fa75e67c0db8f632b135379740051cd10ff31f2 | [
"MIT"
] | 5 | 2021-08-06T11:20:31.000Z | 2022-01-07T19:39:40.000Z | import matplotlib
matplotlib.use("Agg")
if __name__ == "__main__":
main()
| 34.585586 | 96 | 0.616567 | import argparse
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
from rlo import experiment_result
from rlo import plotting
from rlo import utils
def plot_empirical_predicted_values(
outfile, title_suffix, events, probabilities=[10, 50, 90]
):
# import json # deter... | 0 | 0 | 0 | 0 | 0 | 3,537 | 0 | 16 | 202 |
439e5ce03fdeb7ff15b9bc418b9bb213e3b0abfd | 1,348 | py | Python | interviewee/05_leetcode/arr_intersection_of_arrays.py | Anshul-GH/interview_prep | 0a30e980e910afbae4ad086dc7ff3b339eba4ec0 | [
"MIT"
] | 1 | 2020-10-10T10:14:27.000Z | 2020-10-10T10:14:27.000Z | interviewee/05_leetcode/arr_intersection_of_arrays.py | Anshul-GH/interview_prep | 0a30e980e910afbae4ad086dc7ff3b339eba4ec0 | [
"MIT"
] | null | null | null | interviewee/05_leetcode/arr_intersection_of_arrays.py | Anshul-GH/interview_prep | 0a30e980e910afbae4ad086dc7ff3b339eba4ec0 | [
"MIT"
] | null | null | null | '''
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it shows in both arrays and you may return the result in any order.
Example 1:
Input: nums1 = [1,2,2,1], nums2 = [2,2]
Output: [2,2]
Example 2:
Input: nums1 = [4,9,5],... | 29.955556 | 205 | 0.594214 | '''
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it shows in both arrays and you may return the result in any order.
Example 1:
Input: nums1 = [1,2,2,1], nums2 = [2,2]
Output: [2,2]
Example 2:
Input: nums1 = [4,9,5],... | 0 | 0 | 0 | 507 | 0 | 0 | 0 | 0 | 23 |
f4cb10f0f56ff24847349376a900ee090e9a7376 | 403 | py | Python | pysbd/lang/english.py | nipunsadvilkar/pysbd | 5905f13be4fc95f407b98392e0ec303617a33d86 | [
"MIT"
] | 429 | 2019-03-27T14:42:33.000Z | 2022-03-30T15:52:33.000Z | pysbd/lang/english.py | nipunsadvilkar/pysbd | 5905f13be4fc95f407b98392e0ec303617a33d86 | [
"MIT"
] | 86 | 2017-06-14T17:47:00.000Z | 2022-02-25T07:44:42.000Z | pysbd/lang/english.py | nipunsadvilkar/pysbd | 5905f13be4fc95f407b98392e0ec303617a33d86 | [
"MIT"
] | 55 | 2019-04-16T17:17:39.000Z | 2022-03-09T20:12:48.000Z | # -*- coding: utf-8 -*-
| 33.583333 | 80 | 0.717122 | # -*- coding: utf-8 -*-
from pysbd.abbreviation_replacer import AbbreviationReplacer
from pysbd.lang.common import Common, Standard
class English(Common, Standard):
iso_code = 'en'
class AbbreviationReplacer(AbbreviationReplacer):
SENTENCE_STARTERS = "A Being Did For He How However I In It Millions "... | 0 | 0 | 0 | 248 | 0 | 0 | 0 | 64 | 67 |
f207a86266fcce606728900c23230def441f9355 | 3,578 | py | Python | scarlett_os/utility/file.py | bossjones/scarlett-os | dc3b96604220a5848c51a14a343e97d464ad811b | [
"Apache-2.0"
] | 5 | 2016-11-08T21:01:00.000Z | 2018-05-07T11:02:43.000Z | scarlett_os/utility/file.py | bossjones/scarlett-os | dc3b96604220a5848c51a14a343e97d464ad811b | [
"Apache-2.0"
] | 854 | 2016-09-21T13:06:32.000Z | 2022-02-10T13:21:47.000Z | scarlett_os/utility/file.py | bossjones/scarlett-os | dc3b96604220a5848c51a14a343e97d464ad811b | [
"Apache-2.0"
] | 2 | 2016-12-02T15:12:41.000Z | 2017-02-25T08:21:56.000Z | # -*- coding: utf-8 -*-
from __future__ import with_statement, division
from scarlett_os.compat import os
from scarlett_os.compat import errno
from scarlett_os.compat import environ
from scarlett_os.compat import text_type
from scarlett_os.compat import _FSCODING
def format_size(size):
"""Turn an integer size v... | 27.523077 | 76 | 0.605087 | # -*- coding: utf-8 -*-
from __future__ import with_statement, division
from scarlett_os.compat import os
from scarlett_os.compat import errno
from scarlett_os.compat import environ
from scarlett_os.compat import text_type
from scarlett_os.compat import _FSCODING
def format_size(size):
"""Turn an integer size v... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
61981eb93391ba5fface0de71de724470844469f | 4,159 | py | Python | Raycast.py | Dylooz/raycasting | f0983ecc569f67cbd4dfeed8b28c0c1568db059f | [
"MIT"
] | null | null | null | Raycast.py | Dylooz/raycasting | f0983ecc569f67cbd4dfeed8b28c0c1568db059f | [
"MIT"
] | null | null | null | Raycast.py | Dylooz/raycasting | f0983ecc569f67cbd4dfeed8b28c0c1568db059f | [
"MIT"
] | null | null | null | import math
CONFIG = {
"START_POS": (400, 400),
"PLAYER_COLOUR": (0, 0, 255),
"PLAYER_RADIUS": 10,
"FOV": (math.pi / 2),
"RESOLUTION": 0.25,
"ROTATE_SPEED": (math.pi / 360),
"MOVE_SPEED": 0.5,
"VIEW_DIST": 300
}
WIDTH = 800
KEYS = {
1073741904: False, # left
1... | 28.101351 | 132 | 0.534744 | import math
import numpy
import pygame
CONFIG = {
"START_POS": (400, 400),
"PLAYER_COLOUR": (0, 0, 255),
"PLAYER_RADIUS": 10,
"FOV": (math.pi / 2),
"RESOLUTION": 0.25,
"ROTATE_SPEED": (math.pi / 360),
"MOVE_SPEED": 0.5,
"VIEW_DIST": 300
}
WIDTH = 800
KEYS = {
107... | 0 | 0 | 0 | 2,027 | 0 | 1,219 | 0 | -17 | 246 |
163743d78c16425801fc8839cd339747e3afc7a4 | 15,109 | py | Python | dynaconf/cli.py | aruncse01/dynaconf | 61c361821cf89b728e3bf3ae2c0b773e3387e120 | [
"MIT"
] | null | null | null | dynaconf/cli.py | aruncse01/dynaconf | 61c361821cf89b728e3bf3ae2c0b773e3387e120 | [
"MIT"
] | null | null | null | dynaconf/cli.py | aruncse01/dynaconf | 61c361821cf89b728e3bf3ae2c0b773e3387e120 | [
"MIT"
] | null | null | null | import io
import os
import sys
import click
from pathlib import Path
from dynaconf import default_settings
from dynaconf.utils.parse_conf import parse_conf_data
from contextlib import suppress
flask_app = None
django_app = None
if 'FLASK_APP' in os.environ: # pragma: no cover
with suppress(ImportError, click.Us... | 34.813364 | 101 | 0.586538 | import io
import os
import sys
import toml
import click
import pprint
import importlib
import webbrowser
from pathlib import Path
from dynaconf import default_settings
from dynaconf import constants
from dynaconf.validator import Validator
from dynaconf.utils.parse_conf import parse_conf_data
from dotenv import cli as ... | 0 | 12,341 | 0 | 0 | 0 | 376 | 0 | 34 | 353 |
e03ddb71ae236fed5ccd6de147c4d4b99638e687 | 5,850 | py | Python | cbandits/core/contextual_dataset.py | AlliedToasters/dev_bandits | 7e3655bd5a91854951a52d0f037ee06aefb2922c | [
"MIT"
] | null | null | null | cbandits/core/contextual_dataset.py | AlliedToasters/dev_bandits | 7e3655bd5a91854951a52d0f037ee06aefb2922c | [
"MIT"
] | null | null | null | cbandits/core/contextual_dataset.py | AlliedToasters/dev_bandits | 7e3655bd5a91854951a52d0f037ee06aefb2922c | [
"MIT"
] | null | null | null | """Define a data buffer for contextual bandit algorithms."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
| 36.335404 | 95 | 0.607692 | """Define a data buffer for contextual bandit algorithms."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
class ContextualDataset(object):
"""The buffer is able to append new data, and sample random minibatches."""
def __ini... | 0 | 383 | 0 | 5,253 | 0 | 0 | 0 | -3 | 46 |
4210e8540a38faec5e55ddf81f43aaa043dc7da9 | 921 | py | Python | web-app/migrations/versions/20210626_114817_822caa87a652_add_quiz_game_setups_table.py | philipp-mos/iubh-quiz-app | 3ea4a6b673bba6df0ece273e17e65c8fe5edc341 | [
"MIT"
] | null | null | null | web-app/migrations/versions/20210626_114817_822caa87a652_add_quiz_game_setups_table.py | philipp-mos/iubh-quiz-app | 3ea4a6b673bba6df0ece273e17e65c8fe5edc341 | [
"MIT"
] | 65 | 2021-06-01T15:52:12.000Z | 2021-10-01T15:44:50.000Z | web-app/migrations/versions/20210626_114817_822caa87a652_add_quiz_game_setups_table.py | philipp-mos/iubh-quiz-app | 3ea4a6b673bba6df0ece273e17e65c8fe5edc341 | [
"MIT"
] | 1 | 2022-03-29T14:13:45.000Z | 2022-03-29T14:13:45.000Z | """Add quiz_game_setups Table
Revision ID: 822caa87a652
Revises: 3b809ceaf543
Create Date: 2021-06-26 11:48:17.948434
"""
# revision identifiers, used by Alembic.
revision = '822caa87a652'
down_revision = '3b809ceaf543'
branch_labels = None
depends_on = None
| 26.314286 | 74 | 0.697068 | """Add quiz_game_setups Table
Revision ID: 822caa87a652
Revises: 3b809ceaf543
Create Date: 2021-06-26 11:48:17.948434
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '822caa87a652'
down_revision = '3b809ceaf543'
branch_labels = None
depends_on = None
def upgr... | 0 | 0 | 0 | 0 | 0 | 563 | 0 | 3 | 90 |
12e7db795759076fbdbf6d2c0d3b75f7bcb8889a | 2,368 | py | Python | clamor/rest/endpoints/emoji.py | TomSputz/Clamor | 13222b90532938e6ebdbe8aea0430512e7d22817 | [
"MIT"
] | 15 | 2019-07-05T20:26:18.000Z | 2020-09-18T12:44:16.000Z | clamor/rest/endpoints/emoji.py | TomSputz/Clamor | 13222b90532938e6ebdbe8aea0430512e7d22817 | [
"MIT"
] | 7 | 2019-07-07T19:55:07.000Z | 2019-08-20T22:07:31.000Z | clamor/rest/endpoints/emoji.py | TomSputz/Clamor | 13222b90532938e6ebdbe8aea0430512e7d22817 | [
"MIT"
] | 6 | 2019-07-07T20:39:29.000Z | 2020-11-06T10:12:20.000Z | # -*- coding: utf-8 -*-
__all__ = (
'EmojiWrapper',
)
| 36.430769 | 87 | 0.472551 | # -*- coding: utf-8 -*-
from ..routes import Routes
from .base import *
__all__ = (
'EmojiWrapper',
)
class EmojiWrapper(EndpointsWrapper):
"""A higher-level wrapper around Emoji endpoints.
.. seealso:: Emoji endpoints https://discordapp.com/developers/docs/resources/emoji
"""
def __init__(sel... | 0 | 0 | 1,810 | 426 | 0 | 0 | 0 | 4 | 68 |
879bf6cedca3a228a0ed5d68b969c46f3730e446 | 7,697 | py | Python | api/base/filters.py | bdyetton/prettychart | e8b33a7dfdc8c33d15969586be7f68172795f76d | [
"Apache-2.0"
] | null | null | null | api/base/filters.py | bdyetton/prettychart | e8b33a7dfdc8c33d15969586be7f68172795f76d | [
"Apache-2.0"
] | null | null | null | api/base/filters.py | bdyetton/prettychart | e8b33a7dfdc8c33d15969586be7f68172795f76d | [
"Apache-2.0"
] | null | null | null | import re
query_pattern = re.compile(r'filter\[\s*(?P<field>\S*)\s*\]\s*')
# Used to make intersection "reduce-able"
| 39.071066 | 149 | 0.678706 | import re
import functools
from modularodm import Q
from rest_framework.filters import OrderingFilter
from rest_framework import serializers as ser
class ODMOrderingFilter(OrderingFilter):
"""Adaptation of rest_framework.filters.OrderingFilter to work with modular-odm."""
# override
def filter_queryset(... | 0 | 0 | 0 | 7,097 | 0 | 199 | 0 | 50 | 226 |
6a9ee4906295ec1af783379bcd1b815404b3ad4d | 1,597 | py | Python | engine/gui/uielement.py | UnidayStudio/Easy-2D-Game-Engine | 1a8501cba538d7542b0e24bf64eead388085480f | [
"MIT"
] | 8 | 2019-12-15T22:32:30.000Z | 2021-06-14T07:38:51.000Z | engine/gui/uielement.py | UnidayStudio/Easy-2D-Game-Engine | 1a8501cba538d7542b0e24bf64eead388085480f | [
"MIT"
] | null | null | null | engine/gui/uielement.py | UnidayStudio/Easy-2D-Game-Engine | 1a8501cba538d7542b0e24bf64eead388085480f | [
"MIT"
] | 2 | 2020-09-10T17:34:23.000Z | 2021-03-11T09:26:26.000Z |
import engine.app
| 22.814286 | 67 | 0.690044 | import pygame
import pygame_gui
import engine.app
from engine.math import Vector
import engine.math
class UIElement():
def __init__(self):
self._element = None
self._lastResolution = [-1, -1]
self._position = Vector(0.4, 0.45)
self._scale = Vector(0.2, 0.1)
self._killed = False
def isKilled(self):
r... | 0 | 0 | 0 | 1,472 | 0 | 0 | 0 | -6 | 112 |
016c3b8beea50db52081dfe286ec8ca22e8adc82 | 5,347 | py | Python | src/libs/core/results/console.py | VirtualVFix/AndroidTestFramework | 1feb769c6aca39a78e6daefd6face0a1e4d62cd4 | [
"MIT"
] | null | null | null | src/libs/core/results/console.py | VirtualVFix/AndroidTestFramework | 1feb769c6aca39a78e6daefd6face0a1e4d62cd4 | [
"MIT"
] | null | null | null | src/libs/core/results/console.py | VirtualVFix/AndroidTestFramework | 1feb769c6aca39a78e6daefd6face0a1e4d62cd4 | [
"MIT"
] | null | null | null | # All rights reserved by forest fairy.
# You cannot modify or share anything without sacrifice.
# If you don't agree, keep calm and don't look at code bellow!
__author__ = "VirtualV <https://github.com/virtualvfix>"
__date__ = "12/18/2017 4:43 PM"
| 55.123711 | 124 | 0.438751 | # All rights reserved by forest fairy.
# You cannot modify or share anything without sacrifice.
# If you don't agree, keep calm and don't look at code bellow!
__author__ = "VirtualV <https://github.com/virtualvfix>"
__date__ = "12/18/2017 4:43 PM"
from config import CONFIG
from libs.core.tools.utility import Utility
... | 0 | 4,704 | 0 | 75 | 0 | 0 | 0 | 162 | 156 |
78fee5d7b83ceaeb50369b8d08b4b4f569f3d5fc | 115 | py | Python | web_scraping/ec2files/ec2file32.py | nikibhatt/Groa | fc2d4ae87cb825e6d54a0831c72be16541eebe61 | [
"MIT"
] | 1 | 2020-04-08T20:11:48.000Z | 2020-04-08T20:11:48.000Z | web_scraping/ec2files/ec2file32.py | cmgospod/Groa | 31b3624bfe61e772b55f8175b4e95d63c9e67966 | [
"MIT"
] | null | null | null | web_scraping/ec2files/ec2file32.py | cmgospod/Groa | 31b3624bfe61e772b55f8175b4e95d63c9e67966 | [
"MIT"
] | 1 | 2020-09-12T07:07:41.000Z | 2020-09-12T07:07:41.000Z | s = Scraper(start=57024, end=58805, max_iter=30, scraper_instance=32)
s.scrape_letterboxd() | 38.333333 | 70 | 0.773913 | from scraper import *
s = Scraper(start=57024, end=58805, max_iter=30, scraper_instance=32)
s.scrape_letterboxd() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 |
427c94638f2f3f91cf67eb6119a5530d3b4ed8b8 | 8,175 | py | Python | catalog.py | healingbrew/HeroesEmojiSlicer | 3c2cab9db8a0afea6b3bf3eb60c2a0e45d840355 | [
"MIT"
] | 1 | 2020-09-18T20:48:10.000Z | 2020-09-18T20:48:10.000Z | catalog.py | healingbrew/HeroesEmojiSlicer | 3c2cab9db8a0afea6b3bf3eb60c2a0e45d840355 | [
"MIT"
] | null | null | null | catalog.py | healingbrew/HeroesEmojiSlicer | 3c2cab9db8a0afea6b3bf3eb60c2a0e45d840355 | [
"MIT"
] | null | null | null | # encoding: utf-8
from Storm.Localized import Strings as LocalizedStrings
from Storm.GameData import Catalog
from Storm.DepotIndex import DepotIndex
from Storm.DepotCataFile import DepotCataFile
from sys import argv
from os.path import exists
if __name__ != '__main__':
print_utf8('catalog.py is a CLI file... | 41.923077 | 159 | 0.596697 | # encoding: utf-8
from Storm.Localized import Strings as LocalizedStrings
from Storm.GameData import Catalog
from Storm.DepotIndex import DepotIndex
from Storm.DepotCataFile import DepotCataFile, TYPE_NONE, TYPE_PRODUCTS, TYPE_LICENSES
from sys import argv
from os.path import exists
def print_utf8(text):
... | 0 | 0 | 0 | 0 | 0 | 4,997 | 0 | 41 | 75 |
fc9232403d12cc2eba69cc683ada204241083f20 | 2,640 | py | Python | src/graph_notebook/options/options.py | joywa/graph-notebook | 2c55b4fb5b6fb3c3205d0786a45a9101a44288a4 | [
"ISC",
"Apache-2.0",
"CC0-1.0"
] | 1 | 2021-07-10T14:20:09.000Z | 2021-07-10T14:20:09.000Z | src/graph_notebook/options/options.py | QPC-database/graph-notebook | ea162e47c2c2e5600417e6ad9ac34aa7ac462899 | [
"ISC",
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/graph_notebook/options/options.py | QPC-database/graph-notebook | ea162e47c2c2e5600417e6ad9ac34aa7ac462899 | [
"ISC",
"Apache-2.0",
"CC0-1.0"
] | null | null | null | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
"""
OPTIONS_DEFAULT_DIRECTED = {
"nodes": {
"borderWidthSelected": 0,
"borderWidth": 0,
"color": {
"background": "rgba(210, 229, 255, 1)",
"border": "transparen... | 25.882353 | 106 | 0.485606 | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
"""
OPTIONS_DEFAULT_DIRECTED = {
"nodes": {
"borderWidthSelected": 0,
"borderWidth": 0,
"color": {
"background": "rgba(210, 229, 255, 1)",
"border": "transparen... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8846f6302398d9ef67a8e1cf2f29121a9029efb4 | 722 | py | Python | module/other-test/unroll/unroll-test.py | dbunker/SABR | 556fd9d9e152c3067ea873e401d68d7656284808 | [
"MIT"
] | 8 | 2017-03-06T01:37:06.000Z | 2020-11-05T09:58:01.000Z | module/other-test/unroll/unroll-test.py | dbunker/SABR | 556fd9d9e152c3067ea873e401d68d7656284808 | [
"MIT"
] | null | null | null | module/other-test/unroll/unroll-test.py | dbunker/SABR | 556fd9d9e152c3067ea873e401d68d7656284808 | [
"MIT"
] | 2 | 2018-12-19T23:01:51.000Z | 2021-09-19T07:13:08.000Z | # shell game
import sys
relFold = '../../../'
sys.path.append(relFold+'module')
sabrUnroll() | 17.609756 | 55 | 0.587258 | # shell game
import sys, os, time, random, math
relFold = '../../../'
sys.path.append(relFold+'module')
import sabr
def sabrUnroll():
sabrObj = sabr.SabrObj()
# sym
sabrObj.setSym(['0','1','2'])
# board
sabrObj.setBoard(['a','b','c'])
# start
sabrObj.setStart(['2','0','1'])
# end
sabrObj.setEnd(['0... | 0 | 0 | 0 | 0 | 0 | 569 | 0 | 14 | 45 |
b9932aaaeb9920723bc0da7fce971d77b6853de5 | 2,485 | py | Python | assembly_ai/app.py | mattheweverette/Lectern | cc06a4df7af7fad9c320eb4803746da3669f1275 | [
"MIT"
] | 1 | 2022-03-31T20:47:02.000Z | 2022-03-31T20:47:02.000Z | assembly_ai/app.py | mattheweverette/Lectern | cc06a4df7af7fad9c320eb4803746da3669f1275 | [
"MIT"
] | null | null | null | assembly_ai/app.py | mattheweverette/Lectern | cc06a4df7af7fad9c320eb4803746da3669f1275 | [
"MIT"
] | null | null | null | import streamlit as st
import glob
import json
from podcasts import pipeline
from threading import Thread
st.title("Podcast Summaries")
json_files = glob.glob('*.json')
episode_id = st.sidebar.text_input("Episode ID")
button = st.sidebar.button("Download Episode summary")
if button and episode_id:
st.sidebar.wr... | 32.272727 | 104 | 0.591952 | import streamlit as st
import glob
import json
from podcasts import pipeline
from threading import Thread
st.title("Podcast Summaries")
json_files = glob.glob('*.json')
episode_id = st.sidebar.text_input("Episode ID")
button = st.sidebar.button("Download Episode summary")
if button and episode_id:
st.sidebar.wr... | 0 | 0 | 0 | 0 | 0 | 1,566 | 0 | 0 | 23 |
f6ef9e916c9d652c9865097a55a09201ba1bdecc | 3,364 | py | Python | rootpy/utils/ext_glob.py | masonproffitt/rootpy | 3926935e1f2100d8ba68070c2ab44055d4800f73 | [
"BSD-3-Clause"
] | 146 | 2015-01-04T15:16:44.000Z | 2022-01-27T11:29:31.000Z | rootpy/utils/ext_glob.py | masonproffitt/rootpy | 3926935e1f2100d8ba68070c2ab44055d4800f73 | [
"BSD-3-Clause"
] | 143 | 2015-01-07T00:20:42.000Z | 2021-11-04T07:48:26.000Z | rootpy/utils/ext_glob.py | masonproffitt/rootpy | 3926935e1f2100d8ba68070c2ab44055d4800f73 | [
"BSD-3-Clause"
] | 56 | 2015-01-30T11:11:07.000Z | 2022-03-28T09:42:06.000Z | """
Reproduce the standard glob package behaviour but use TSystem to be able to
query remote file systems such as xrootd
"""
from __future__ import print_function
__all__ = ["glob", "iglob"]
if __name__ == "__main__":
test_paths = [
"*.*",
"*/*.txt",
"data/L1Ntuple_test_3.root",
... | 31.439252 | 75 | 0.615933 | """
Reproduce the standard glob package behaviour but use TSystem to be able to
query remote file systems such as xrootd
"""
from __future__ import print_function
from rootpy.ROOT import gSystem
import glob as gl
import os.path
import fnmatch
__all__ = ["glob", "iglob"]
def __directory_iter(directory):
while Tr... | 0 | 0 | 0 | 0 | 254 | 1,218 | 0 | -8 | 180 |
f700e672cd17275a041dea32beccb6a84ec37569 | 392 | py | Python | setup.py | Damaen/Travis-Hello-world | 6c88895142e708638000c9bd9550c3bc61045689 | [
"MIT"
] | null | null | null | setup.py | Damaen/Travis-Hello-world | 6c88895142e708638000c9bd9550c3bc61045689 | [
"MIT"
] | null | null | null | setup.py | Damaen/Travis-Hello-world | 6c88895142e708638000c9bd9550c3bc61045689 | [
"MIT"
] | null | null | null |
#!/usr/bin/env python
from distutils.core import setup
from glob import glob
from setuptools import find_packages
setup(name='Fibonacci',
version='1.0',
description='Python Distribution Utilities',
author='Kevin Chen',
packages=find_packages('src'),
package_dir={'': 'src'},
py_mo... | 24.5 | 76 | 0.665816 |
#!/usr/bin/env python
from distutils.core import setup
from glob import glob
from setuptools import find_packages
setup(name='Fibonacci',
version='1.0',
description='Python Distribution Utilities',
author='Kevin Chen',
packages=find_packages('src'),
package_dir={'': 'src'},
py_mo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
140c6353a82e92848c975322c3dc412086d94517 | 125 | py | Python | tests/__init__.py | Foxbud/tagup | e55f13658006563851943ee68cd2955b79b19c3d | [
"MIT"
] | null | null | null | tests/__init__.py | Foxbud/tagup | e55f13658006563851943ee68cd2955b79b19c3d | [
"MIT"
] | 3 | 2020-06-14T22:41:10.000Z | 2020-06-16T17:15:29.000Z | tests/__init__.py | Foxbud/tagup | e55f13658006563851943ee68cd2955b79b19c3d | [
"MIT"
] | null | null | null | """
This file is part of the tagup Python module which is released under MIT.
See file LICENSE for full license details.
"""
| 25 | 73 | 0.752 | """
This file is part of the tagup Python module which is released under MIT.
See file LICENSE for full license details.
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8555ab80f0d583260980e8115da2a96b1679c256 | 5,152 | py | Python | models_dev/point_transformer.py | A-suozhang/SpatioTemporalSegmentation-ScanNet | 479de1793afe6ec20bed6c0f68498b0c49e7315c | [
"MIT"
] | 1 | 2021-05-07T08:42:40.000Z | 2021-05-07T08:42:40.000Z | models_dev/point_transformer.py | A-suozhang/SpatioTemporalSegmentation-ScanNet | 479de1793afe6ec20bed6c0f68498b0c49e7315c | [
"MIT"
] | null | null | null | models_dev/point_transformer.py | A-suozhang/SpatioTemporalSegmentation-ScanNet | 479de1793afe6ec20bed6c0f68498b0c49e7315c | [
"MIT"
] | null | null | null | import torch.nn as nn
| 39.937984 | 135 | 0.638199 | import torch
import torch.nn as nn
import torch.nn.functional as F
from models.pct_utils import TDLayer, TULayer, PTBlock, TRBlock
class PointTransformer(nn.Module):
def __init__(self,config,num_class,N,normal_channel=3):
super(PointTransformer, self).__init__()
# The normal channel for Modelnet is... | 0 | 0 | 0 | 4,973 | 0 | 0 | 0 | 43 | 112 |
a9cbb09777c6a011d3778870d939d1f2d673530d | 5,138 | py | Python | backend/src/apiserver/visualization/server.py | nostro-im/pipelines | 39f5b6b74040abbf4b764cbd5b422d7548723d9e | [
"Apache-2.0"
] | 2,860 | 2018-05-24T04:55:01.000Z | 2022-03-31T13:49:56.000Z | backend/src/apiserver/visualization/server.py | nostro-im/pipelines | 39f5b6b74040abbf4b764cbd5b422d7548723d9e | [
"Apache-2.0"
] | 7,331 | 2018-05-16T09:03:26.000Z | 2022-03-31T23:22:04.000Z | backend/src/apiserver/visualization/server.py | nostro-im/pipelines | 39f5b6b74040abbf4b764cbd5b422d7548723d9e | [
"Apache-2.0"
] | 1,359 | 2018-05-15T11:05:41.000Z | 2022-03-31T09:42:09.000Z | # Copyright 2019 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 34.253333 | 91 | 0.651226 | # Copyright 2019 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 0 | 0 | 0 | 3,713 | 0 | 0 | 0 | 37 | 134 |
5daf88dd6a1a490f60f07f2c9811da15535f9510 | 1,404 | py | Python | apps/trade/src/market/QuoineConstants.py | kikei/btc-bot-ai | cb118fa1809ebef472a2025be697c9050e948009 | [
"Apache-2.0"
] | 1 | 2020-02-02T13:53:21.000Z | 2020-02-02T13:53:21.000Z | apps/trade/src/market/QuoineConstants.py | kikei/btc-bot-ai | cb118fa1809ebef472a2025be697c9050e948009 | [
"Apache-2.0"
] | null | null | null | apps/trade/src/market/QuoineConstants.py | kikei/btc-bot-ai | cb118fa1809ebef472a2025be697c9050e948009 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
#
ORDER_IGNORE_TIMEOUT = True
#
ORDER_EXECUTED_RETRY_INTERVAL = 2
#
ORDER_EXECUTED_RETRY = 40
# [s]
TIME_ERROR_ALLOW = 3
# API
RETRY_API_CALL = 10
API_URI = 'https://api.liquid.com'
API_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Ch... | 24.206897 | 148 | 0.775641 | # -*- coding: utf-8 -*-
# 新規注文後、一定時間経ってもオーダーが残っている場合に
# 処理を続行するか否か
ORDER_IGNORE_TIMEOUT = True
# 注文完了待ち確認間隔
ORDER_EXECUTED_RETRY_INTERVAL = 2
# 注文完了待ち確認回数
ORDER_EXECUTED_RETRY = 40
# クローズ済みトレード取得時の許容時間誤差 [s]
TIME_ERROR_ALLOW = 3
# API呼び出しリトライ数
RETRY_API_CALL = 10
API_URI = 'https://api.liquid.com'
API_USER_AGENT ... | 270 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
035639992fbaa91dbf14c63e7f1d5e1d1b08b6d2 | 7,226 | py | Python | Code/scripts/Worlds/RvizElements.py | JoseAndresMR/jamrepo | b4205d55995a138f5d5e8502015b3620ab2afa10 | [
"MIT"
] | 1 | 2019-11-19T12:31:49.000Z | 2019-11-19T12:31:49.000Z | Code/scripts/Worlds/RvizElements.py | JoseAndresMR/jamrepo | b4205d55995a138f5d5e8502015b3620ab2afa10 | [
"MIT"
] | null | null | null | Code/scripts/Worlds/RvizElements.py | JoseAndresMR/jamrepo | b4205d55995a138f5d5e8502015b3620ab2afa10 | [
"MIT"
] | 2 | 2019-11-19T12:31:45.000Z | 2020-09-27T07:45:23.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------------------------------------------------
# ROS-MAGNA
# -----------------------------------------------------------------------------------------... | 35.772277 | 165 | 0.640742 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------------------------------------------------
# ROS-MAGNA
# -----------------------------------------------------------------------------------------... | 0 | 0 | 0 | 4,764 | 0 | 0 | 0 | 85 | 489 |
d609e4179a2fa5c1d3b6e223cb14512352e5b429 | 697 | py | Python | forecast-admin/forecast/opportunities/migrations/0007_auto_20151127_1141.py | 18F/osbu-forecast-api | 26a53dad8da4f3d2de522ac1e488e7135a56b557 | [
"CC0-1.0"
] | 3 | 2016-03-02T17:27:54.000Z | 2016-03-15T16:49:27.000Z | forecast-admin/forecast/opportunities/migrations/0007_auto_20151127_1141.py | 18F/forecast | 26a53dad8da4f3d2de522ac1e488e7135a56b557 | [
"CC0-1.0"
] | 62 | 2015-12-14T14:42:35.000Z | 2016-05-19T16:47:56.000Z | forecast-admin/forecast/opportunities/migrations/0007_auto_20151127_1141.py | 18F/forecast | 26a53dad8da4f3d2de522ac1e488e7135a56b557 | [
"CC0-1.0"
] | 5 | 2016-01-29T17:10:24.000Z | 2021-02-14T12:15:37.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 27.88 | 110 | 0.629842 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('opportunities', '0006_auto_20151127_0336'),
]
operations = [
migrations.AlterField(
model_name='opportunity',
... | 0 | 0 | 0 | 567 | 0 | 0 | 0 | 19 | 46 |
4e5f3a16117fa6e6f15130ae3b5999c7cf174f54 | 1,457 | py | Python | foreshadow/smart/intent_resolving/core/secondary_featurizers/base_featurizer_via_lambda.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 25 | 2018-07-26T17:30:31.000Z | 2021-02-23T22:54:01.000Z | foreshadow/smart/intent_resolving/core/secondary_featurizers/base_featurizer_via_lambda.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 150 | 2018-11-02T18:09:12.000Z | 2020-05-15T01:01:35.000Z | foreshadow/smart/intent_resolving/core/secondary_featurizers/base_featurizer_via_lambda.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 1 | 2019-02-20T22:24:00.000Z | 2019-02-20T22:24:00.000Z | """Class defintion for BaseFeaturizeViaLambda abstract class."""
| 30.354167 | 80 | 0.633493 | """Class defintion for BaseFeaturizeViaLambda abstract class."""
from typing import Callable
import pandas as pd
from .base_featurizer import BaseFeaturizer
class BaseFeaturizerViaLambda(BaseFeaturizer):
"""
Abstract class to create secondary featurization via a custom function.
Attributes:
_c... | 0 | 0 | 0 | 1,273 | 0 | 0 | 0 | 26 | 92 |
5834ad7c7df985e3609b87d3b72c1aec6609e340 | 666 | py | Python | ind2.py | 12W300/Three | 1faf8e5379541d409978c64ca1c8facdef58552b | [
"MIT"
] | null | null | null | ind2.py | 12W300/Three | 1faf8e5379541d409978c64ca1c8facdef58552b | [
"MIT"
] | null | null | null | ind2.py | 12W300/Three | 1faf8e5379541d409978c64ca1c8facdef58552b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
if __name__ == '__main__':
A = tuple(map(int, input().split()))
print(' ', A.index(max(A)))
zero_1 = zero_2 = -1
for i, item in enumerate(A):
if (item == 0) and (zero_1 != -1) and (zero_2 == -1):
zero_2 = i
if (it... | 30.272727 | 101 | 0.558559 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
if __name__ == '__main__':
A = tuple(map(int, input().split()))
print('максимальный элемент имеет номер ', A.index(max(A)))
zero_1 = zero_2 = -1
for i, item in enumerate(A):
if (item == 0) and (zero_1 != -1) and (zero_2 == -... | 258 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 25 |
a36534259b6d4d6eb89bb926cda2c1dd7feac4ad | 579 | py | Python | aula7/tarefa1.py | davidpvilaca/TEP | decbf61a96863d76e1b84dc097aa37b12038aa75 | [
"MIT"
] | 2 | 2017-08-28T18:24:47.000Z | 2019-08-29T03:34:15.000Z | aula7/tarefa1.py | davidpvilaca/TEP | decbf61a96863d76e1b84dc097aa37b12038aa75 | [
"MIT"
] | null | null | null | aula7/tarefa1.py | davidpvilaca/TEP | decbf61a96863d76e1b84dc097aa37b12038aa75 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 14 08:29:23 2017
@author: davidpvilaca
"""
import matplotlib.pyplot as plt
import cv2
img1 = cv2.imread('vermelho3.jpg')
img1_hsv = cv2.cvtColor(img1, cv2.COLOR_BGR2HSV)
i = img1_hsv[:,:, 0] < 30
img1_hsv[i, 0] += 30
i = img1_hsv[:,:, 0] > 150
i... | 21.444444 | 72 | 0.699482 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 14 08:29:23 2017
@author: davidpvilaca
"""
import matplotlib.pyplot as plt
import cv2
img1 = cv2.imread('vermelho3.jpg')
img1_hsv = cv2.cvtColor(img1, cv2.COLOR_BGR2HSV)
i = img1_hsv[:,:, 0] < 30
img1_hsv[i, 0] += 30
i = img1_hsv[:,:, 0] > 150
i... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
46c72939e50816fe6d9dffd8f1c48937d6b5bd57 | 51,920 | py | Python | professors/generative_professor.py | tudor-berariu/training-teachers | 44d0e754a058bc45c3529a906127e09ae30fe670 | [
"MIT"
] | 1 | 2018-10-07T15:52:32.000Z | 2018-10-07T15:52:32.000Z | professors/generative_professor.py | tudor-berariu/training-teachers | 44d0e754a058bc45c3529a906127e09ae30fe670 | [
"MIT"
] | null | null | null | professors/generative_professor.py | tudor-berariu/training-teachers | 44d0e754a058bc45c3529a906127e09ae30fe670 | [
"MIT"
] | null | null | null | from torch import autograd
def grad_of(outputs, inputs, grad_outputs=None):
"""Call autograd.grad with create & retain graph, and ignore other
leaf variables.
"""
return autograd.grad(outputs, inputs,
grad_outputs=grad_outputs,
create_graph=True,
... | 42.452984 | 86 | 0.518394 | from itertools import chain
from collections import OrderedDict
import os.path
from typing import Tuple
from argparse import Namespace
from tabulate import tabulate
from termcolor import colored as clr
import numpy as np
import torch
from torch import Tensor
from torch import nn
import torch.nn.functional as F
from tor... | 0 | 0 | 0 | 49,501 | 0 | 1,263 | 0 | 214 | 533 |
74dcaf3b4fc5c6a6b348a1d53ba3fa3b1a0c2513 | 1,450 | py | Python | example-data/3d-reconstruct.py | DiamondLightSource/rpi-config | 617f5e176c0621e3ea1b567e9586e96ba0f8b5db | [
"Apache-2.0"
] | 4 | 2016-08-23T12:13:21.000Z | 2018-08-22T12:55:55.000Z | example-data/3d-reconstruct.py | DiamondLightSource/rpi-config | 617f5e176c0621e3ea1b567e9586e96ba0f8b5db | [
"Apache-2.0"
] | null | null | null | example-data/3d-reconstruct.py | DiamondLightSource/rpi-config | 617f5e176c0621e3ea1b567e9586e96ba0f8b5db | [
"Apache-2.0"
] | 2 | 2016-09-15T19:17:30.000Z | 2018-03-06T06:34:13.000Z | import numpy as np
import h5py
import scisoftpy as dnp
from math import cos, sin
print("Starting")
data = h5py.File('/dls/tmp/ssg37927/31_processed_160905_141219.nxs','r')['entry/result/data']
angles = h5py.File('/dls/tmp/ssg37927/31_processed_160905_141219.nxs','r')['entry/result/Angle']
frame = 300
dnp.plot.image(... | 23.387097 | 108 | 0.622759 | import numpy as np
import h5py
import scisoftpy as dnp
from time import sleep
from math import cos, sin
print("Starting")
data = h5py.File('/dls/tmp/ssg37927/31_processed_160905_141219.nxs','r')['entry/result/data']
angles = h5py.File('/dls/tmp/ssg37927/31_processed_160905_141219.nxs','r')['entry/result/Angle']
fram... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 22 |
16f438ea264cd3a6cbbb277a018a017480157550 | 3,757 | py | Python | PaperwithCode/1.Co-Interactive-Transformer/load_data.py | techthiyanes/nlp-notebook | 0e5f4b75e635128d4056c89a6c65bea60c15e836 | [
"MIT"
] | 136 | 2021-04-18T12:03:55.000Z | 2022-03-31T14:58:46.000Z | PaperwithCode/1.Co-Interactive-Transformer/load_data.py | techthiyanes/nlp-notebook | 0e5f4b75e635128d4056c89a6c65bea60c15e836 | [
"MIT"
] | 3 | 2021-08-08T08:38:06.000Z | 2022-03-26T17:17:40.000Z | PaperwithCode/1.Co-Interactive-Transformer/load_data.py | techthiyanes/nlp-notebook | 0e5f4b75e635128d4056c89a6c65bea60c15e836 | [
"MIT"
] | 40 | 2021-05-18T06:55:37.000Z | 2022-03-30T00:47:12.000Z | # -*- coding: utf-8 -*-
import csv
import torch
import torch.utils.data as tud
from torch.nn.utils.rnn import pad_sequence
TRAIN_DATA_PATH = './data/data_with_slots_intent_train.csv'
DEV_DATA_PATH = './data/data_with_slots_intent_dev.csv'
SLOT_PATH = './data/slot_maping.csv'
INTENT_PATH = './data/intent_maping.csv'
BA... | 36.475728 | 120 | 0.637211 | # -*- coding: utf-8 -*-
import csv
import torch
import torch.utils.data as tud
from torch.nn.utils.rnn import pad_sequence
TRAIN_DATA_PATH = './data/data_with_slots_intent_train.csv'
DEV_DATA_PATH = './data/data_with_slots_intent_dev.csv'
SLOT_PATH = './data/slot_maping.csv'
INTENT_PATH = './data/intent_maping.csv'
BA... | 237 | 0 | 0 | 967 | 0 | 0 | 0 | 0 | 27 |
4dc63e70df28d10f5316b2903975a3cb406d4d5c | 1,222 | py | Python | data/render_data.py | ai-se/ResourcesDataDrivenSBSE | a061313f108f416035dcc6d03edc212aa4c7563e | [
"CC0-1.0"
] | 3 | 2018-09-11T07:28:18.000Z | 2020-07-07T17:25:11.000Z | data/render_data.py | ai-se/ResourcesDataDrivenSBSE | a061313f108f416035dcc6d03edc212aa4c7563e | [
"CC0-1.0"
] | 50 | 2018-01-20T20:48:24.000Z | 2018-03-05T00:29:47.000Z | data/render_data.py | ai-se/ResourcesDataDrivenSBSE | a061313f108f416035dcc6d03edc212aa4c7563e | [
"CC0-1.0"
] | null | null | null | from __future__ import print_function
import pandas as pd
import os
head = """
[home](http://tiny.cc/sbse) |
[models](xx) |
[data](xx) |
[discuss](https://github.com/ai-se/ResourcesDataDrivenSBSE/issues) |
[citation](https://github.com/ai-se/ResourcesDataDrivenSBSE/blob/master/CITATION.md) |
[copyright](https://githu... | 26.565217 | 135 | 0.728314 | from __future__ import print_function
from glob2 import glob
import pandas as pd
import os
from pdb import set_trace
head = """
[home](http://tiny.cc/sbse) |
[models](xx) |
[data](xx) |
[discuss](https://github.com/ai-se/ResourcesDataDrivenSBSE/issues) |
[citation](https://github.com/ai-se/ResourcesDataDrivenSBSE/blo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 44 |
13eea81b3a271a532aa1b861edb5ff30a4588a1b | 712 | py | Python | monster_scrapper.py | Mounika1705/job_analysis | f90b7ca6dfb023ef06f894f120fde6673a1f3d8f | [
"Apache-2.0"
] | null | null | null | monster_scrapper.py | Mounika1705/job_analysis | f90b7ca6dfb023ef06f894f120fde6673a1f3d8f | [
"Apache-2.0"
] | null | null | null | monster_scrapper.py | Mounika1705/job_analysis | f90b7ca6dfb023ef06f894f120fde6673a1f3d8f | [
"Apache-2.0"
] | null | null | null | #import pandas as pd
query="engineer"
extract(query) | 20.342857 | 60 | 0.651685 | import feedparser
import csv
import json
#import pandas as pd
from urllib.request import urlopen
from bs4 import BeautifulSoup
def extract(query):
url= "http://rss.jobsearch.monster.com/rssquery.ashx?q="
query= "engineer"
final_url = url + query
url_xml = urlopen(final_url)
xml = url_xml.read()
... | 0 | 0 | 0 | 0 | 0 | 498 | 0 | -4 | 156 |
066097e133b01ab3ecc03ebcc6052eaff7e3fa82 | 9,550 | py | Python | bleak/backends/dotnet/scanner.py | soldag/bleak | 7ef5d61c93cf92806ac16eca38ed565d08d8ac59 | [
"MIT"
] | null | null | null | bleak/backends/dotnet/scanner.py | soldag/bleak | 7ef5d61c93cf92806ac16eca38ed565d08d8ac59 | [
"MIT"
] | 2 | 2019-07-09T19:37:39.000Z | 2020-07-25T12:23:27.000Z | bleak/backends/dotnet/scanner.py | soldag/bleak | 7ef5d61c93cf92806ac16eca38ed565d08d8ac59 | [
"MIT"
] | 2 | 2019-07-03T20:26:30.000Z | 2020-09-05T13:01:53.000Z | import logging
import pathlib
# Import of Bleak CLR->UWP Bridge. It is not needed here, but it enables loading of Windows.Devices
logger = logging.getLogger(__name__)
_here = pathlib.Path(__file__).parent
| 37.747036 | 129 | 0.673927 | import logging
import asyncio
import pathlib
import uuid
from functools import wraps
from typing import Callable, Any, Union, List
from bleak.backends.device import BLEDevice
from bleak.backends.dotnet.utils import BleakDataReader
from bleak.exc import BleakError, BleakDotNetTaskError
from bleak.backends.scanner impor... | 0 | 2,836 | 2,375 | 3,232 | 0 | 282 | 0 | 302 | 313 |
f00bbaa6bf9d748d229a232f4dfbb02cf2de0cca | 2,904 | py | Python | contract_tests.py | LukasForst/SWA-TP-user-service-contract-tests | 7f08be64b23ff63f2b647c811226097619a363db | [
"MIT"
] | null | null | null | contract_tests.py | LukasForst/SWA-TP-user-service-contract-tests | 7f08be64b23ff63f2b647c811226097619a363db | [
"MIT"
] | null | null | null | contract_tests.py | LukasForst/SWA-TP-user-service-contract-tests | 7f08be64b23ff63f2b647c811226097619a363db | [
"MIT"
] | null | null | null | import unittest
SERVICE_URL = 'http://localhost:8080'
if __name__ == '__main__':
unittest.main()
| 38.210526 | 113 | 0.625689 | import unittest
import uuid
import requests
SERVICE_URL = 'http://localhost:8080'
class MyTestCase(unittest.TestCase):
def test_status_returns_ok(self):
r = requests.get(f'{SERVICE_URL}/status')
self.assertEqual('OK', r.json()['status'])
def test_version_returns_some_version(self):
... | 0 | 0 | 0 | 2,747 | 0 | 0 | 0 | -16 | 68 |
46cb05635ad337e6167d8763bcaa6919b36bc980 | 2,539 | py | Python | server/app/service/motion.py | raspihats/EvePnP | 2961d759554c38609f0f431c012ea8d38016f347 | [
"MIT"
] | null | null | null | server/app/service/motion.py | raspihats/EvePnP | 2961d759554c38609f0f431c012ea8d38016f347 | [
"MIT"
] | 5 | 2020-07-07T19:41:23.000Z | 2022-02-12T05:42:50.000Z | server/app/service/motion.py | raspihats/EvePnP | 2961d759554c38609f0f431c012ea8d38016f347 | [
"MIT"
] | null | null | null |
motion_service = MotionService()
| 36.271429 | 89 | 0.579756 | from ..dao import axis_dao
from .controllers import controllers_service
class MotionService(object):
def home(self):
controllers_service.motion_controller.home()
self.park([{'id': 'z'}])
self.park([{'id': 'x'}, {'id': 'y'}])
self.park([{'id': 'a'}, {'id': 'b'}])
def park(self... | 0 | 0 | 0 | 2,408 | 0 | 0 | 0 | 28 | 67 |
37a912fcaa51bf417936b1e79aa45ed24ecd9252 | 563 | py | Python | backend/smartMoney_project/smartMoney_app/migrations/0013_expense_category.py | uca-pid/f-al-cuadrado-2021 | 2cd203f5a998f3b4f54811a382458ce5b6762a2a | [
"MIT"
] | null | null | null | backend/smartMoney_project/smartMoney_app/migrations/0013_expense_category.py | uca-pid/f-al-cuadrado-2021 | 2cd203f5a998f3b4f54811a382458ce5b6762a2a | [
"MIT"
] | 13 | 2021-09-08T21:05:49.000Z | 2021-12-16T04:58:51.000Z | backend/smartMoney_project/smartMoney_app/migrations/0013_expense_category.py | uca-pid/f-al-cuadrado-2021 | 2cd203f5a998f3b4f54811a382458ce5b6762a2a | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-09-19 22:33
| 26.809524 | 157 | 0.68206 | # Generated by Django 3.2.4 on 2021-09-19 22:33
from django.db import migrations, models
import django.db.models.deletion
import smartMoney_app.models
class Migration(migrations.Migration):
dependencies = [
('smartMoney_app', '0012_auto_20210919_2119'),
]
operations = [
migrations.AddFi... | 0 | 0 | 0 | 387 | 0 | 0 | 0 | 37 | 90 |
94e1a55855eb3fba74bcfbc988c3961ba5b60fc7 | 2,321 | py | Python | udapi/mongodb/databases.py | FOSS-X/udapi-core-v2 | 0e0cceb7130389d01bc4e674ad9a1f38fb556837 | [
"MIT"
] | null | null | null | udapi/mongodb/databases.py | FOSS-X/udapi-core-v2 | 0e0cceb7130389d01bc4e674ad9a1f38fb556837 | [
"MIT"
] | null | null | null | udapi/mongodb/databases.py | FOSS-X/udapi-core-v2 | 0e0cceb7130389d01bc4e674ad9a1f38fb556837 | [
"MIT"
] | null | null | null | #
# databases.py
# Start of dataabases.py
#
# Created by FOSS-X UDAPI Desgin Team on 7/05/20.
# Copyright 2020 FOSS-X. All rights reserved.
#
from flask import Blueprint
import pymongo
mod = Blueprint('databasesMongodb', __name__)
client = pymongo.MongoClient()
| 35.707692 | 124 | 0.691081 | #
# databases.py
# Start of dataabases.py
#
# Created by FOSS-X UDAPI Desgin Team on 7/05/20.
# Copyright © 2020 FOSS-X. All rights reserved.
#
from flask import Flask, jsonify, request,Blueprint
from ..util_mongodb import *
from ..util import *
from ..util_mysql import *
import pymongo
mod = Blueprint(... | 2 | 1,869 | 0 | 0 | 0 | 0 | 0 | 35 | 136 |
56483d92d184dffd6f7b6f11cd36ff2344b63545 | 550 | py | Python | relaax/server/common/saver/fs_saver.py | j0k/relaax | dff865facc2932e4f8317d6ab4ad32a1f218e7b6 | [
"MIT"
] | 4 | 2018-07-31T06:32:30.000Z | 2021-05-02T20:21:37.000Z | relaax/server/common/saver/fs_saver.py | bohblue2/relaax | 0a7ed8f2a21e37ca047e16d216d164527c1fffdd | [
"MIT"
] | null | null | null | relaax/server/common/saver/fs_saver.py | bohblue2/relaax | 0a7ed8f2a21e37ca047e16d216d164527c1fffdd | [
"MIT"
] | null | null | null | from __future__ import print_function
| 22.916667 | 52 | 0.667273 | from __future__ import print_function
import os
import tensorflow
import saver
class FsSaver(saver.Saver):
def __init__(self, dir):
super(FsSaver, self).__init__()
self._dir = dir
def restore_latest_checkpoint(self, session):
return self._restore(self._dir, session)
def save_ch... | 0 | 0 | 0 | 445 | 0 | 0 | 0 | -25 | 91 |
062502d51ba25c33ec0f0bba62d7be2e338d4bb9 | 1,762 | py | Python | syn/tagmathon/b/tests/test_interpreter.py | mbodenhamer/syn | aeaa3ad8a49bac8f50cf89b6f1fe97ad43d1d258 | [
"MIT"
] | 1 | 2021-07-15T08:55:12.000Z | 2021-07-15T08:55:12.000Z | syn/tagmathon/b/tests/test_interpreter.py | mbodenhamer/syn | aeaa3ad8a49bac8f50cf89b6f1fe97ad43d1d258 | [
"MIT"
] | 7 | 2021-01-07T23:51:57.000Z | 2021-12-13T19:50:57.000Z | syn/tagmathon/b/tests/test_interpreter.py | mbodenhamer/syn | aeaa3ad8a49bac8f50cf89b6f1fe97ad43d1d258 | [
"MIT"
] | 2 | 2016-07-11T08:46:31.000Z | 2017-12-13T13:30:51.000Z |
#-------------------------------------------------------------------------------
# Frame
#-------------------------------------------------------------------------------
# Env
#-------------------------------------------------------------------------------
# eval
#---------------------------------------------------... | 21.753086 | 80 | 0.420545 | from nose.tools import assert_raises
from syn.tagmathon.b import Frame, Env, eval
#-------------------------------------------------------------------------------
# Frame
def test_frame():
f = Frame()
f['a'] = 1
f['b'] = 2
assert f.globals == {}
assert f.locals == dict(a=1, b=2)
f.set_global... | 0 | 0 | 0 | 0 | 0 | 1,107 | 0 | 38 | 113 |
23022abdf1b502146d3781d4836f78943a7ec6e6 | 2,186 | py | Python | kvmagent/kvmagent/test/test_vm_plugin_update_hostIommu_status.py | qianfei11/zstack-utility | e791bc6b6ae3a74e202f6fce84bde498c715aee8 | [
"Apache-2.0"
] | 55 | 2017-02-10T07:55:21.000Z | 2021-09-01T00:59:36.000Z | kvmagent/kvmagent/test/test_vm_plugin_update_hostIommu_status.py | qianfei11/zstack-utility | e791bc6b6ae3a74e202f6fce84bde498c715aee8 | [
"Apache-2.0"
] | 106 | 2017-02-13T09:58:27.000Z | 2022-02-15T09:51:48.000Z | kvmagent/kvmagent/test/test_vm_plugin_update_hostIommu_status.py | qianfei11/zstack-utility | e791bc6b6ae3a74e202f6fce84bde498c715aee8 | [
"Apache-2.0"
] | 68 | 2017-02-13T11:02:01.000Z | 2021-12-16T11:02:01.000Z | '''
@author: kaicai.hu
'''
import unittest
if __name__ == "__main__":
unittest.main() | 46.510638 | 237 | 0.639067 | '''
@author: kaicai.hu
'''
import unittest
import tempfile
from kvmagent import kvmagent
from kvmagent.plugins import vm_plugin
from zstacklib.utils import bash
class Test(unittest.TestCase):
def testName(self):
temp = tempfile.NamedTemporaryFile(prefix='grub', suffix='', dir='/tmp', mode='w+b', del... | 0 | 0 | 0 | 1,951 | 0 | 0 | 0 | 30 | 113 |
ea8f8a167839e9e37d789b4d71ccdca1c2f23656 | 2,816 | py | Python | math/functions/contrast/contrast.py | timi-liuliang/auto | 2562fd6c41b05e6db453bc0346ddcb4a0a9281a1 | [
"MIT"
] | 3 | 2022-02-07T09:45:59.000Z | 2022-02-08T08:48:43.000Z | math/functions/contrast/contrast.py | timi-liuliang/auto | 2562fd6c41b05e6db453bc0346ddcb4a0a9281a1 | [
"MIT"
] | 13 | 2021-08-06T02:20:30.000Z | 2021-09-09T02:20:43.000Z | math/functions/contrast/contrast.py | timi-liuliang/auto | 2562fd6c41b05e6db453bc0346ddcb4a0a9281a1 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
# total time
base_time = 4.0
pause_time = 1.5
total_time = base_time + pause_time
# fig
fig, ax = plt.subplots()
# plots
plot_0 = None
plot_25 = None
plot_50 = None
plot_75 = None
plot_100 = None
plot_125 = None
plot_150 = No... | 22.173228 | 150 | 0.675426 | import os
import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.ticker import FuncFormatter, MultipleLocator
from scipy import integrate
# total time
base_time = 4.0
pause_time = 1.5
total_time = base_time + pause_time
# fig
fig, ax = plt.subplots()
#... | 0 | 0 | 0 | 0 | 0 | 1,542 | 0 | 23 | 253 |
096631f832909cdbfb5d9cd339d4547385821674 | 75 | py | Python | simple_test.py | RaymondKlass/raspberry_pi_tuner | 0f2bc1d4a9e483f293575fc5b4765d7bf3489b49 | [
"MIT"
] | null | null | null | simple_test.py | RaymondKlass/raspberry_pi_tuner | 0f2bc1d4a9e483f293575fc5b4765d7bf3489b49 | [
"MIT"
] | null | null | null | simple_test.py | RaymondKlass/raspberry_pi_tuner | 0f2bc1d4a9e483f293575fc5b4765d7bf3489b49 | [
"MIT"
] | null | null | null | import spidev
spi = spidev.SpiDev()
spi.open(0,0)
print("Yay")
| 9.375 | 21 | 0.693333 | import spidev
import os
spi = spidev.SpiDev()
spi.open(0,0)
print("Yay")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
e5c02850e19cee76b29d8f84b88d8484cee6661b | 5,377 | py | Python | arith.py | versey-sherry/arith | e110fe050bd04ca00fd9d9c0d4261e4bff49366e | [
"MIT"
] | null | null | null | arith.py | versey-sherry/arith | e110fe050bd04ca00fd9d9c0d4261e4bff49366e | [
"MIT"
] | 1 | 2020-01-14T04:52:52.000Z | 2020-01-14T04:52:52.000Z | test/arith.py | versey-sherry/arith | e110fe050bd04ca00fd9d9c0d4261e4bff49366e | [
"MIT"
] | 1 | 2020-04-03T21:43:08.000Z | 2020-04-03T21:43:08.000Z |
#!/usr/bin/env python3
#I mainly followed this post https://ruslanspivak.com/lsbasi-part7/
#Lexer
#Tokenize the inputs
#Token type PLUS MUL MINUS INTEGER
import sys
sys.tracebacklimit=0
#lexer
#Parser
#Parse the tokens into an AST
#A node for all the integers
#Interpreter
#Evaluate the programing with AST
'''
tex... | 23.378261 | 87 | 0.679375 |
#!/usr/bin/env python3
#I mainly followed this post https://ruslanspivak.com/lsbasi-part7/
#Lexer
#Tokenize the inputs
#Token type PLUS MUL MINUS INTEGER
import sys
sys.tracebacklimit=0
class Token():
def __init__(self, type, value):
self.type = type
self.value = value
#String representation for debugging just... | 0 | 0 | 0 | 4,158 | 0 | 497 | 0 | 0 | 225 |
9664835c042e90d1230dac038e374368cbb3ceb1 | 1,284 | py | Python | auto_pose/meshrenderer/gl_utils/glfw_offscreen_context.py | juwangvsu/AugmentedAutoencoder_new | f29d657f369332a6284cf39e615af24758add624 | [
"MIT"
] | 299 | 2018-11-05T20:29:13.000Z | 2022-03-31T11:03:45.000Z | auto_pose/meshrenderer/gl_utils/glfw_offscreen_context.py | juwangvsu/AugmentedAutoencoder_new | f29d657f369332a6284cf39e615af24758add624 | [
"MIT"
] | 103 | 2018-11-21T20:00:24.000Z | 2022-03-30T21:03:56.000Z | auto_pose/meshrenderer/gl_utils/glfw_offscreen_context.py | juwangvsu/AugmentedAutoencoder_new | f29d657f369332a6284cf39e615af24758add624 | [
"MIT"
] | 96 | 2018-11-30T12:03:21.000Z | 2022-02-18T07:15:24.000Z | # -*- coding: utf-8 -*-
| 25.68 | 77 | 0.634735 | # -*- coding: utf-8 -*-
import logging as log
import os
from OpenGL.GL import *
import cyglfw3 as glfw
class OffscreenContext(object):
def __init__(self):
assert glfw.Init(), 'Glfw Init failed!'
glfw.WindowHint(glfw.VISIBLE, False)
self._offscreen_context = glfw.CreateWindow(1, 1, "", No... | 0 | 32 | 0 | 1,124 | 0 | 0 | 0 | -9 | 113 |
71ad7eeb0397df8745079fc70911f19d55534c40 | 12,461 | py | Python | legacy/dicebox_multi_client.py | shapeandshare/dicebox.sdk | 4cf80f5034e4c3f2f859bc5cbd6607c8af278819 | [
"MIT"
] | 1 | 2018-09-24T21:17:32.000Z | 2018-09-24T21:17:32.000Z | legacy/dicebox_multi_client.py | shapeandshare/dicebox.sdk | 4cf80f5034e4c3f2f859bc5cbd6607c8af278819 | [
"MIT"
] | 6 | 2017-09-25T00:28:18.000Z | 2022-01-13T03:01:32.000Z | legacy/dicebox_multi_client.py | shapeandshare/dicebox.sdk | 4cf80f5034e4c3f2f859bc5cbd6607c8af278819 | [
"MIT"
] | null | null | null | ###############################################################################
# dice box
###############################################################################
import cv
import cv2
from datetime import datetime
import json
import os
from lib import dicebox_config as config # import our high level configurat... | 35.300283 | 148 | 0.644892 | ###############################################################################
# dice box
###############################################################################
import cv
import cv2
from datetime import datetime
import json
import requests
import os
import numpy
import math
from lib import dicebox_config as c... | 0 | 0 | 0 | 0 | 0 | 4,129 | 0 | -34 | 225 |
59c6f237a998baf3a75150823097b488c556a173 | 1,473 | py | Python | eland/tests/operations/test_map_pd_aggs_to_es_aggs_pytest.py | mesejo/eland | d1444f8e094ef11ce4fa6713a521245b68a842d7 | [
"Apache-2.0"
] | null | null | null | eland/tests/operations/test_map_pd_aggs_to_es_aggs_pytest.py | mesejo/eland | d1444f8e094ef11ce4fa6713a521245b68a842d7 | [
"Apache-2.0"
] | 1 | 2020-05-06T01:34:25.000Z | 2020-05-06T01:34:25.000Z | eland/tests/operations/test_map_pd_aggs_to_es_aggs_pytest.py | mesejo/eland | d1444f8e094ef11ce4fa6713a521245b68a842d7 | [
"Apache-2.0"
] | 1 | 2020-05-06T01:31:18.000Z | 2020-05-06T01:31:18.000Z | # Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information
| 36.825 | 87 | 0.649695 | # Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information
from eland.operations import Operations
def test_all_aggs():
es_aggs = Operations._map_pd_aggs_to_es_aggs(
... | 0 | 0 | 0 | 0 | 0 | 1,182 | 0 | 18 | 69 |
fd052ded2f5e1744dcd04fbd358f8ba09d27b9d2 | 2,386 | py | Python | src/visualization/plot_dist.py | igordub/enm-research-project | c5c52f2a6b415bd871800bcf725fda23cb3fd542 | [
"MIT"
] | null | null | null | src/visualization/plot_dist.py | igordub/enm-research-project | c5c52f2a6b415bd871800bcf725fda23cb3fd542 | [
"MIT"
] | null | null | null | src/visualization/plot_dist.py | igordub/enm-research-project | c5c52f2a6b415bd871800bcf725fda23cb3fd542 | [
"MIT"
] | null | null | null | import sys, numpy as np
import matplotlib.pyplot as plt
import src.utilities as utils
config = utils.read_config()
mpl.rcParams.update(mpl.rcParamsDefault) # VS Code plots not black
plt.style.use(config['viz'])
infile='dist.dat' #First input file
outname='dist' #Name output files will take
xlbl='Am... | 22.299065 | 102 | 0.601006 | import os,sys, math, numpy as np, itertools
from matplotlib.patches import Patch
import matplotlib.pyplot as plt
from pylab import *
import src.utilities as utils
config = utils.read_config()
mpl.rcParams.update(mpl.rcParamsDefault) # VS Code plots not black
plt.style.use(config['viz'])
infile='dist.dat' #First ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 33 | 44 |
39fff929dd82ff62b575763af114fc78809ce1dc | 1,639 | py | Python | lib/uiEntityClass.py | Dogeek/codevo | 690d161b4099d37597246f1ca3164f60a350e662 | [
"MIT"
] | null | null | null | lib/uiEntityClass.py | Dogeek/codevo | 690d161b4099d37597246f1ca3164f60a350e662 | [
"MIT"
] | null | null | null | lib/uiEntityClass.py | Dogeek/codevo | 690d161b4099d37597246f1ca3164f60a350e662 | [
"MIT"
] | null | null | null | #from .functions import *
#from .constants import *
| 36.422222 | 85 | 0.705918 | import pygame
from pygame.locals import *
import math
from . import *
#from .functions import *
#from .constants import *
class UiEntity(pygame.sprite.Sprite):
def __init__(self, player):
pygame.sprite.Sprite.__init__(self, uiEntityGroup)
self.heart_sprites = []
heart_spritesheet = pygame.image.load(PATH+"spri... | 0 | 0 | 0 | 1,493 | 0 | 0 | 0 | -18 | 112 |
729efd3596279ece5858734443f087028b153fd0 | 4,806 | py | Python | tests/models/test_tensorflow.py | cdknorow/modelstore | f08839478432b89e828a8dcb41adf27b0e3aa66b | [
"Apache-2.0"
] | null | null | null | tests/models/test_tensorflow.py | cdknorow/modelstore | f08839478432b89e828a8dcb41adf27b0e3aa66b | [
"Apache-2.0"
] | null | null | null | tests/models/test_tensorflow.py | cdknorow/modelstore | f08839478432b89e828a8dcb41adf27b0e3aa66b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Neal Lathia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 29.484663 | 88 | 0.700375 | # Copyright 2020 Neal Lathia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 2 | 634 | 0 | 0 | 0 | 2,879 | 0 | 85 | 433 |
ed60387424a02a928c8ef69020f22264e81ae158 | 524 | py | Python | tests/test_main_game.py | sandu-alexandru/hero_game | f8094cec260b45e7e1e2b847cd4bb5ae726a38f6 | [
"MIT"
] | null | null | null | tests/test_main_game.py | sandu-alexandru/hero_game | f8094cec260b45e7e1e2b847cd4bb5ae726a38f6 | [
"MIT"
] | null | null | null | tests/test_main_game.py | sandu-alexandru/hero_game | f8094cec260b45e7e1e2b847cd4bb5ae726a38f6 | [
"MIT"
] | null | null | null | from game_hero.main_game import HeroGame
def test_start_game():
"""
Tests output of the game as string
"""
game_instance = HeroGame()
game_output = game_instance.start_game()
assert isinstance(game_output, str), "Output of the game is not string!"
def test_game_instance():
"""
Tests ... | 26.2 | 77 | 0.709924 | from game_hero.main_game import HeroGame
def test_start_game():
"""
Tests output of the game as string
"""
game_instance = HeroGame()
game_output = game_instance.start_game()
assert isinstance(game_output, str), "Output of the game is not string!"
def test_game_instance():
"""
Tests ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
012bae7ff5639b2c9a4156f6f0c70ca87eab3abc | 6,948 | py | Python | previousTries (1).py | Katzuno/BlackBoxClassification-IA-Sem2 | 79869dc5abf4cb04b12ff9b722c77a2c296b144d | [
"MIT"
] | null | null | null | previousTries (1).py | Katzuno/BlackBoxClassification-IA-Sem2 | 79869dc5abf4cb04b12ff9b722c77a2c296b144d | [
"MIT"
] | null | null | null | previousTries (1).py | Katzuno/BlackBoxClassification-IA-Sem2 | 79869dc5abf4cb04b12ff9b722c77a2c296b144d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 4 23:15:21 2019
@author: erikh
"""
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 4 21:15:45 2019
@author: erikh
"""
# Data Preprocessing Template
"""
"""
# Importing the libraries
import numpy as np
import pandas as pd
from sklearn.utils impo... | 31.726027 | 174 | 0.614421 | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 4 23:15:21 2019
@author: erikh
"""
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 4 21:15:45 2019
@author: erikh
"""
# Data Preprocessing Template
"""
"""
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas... | 0 | 0 | 0 | 0 | 0 | 56 | 0 | 32 | 71 |
c85c112ba096f11bd69535331666d12ef9fc027a | 13,077 | py | Python | lib/python2.7/site-packages/appionlib/apIMAGIC.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/appionlib/apIMAGIC.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/appionlib/apIMAGIC.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | 1 | 2019-09-05T20:58:37.000Z | 2019-09-05T20:58:37.000Z | import os
import re
import shutil
import sys
import stat
import time
import subprocess
import glob
from appionlib import apDisplay
from appionlib import apParam
from pyami import imagic2mrc
#======================
#======================
#======================
def executeImagicBatchFile(filename, showcmd=True, ve... | 28.803965 | 123 | 0.679131 | import os
import re
import shutil
import sys
import stat
import time
import subprocess
import glob
from appionlib import apDisplay
from appionlib import apParam
from pyami import imagic2mrc
#======================
def checkImagicExecutablePath():
### check for IMAGIC installation
d = os.environ
if d.has_key('IMAGIC... | 0 | 0 | 0 | 0 | 0 | 3,441 | 0 | 0 | 132 |
84676529c79351f4d06d6bfc27b4b70952854e49 | 3,736 | py | Python | home/storage/migrations/0003_logical_delete.py | he0119/smart-home | bdd3a59a8c46c0fdc07ac3049bf589c7f95a2683 | [
"MIT"
] | null | null | null | home/storage/migrations/0003_logical_delete.py | he0119/smart-home | bdd3a59a8c46c0fdc07ac3049bf589c7f95a2683 | [
"MIT"
] | 223 | 2020-02-21T06:16:56.000Z | 2022-03-01T22:24:19.000Z | home/storage/migrations/0003_logical_delete.py | he0119/smart-home | bdd3a59a8c46c0fdc07ac3049bf589c7f95a2683 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2020-12-21 11:36
def set_edited_by(apps, schema_editor):
""""""
Item = apps.get_model("storage", "Item")
for item in Item.objects.all():
item.edited_by = item.created_by
item.save()
def reverse_set_edited_by(apps, schema_editor):
""" storage_id """
... | 30.876033 | 83 | 0.546842 | # Generated by Django 3.1.4 on 2020-12-21 11:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
def set_edited_by(apps, schema_editor):
"""将修改人设置为录入人"""
Item = apps.get_model("storage", "Item")
for item in Item.objects.all():
item.edited_... | 216 | 0 | 0 | 3,081 | 0 | 0 | 0 | 41 | 90 |
067cdd1fe5c0e35cddffd2297f13aa8f28c0b978 | 903 | py | Python | chapter05/eight_queens_problem.py | persevere-in-coding-persist-in-learning/python2 | b207d0040232abae63638784b34a950b932bef77 | [
"Apache-2.0"
] | 3 | 2020-08-05T01:15:41.000Z | 2020-08-05T09:28:36.000Z | chapter05/eight_queens_problem.py | persevere-in-coding-persist-in-learning/python2 | b207d0040232abae63638784b34a950b932bef77 | [
"Apache-2.0"
] | null | null | null | chapter05/eight_queens_problem.py | persevere-in-coding-persist-in-learning/python2 | b207d0040232abae63638784b34a950b932bef77 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
"""
@desc:
8x8
1848
82
@author: huijz
@version 0.1
@date 2020-08-31
@email huijz8117@gmail.com
"""
BOARD_SIZE = 8 # 8*8=64
for answer in solve(BOARD_SIZE):
print answer
| 23.763158 | 60 | 0.654485 | # coding=utf-8
"""
@desc:
国际象棋中的皇后比中国象棋里的大车还厉害,皇后能横向,纵向和斜向移动,在这三条线上的其他棋子都可以被吃掉。
所谓八皇后问题就是:将八位皇后放在一张8x8的棋盘上,使得每位皇后都无法吃掉别的皇后,(即任意两个皇后都不在同一条横线,
竖线和斜线上),问一共有多少种摆法。此问题是在1848年由棋手马克思·贝瑟尔提出的,后面陆续有包括高斯等大数学家们给出
自己的思考和解法,所以此问题不只是有年头了,简直比82年的拉菲还有年头,我们今天不妨尝尝这老酒。
@author: huijz
@version 0.1
@date 2020-08-31
@email huijz8117@gmail.co... | 677 | 0 | 0 | 0 | 0 | 436 | 0 | 0 | 46 |
3cfe2ab1ae54a13c77234ff9e4a3a082363da06f | 361 | py | Python | atcoder/corp/ddcc2019_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | 1 | 2018-11-12T15:18:55.000Z | 2018-11-12T15:18:55.000Z | atcoder/corp/ddcc2019_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | atcoder/corp/ddcc2019_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null |
N = int(input())
ans = 0
K = 100
for i in range(N):
for j in range(N):
a, b = i * 2 * K, (i + 1) * 2 * K
c, d = j * 2 * K, (j + 1) * 2 * K
if in_(a, c) and in_(a, d) and in_(b, c) and in_(b, d):
ans += 1
print(ans)
| 25.785714 | 89 | 0.393352 | def in_(x, y):
return -x + y >= -N * K and x + y >= N * K and x + y <= 3 * K * N and -x + y <= N * K
N = int(input())
ans = 0
K = 100
for i in range(N):
for j in range(N):
a, b = i * 2 * K, (i + 1) * 2 * K
c, d = j * 2 * K, (j + 1) * 2 * K
if in_(a, c) and in_(a, d) and in_(b, c) and in... | 0 | 0 | 0 | 0 | 0 | 83 | 0 | 0 | 22 |
d9a2f33161a7ccbe3aabf596b65a792342fd5b61 | 366 | py | Python | gee_gateway/__init__.py | jdilger/gee-gateway | 2e4d11f01e785359e6f213fe7d647032f1212b76 | [
"MIT"
] | 5 | 2016-12-08T15:40:27.000Z | 2021-09-10T16:01:36.000Z | gee_gateway/__init__.py | jdilger/gee-gateway | 2e4d11f01e785359e6f213fe7d647032f1212b76 | [
"MIT"
] | 1 | 2020-02-03T22:11:09.000Z | 2020-02-03T22:11:09.000Z | gee_gateway/__init__.py | jdilger/gee-gateway | 2e4d11f01e785359e6f213fe7d647032f1212b76 | [
"MIT"
] | 8 | 2017-05-12T20:49:38.000Z | 2020-05-14T19:22:21.000Z | from flask import Blueprint
gee_gateway = Blueprint('gee_gateway', __name__, template_folder='templates', static_folder='static', static_url_path='/static/gee_gateway')
| 40.666667 | 140 | 0.795082 | from flask import Blueprint
gee_gateway = Blueprint('gee_gateway', __name__, template_folder='templates', static_folder='static', static_url_path='/static/gee_gateway')
from . import gee, web
def gee_initialize(ee_account='', ee_key_path='', ee_user_token=''):
gee.utils.initialize(ee_account=ee_account, ee_key_p... | 0 | 0 | 0 | 0 | 0 | 149 | 0 | 1 | 46 |
d31522c6adbf649e52bc307feaa904c8a1650d3f | 2,445 | py | Python | main1.py | wotmd5731/pseudo_random_gen | f79810cd5ac79afe0a73dee73aa21bd8c01aeb9b | [
"MIT"
] | null | null | null | main1.py | wotmd5731/pseudo_random_gen | f79810cd5ac79afe0a73dee73aa21bd8c01aeb9b | [
"MIT"
] | null | null | null | main1.py | wotmd5731/pseudo_random_gen | f79810cd5ac79afe0a73dee73aa21bd8c01aeb9b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import csv
"""
NOT USED.
leaky_relu.
Pred - ~ +
real target value is only 0 or 1 value
"""
cx = Variable(torch.zeros(3,1, 512))
hx = Variable(torch.zeros(3,1, 512))
... | 21.447368 | 114 | 0.633538 | # -*- coding: utf-8 -*-
import random
import numpy as np
import time
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
import os
import csv
"""
NOT USED.
leaky_relu사용.
Pred 값이 - ~ +가 나옴
real target value is only 0 or 1 value
"""
... | 21 | 0 | 0 | 368 | 0 | 0 | 0 | -20 | 121 |
20b6df6c10f2fe6702e8ead6111932be15ff0bb4 | 2,403 | py | Python | Bot/cogs/staff/shutdown.py | HoggyTheWizard/GuildofGuilds | e0dd5188b41e542587149c38e41d85414ada6e5c | [
"MIT"
] | null | null | null | Bot/cogs/staff/shutdown.py | HoggyTheWizard/GuildofGuilds | e0dd5188b41e542587149c38e41d85414ada6e5c | [
"MIT"
] | null | null | null | Bot/cogs/staff/shutdown.py | HoggyTheWizard/GuildofGuilds | e0dd5188b41e542587149c38e41d85414ada6e5c | [
"MIT"
] | null | null | null | from main import main_db
users = main_db["users"]
blacklisted_files = ["shutdown", "start", "reload"]
| 33.84507 | 119 | 0.555972 | from discord.ext import commands
from Bot.utils.staff.staff_checks import *
from main import main_db
from pathlib import Path
from config import prefixes
users = main_db["users"]
blacklisted_files = ["shutdown", "start", "reload"]
class shutdown(commands.Cog):
def __init__(self, bot):
self.bot = bot
... | 0 | 1,931 | 0 | 168 | 0 | 25 | 0 | 41 | 134 |
e7acf8eecac1fc1b17b7af722ce3c075dadbe3ca | 3,383 | py | Python | tests/lib/interface/test_predicate.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | tests/lib/interface/test_predicate.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | tests/lib/interface/test_predicate.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | # pyright: reportUnusedClass=false
from __future__ import annotations
from typing import TypeVar
T = TypeVar("T")
| 23.493056 | 99 | 0.663021 | # pyright: reportUnusedClass=false
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Iterator, Optional, TypeVar
import pytest
from antidote import implements, inject, injectable, interface, world
from antidote.lib.injectable import register_injectable_provider
from antidot... | 0 | 1,202 | 0 | 0 | 0 | 1,467 | 0 | 198 | 389 |
df82f21dd0f33072fb753615eac78da6261729b3 | 2,580 | py | Python | VirtualBox-5.0.0/src/VBox/ValidationKit/testmanager/core/webservergluecgi.py | egraba/vbox_openbsd | 6cb82f2eed1fa697d088cecc91722b55b19713c2 | [
"MIT"
] | 1 | 2015-04-30T14:18:45.000Z | 2015-04-30T14:18:45.000Z | VirtualBox-5.0.0/src/VBox/ValidationKit/testmanager/core/webservergluecgi.py | egraba/vbox_openbsd | 6cb82f2eed1fa697d088cecc91722b55b19713c2 | [
"MIT"
] | null | null | null | VirtualBox-5.0.0/src/VBox/ValidationKit/testmanager/core/webservergluecgi.py | egraba/vbox_openbsd | 6cb82f2eed1fa697d088cecc91722b55b19713c2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# $Id: webservergluecgi.py $
"""
Test Manager Core - Web Server Abstraction Base Class.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you ... | 30 | 78 | 0.711628 | # -*- coding: utf-8 -*-
# $Id: webservergluecgi.py $
"""
Test Manager Core - Web Server Abstraction Base Class.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you ... | 0 | 0 | 0 | 1,211 | 0 | 0 | 0 | 32 | 161 |
72c98fea0717dde69cbc4a74a1ecfb4b2872563f | 23,840 | py | Python | tests/test_vjp.py | AmintorDusko/pennylane-lightning | 9554a95842de9d7759ce96bfa75857e0c9ca756b | [
"Apache-2.0"
] | null | null | null | tests/test_vjp.py | AmintorDusko/pennylane-lightning | 9554a95842de9d7759ce96bfa75857e0c9ca756b | [
"Apache-2.0"
] | null | null | null | tests/test_vjp.py | AmintorDusko/pennylane-lightning | 9554a95842de9d7759ce96bfa75857e0c9ca756b | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 32.928177 | 100 | 0.574664 | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 0 | 20,585 | 0 | 2,174 | 0 | 0 | 0 | 121 | 162 |
0a101192ae0b1abd0f873dc0f51892babefc1c5e | 31,147 | py | Python | test/initial_sharding.py | Santiclause/vitess | 870177ca857e3bba2941a999174cc97d2c40c864 | [
"Apache-2.0"
] | null | null | null | test/initial_sharding.py | Santiclause/vitess | 870177ca857e3bba2941a999174cc97d2c40c864 | [
"Apache-2.0"
] | null | null | null | test/initial_sharding.py | Santiclause/vitess | 870177ca857e3bba2941a999174cc97d2c40c864 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 43.020718 | 81 | 0.650239 | #!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 0 | 0 | 0 | 28,593 | 0 | 504 | 0 | -3 | 182 |
714062181c6a8c08dde0d08f41e9a77ca3c05897 | 229 | py | Python | tests/settings_pg.py | maykinmedia/djadyen | 8bde7172c72d68975d4a77c7ef6bed73412619dc | [
"BSD-3-Clause"
] | 3 | 2018-10-19T06:57:50.000Z | 2020-11-12T11:20:37.000Z | tests/settings_pg.py | maykinmedia/djadyen | 8bde7172c72d68975d4a77c7ef6bed73412619dc | [
"BSD-3-Clause"
] | 16 | 2017-02-14T12:37:58.000Z | 2019-04-25T07:55:42.000Z | tests/settings_pg.py | maykinmedia/djadyen | 8bde7172c72d68975d4a77c7ef6bed73412619dc | [
"BSD-3-Clause"
] | 2 | 2018-05-16T10:08:34.000Z | 2019-09-29T23:31:04.000Z |
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
# 'NAME': 'djadyen',
# 'USERNAME': 'djadyen',
# 'PASSWORD': 'djadyen',
# }
# }
| 20.818182 | 61 | 0.50655 | from .settings import *
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
# 'NAME': 'djadyen',
# 'USERNAME': 'djadyen',
# 'PASSWORD': 'djadyen',
# }
# }
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 22 |
96a4c857fca98f8eee279e5b54706931a2a8bdf5 | 478 | py | Python | AiSD_03/Zadanie_9.py | DLQuake/Algorytmy_i_struktury_danych | 210d0b4e868e5cc9d6aa730a2297d8074e4d52a1 | [
"MIT"
] | null | null | null | AiSD_03/Zadanie_9.py | DLQuake/Algorytmy_i_struktury_danych | 210d0b4e868e5cc9d6aa730a2297d8074e4d52a1 | [
"MIT"
] | null | null | null | AiSD_03/Zadanie_9.py | DLQuake/Algorytmy_i_struktury_danych | 210d0b4e868e5cc9d6aa730a2297d8074e4d52a1 | [
"MIT"
] | null | null | null | # Zaimplementowa funkcj remove_duplicates(txt: str) -> str, ktra zwrci warto parametru txt pozbawion ssiadujcych duplikujcych si znakw. Przykad: XXYZZZ -> XYZ
print(remove_duplicates("XXYZZ")) | 31.866667 | 171 | 0.682008 | # Zaimplementować funkcję remove_duplicates(txt: str) -> str, która zwróci wartość parametru txt pozbawioną sąsiadujących duplikujących się znaków. Przykład: XXYZZZ -> XYZ
def remove_duplicates(txt: str):
if len(txt)==0 or len(txt)==1:
return txt
elif txt[0]==txt[1]:
pom1=txt[1:]
pom2=remove_... | 26 | 0 | 0 | 0 | 0 | 249 | 0 | 0 | 23 |
c88837628aad1517d6dea3ae4d7df98cf1f290e6 | 4,476 | py | Python | bomba.py | ncos/checkq | 79506a9eafc9c5dacc84ee3dc37f799d734f4701 | [
"MIT"
] | 3 | 2016-01-25T02:19:28.000Z | 2019-09-01T22:03:31.000Z | bomba.py | ncos/checkq | 79506a9eafc9c5dacc84ee3dc37f799d734f4701 | [
"MIT"
] | null | null | null | bomba.py | ncos/checkq | 79506a9eafc9c5dacc84ee3dc37f799d734f4701 | [
"MIT"
] | null | null | null | #!/usr/bin/python
p = Process('/root/Desktop/b.jpg')
img_disp = ImageDisplay('result')
img_disp.spin(p)
| 33.155556 | 138 | 0.59294 | #!/usr/bin/python
import cv2
import numpy as np
class ImageDisplay:
def __init__(self, windowname):
self.windowname = windowname
cv2.namedWindow(windowname, cv2.WINDOW_NORMAL)
def show_blend(self, images, windowname):
if len(images) == 0:
print "WARNING: No images prov... | 0 | 0 | 0 | 4,291 | 0 | 0 | 0 | -14 | 91 |
13f06832e4295172b8c261e2389cec10b0362703 | 3,512 | py | Python | moksha.hub/moksha/hub/__init__.py | hroncok/moksha | 08b3f668a9a3ca45fe49174eaace7b89bb995a92 | [
"Apache-2.0"
] | 11 | 2015-01-17T04:27:26.000Z | 2018-06-07T21:56:25.000Z | moksha.hub/moksha/hub/__init__.py | hroncok/moksha | 08b3f668a9a3ca45fe49174eaace7b89bb995a92 | [
"Apache-2.0"
] | 41 | 2015-05-08T18:54:46.000Z | 2019-10-25T05:08:31.000Z | moksha.hub/moksha/hub/__init__.py | hroncok/moksha | 08b3f668a9a3ca45fe49174eaace7b89bb995a92 | [
"Apache-2.0"
] | 16 | 2015-06-26T21:52:42.000Z | 2021-05-10T17:27:32.000Z | # This file is part of Moksha.
# Copyright (C) 2008-2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 31.63964 | 80 | 0.693622 | # This file is part of Moksha.
# Copyright (C) 2008-2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 0 | 0 | 0 | 24 | 0 | 546 | 0 | 0 | 76 |
ad89261a9f20fc8289c0d58ac0edee9defef16a5 | 20 | py | Python | nifi-linksmart-processors/src/test/resources/get_exception.py | linksmart/nifi-linksmart-processor | 74317b338669525ea60538ad2fe13841e71edaf4 | [
"Apache-2.0"
] | null | null | null | nifi-linksmart-processors/src/test/resources/get_exception.py | linksmart/nifi-linksmart-processor | 74317b338669525ea60538ad2fe13841e71edaf4 | [
"Apache-2.0"
] | null | null | null | nifi-linksmart-processors/src/test/resources/get_exception.py | linksmart/nifi-linksmart-processor | 74317b338669525ea60538ad2fe13841e71edaf4 | [
"Apache-2.0"
] | null | null | null |
a = 10/0 | 6.666667 | 10 | 0.65 | import sys
a = 10/0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
131e7ecadea4a9957479632d96bd39eede25e3ea | 878 | py | Python | scripts/field/eunwol_house.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/field/eunwol_house.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/field/eunwol_house.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | # 410000001
if sm.hasQuest(38002):
sm.removeEscapeButton()
sm.flipDialoguePlayerAsSpeaker()
sm.sendNext("What happened? A house and a new name... But what happened to my friends? Are they alive? If I am, then maybe we failed to seal the Black Mage...")
sm.sendSay("No. They wouldn't give up that easily. ... | 67.538462 | 188 | 0.719818 | # 410000001
if sm.hasQuest(38002):
sm.removeEscapeButton()
sm.flipDialoguePlayerAsSpeaker()
sm.sendNext("What happened? A house and a new name... But what happened to my friends? Are they alive? If I am, then maybe we failed to seal the Black Mage...")
sm.sendSay("No. They wouldn't give up that easily. ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b7e295aaee12733b24208bc9ecfd8c3391cf29ce | 10,398 | py | Python | daceml/autodiff/utils.py | spcl/daceml | a096cf009d1c9fbb2f1872a86a016d209d344f22 | [
"BSD-3-Clause"
] | 30 | 2020-09-09T21:13:36.000Z | 2022-03-15T01:58:10.000Z | daceml/autodiff/utils.py | Shigangli/daceml | c2133c677d5174763e30cf2d98dcb3fd64059db3 | [
"BSD-3-Clause"
] | 83 | 2020-09-05T11:45:06.000Z | 2021-09-28T14:21:44.000Z | daceml/autodiff/utils.py | Shigangli/daceml | c2133c677d5174763e30cf2d98dcb3fd64059db3 | [
"BSD-3-Clause"
] | 7 | 2020-09-03T13:28:45.000Z | 2021-12-12T02:53:22.000Z | import typing
import copy
import inspect
import ast
import astunparse
import dace
import dace.sdfg.nodes as nd
import dace.data as dt
from dace.frontend.python.parser import DaceProgram
from daceml.autodiff.base_abc import BackwardContext, BackwardResult
import daceml.util.utils as utils
def forward_in_desc_with_n... | 40.937008 | 119 | 0.614637 | import collections
import typing
import copy
import inspect
import ast
import astunparse
import dace
import dace.sdfg.nodes as nd
import dace.data as dt
from dace.frontend.python.parser import DaceProgram
from daceml.autodiff.base_abc import BackwardContext, BackwardResult
import daceml.util.utils as utils
def for... | 0 | 0 | 0 | 1,499 | 0 | 86 | 0 | -3 | 75 |
11b8ebdd1c7b704fd7e62c4aa52c1ebd4b17118e | 885 | py | Python | app/db.py | narutox900/GotItOnboardFinal | 32d4c186adb1ac0cb0cd719f4a3aa8d5e85ea07b | [
"MIT"
] | null | null | null | app/db.py | narutox900/GotItOnboardFinal | 32d4c186adb1ac0cb0cd719f4a3aa8d5e85ea07b | [
"MIT"
] | null | null | null | app/db.py | narutox900/GotItOnboardFinal | 32d4c186adb1ac0cb0cd719f4a3aa8d5e85ea07b | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
# Force mysql to compile fraction of seconds
db = SQLAlchemy()
def init_app(app):
"""Register database functions with the Flask app. This is called by
the application factory.
"""
app.cli.add_command(init_db_command)
app.cli.add_command(clear_db_comm... | 19.23913 | 72 | 0.734463 | import click
from flask.cli import with_appcontext
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.types import DateTime
# Force mysql to compile fraction of seconds
@compiles(DateTime, "mysql")
def compile_datetime_mysql(type_, compiler, **kw):
return "DATETI... | 0 | 286 | 0 | 0 | 0 | 25 | 0 | 46 | 203 |
2d277923a1f07571de22bab838242f14997d5396 | 3,669 | py | Python | benchmarks/run_benchmark.py | kokizzu/prometeo | ce8aa66a21bec51581cad0a7a0998b0a86581734 | [
"BSD-2-Clause"
] | 509 | 2019-11-06T22:08:49.000Z | 2022-03-30T01:06:52.000Z | benchmarks/run_benchmark.py | kokizzu/prometeo | ce8aa66a21bec51581cad0a7a0998b0a86581734 | [
"BSD-2-Clause"
] | 14 | 2018-10-23T10:08:24.000Z | 2022-01-14T02:02:17.000Z | benchmarks/run_benchmark.py | kokizzu/prometeo | ce8aa66a21bec51581cad0a7a0998b0a86581734 | [
"BSD-2-Clause"
] | 22 | 2019-06-12T10:01:13.000Z | 2022-02-27T06:38:21.000Z | import numpy as np
import subprocess
import json
import matplotlib.pyplot as plt
plt.rcParams['text.usetex'] = True
plt.rcParams['text.latex.preamble'] = [r'\usepackage{lmodern}']
font = {'family':'serif'}
plt.rc('font',**font)
NM = range(2,150,4)
# NM = range(2,20,2)
NREP_small = 10000
NREP_medium = 100
NREP_large = ... | 30.07377 | 89 | 0.677569 | import numpy as np
import subprocess
import json
import matplotlib
import matplotlib.pyplot as plt
import matplotlib as mpl
plt.rcParams['text.usetex'] = True
plt.rcParams['text.latex.preamble'] = [r'\usepackage{lmodern}']
font = {'family':'serif'}
plt.rc('font',**font)
NM = range(2,150,4)
# NM = range(2,20,2)
NREP_sm... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 44 |
56a1896325abf664998601ebfdf9e7d181777606 | 29,130 | py | Python | psx/_dump_/50/_dump_ida_/overlay_c/set_funcs.py | maoa3/scalpel | 2e7381b516cded28996d290438acc618d00b2aa7 | [
"Unlicense"
] | 15 | 2018-06-28T01:11:25.000Z | 2021-09-27T15:57:18.000Z | psx/_dump_/50/_dump_ida_/overlay_c/set_funcs.py | maoa3/scalpel | 2e7381b516cded28996d290438acc618d00b2aa7 | [
"Unlicense"
] | 7 | 2018-06-29T04:08:23.000Z | 2019-10-17T13:57:22.000Z | psx/_dump_/50/_dump_ida_/overlay_c/set_funcs.py | maoa3/scalpel | 2e7381b516cded28996d290438acc618d00b2aa7 | [
"Unlicense"
] | 7 | 2018-06-28T01:11:34.000Z | 2020-05-23T09:21:48.000Z | del_items(0x8012F26C)
SetType(0x8012F26C, "void GameOnlyTestRoutine__Fv()")
del_items(0x8012F274)
SetType(0x8012F274, "int vecleny__Fii(int a, int b)")
del_items(0x8012F298)
SetType(0x8012F298, "int veclenx__Fii(int a, int b)")
del_items(0x8012F2C4)
SetType(0x8012F2C4, "void GetDamageAmt__FiPiT1(int i, int *mind, int *... | 48.308458 | 195 | 0.789255 | del_items(0x8012F26C)
SetType(0x8012F26C, "void GameOnlyTestRoutine__Fv()")
del_items(0x8012F274)
SetType(0x8012F274, "int vecleny__Fii(int a, int b)")
del_items(0x8012F298)
SetType(0x8012F298, "int veclenx__Fii(int a, int b)")
del_items(0x8012F2C4)
SetType(0x8012F2C4, "void GetDamageAmt__FiPiT1(int i, int *mind, int *... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
53654b6927aa429eb4b1d14084bab5ab43f23388 | 7,762 | py | Python | ansible_collections/ctera/ctera/plugins/modules/ctera_portal_plan.py | ctera/ctera-ansible-collections | 0a3a664e271015a3a701349fc4fd1ad7df0acebd | [
"Apache-2.0"
] | null | null | null | ansible_collections/ctera/ctera/plugins/modules/ctera_portal_plan.py | ctera/ctera-ansible-collections | 0a3a664e271015a3a701349fc4fd1ad7df0acebd | [
"Apache-2.0"
] | 3 | 2020-04-29T20:30:05.000Z | 2020-08-04T22:51:11.000Z | ansible_collections/ctera/ctera/plugins/modules/ctera_portal_plan.py | ctera/ctera-ansible-collections | 0a3a664e271015a3a701349fc4fd1ad7df0acebd | [
"Apache-2.0"
] | 2 | 2020-04-28T17:01:53.000Z | 2021-03-01T19:23:14.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2020, CTERA Networks Ltd.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',... | 32.613445 | 135 | 0.583355 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2020, CTERA Networks Ltd.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',... | 0 | 1,335 | 0 | 3,580 | 0 | 38 | 0 | 91 | 94 |
d207914ecf9eca2833a7d7d4678a7431ddca2809 | 734 | py | Python | sensorCalibration.py | cbates8/CompostMonitoringSystem | 765fbf60e3d684c83c8fda6d9f18b5de2b7e03ab | [
"MIT"
] | null | null | null | sensorCalibration.py | cbates8/CompostMonitoringSystem | 765fbf60e3d684c83c8fda6d9f18b5de2b7e03ab | [
"MIT"
] | null | null | null | sensorCalibration.py | cbates8/CompostMonitoringSystem | 765fbf60e3d684c83c8fda6d9f18b5de2b7e03ab | [
"MIT"
] | null | null | null | import adafruit_mcp3xxx.mcp3008 as MCP
from multiprocessing import Process
from moistureSensor import MoistureSensor
moisture_one = MoistureSensor(MCP.P0)
moisture_two = MoistureSensor(MCP.P1)
moisture_three = MoistureSensor(MCP.P3)
# Calibrates the sensors in parallel.
p1 = Process(target=moisture_one.calibrate())
... | 28.230769 | 82 | 0.77248 | import adafruit_mcp3xxx.mcp3008 as MCP
from multiprocessing import Process
from moistureSensor import MoistureSensor
moisture_one = MoistureSensor(MCP.P0)
moisture_two = MoistureSensor(MCP.P1)
moisture_three = MoistureSensor(MCP.P3)
# Calibrates the sensors in parallel.
p1 = Process(target=moisture_one.calibrate())
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cfb14c38b8c02167d0a208d3b4653323a9779125 | 1,741 | py | Python | app.py | MostafaBalata/smart-monitor-system | 079b4e1cf2e2639a710e6854b628cb7ee820ab5b | [
"MIT"
] | 4 | 2017-03-01T21:20:37.000Z | 2018-07-17T08:29:08.000Z | app.py | MostafaBalata/smart-monitor-system | 079b4e1cf2e2639a710e6854b628cb7ee820ab5b | [
"MIT"
] | 1 | 2017-03-03T12:45:25.000Z | 2017-03-03T12:45:25.000Z | app.py | MostafaBalata/smart-monitor-system | 079b4e1cf2e2639a710e6854b628cb7ee820ab5b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from flask import Flask
# emulated camera
#from camera import Camera
# Raspberry Pi camera module (requires picamera package)
# from camera_pi import Camera
app = Flask(__name__)
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True, threaded=True)
| 26.784615 | 81 | 0.63297 | #!/usr/bin/env python
from flask import Flask, render_template, Response
# emulated camera
#from camera import Camera
from camera_pi import Camera
# Raspberry Pi camera module (requires picamera package)
# from camera_pi import Camera
from motion_tracker import get_frame
app = Flask(__name__)
@app.route('/')
def ind... | 0 | 544 | 0 | 0 | 671 | 0 | 0 | 57 | 180 |
855310f6abf608e0738d7e82ba8e8976e6186a5e | 2,487 | py | Python | src/adventofcode/year_2021/day_05_2021.py | marcelblijleven/adventofcode | 94def5ec340fbb58eaa56e82b54b9495903eb9d9 | [
"MIT"
] | 13 | 2021-12-01T03:50:04.000Z | 2022-03-23T14:16:29.000Z | src/adventofcode/year_2021/day_05_2021.py | marcelblijleven/adventofcode | 94def5ec340fbb58eaa56e82b54b9495903eb9d9 | [
"MIT"
] | 7 | 2021-11-30T19:52:21.000Z | 2021-12-20T07:46:00.000Z | src/adventofcode/year_2021/day_05_2021.py | marcelblijleven/adventofcode | 94def5ec340fbb58eaa56e82b54b9495903eb9d9 | [
"MIT"
] | 6 | 2021-11-30T20:15:35.000Z | 2021-12-20T17:14:19.000Z | import re
from typing import List, DefaultDict
from adventofcode.util.input_helpers import get_input_for_day
Coord = tuple[int, int]
GridType = DefaultDict[Coord, int]
LinePositions = tuple[Coord, Coord]
Line = List[Coord]
line_pattern = re.compile(r'(\d+)')
if __name__ == '__main__':
data = get_input_f... | 25.377551 | 92 | 0.685967 | import re
from collections import defaultdict
from typing import List, DefaultDict, Generator
from adventofcode.util.exceptions import SolutionNotFoundException
from adventofcode.util.helpers import solution_timer
from adventofcode.util.input_helpers import get_input_for_day
Coord = tuple[int, int]
GridType = Default... | 0 | 471 | 0 | 0 | 132 | 1,135 | 0 | 101 | 274 |
edf651a400730b62f2a934c8bd13d13b520aa848 | 741 | py | Python | wicked_historian/compat/mysql.py | innovationinit/django-wicked-historian | bef0011639791e2275c6bf2272b57542174b4cf0 | [
"BSD-2-Clause"
] | null | null | null | wicked_historian/compat/mysql.py | innovationinit/django-wicked-historian | bef0011639791e2275c6bf2272b57542174b4cf0 | [
"BSD-2-Clause"
] | null | null | null | wicked_historian/compat/mysql.py | innovationinit/django-wicked-historian | bef0011639791e2275c6bf2272b57542174b4cf0 | [
"BSD-2-Clause"
] | 1 | 2022-03-15T07:29:58.000Z | 2022-03-15T07:29:58.000Z |
__all__ = (
'JSONField',
)
| 26.464286 | 71 | 0.68691 | import json
from django_mysql.models.fields import JSONField as MySQLJSONField
from wicked_historian.encoder import JSONEncoder
__all__ = (
'JSONField',
)
class JSONField(MySQLJSONField):
def __init__(self, *args, **kwargs):
self.encoder = kwargs.pop('encoder', JSONEncoder)
super().__init_... | 0 | 0 | 0 | 555 | 0 | 0 | 0 | 62 | 90 |
5827ec9f745130abc2c1eddb42effc2086db230d | 6,023 | py | Python | others/old/Dataset.py | YuRui8879/CPSC2021_python | bfa4c565ec3113528e73b064041082863cd228b4 | [
"MIT"
] | 4 | 2021-12-20T12:52:02.000Z | 2021-12-29T09:34:42.000Z | others/old/Dataset.py | YuRui8879/CPSC2021_python | bfa4c565ec3113528e73b064041082863cd228b4 | [
"MIT"
] | null | null | null | others/old/Dataset.py | YuRui8879/CPSC2021_python | bfa4c565ec3113528e73b064041082863cd228b4 | [
"MIT"
] | 1 | 2021-11-20T12:20:55.000Z | 2021-11-20T12:20:55.000Z | import numpy as np
if __name__ == '__main__':
X = np.empty((10,5))
Y = np.linspace(0,9,10)
d = AssembleDataset(X,Y,5,seed = 0)
a,b = d.get_fold_data()
print(a,b)
a,b = d.get_res_data()
print(a,b)
| 32.556757 | 65 | 0.470032 | import numpy as np
import random
class Dataset:
def __init__(self,X,Y,fold):
self.idx = 0
self.fold = fold
self.X = np.array(X)
self.Y = np.array(Y)
if self.X.shape[0] != self.Y.shape[0]:
raise Exception('数据与标签维度不一致')
self.length = self.Y.shape[0]
... | 396 | 0 | 0 | 5,605 | 0 | 0 | 0 | -8 | 68 |
d227c6b7d42bf9b54733a1338de7b87c5ae514d8 | 6,236 | py | Python | open_spiel/python/algorithms/action_value_vs_best_response.py | texasmichelle/open_spiel | d9a9b8f9f1f44143867217fc3f6ff2db71b174b0 | [
"Apache-2.0"
] | 2 | 2020-09-05T07:17:08.000Z | 2021-05-02T21:10:28.000Z | open_spiel/python/algorithms/action_value_vs_best_response.py | texasmichelle/open_spiel | d9a9b8f9f1f44143867217fc3f6ff2db71b174b0 | [
"Apache-2.0"
] | 4 | 2020-11-13T18:58:27.000Z | 2022-02-10T01:58:38.000Z | open_spiel/python/algorithms/action_value_vs_best_response.py | texasmichelle/open_spiel | d9a9b8f9f1f44143867217fc3f6ff2db71b174b0 | [
"Apache-2.0"
] | 1 | 2020-06-02T17:52:48.000Z | 2020-06-02T17:52:48.000Z | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 38.732919 | 100 | 0.712155 | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 0 | 0 | 0 | 3,722 | 0 | 113 | 0 | 106 | 157 |
60f7add424ef1c9769b7a21c44abf24d17df3775 | 217 | py | Python | 10-Tecnologie_Web-Introduzione_a_Python/esempio06.py | matteocerullo/TW6 | 0219418576960ff8163fbe90f866c15f1fb1ad27 | [
"CC0-1.0"
] | 5 | 2021-05-07T08:56:46.000Z | 2022-02-08T20:58:56.000Z | 10-Tecnologie_Web-Introduzione_a_Python/esempio06.py | matteocerullo/TW6 | 0219418576960ff8163fbe90f866c15f1fb1ad27 | [
"CC0-1.0"
] | 1 | 2021-05-14T09:11:51.000Z | 2021-05-14T09:11:51.000Z | 10-Tecnologie_Web-Introduzione_a_Python/esempio06.py | matteocerullo/TW6 | 0219418576960ff8163fbe90f866c15f1fb1ad27 | [
"CC0-1.0"
] | 64 | 2021-05-07T08:53:30.000Z | 2022-02-10T17:02:41.000Z | # Cycles - For
import random
n = 10000
m = 0
l = 1000
for i in range(n):
count = 0
x = -1
while x != l:
x = random.randint(1, l)
count=count+1
m=m+count
print("Done! average:", m/n) | 12.764706 | 32 | 0.520737 | # Cycles - For
import random
n = 10000
m = 0
l = 1000
for i in range(n):
count = 0
x = -1
while x != l:
x = random.randint(1, l)
count=count+1
m=m+count
print("Done! average:", m/n) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
35b7aa855385ade468b728b5ddd2f4f8a05dd422 | 1,961 | py | Python | autoremovetorrents/torrent.py | drawwon/autoremove-torrents | 730fe989a6ffd53213b15e4f39b1c95f256e0a52 | [
"MIT"
] | null | null | null | autoremovetorrents/torrent.py | drawwon/autoremove-torrents | 730fe989a6ffd53213b15e4f39b1c95f256e0a52 | [
"MIT"
] | null | null | null | autoremovetorrents/torrent.py | drawwon/autoremove-torrents | 730fe989a6ffd53213b15e4f39b1c95f256e0a52 | [
"MIT"
] | null | null | null | #-*- coding:utf-8 -*- | 31.126984 | 109 | 0.54819 | #-*- coding:utf-8 -*-
import sys
import time
from .torrentstatus import TorrentStatus
class Torrent(object):
def __init__(self, hash_value, name, category, tracker, status, stalled, size, ratio,
uploaded, create_time, seeding_time):
# Save Properties
self.hash = hash_value
self.na... | 0 | 739 | 0 | 1,112 | 0 | 0 | 0 | -2 | 91 |
90459e756ccbe912bed5ca83e56c654291f93de6 | 4,873 | py | Python | Lang/Python/py_base/data_structure/graph/graph.py | Orig5826/Basics | 582e74c83a2b654640fe7c47a1a385a8913cc466 | [
"MIT"
] | 5 | 2018-03-09T13:51:11.000Z | 2021-12-17T02:05:59.000Z | Lang/Python/py_base/data_structure/graph/graph.py | Orig5826/Basics | 582e74c83a2b654640fe7c47a1a385a8913cc466 | [
"MIT"
] | null | null | null | Lang/Python/py_base/data_structure/graph/graph.py | Orig5826/Basics | 582e74c83a2b654640fe7c47a1a385a8913cc466 | [
"MIT"
] | null | null | null |
#
graph = {'A': ['B', 'C', 'F'],
'B': ['C', 'D'],
'C': ['D'],
'D': ['C'],
'E': ['F', 'D'],
'F': ['C']
}
def find_path(graph, start, end, path=[]):
"""
graph
startend
path
"""
path = path + [start]
# 3.0
if start == e... | 26.922652 | 70 | 0.533963 |
from pydotplus import Dot, Node, Edge
import os
# 该图配置
graph = {'A': ['B', 'C', 'F'],
'B': ['C', 'D'],
'C': ['D'],
'D': ['C'],
'E': ['F', 'D'],
'F': ['C']
}
def dotgraph(graph):
__graph = Dot(rankdir='TB', fontname="Fangsong",
fontcolor='bl... | 1,011 | 0 | 0 | 0 | 0 | 3,058 | 0 | 4 | 160 |