hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4909075b90f779efa0cc283e1cf15a85409c64e5 | 1,003 | py | Python | pycodegen/frontend/frontend_cpp/__init__.py | blejdfist/pycodegen | b7a7fad2c9e0a537893e53df0e07544d047e443d | [
"MIT"
] | 5 | 2019-02-15T16:13:43.000Z | 2021-07-22T02:54:57.000Z | pycodegen/frontend/frontend_cpp/__init__.py | blejdfist/pycodegen | b7a7fad2c9e0a537893e53df0e07544d047e443d | [
"MIT"
] | 1 | 2019-12-06T20:24:36.000Z | 2020-05-04T18:43:12.000Z | pycodegen/frontend/frontend_cpp/__init__.py | blejdfist/pycodegen | b7a7fad2c9e0a537893e53df0e07544d047e443d | [
"MIT"
] | null | null | null | """C/C++ parser frontend based on libclang"""
import argparse
import logging
import sys
_LOGGER = logging.getLogger(__name__)
| 27.861111 | 86 | 0.65005 | """C/C++ parser frontend based on libclang"""
import argparse
import logging
import sys
_LOGGER = logging.getLogger(__name__)
def register_arguments(argument_parser):
argument_parser.add_argument("--args", nargs=argparse.REMAINDER,
help="Arguments to pass to clang")
argument... | 828 | 0 | 46 |
4ef3ac76c9db1a0b2024af4c2263d9bea69f7d99 | 1,773 | py | Python | pgscout/ScoutGuard.py | SuspectJohnny/PGScout | 35e3209b681942977be82544616d8dd4a5262574 | [
"Apache-2.0"
] | null | null | null | pgscout/ScoutGuard.py | SuspectJohnny/PGScout | 35e3209b681942977be82544616d8dd4a5262574 | [
"Apache-2.0"
] | null | null | null | pgscout/ScoutGuard.py | SuspectJohnny/PGScout | 35e3209b681942977be82544616d8dd4a5262574 | [
"Apache-2.0"
] | null | null | null | import logging
import sys
import time
from pgscout.Scout import Scout
from pgscout.config import use_pgpool
from pgscout.utils import load_pgpool_accounts
log = logging.getLogger(__name__)
| 31.660714 | 118 | 0.599549 | import logging
import sys
import time
from pgscout.Scout import Scout
from pgscout.config import use_pgpool
from pgscout.utils import load_pgpool_accounts
log = logging.getLogger(__name__)
class ScoutGuard(object):
def __init__(self, auth, username, password, job_queue):
self.job_queue = job_queue
... | 1,446 | 4 | 131 |
3fadd272a1dd660ba3aac05b14b52bd48175a9ea | 4,027 | py | Python | am/legislative/schema.py | access-missouri/am-django-project | 2457b8089900c61c73000c1d7479b7a72f6d1855 | [
"BSD-2-Clause"
] | 4 | 2018-05-01T20:31:49.000Z | 2021-12-20T19:30:40.000Z | am/legislative/schema.py | access-missouri/am-django-project | 2457b8089900c61c73000c1d7479b7a72f6d1855 | [
"BSD-2-Clause"
] | 22 | 2017-04-13T15:02:09.000Z | 2021-02-02T21:48:41.000Z | am/legislative/schema.py | access-missouri/am-django-project | 2457b8089900c61c73000c1d7479b7a72f6d1855 | [
"BSD-2-Clause"
] | 1 | 2018-07-02T20:08:43.000Z | 2018-07-02T20:08:43.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from graphene import relay, ObjectType, String
from graphene_django.types import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from legislative import models as LM
| 35.955357 | 82 | 0.627514 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from graphene import relay, ObjectType, String
from graphene_django.types import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from legislative import models as LM
class BillNode(DjangoObjectType):
absolute_url = String()
admin_url... | 357 | 3,284 | 138 |
d1cc6225724878d5dd3d8e4214d652acbfc7f11c | 1,123 | py | Python | techminer2/most_local_cited_authors.py | jdvelasq/techminer2 | ad64a49402749755798a18417c38a7ad10e83bad | [
"MIT"
] | null | null | null | techminer2/most_local_cited_authors.py | jdvelasq/techminer2 | ad64a49402749755798a18417c38a7ad10e83bad | [
"MIT"
] | null | null | null | techminer2/most_local_cited_authors.py | jdvelasq/techminer2 | ad64a49402749755798a18417c38a7ad10e83bad | [
"MIT"
] | null | null | null | """
Most local cited authors in references
===============================================================================
See :doc:`column indicators <column_indicators>` to obtain a `pandas.Dataframe`
with the data. Use the following code:
.. code:: python
column_indicators(
column="authors",
... | 22.019608 | 109 | 0.606411 | """
Most local cited authors in references
===============================================================================
See :doc:`column indicators <column_indicators>` to obtain a `pandas.Dataframe`
with the data. Use the following code:
.. code:: python
column_indicators(
column="authors",
... | 312 | 0 | 23 |
d4d4167b896d5de17790ec88ba387137143b6306 | 1,890 | py | Python | scripts/networks_theoretical_bounds_analysis.py | PuchatekwSzortach/voc_ssd | 4bf1013c5243b5a76e4c1a392c8d1c3076c72a90 | [
"MIT"
] | 1 | 2020-01-22T07:13:12.000Z | 2020-01-22T07:13:12.000Z | scripts/networks_theoretical_bounds_analysis.py | PuchatekwSzortach/voc_ssd | 4bf1013c5243b5a76e4c1a392c8d1c3076c72a90 | [
"MIT"
] | null | null | null | scripts/networks_theoretical_bounds_analysis.py | PuchatekwSzortach/voc_ssd | 4bf1013c5243b5a76e4c1a392c8d1c3076c72a90 | [
"MIT"
] | 1 | 2021-11-10T22:02:36.000Z | 2021-11-10T22:02:36.000Z | """
Script for analyzing theoretical bounds on model's recall
"""
import argparse
import sys
import yaml
import tqdm
import net.data
import net.ssd
import net.utilities
def analyse_theoretical_performance(config, ssd_model_configuration):
"""
Analyse theoretical performance of SSD model on VOC dataset
... | 26.25 | 112 | 0.732804 | """
Script for analyzing theoretical bounds on model's recall
"""
import argparse
import sys
import yaml
import tqdm
import net.data
import net.ssd
import net.utilities
def analyse_theoretical_performance(config, ssd_model_configuration):
"""
Analyse theoretical performance of SSD model on VOC dataset
... | 0 | 0 | 0 |
f4ca648ec083b50f3ce5b91759643c2cf7dca9fa | 16,182 | py | Python | examples/lidar_tour_traffic_data_analysis.py | MissMeriel/BeamNGpy | a8467c57537441802bc5b56f0012dfee2b5f5af0 | [
"MIT"
] | 1 | 2021-08-10T19:29:52.000Z | 2021-08-10T19:29:52.000Z | examples/lidar_tour_traffic_data_analysis.py | MissMeriel/BeamNGpy | a8467c57537441802bc5b56f0012dfee2b5f5af0 | [
"MIT"
] | null | null | null | examples/lidar_tour_traffic_data_analysis.py | MissMeriel/BeamNGpy | a8467c57537441802bc5b56f0012dfee2b5f5af0 | [
"MIT"
] | null | null | null | import sys
from time import sleep
import numpy as np
from beamngpy.beamngcommon import *
import time
import random, copy
import math
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
from matplotlib.pyplot import imshow
import pandas as pd
import seaborn as sn
import matplotlib.pyplot as plt
from sci... | 38.165094 | 131 | 0.559016 | import sys
from time import sleep
import numpy as np
from beamngpy.beamngcommon import *
import time
import random, copy
import math
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
from matplotlib.pyplot import imshow
import pandas as pd
import seaborn as sn
import matplotlib.pyplot as plt
from sci... | 15,364 | 0 | 321 |
d0f29bd121a2f242a9f7c96ec14a606691ede76d | 1,346 | py | Python | microbenchmarks/callables.py | 97littleleaf11/mypyc-benchmarks | 30661c7ffc30d6c1c4fc4e45e581e5aec4a5361c | [
"MIT"
] | 13 | 2020-05-03T11:18:41.000Z | 2021-11-22T06:42:57.000Z | microbenchmarks/callables.py | 97littleleaf11/mypyc-benchmarks | 30661c7ffc30d6c1c4fc4e45e581e5aec4a5361c | [
"MIT"
] | 23 | 2020-05-03T11:18:35.000Z | 2021-09-03T12:55:21.000Z | microbenchmarks/callables.py | 97littleleaf11/mypyc-benchmarks | 30661c7ffc30d6c1c4fc4e45e581e5aec4a5361c | [
"MIT"
] | 5 | 2021-06-12T01:25:57.000Z | 2022-03-17T17:50:46.000Z | from typing import Callable
from benchmarking import benchmark
@benchmark
@benchmark
@benchmark
| 15.651163 | 53 | 0.526746 | from typing import Callable
from benchmarking import benchmark
@benchmark
def nested_func() -> None:
n = 0
for i in range(100 * 1000):
n += call_nested_fast()
assert n == 5500000, n
def call_nested_fast() -> int:
n = 0
def add(d: int) -> None:
nonlocal n
n += d
f... | 964 | -10 | 283 |
ab2dbea6e1fc2af0c93dae92cb5a85ec8dcd206c | 974 | py | Python | flask/app.py | apple800/python_study | 29864a6b4389d47c5d59f6459bee7c7fd09cceb5 | [
"MIT"
] | null | null | null | flask/app.py | apple800/python_study | 29864a6b4389d47c5d59f6459bee7c7fd09cceb5 | [
"MIT"
] | null | null | null | flask/app.py | apple800/python_study | 29864a6b4389d47c5d59f6459bee7c7fd09cceb5 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, redirect, url_for
# Init app
app = Flask(__name__)
db = []
# URI, endpoint
@app.route('/', methods=['GET', 'POST'])
@app.route('/delete/<task>', methods=['GET'])
# Update list
# @app.route('/update/<task>', methods=['GET'])
# def update(task):
# num = db.in... | 21.644444 | 68 | 0.603696 | from flask import Flask, render_template, request, redirect, url_for
# Init app
app = Flask(__name__)
db = []
# URI, endpoint
@app.route('/', methods=['GET', 'POST'])
def main():
if request.method == 'POST':
new_task = request.form['new_task']
modify_task = request.form['mo']
num = reque... | 442 | 0 | 44 |
fbea0d257d3da6c82d0b9bbeaff1d1aaf62a8831 | 795 | py | Python | neodroid/messaging/__init__.py | sintefneodroid/neo | 0999f1dff95c4a8c5880a9b3add532d74f38586a | [
"Apache-2.0"
] | 7 | 2017-09-13T08:28:37.000Z | 2022-01-21T15:59:14.000Z | neodroid/messaging/__init__.py | sintefneodroid/neo | 0999f1dff95c4a8c5880a9b3add532d74f38586a | [
"Apache-2.0"
] | 25 | 2019-03-25T13:49:43.000Z | 2019-05-02T13:58:13.000Z | neodroid/messaging/__init__.py | sintefneodroid/neo | 0999f1dff95c4a8c5880a9b3add532d74f38586a | [
"Apache-2.0"
] | 2 | 2017-09-21T10:14:39.000Z | 2017-10-21T09:57:04.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Christian Heider Nielsen"
import logging
from enum import Enum, auto
from functools import wraps
| 25.645161 | 56 | 0.631447 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Christian Heider Nielsen"
import logging
from enum import Enum, auto
from functools import wraps
class ClientEvents(Enum):
CONNECTED = auto()
DISCONNECTED = auto()
TIMEOUT = auto()
def message_client_event(event):
def receive_func(func):
... | 514 | 74 | 46 |
7abe810fd81a21cf6205eb72f6adcda029373c0e | 1,329 | py | Python | tests/template_tests/filter_tests/test_removetags.py | DasAllFolks/django | 9f427617e4559012e1c2fd8fce46cbe225d8515d | [
"BSD-3-Clause"
] | 1 | 2015-01-09T08:45:54.000Z | 2015-01-09T08:45:54.000Z | tests/template_tests/filter_tests/test_removetags.py | DasAllFolks/django | 9f427617e4559012e1c2fd8fce46cbe225d8515d | [
"BSD-3-Clause"
] | null | null | null | tests/template_tests/filter_tests/test_removetags.py | DasAllFolks/django | 9f427617e4559012e1c2fd8fce46cbe225d8515d | [
"BSD-3-Clause"
] | null | null | null | import warnings
from django.test import SimpleTestCase
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.safestring import mark_safe
from ..utils import render, setup
| 34.973684 | 100 | 0.514673 | import warnings
from django.test import SimpleTestCase
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.safestring import mark_safe
from ..utils import render, setup
class RemovetagsTests(SimpleTestCase):
@setup({'removetags01': '{{ a|removetags:"a b" }} {{ b|removetags:"a b" }}'... | 824 | 282 | 23 |
ce27e0fd1a63289b96eec99e747558875b354786 | 88 | py | Python | P3_9.py | JosefinaMedina/EjerciciosComputacion-Python | 98f04171ce954e4eb9b20adfc98b0351e6016deb | [
"Apache-2.0"
] | null | null | null | P3_9.py | JosefinaMedina/EjerciciosComputacion-Python | 98f04171ce954e4eb9b20adfc98b0351e6016deb | [
"Apache-2.0"
] | null | null | null | P3_9.py | JosefinaMedina/EjerciciosComputacion-Python | 98f04171ce954e4eb9b20adfc98b0351e6016deb | [
"Apache-2.0"
] | null | null | null | import numpy as np
n=int(input("Dimension de la matriz: "))
print(np.identity(n)) | 17.6 | 41 | 0.670455 | import numpy as np
n=int(input("Dimension de la matriz: "))
print(np.identity(n)) | 0 | 0 | 0 |
02e08aa2c67dd5c15617f863e1ff3ce9467f1dfd | 2,557 | py | Python | src/horner.py | dhermes/k-compensated-de-casteljau | 8511f0c2c525ac24215f6307e80032329f97301d | [
"Apache-2.0"
] | 2 | 2020-02-22T15:45:20.000Z | 2020-12-03T07:56:01.000Z | src/horner.py | dhermes/k-compensated-de-casteljau | 8511f0c2c525ac24215f6307e80032329f97301d | [
"Apache-2.0"
] | null | null | null | src/horner.py | dhermes/k-compensated-de-casteljau | 8511f0c2c525ac24215f6307e80032329f97301d | [
"Apache-2.0"
] | null | null | null | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 22.628319 | 74 | 0.594056 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 1,471 | 0 | 115 |
4b5221cd58c1dfa6507ede60d4aff71e4b131d0f | 248 | py | Python | datalad/plugin/wtf.py | mikapfl/datalad | 7b407ecbbfbbea0789304a640bac721d1718e72d | [
"MIT"
] | 298 | 2015-01-25T17:36:29.000Z | 2022-03-20T03:38:47.000Z | datalad/plugin/wtf.py | mikapfl/datalad | 7b407ecbbfbbea0789304a640bac721d1718e72d | [
"MIT"
] | 6,387 | 2015-01-02T18:15:01.000Z | 2022-03-31T20:58:58.000Z | datalad/plugin/wtf.py | mikapfl/datalad | 7b407ecbbfbbea0789304a640bac721d1718e72d | [
"MIT"
] | 109 | 2015-01-25T17:49:40.000Z | 2022-03-06T06:54:54.000Z | import warnings
warnings.warn(
"datalad.plugin.wtf is deprecated and will be removed in a future "
"release. "
"Use the module from its new location datalad.local.wtf instead.",
DeprecationWarning)
from datalad.local.wtf import *
| 24.8 | 71 | 0.729839 | import warnings
warnings.warn(
"datalad.plugin.wtf is deprecated and will be removed in a future "
"release. "
"Use the module from its new location datalad.local.wtf instead.",
DeprecationWarning)
from datalad.local.wtf import *
| 0 | 0 | 0 |
84cf22b27aac3a65db381fcda7a1bc9a171a4dc0 | 588 | py | Python | rsi/state.py | nuke-makes-games/RSI.py | 340311412a0869fabaf3fa3c3030310a8a3e0c89 | [
"MIT"
] | 2 | 2018-09-05T16:19:25.000Z | 2020-02-04T17:18:22.000Z | rsi/state.py | nuke-makes-games/RSI.py | 340311412a0869fabaf3fa3c3030310a8a3e0c89 | [
"MIT"
] | 5 | 2020-05-13T23:46:06.000Z | 2022-01-24T16:04:42.000Z | rsi/state.py | nuke-makes-games/RSI.py | 340311412a0869fabaf3fa3c3030310a8a3e0c89 | [
"MIT"
] | 5 | 2019-06-19T11:03:29.000Z | 2020-08-15T15:58:32.000Z | from typing import List, Tuple, Dict, Any
from PIL import Image
| 36.75 | 90 | 0.559524 | from typing import List, Tuple, Dict, Any
from PIL import Image
class State(object):
def __init__(self,
name: str,
size: Tuple[int, int],
directions: int = 1) -> None:
self.name = name # type: str
self.flags = {} # type: Dict[str, Any]
se... | 476 | -1 | 49 |
f658e8ccbd73923fbc6b2c597d99bc868e8e814c | 22,841 | py | Python | flopy/modflow/mfoc.py | langevin/flopy | 2398a0b9a9294b4e2fb5c7e0228f0f42af45b80a | [
"BSD-3-Clause"
] | null | null | null | flopy/modflow/mfoc.py | langevin/flopy | 2398a0b9a9294b4e2fb5c7e0228f0f42af45b80a | [
"BSD-3-Clause"
] | null | null | null | flopy/modflow/mfoc.py | langevin/flopy | 2398a0b9a9294b4e2fb5c7e0228f0f42af45b80a | [
"BSD-3-Clause"
] | null | null | null | """
mfoc module. Contains the ModflowOc class. Note that the user can access
the ModflowOc class as `flopy.modflow.ModflowOc`.
Additional information for this MODFLOW package can be found at the `Online
MODFLOW Guide
<http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?oc.htm>`_.
"""
import sy... | 39.585789 | 114 | 0.467668 | """
mfoc module. Contains the ModflowOc class. Note that the user can access
the ModflowOc class as `flopy.modflow.ModflowOc`.
Additional information for this MODFLOW package can be found at the `Online
MODFLOW Guide
<http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?oc.htm>`_.
"""
import sy... | 47 | 0 | 29 |
8349256563b8b4c78b3b7cdafe91df9d453f14f3 | 119 | py | Python | inz/schemas.py | matbur/inz | f6be1a685761f99f8c808d8b23f58debf7e19da2 | [
"MIT"
] | null | null | null | inz/schemas.py | matbur/inz | f6be1a685761f99f8c808d8b23f58debf7e19da2 | [
"MIT"
] | 2 | 2020-03-24T16:35:39.000Z | 2020-03-31T00:33:08.000Z | inz/schemas.py | matbur/inz | f6be1a685761f99f8c808d8b23f58debf7e19da2 | [
"MIT"
] | null | null | null | from typing import List
NeuronSchema = List[float]
LayerSchema = List[NeuronSchema]
NetworkSchema = List[LayerSchema]
| 19.833333 | 33 | 0.806723 | from typing import List
NeuronSchema = List[float]
LayerSchema = List[NeuronSchema]
NetworkSchema = List[LayerSchema]
| 0 | 0 | 0 |
0fa4c4b707a2fe6efc8f8b9d1d08a4a4a7bba8fd | 1,433 | py | Python | starlite/datastructures.py | to-ph/starlite | 8169749468c1fb76c408c9939669e89e18ca6f02 | [
"MIT"
] | 57 | 2021-12-19T08:26:00.000Z | 2022-01-06T06:02:29.000Z | starlite/datastructures.py | to-ph/starlite | 8169749468c1fb76c408c9939669e89e18ca6f02 | [
"MIT"
] | 12 | 2021-12-15T19:29:11.000Z | 2022-01-06T18:16:05.000Z | starlite/datastructures.py | to-ph/starlite | 8169749468c1fb76c408c9939669e89e18ca6f02 | [
"MIT"
] | 4 | 2021-12-30T05:30:16.000Z | 2022-01-03T20:19:58.000Z | import os
from copy import copy
from typing import Any, AsyncIterator, Dict, Iterator, Optional, Union, cast
from pydantic import BaseModel, FilePath, validator
from starlette.datastructures import State as StarletteStateClass
| 26.537037 | 78 | 0.688067 | import os
from copy import copy
from typing import Any, AsyncIterator, Dict, Iterator, Optional, Union, cast
from pydantic import BaseModel, FilePath, validator
from starlette.datastructures import State as StarletteStateClass
class State(StarletteStateClass):
def __copy__(self) -> "State":
"""
R... | 0 | 1,061 | 138 |
b181d0030ad8cc4abf4c2b847f5e8fba3ba43456 | 3,497 | py | Python | Programs/MP2/MP2_NUMPY/mp2.py | dgasmith/SICM2-Software-Summer-School-2014 | af97770cbade3bf4a246f21e607e8be66c9df7da | [
"MIT"
] | 2 | 2015-07-16T14:00:27.000Z | 2016-01-10T20:21:48.000Z | Programs/MP2/MP2_NUMPY/mp2.py | dgasmith/SICM2-Software-Summer-School-2014 | af97770cbade3bf4a246f21e607e8be66c9df7da | [
"MIT"
] | null | null | null | Programs/MP2/MP2_NUMPY/mp2.py | dgasmith/SICM2-Software-Summer-School-2014 | af97770cbade3bf4a246f21e607e8be66c9df7da | [
"MIT"
] | null | null | null | #
# Author: Daniel G. A. Smith
# Created: 6/15/14
# Original content from:
# http://sirius.chem.vt.edu/wiki/doku.php?id=crawdad:programming
#
import numpy as np
from scipy import linalg as SLA
#Setup a few constats for the HF computation
nuclear = 8.002367061810450
ndocc = 5
print 'Reading in integrals...'
# Read i... | 22.707792 | 94 | 0.592222 | #
# Author: Daniel G. A. Smith
# Created: 6/15/14
# Original content from:
# http://sirius.chem.vt.edu/wiki/doku.php?id=crawdad:programming
#
import numpy as np
from scipy import linalg as SLA
#Setup a few constats for the HF computation
nuclear = 8.002367061810450
ndocc = 5
print 'Reading in integrals...'
# Read i... | 269 | 0 | 23 |
3863ce9f8d10cfb3ae982a92420729f09cb0102c | 4,727 | py | Python | pyrobolearn/models/dmp/rhythmic_dmp.py | Pandinosaurus/pyrobolearn | 9cd7c060723fda7d2779fa255ac998c2c82b8436 | [
"Apache-2.0"
] | 2 | 2021-01-21T21:08:30.000Z | 2022-03-29T16:45:49.000Z | pyrobolearn/models/dmp/rhythmic_dmp.py | Pandinosaurus/pyrobolearn | 9cd7c060723fda7d2779fa255ac998c2c82b8436 | [
"Apache-2.0"
] | null | null | null | pyrobolearn/models/dmp/rhythmic_dmp.py | Pandinosaurus/pyrobolearn | 9cd7c060723fda7d2779fa255ac998c2c82b8436 | [
"Apache-2.0"
] | 1 | 2020-09-29T21:25:39.000Z | 2020-09-29T21:25:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Define the rhythmic dynamic movement primitive.
"""
import numpy as np
from pyrobolearn.models.dmp.canonical_systems import RhythmicCS
from pyrobolearn.models.dmp.forcing_terms import RhythmicForcingTerm
from pyrobolearn.models.dmp.dmp import DMP
__author__ = "Brian D... | 41.104348 | 118 | 0.649672 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Define the rhythmic dynamic movement primitive.
"""
import numpy as np
from pyrobolearn.models.dmp.canonical_systems import RhythmicCS
from pyrobolearn.models.dmp.forcing_terms import RhythmicForcingTerm
from pyrobolearn.models.dmp.dmp import DMP
__author__ = "Brian D... | 0 | 0 | 0 |
f435c309888d9e68dc96f1aa6e903d696c5cca03 | 656 | py | Python | xblock/test/test_fragment.py | cclauss/XBlock | 3e5341015e8f8b4a203ac4a41471bac5549182b0 | [
"Apache-2.0"
] | null | null | null | xblock/test/test_fragment.py | cclauss/XBlock | 3e5341015e8f8b4a203ac4a41471bac5549182b0 | [
"Apache-2.0"
] | null | null | null | xblock/test/test_fragment.py | cclauss/XBlock | 3e5341015e8f8b4a203ac4a41471bac5549182b0 | [
"Apache-2.0"
] | null | null | null | """
Unit tests for the Fragment class.
Note: this class has been deprecated in favor of web_fragments.fragment.Fragment
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from unittest import TestCase
from xblock.fragment import Fragment
class TestFragment(TestCase):
"""
... | 25.230769 | 82 | 0.690549 | """
Unit tests for the Fragment class.
Note: this class has been deprecated in favor of web_fragments.fragment.Fragment
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from unittest import TestCase
from xblock.fragment import Fragment
class TestFragment(TestCase):
"""
... | 0 | 0 | 0 |
c6bcb780f95fe8ae4a95bc9a59ae2ad9f8b29924 | 8,244 | py | Python | eval/cls_eval.py | EthanZhangYC/invariance-equivariance | 6e369fd6f43c6b217740f7acd9533c298c43d360 | [
"MIT"
] | 24 | 2021-04-21T09:35:23.000Z | 2022-02-28T12:44:39.000Z | eval/cls_eval.py | wct5217488/invariance-equivariance | 6dfadb39a485d0e55c1cd0c8ce0e0f6dfc602dd3 | [
"MIT"
] | 3 | 2021-05-12T19:09:13.000Z | 2021-08-23T17:17:10.000Z | eval/cls_eval.py | wct5217488/invariance-equivariance | 6dfadb39a485d0e55c1cd0c8ce0e0f6dfc602dd3 | [
"MIT"
] | 8 | 2021-06-09T02:41:37.000Z | 2022-02-27T02:14:17.000Z | from __future__ import print_function
import torch
import time
from tqdm import tqdm
from .util import AverageMeter, accuracy
import numpy as np
def validate(val_loader, model, criterion, opt):
"""One epoch validation"""
batch_time = AverageMeter()
losses = AverageMeter()
top1 = AverageMeter()
top... | 40.610837 | 88 | 0.434983 | from __future__ import print_function
import torch
import time
from tqdm import tqdm
from .util import AverageMeter, accuracy
import numpy as np
def validate(val_loader, model, criterion, opt):
"""One epoch validation"""
batch_time = AverageMeter()
losses = AverageMeter()
top1 = AverageMeter()
top... | 0 | 0 | 0 |
4a0fdc481c5a936d2863ba60f31ce7a87ac8d13b | 2,576 | py | Python | exampdftomindmap.py | synsandacks/CiscoExamPDFtoMindmap | fff0a10bcf18a2a2075e770b2305b038b1375de4 | [
"MIT"
] | 1 | 2022-02-10T09:31:50.000Z | 2022-02-10T09:31:50.000Z | exampdftomindmap.py | synsandacks/CiscoExamPDFtoMindmap | fff0a10bcf18a2a2075e770b2305b038b1375de4 | [
"MIT"
] | null | null | null | exampdftomindmap.py | synsandacks/CiscoExamPDFtoMindmap | fff0a10bcf18a2a2075e770b2305b038b1375de4 | [
"MIT"
] | 1 | 2022-02-09T21:19:38.000Z | 2022-02-09T21:19:38.000Z | import PyPDF2
import re
# Function that extracts the text from the supplied PDF and return the contents as a massive string.
# Function that takes a list of text ex. ['this', 'is', 'how', 'the', 'data', 'would', 'look']
# and iterate over that list to return a new list that groups exam objectives properly.
# Functio... | 35.287671 | 113 | 0.590062 | import PyPDF2
import re
# Function that extracts the text from the supplied PDF and return the contents as a massive string.
def pdftotext(pdffile):
pdfFile = open(pdffile, 'rb')
pdfReader = PyPDF2.PdfFileReader(pdfFile)
numPages = pdfReader.numPages
pdfText = ''
for page in range(numPages):
... | 1,879 | 0 | 89 |
5f41b87dcf6b0dbdc532c835f9547fb846c9d202 | 317 | py | Python | MoCalculator/main.py | daveh07/AS4100-1998-Mo_Moment_Calculator | 5b83044d73bc78b12943e7b2175df6baf40a634b | [
"MIT"
] | null | null | null | MoCalculator/main.py | daveh07/AS4100-1998-Mo_Moment_Calculator | 5b83044d73bc78b12943e7b2175df6baf40a634b | [
"MIT"
] | null | null | null | MoCalculator/main.py | daveh07/AS4100-1998-Mo_Moment_Calculator | 5b83044d73bc78b12943e7b2175df6baf40a634b | [
"MIT"
] | null | null | null | # MEMBER CAPACITY OF SEGMENTS WITHOUT FULL LATERAL RESTRAINT
# IN ACCORDANCE WITH AS4100-1998 - SECTION 5.6
#
# V1.0 - 04/12/2020 by D.HILL
from userInputs import *
from alpha_m import *
from alpha_s import *
# Calculate Alpha M
print("Alpha_m = " + str((alpha_m_moment())))
# Calculate Alpha S
buckling_moment()
| 19.8125 | 60 | 0.731861 | # MEMBER CAPACITY OF SEGMENTS WITHOUT FULL LATERAL RESTRAINT
# IN ACCORDANCE WITH AS4100-1998 - SECTION 5.6
#
# V1.0 - 04/12/2020 by D.HILL
from userInputs import *
from alpha_m import *
from alpha_s import *
# Calculate Alpha M
print("Alpha_m = " + str((alpha_m_moment())))
# Calculate Alpha S
buckling_moment()
| 0 | 0 | 0 |
9a5198bc7713ce99f07d59ad097f76cd84eb5861 | 7,732 | py | Python | webProject/sport/models.py | mohammadrezasalehi95/webproject-backend | e7b697d6e1197d3781446f44904eabd3d5137c5a | [
"MIT"
] | null | null | null | webProject/sport/models.py | mohammadrezasalehi95/webproject-backend | e7b697d6e1197d3781446f44904eabd3d5137c5a | [
"MIT"
] | 7 | 2020-02-11T23:40:45.000Z | 2022-03-11T23:39:40.000Z | webProject/sport/models.py | mohammadrezasalehi95/webproject-backend | e7b697d6e1197d3781446f44904eabd3d5137c5a | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from django.utils import timezone
from model_utils import Choices
from pygments.lexers import get_all_lexers
from pygments.styles import get_all_styles
from django.contrib.auth.models import AbstractUser
from django.db import models
LEXERS = [item for item in get_all_lexers(... | 42.718232 | 105 | 0.725297 | from django.contrib.auth.models import User
from django.utils import timezone
from model_utils import Choices
from pygments.lexers import get_all_lexers
from pygments.styles import get_all_styles
from django.contrib.auth.models import AbstractUser
from django.db import models
LEXERS = [item for item in get_all_lexers(... | 60 | 6,392 | 391 |
4215a859c4f0ee1fa3f5c5043ebaff2722426e5a | 277 | py | Python | src/button.py | 3dani33/ePaper_polaroid | 54d98ac3492ecf5974254ac6651295affb23cb88 | [
"MIT"
] | null | null | null | src/button.py | 3dani33/ePaper_polaroid | 54d98ac3492ecf5974254ac6651295affb23cb88 | [
"MIT"
] | null | null | null | src/button.py | 3dani33/ePaper_polaroid | 54d98ac3492ecf5974254ac6651295affb23cb88 | [
"MIT"
] | null | null | null | import RPi.GPIO as GPIO
BUTTON_PIN = 4
if __name__ == '__main__':
setup()
while True:
GPIO.wait_for_edge(BUTTON_PIN, GPIO.RISING)
print('button!') | 21.307692 | 63 | 0.66787 | import RPi.GPIO as GPIO
BUTTON_PIN = 4
def setup():
GPIO.setmode(GPIO.BCM)
GPIO.setup(BUTTON_PIN, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
if __name__ == '__main__':
setup()
while True:
GPIO.wait_for_edge(BUTTON_PIN, GPIO.RISING)
print('button!') | 82 | 0 | 23 |
6da0e91d33eed83fe5c7b0ac6a350c323b69f234 | 1,848 | py | Python | lustre/precomputation.py | half-cambodian-hacker-man/lustre | 93e2196a962cafcfd7fa0be93a6b0d563c46ba75 | [
"MIT"
] | 3 | 2020-09-06T02:21:09.000Z | 2020-09-30T00:05:54.000Z | lustre/precomputation.py | videogame-hacker/lustre | 93e2196a962cafcfd7fa0be93a6b0d563c46ba75 | [
"MIT"
] | null | null | null | lustre/precomputation.py | videogame-hacker/lustre | 93e2196a962cafcfd7fa0be93a6b0d563c46ba75 | [
"MIT"
] | null | null | null | import typing
import importlib, importlib.resources
from markupsafe import Markup
from .templating import set_template_global
| 28.875 | 83 | 0.621753 | import typing
import importlib, importlib.resources
from markupsafe import Markup
from .templating import set_template_global
class Precomputation: # TODO: Can we think of a better name for this?
def __init__(self, precomputation_package: str):
self.precomputation_package = precomputation_package
... | 1,428 | 57 | 233 |
2adffddfdd68ffd15f238992beb73b2d8929d348 | 2,847 | py | Python | tests/junk/recall/train_keras.py | imandr/gradnet | 72b9b140cb3f43224a11310b115480fb42820546 | [
"BSD-3-Clause"
] | null | null | null | tests/junk/recall/train_keras.py | imandr/gradnet | 72b9b140cb3f43224a11310b115480fb42820546 | [
"BSD-3-Clause"
] | null | null | null | tests/junk/recall/train_keras.py | imandr/gradnet | 72b9b140cb3f43224a11310b115480fb42820546 | [
"BSD-3-Clause"
] | null | null | null | from generator import Generator
import numpy as np, random
np.set_printoptions(precision=4, suppress=True, linewidth=132)
from tensorflow import keras
from tensorflow.keras.layers import LSTM, Dense, Input
from tensorflow.keras import Model
from tensorflow.keras.optimizers import Adagrad
if __name__ == '__main_... | 33.494118 | 118 | 0.60274 | from generator import Generator
import numpy as np, random
np.set_printoptions(precision=4, suppress=True, linewidth=132)
from tensorflow import keras
from tensorflow.keras.layers import LSTM, Dense, Input
from tensorflow.keras import Model
from tensorflow.keras.optimizers import Adagrad
def create_net(nwords, batch... | 2,227 | 0 | 96 |
6500f03260a475dd256be21b2448a300479360eb | 29,087 | py | Python | resolwe_bio/processes/alignment/star.py | plojyon/resolwe-bio | 45d001a78fcc387b5e3239a34c9da7f40d789022 | [
"Apache-2.0"
] | 12 | 2015-12-07T18:29:27.000Z | 2022-03-16T08:00:18.000Z | resolwe_bio/processes/alignment/star.py | plojyon/resolwe-bio | 45d001a78fcc387b5e3239a34c9da7f40d789022 | [
"Apache-2.0"
] | 480 | 2015-11-20T21:46:43.000Z | 2022-03-28T12:40:57.000Z | resolwe_bio/processes/alignment/star.py | plojyon/resolwe-bio | 45d001a78fcc387b5e3239a34c9da7f40d789022 | [
"Apache-2.0"
] | 45 | 2015-11-19T14:54:07.000Z | 2022-02-13T21:36:50.000Z | """Align reads with STAR aligner."""
import gzip
import shutil
from pathlib import Path
from plumbum import TEE
from resolwe.process import (
BooleanField,
Cmd,
DataField,
FileField,
FloatField,
GroupField,
IntegerField,
Process,
SchedulingClass,
StringField,
)
SPECIES = [
... | 42.033237 | 103 | 0.587685 | """Align reads with STAR aligner."""
import gzip
import shutil
from pathlib import Path
from plumbum import TEE
from resolwe.process import (
BooleanField,
Cmd,
DataField,
FileField,
FloatField,
GroupField,
IntegerField,
Process,
SchedulingClass,
StringField,
)
SPECIES = [
... | 0 | 0 | 0 |
3568b320c9b54a136b9f6bb0bf61aa5462c0e752 | 5,759 | py | Python | lywsd02/client.py | andras-tim/lywsd02 | a5d7fb41094a7bf66b0e3bd943f922b3c529d1ca | [
"MIT"
] | null | null | null | lywsd02/client.py | andras-tim/lywsd02 | a5d7fb41094a7bf66b0e3bd943f922b3c529d1ca | [
"MIT"
] | null | null | null | lywsd02/client.py | andras-tim/lywsd02 | a5d7fb41094a7bf66b0e3bd943f922b3c529d1ca | [
"MIT"
] | null | null | null | import collections
import contextlib
import logging
import struct
import time
from datetime import datetime
from bluepy import btle
_LOGGER = logging.getLogger(__name__)
UUID_UNITS = 'EBE0CCBE-7A0A-4B0C-8A1A-6FF2997DA3A6' # 0x00 - F, 0x01 - C READ WRITE
UUID_HISTORY = 'EBE0CCBC-7A0A-4B0C-8A1A-6FF2997DA3A6' ... | 31.12973 | 91 | 0.610523 | import collections
import contextlib
import logging
import struct
import time
from datetime import datetime
from bluepy import btle
_LOGGER = logging.getLogger(__name__)
UUID_UNITS = 'EBE0CCBE-7A0A-4B0C-8A1A-6FF2997DA3A6' # 0x00 - F, 0x01 - C READ WRITE
UUID_HISTORY = 'EBE0CCBC-7A0A-4B0C-8A1A-6FF2997DA3A6' ... | 4,181 | 937 | 46 |
a779c56183368760dd85753f55634afaf79389d6 | 697 | py | Python | problems/euler/45/pentagonal.py | vidyadeepa/the-coding-interview | 90171b77b6884176a6c28bdccb5d45bd6929b489 | [
"MIT"
] | 1,571 | 2015-12-09T14:08:47.000Z | 2022-03-30T21:34:36.000Z | problems/euler/45/pentagonal.py | vidyadeepa/the-coding-interview | 90171b77b6884176a6c28bdccb5d45bd6929b489 | [
"MIT"
] | 117 | 2015-10-22T05:59:19.000Z | 2021-09-17T00:14:38.000Z | problems/euler/45/pentagonal.py | vidyadeepa/the-coding-interview | 90171b77b6884176a6c28bdccb5d45bd6929b489 | [
"MIT"
] | 452 | 2015-10-21T23:00:58.000Z | 2022-03-18T21:16:50.000Z | from itertools import takewhile, combinations
start = 40756
tg = triangle_generator(start)
pg = pentagonal_generator(start)
hg = hexagonal_generator(start)
p = pg.next()
t = tg.next()
for h in hg:
while p < h:
p = pg.next()
if p != h:
continue
while t < h:
t = tg.next()
if t == h:
print h
| 15.840909 | 45 | 0.572453 | from itertools import takewhile, combinations
def triangle_generator(start):
n = 1
while True:
num = n*(n+1)/2
if num >= start:
yield num
n = n + 1
def pentagonal_generator(start):
n = 1
while True:
num = n*(3*n-1)/2
if num >= start:
yield num
n = n + 1
def hexagonal_gener... | 311 | 0 | 69 |
b8b810d6136b1aa2892efe14a75d85f0d51b1527 | 301 | py | Python | classifications/getSubjectDump.py | tingard/Galaxy-builder-aggregation | 78fec76eeb2ab4b38e241b66fa5643e0002ba3a7 | [
"MIT"
] | 1 | 2018-05-16T14:48:43.000Z | 2018-05-16T14:48:43.000Z | classifications/getSubjectDump.py | tingard/Galaxy-builder-aggregation | 78fec76eeb2ab4b38e241b66fa5643e0002ba3a7 | [
"MIT"
] | null | null | null | classifications/getSubjectDump.py | tingard/Galaxy-builder-aggregation | 78fec76eeb2ab4b38e241b66fa5643e0002ba3a7 | [
"MIT"
] | null | null | null | import re
import json
import sys
if len(sys.argv) > 1:
fpath = sys.argv[1]
else:
fpath = 'galaxy-builder-subjects.csv'
try:
with open(fpath) as f:
classificationCsv = f.read().split('\n')[1:]
except FileNotFoundError:
print('No subjects file found, exiting')
sys.exit(0)
| 18.8125 | 52 | 0.651163 | import re
import json
import sys
if len(sys.argv) > 1:
fpath = sys.argv[1]
else:
fpath = 'galaxy-builder-subjects.csv'
try:
with open(fpath) as f:
classificationCsv = f.read().split('\n')[1:]
except FileNotFoundError:
print('No subjects file found, exiting')
sys.exit(0)
| 0 | 0 | 0 |
487508962cb47f6dd9ce8ee856085cd1bb2f3541 | 998 | py | Python | raspberry_pi/lightning/config.py | asmyczek/lightning | f0b27ae07ade148a8ef938bb2356a83650eb3197 | [
"MIT"
] | null | null | null | raspberry_pi/lightning/config.py | asmyczek/lightning | f0b27ae07ade148a8ef938bb2356a83650eb3197 | [
"MIT"
] | null | null | null | raspberry_pi/lightning/config.py | asmyczek/lightning | f0b27ae07ade148a8ef938bb2356a83650eb3197 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from typing import Dict, Any
from json import loads
from pathlib import Path
import logging
| 23.209302 | 57 | 0.538076 | # -*- coding: utf-8 -*-
from typing import Dict, Any
from json import loads
from pathlib import Path
import logging
def load_config(config_file) -> Dict:
try:
config_file = Path(config_file).resolve()
with config_file.open() as file:
return loads(file.read())
except FileNotFoundEr... | 700 | 133 | 46 |
be70ea7a964506442e645e8316bd0bab9a81f566 | 13,643 | py | Python | src/rez/build_system.py | ColinKennedy/rez | 1ecc85f638d11d70ed78d4bd9c5cdc6f32ac58c4 | [
"Apache-2.0"
] | null | null | null | src/rez/build_system.py | ColinKennedy/rez | 1ecc85f638d11d70ed78d4bd9c5cdc6f32ac58c4 | [
"Apache-2.0"
] | null | null | null | src/rez/build_system.py | ColinKennedy/rez | 1ecc85f638d11d70ed78d4bd9c5cdc6f32ac58c4 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Rez Project
import os.path
from rez.build_process import BuildType
from rez.exceptions import BuildSystemError
from rez.packages import get_developer_package
from rez.rex_bindings import VariantBinding
def get_buildsys_types():
"""Returns th... | 40.008798 | 86 | 0.607931 | # SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Rez Project
import os.path
from rez.build_process import BuildType
from rez.exceptions import BuildSystemError
from rez.packages import get_developer_package
from rez.rex_bindings import VariantBinding
def get_buildsys_types():
"""Returns th... | 0 | 0 | 0 |
5dcb7579adca2910e170cde3ffb6e6b2c855b1b4 | 642 | py | Python | languages/python/src/concepts/P093_OOP_Exceptions_TryExceptBlock.py | vikash-india/DeveloperNotes2Myself | fe277a3c52f73884863f2f72b237365b27a8c882 | [
"MIT"
] | 2 | 2019-05-25T10:09:00.000Z | 2022-03-11T09:06:23.000Z | languages/python/src/concepts/P093_OOP_Exceptions_TryExceptBlock.py | vikash-india/DeveloperNotes2Myself | fe277a3c52f73884863f2f72b237365b27a8c882 | [
"MIT"
] | 2 | 2020-03-31T04:30:17.000Z | 2020-10-30T07:54:28.000Z | languages/python/src/concepts/P093_OOP_Exceptions_TryExceptBlock.py | vikash-india/DeveloperNotes2Myself | fe277a3c52f73884863f2f72b237365b27a8c882 | [
"MIT"
] | 4 | 2019-07-12T13:18:56.000Z | 2021-11-17T08:04:55.000Z | # Description: Exception Handling Using Try-Except Block
import sys
random_list = ["a", 0, 2, "#", 33]
for item in random_list:
try:
reciprocal = 1 / int(item)
print("The reciprocal {} is {}".format(item, reciprocal))
except ValueError:
# Handle one exception type ValueError
p... | 32.1 | 75 | 0.64486 | # Description: Exception Handling Using Try-Except Block
import sys
random_list = ["a", 0, 2, "#", 33]
for item in random_list:
try:
reciprocal = 1 / int(item)
print("The reciprocal {} is {}".format(item, reciprocal))
except ValueError:
# Handle one exception type ValueError
p... | 0 | 0 | 0 |
2a950afe711201b092e94ec25cac483c37306dd2 | 89 | py | Python | __init__.py | redtreeai/img2txt | e58ccc8fea802d07403b67474d5d47eacbd66044 | [
"Apache-2.0"
] | 2 | 2019-05-31T01:23:26.000Z | 2019-11-14T09:45:31.000Z | __init__.py | redtreeai/img2txt | e58ccc8fea802d07403b67474d5d47eacbd66044 | [
"Apache-2.0"
] | null | null | null | __init__.py | redtreeai/img2txt | e58ccc8fea802d07403b67474d5d47eacbd66044 | [
"Apache-2.0"
] | null | null | null | '''
@author: redtree
@contact: redtreec@gmail.com
@time: 17-12-28 上午11:17
@desc:
''' | 8.090909 | 28 | 0.629213 | '''
@author: redtree
@contact: redtreec@gmail.com
@time: 17-12-28 上午11:17
@desc:
''' | 0 | 0 | 0 |
d08c76cd24dbc93762735c0379a49d9da7f40305 | 2,983 | py | Python | mogan/api/validation/parameter_types.py | GURUIFENG9139/rocky-mogan | 6008c1d12b00e70d2cc651f7bd5d47968fc3aec7 | [
"Apache-2.0"
] | null | null | null | mogan/api/validation/parameter_types.py | GURUIFENG9139/rocky-mogan | 6008c1d12b00e70d2cc651f7bd5d47968fc3aec7 | [
"Apache-2.0"
] | null | null | null | mogan/api/validation/parameter_types.py | GURUIFENG9139/rocky-mogan | 6008c1d12b00e70d2cc651f7bd5d47968fc3aec7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Huawei Technologies Co.,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
#
# Unl... | 21.307143 | 78 | 0.552799 | # Copyright 2017 Huawei Technologies Co.,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
#
# Unl... | 0 | 0 | 0 |
75e838a4394ded0ea2e9eb939c11fb31a274332e | 1,226 | py | Python | appbasico/migrations/0008_auto_20210409_1835.py | brunovirgilio/django-basico | 156a49cf70cd5c261c3662b62d69e9696c76598f | [
"MIT"
] | 1 | 2021-07-09T06:19:53.000Z | 2021-07-09T06:19:53.000Z | appbasico/migrations/0008_auto_20210409_1835.py | brunovirgilio/django-basico | 156a49cf70cd5c261c3662b62d69e9696c76598f | [
"MIT"
] | null | null | null | appbasico/migrations/0008_auto_20210409_1835.py | brunovirgilio/django-basico | 156a49cf70cd5c261c3662b62d69e9696c76598f | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-04-09 21:35
from django.db import migrations, models
import django.utils.timezone
| 29.902439 | 121 | 0.584829 | # Generated by Django 3.1.7 on 2021-04-09 21:35
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('appbasico', '0007_auto_20210407_1431'),
]
operations = [
migrations.AddField(
model_name='postagem'... | 0 | 1,087 | 23 |
4508d181044add4dc60d5b3b6da615c480a288a2 | 858 | py | Python | setup.py | AlyaGomaa/bitsbehumble | 2e7ee1f8beb727974957f5a3bf111df3f8239594 | [
"MIT"
] | 13 | 2020-06-22T15:00:38.000Z | 2021-08-30T05:28:04.000Z | setup.py | AlyaGomaa/bitsbehumble | 2e7ee1f8beb727974957f5a3bf111df3f8239594 | [
"MIT"
] | null | null | null | setup.py | AlyaGomaa/bitsbehumble | 2e7ee1f8beb727974957f5a3bf111df3f8239594 | [
"MIT"
] | 1 | 2020-06-22T16:35:25.000Z | 2020-06-22T16:35:25.000Z |
from setuptools import *
with open("README.md", "r") as fh:
long_description = fh.read()
my_packages=find_packages()
setup(
name = 'bitsbehumble',
packages = my_packages,
version = '0.5',
long_description=long_description,
long_description_content_type="text/markdown",
author = 'Aly... | 26 | 84 | 0.635198 |
from setuptools import *
with open("README.md", "r") as fh:
long_description = fh.read()
my_packages=find_packages()
setup(
name = 'bitsbehumble',
packages = my_packages,
version = '0.5',
long_description=long_description,
long_description_content_type="text/markdown",
author = 'Aly... | 0 | 0 | 0 |
a58f3a0841bc4642e7bb06398e78041517c53a26 | 4,142 | py | Python | scripts/migrate_experiment_designs.py | SD2E/python-datacatalog | 51ab366639505fb6e8a14cd6b446de37080cd20d | [
"CNRI-Python"
] | null | null | null | scripts/migrate_experiment_designs.py | SD2E/python-datacatalog | 51ab366639505fb6e8a14cd6b446de37080cd20d | [
"CNRI-Python"
] | 2 | 2019-07-25T15:39:04.000Z | 2019-10-21T15:31:46.000Z | scripts/migrate_experiment_designs.py | SD2E/python-datacatalog | 51ab366639505fb6e8a14cd6b446de37080cd20d | [
"CNRI-Python"
] | 1 | 2019-10-15T14:33:44.000Z | 2019-10-15T14:33:44.000Z | # Note: Read and understand https://gitlab.sd2e.org/sd2program/python-datacatalog/merge_requests/190
# Before running!
import pymongo
from datacatalog.identifiers.typeduuid import catalog_uuid
# Update this to target production
# This should only need to be done once
dbURI = "mongodb://catalog:catalog@localhost:2701... | 44.537634 | 160 | 0.619507 | # Note: Read and understand https://gitlab.sd2e.org/sd2program/python-datacatalog/merge_requests/190
# Before running!
import pymongo
from datacatalog.identifiers.typeduuid import catalog_uuid
# Update this to target production
# This should only need to be done once
dbURI = "mongodb://catalog:catalog@localhost:2701... | 0 | 0 | 0 |
da7a312c2f8770733f78d6cb798abc080246a0bd | 6,965 | py | Python | api/views.py | bpatyi/simpleCRM | bf74f0e0d783ea4538fb96b6790474d991175b51 | [
"MIT"
] | 2 | 2016-10-03T08:35:07.000Z | 2016-10-04T07:22:20.000Z | api/views.py | bpatyi/simpleCRM | bf74f0e0d783ea4538fb96b6790474d991175b51 | [
"MIT"
] | null | null | null | api/views.py | bpatyi/simpleCRM | bf74f0e0d783ea4538fb96b6790474d991175b51 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views.generic.base import TemplateView
from rest_framework import generics, permissions, parsers
from rest_framework_docs.api_docs import ApiDocumentation
from rest_framework_docs.settings import DRFSettings
from api.serializers import (
IndividualSerializer,
I... | 32.24537 | 88 | 0.788658 | from django.shortcuts import render
from django.views.generic.base import TemplateView
from rest_framework import generics, permissions, parsers
from rest_framework_docs.api_docs import ApiDocumentation
from rest_framework_docs.settings import DRFSettings
from api.serializers import (
IndividualSerializer,
I... | 804 | 4,842 | 713 |
74eb31bf50e4f0475673bcfefa2b48567fa9e685 | 13,404 | py | Python | paging/paging.py | jounikor/3gpp | 1f0aa0ffa8c83a62740e28fa0d5769b1564edc09 | [
"Unlicense"
] | null | null | null | paging/paging.py | jounikor/3gpp | 1f0aa0ffa8c83a62740e28fa0d5769b1564edc09 | [
"Unlicense"
] | null | null | null | paging/paging.py | jounikor/3gpp | 1f0aa0ffa8c83a62740e28fa0d5769b1564edc09 | [
"Unlicense"
] | 1 | 2022-03-10T16:03:29.000Z | 2022-03-10T16:03:29.000Z | #
# Version 0.1 (c) 2018 Jouni Korhonen
#
#
#import exceptions
import rrcconfig as rrc
import nasconfig as nas
import math as m
# See 36.304 subclause 7.2
# i_s=0 i_s=1 i_s=2 i_s=3
sf_pattern_npdcch_or_mpdcch_gt_3MHz_fdd = (
(9, None, None, None), # Ns = 1
(4, 9, None, None), # Ns... | 33.014778 | 114 | 0.559609 | #
# Version 0.1 (c) 2018 Jouni Korhonen
#
#
#import exceptions
import rrcconfig as rrc
import nasconfig as nas
import math as m
# See 36.304 subclause 7.2
# i_s=0 i_s=1 i_s=2 i_s=3
sf_pattern_npdcch_or_mpdcch_gt_3MHz_fdd = (
(9, None, None, None), # Ns = 1
(4, 9, None, None), # Ns... | 10,735 | 1,571 | 227 |
bc4c0d17d5a50732f9ab3b4888be555842ab0bdb | 3,537 | py | Python | app/controllers/main.py | akotlerman/flask-website | 1e1e659a2fcab522c4179089d370b5783aff1eb1 | [
"BSD-2-Clause"
] | null | null | null | app/controllers/main.py | akotlerman/flask-website | 1e1e659a2fcab522c4179089d370b5783aff1eb1 | [
"BSD-2-Clause"
] | null | null | null | app/controllers/main.py | akotlerman/flask-website | 1e1e659a2fcab522c4179089d370b5783aff1eb1 | [
"BSD-2-Clause"
] | null | null | null | from flask import Blueprint, render_template, flash, request, redirect, url_for, jsonify, abort
from app.extensions import cache, pages
from app.tasks import long_task
import flam3, io, base64, struct
from PIL import Image
main = Blueprint('main', __name__)
@main.route('/')
@cache.cached(timeout=1000)
@main.route(... | 29.722689 | 108 | 0.648007 | from flask import Blueprint, render_template, flash, request, redirect, url_for, jsonify, abort
from app.extensions import cache, pages
from app.tasks import long_task
import flam3, io, base64, struct
from PIL import Image
main = Blueprint('main', __name__)
@main.route('/')
@cache.cached(timeout=1000)
def home():
... | 2,686 | 0 | 243 |
bbe52c431dfd2064958b7c864f8d7ea5f4c87352 | 6,099 | py | Python | src/viektup.py | fyodr/kektuple | 5602134d9b784fbbbf1efd6afe7a0c523dded06a | [
"MIT"
] | null | null | null | src/viektup.py | fyodr/kektuple | 5602134d9b784fbbbf1efd6afe7a0c523dded06a | [
"MIT"
] | 3 | 2020-05-26T22:28:22.000Z | 2020-05-27T02:32:10.000Z | src/viektup.py | fyodr/kektuple | 5602134d9b784fbbbf1efd6afe7a0c523dded06a | [
"MIT"
] | null | null | null | """
viektup.py
by Ted Morin
viektup <= visual interactive kektup
a class for visualizing Barnette graphs via interactive visualization
"""
import numpy as np
from vektup import Vektup
from iektup import Iektup
# event to call when an edge is clicked on (or "picked")
# handle details of selecting an... | 35.666667 | 76 | 0.571733 | """
viektup.py
by Ted Morin
viektup <= visual interactive kektup
a class for visualizing Barnette graphs via interactive visualization
"""
import numpy as np
from vektup import Vektup
from iektup import Iektup
class Viektup(Vektup):
def __init__(self, g=None,
showing_points=True,
showing... | 5,224 | 1 | 315 |
8fd15d8d08dc9ac65b46cdb43fd15e5581c97ffc | 127 | py | Python | stubs/asttokens/util.py | jamescooke/flake8-aaa | 9df248e10538946531b67da4564bb229a91baece | [
"MIT"
] | 44 | 2018-04-08T21:25:43.000Z | 2022-01-20T14:28:16.000Z | stubs/asttokens/util.py | jamescooke/flake8-aaa | 9df248e10538946531b67da4564bb229a91baece | [
"MIT"
] | 72 | 2018-03-30T14:30:48.000Z | 2022-03-31T16:18:16.000Z | stubs/asttokens/util.py | jamescooke/flake8-aaa | 9df248e10538946531b67da4564bb229a91baece | [
"MIT"
] | 1 | 2018-10-17T18:49:25.000Z | 2018-10-17T18:49:25.000Z | import collections
| 21.166667 | 97 | 0.740157 | import collections
class Token(collections.namedtuple('Token', 'type string start end line index startpos endpos')):
...
| 0 | 84 | 23 |
1995081178b8e9fad8c0b013bb69eea59dd02469 | 374 | py | Python | examples/annotations/upload_annotation_to_dataset.py | dataloop-ai/sdk_examples | 422d5629df5af343d2dc275e9570bb83c4e2f49d | [
"MIT"
] | 3 | 2022-01-07T20:33:49.000Z | 2022-03-22T12:41:30.000Z | examples/annotations/upload_annotation_to_dataset.py | dataloop-ai/sdk_examples | 422d5629df5af343d2dc275e9570bb83c4e2f49d | [
"MIT"
] | null | null | null | examples/annotations/upload_annotation_to_dataset.py | dataloop-ai/sdk_examples | 422d5629df5af343d2dc275e9570bb83c4e2f49d | [
"MIT"
] | 3 | 2021-12-29T13:11:30.000Z | 2022-03-22T12:25:50.000Z | import dtlpy as dl
dataset_id = ''
annotations_path = r''
# make sure they have the same hierarchy
dataset = dl.datasets.get(dataset_id=dataset_id)
# clean: bool - if True it remove the old annotations
# remote_root_path: str - the remote root path to match remote and local items
dataset.upload_annotations(local_path... | 34 | 90 | 0.783422 | import dtlpy as dl
dataset_id = ''
annotations_path = r''
# make sure they have the same hierarchy
dataset = dl.datasets.get(dataset_id=dataset_id)
# clean: bool - if True it remove the old annotations
# remote_root_path: str - the remote root path to match remote and local items
dataset.upload_annotations(local_path... | 0 | 0 | 0 |
1c6e4a81a173fa18b5f8b7f938e0d2aac2fb1994 | 436 | py | Python | examples/volumetric/tet_threshold.py | evanphilip/vedo | e8504fb1a7d2cb667a776180d69bb17cad634e1e | [
"CC0-1.0"
] | 836 | 2020-06-14T02:38:12.000Z | 2022-03-31T15:39:50.000Z | examples/volumetric/tet_threshold.py | evanphilip/vedo | e8504fb1a7d2cb667a776180d69bb17cad634e1e | [
"CC0-1.0"
] | 418 | 2020-06-14T10:51:32.000Z | 2022-03-31T23:23:14.000Z | examples/volumetric/tet_threshold.py | evanphilip/vedo | e8504fb1a7d2cb667a776180d69bb17cad634e1e | [
"CC0-1.0"
] | 136 | 2020-06-14T02:26:41.000Z | 2022-03-31T12:47:18.000Z | """Threshold the original TetMesh
with a scalar array"""
from vedo import *
settings.useDepthPeeling = True
tetm = TetMesh(dataurl+'limb_ugrid.vtk')
tetm.color('prism').alpha([0,1])
# Threshold the tetrahedral mesh for values in the range:
tetm.threshold(above=0.9, below=1)
tetm.addScalarBar3D(title='chem_0 express... | 24.222222 | 71 | 0.704128 | """Threshold the original TetMesh
with a scalar array"""
from vedo import *
settings.useDepthPeeling = True
tetm = TetMesh(dataurl+'limb_ugrid.vtk')
tetm.color('prism').alpha([0,1])
# Threshold the tetrahedral mesh for values in the range:
tetm.threshold(above=0.9, below=1)
tetm.addScalarBar3D(title='chem_0 express... | 0 | 0 | 0 |
8232a837d37bf5ce21f07e2fbce3a35ef2d5d563 | 373 | py | Python | test/client/post_client.py | lidall/risk-authentication-service | 17e59dc264618a691767b5e271ac170b4178eb6f | [
"MIT"
] | null | null | null | test/client/post_client.py | lidall/risk-authentication-service | 17e59dc264618a691767b5e271ac170b4178eb6f | [
"MIT"
] | null | null | null | test/client/post_client.py | lidall/risk-authentication-service | 17e59dc264618a691767b5e271ac170b4178eb6f | [
"MIT"
] | null | null | null | import asyncio
import aiohttp
text = asyncio.run(main()) # Assuming you're using python 3.7+
print(text)
| 24.866667 | 70 | 0.619303 | import asyncio
import aiohttp
async def main():
url = 'http://0.0.0.0:8080/log'
with open('data.txt', 'rb') as f:
async with aiohttp.ClientSession() as session:
async with session.post(url, data={'key': f}) as response:
return await response.text()
text = asyncio.run(main... | 241 | 0 | 23 |
0f1ba0f472d43145fe9d19222d09e17981af0786 | 1,934 | py | Python | lldb/scripts/copy-static-bindings.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | null | null | null | lldb/scripts/copy-static-bindings.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | null | null | null | lldb/scripts/copy-static-bindings.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""SWIG Static Binding Copier
This script copies over the Python bindings generated by SWIG from the build
directory to the source directory. Before using the script, make sure you have
LLDB_USE_STATIC_BINDINGS set to OFF by looking at CMakeCache.txt in the LLDB
build directory.
The scripts kno... | 32.233333 | 78 | 0.668046 | #!/usr/bin/env python
"""SWIG Static Binding Copier
This script copies over the Python bindings generated by SWIG from the build
directory to the source directory. Before using the script, make sure you have
LLDB_USE_STATIC_BINDINGS set to OFF by looking at CMakeCache.txt in the LLDB
build directory.
The scripts kno... | 1,185 | 0 | 23 |
2854f114e96f2c3f14e1c5c147096d7b6d434e74 | 193 | py | Python | tests/requests/req-head.py | Team-Fenris/tfcctrl | d7af8750fddb7d09f6ee3830d9703c5356b9ef13 | [
"Apache-2.0"
] | 1 | 2021-12-28T17:07:21.000Z | 2021-12-28T17:07:21.000Z | tests/requests/req-head.py | Team-Fenris/tfcctrl | d7af8750fddb7d09f6ee3830d9703c5356b9ef13 | [
"Apache-2.0"
] | null | null | null | tests/requests/req-head.py | Team-Fenris/tfcctrl | d7af8750fddb7d09f6ee3830d9703c5356b9ef13 | [
"Apache-2.0"
] | null | null | null | import requests
# Request URL from the user input
url = input("Insert URL: ")
# Set up and make the test ready for print
x = requests.head(url)
# Print the callback
print(x.headers) | 19.3 | 43 | 0.694301 | import requests
# Request URL from the user input
url = input("Insert URL: ")
# Set up and make the test ready for print
x = requests.head(url)
# Print the callback
print(x.headers) | 0 | 0 | 0 |
a0eaa0066688a682511c63cb1875814600dd18a3 | 205 | py | Python | fec_raw/tests.py | datadesk/django-fec-raw-data | 9d1f49e5ecc1552c55b635c63c1bf021871e4c0b | [
"MIT"
] | 3 | 2016-06-01T18:16:36.000Z | 2021-07-20T14:51:40.000Z | fec_raw/tests.py | datadesk/django-fec-raw-data | 9d1f49e5ecc1552c55b635c63c1bf021871e4c0b | [
"MIT"
] | 9 | 2015-11-24T06:22:56.000Z | 2021-06-10T17:45:57.000Z | fec_raw/tests.py | datadesk/django-fec-raw-data | 9d1f49e5ecc1552c55b635c63c1bf021871e4c0b | [
"MIT"
] | 1 | 2020-12-01T21:22:53.000Z | 2020-12-01T21:22:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
| 18.636364 | 39 | 0.697561 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
class FecTest(TestCase):
def test_fake(self):
self.assertEqual(2+2, 4)
| 32 | 3 | 50 |
345988313f381b37b27d23851276e597d1cfa427 | 1,432 | py | Python | tests/test_fix_print.py | graingert/python-modernize | 028d13416d7abe4b8b39bc21e6425df65c7836c0 | [
"BSD-3-Clause"
] | 220 | 2015-03-25T11:06:13.000Z | 2020-08-19T13:33:57.000Z | tests/test_fix_print.py | graingert/python-modernize | 028d13416d7abe4b8b39bc21e6425df65c7836c0 | [
"BSD-3-Clause"
] | 113 | 2015-01-03T18:05:27.000Z | 2020-08-18T21:42:23.000Z | tests/test_fix_print.py | graingert/python-modernize | 028d13416d7abe4b8b39bc21e6425df65c7836c0 | [
"BSD-3-Clause"
] | 39 | 2015-01-18T10:08:52.000Z | 2020-07-12T18:44:40.000Z | from __future__ import generator_stop
from utils import check_on_input
PRINT_BARE = (
"""\
print
""",
"""\
from __future__ import print_function
print()
""",
)
PRINT_SIMPLE = (
"""\
print 'Hello'
""",
"""\
from __future__ import print_function
print('Hello')
""",
)
PRINT_MULTIPLE = (
"""\
print ... | 14.039216 | 47 | 0.65852 | from __future__ import generator_stop
from utils import check_on_input
PRINT_BARE = (
"""\
print
""",
"""\
from __future__ import print_function
print()
""",
)
PRINT_SIMPLE = (
"""\
print 'Hello'
""",
"""\
from __future__ import print_function
print('Hello')
""",
)
PRINT_MULTIPLE = (
"""\
print ... | 311 | 0 | 161 |
d736de07b87063cbed39e7376c3caac6450912bb | 490 | py | Python | app/server/auth/__init__.py | tderleth/2-item-catalog | 168e8f5ad10a26a03f6c50b1b2173de0b5dde113 | [
"MIT"
] | null | null | null | app/server/auth/__init__.py | tderleth/2-item-catalog | 168e8f5ad10a26a03f6c50b1b2173de0b5dde113 | [
"MIT"
] | null | null | null | app/server/auth/__init__.py | tderleth/2-item-catalog | 168e8f5ad10a26a03f6c50b1b2173de0b5dde113 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""Initialize package."""
from flask import redirect, url_for
from flask import session as login_session
from functools import wraps
def login_required(f):
"""Check if user is authenticated."""
@wraps(f)
return wrap
| 23.333333 | 50 | 0.632653 | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""Initialize package."""
from flask import redirect, url_for
from flask import session as login_session
from functools import wraps
def login_required(f):
"""Check if user is authenticated."""
@wraps(f)
def wrap(*args, **kwargs):
if login_session... | 182 | 0 | 26 |
ca1e6d19ff949ebaf3c6b29a5cb5dea9ff1c5275 | 240 | py | Python | cli_tests/nb_config.py | jbn/dissertate | a3e258b8686408b28fec13ba300e77d466465e5b | [
"MIT"
] | 2 | 2019-03-08T14:24:11.000Z | 2019-07-11T15:13:07.000Z | cli_tests/nb_config.py | jbn/dissertate | a3e258b8686408b28fec13ba300e77d466465e5b | [
"MIT"
] | 1 | 2017-04-30T18:04:19.000Z | 2017-06-15T22:28:53.000Z | cli_tests/nb_config.py | jbn/dissertate | a3e258b8686408b28fec13ba300e77d466465e5b | [
"MIT"
] | null | null | null | import dissertate
c = get_config()
c.Exporter.preprocessors = ['dissertate.preprocessors.CellElider',
'dissertate.preprocessors.EmptyCellElider']
c.Exporter.template_file = dissertate.markdown_template_path()
| 26.666667 | 71 | 0.725 | import dissertate
c = get_config()
c.Exporter.preprocessors = ['dissertate.preprocessors.CellElider',
'dissertate.preprocessors.EmptyCellElider']
c.Exporter.template_file = dissertate.markdown_template_path()
| 0 | 0 | 0 |
ba57317d47dd39595ebadff7a609644ff3f9eb12 | 19,205 | py | Python | responder/aws/function/responder.py | gracious-tech/stello | 1b7b1b28c76c38eede4abef308cb981e26f068b8 | [
"MIT"
] | 1 | 2021-11-04T11:36:12.000Z | 2021-11-04T11:36:12.000Z | responder/aws/function/responder.py | gracious-tech/stello | 1b7b1b28c76c38eede4abef308cb981e26f068b8 | [
"MIT"
] | 7 | 2021-07-29T06:26:06.000Z | 2021-11-19T01:42:25.000Z | responder/aws/function/responder.py | gracious-tech/stello | 1b7b1b28c76c38eede4abef308cb981e26f068b8 | [
"MIT"
] | null | null | null |
import os
import json
import base64
import string
from time import time
from uuid import uuid4
from pathlib import Path
from traceback import format_exc
from contextlib import suppress
import rollbar
import boto3
from botocore.config import Config
from cryptography.hazmat.primitives.hashes import SHA256
from cryptogr... | 35.964419 | 398 | 0.664358 |
import os
import json
import base64
import string
from time import time
from uuid import uuid4
from pathlib import Path
from traceback import format_exc
from contextlib import suppress
import rollbar
import boto3
from botocore.config import Config
from cryptography.hazmat.primitives.hashes import SHA256
from cryptogr... | 140 | 0 | 22 |
3d41d405150ed0e79bbadee5ab542a4512d98c48 | 2,718 | py | Python | controllers.py | afewyards/starcitizen_gremlin | a173711f96e4ad491901a0afd3b899fa08f76d2b | [
"MIT"
] | null | null | null | controllers.py | afewyards/starcitizen_gremlin | a173711f96e4ad491901a0afd3b899fa08f76d2b | [
"MIT"
] | null | null | null | controllers.py | afewyards/starcitizen_gremlin | a173711f96e4ad491901a0afd3b899fa08f76d2b | [
"MIT"
] | null | null | null | # Copyright (c) 2017 Thierry Kleist
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merg... | 33.555556 | 75 | 0.702723 | # Copyright (c) 2017 Thierry Kleist
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merg... | 1,175 | -3 | 207 |
366c3dd1425e93e61a20c2ae2a3da2669aab8950 | 741 | py | Python | Computer & Information Science Core courses/2168/prims/node.py | Vaporjawn/Temple-University-Computer-Science-Resources | 8d54db3a85a1baa8ba344efc90593b440eb6d585 | [
"MIT"
] | 1 | 2020-07-28T16:18:38.000Z | 2020-07-28T16:18:38.000Z | Computer & Information Science Core courses/2168/prims/node.py | Vaporjawn/Temple-University-Computer-Science-Resources | 8d54db3a85a1baa8ba344efc90593b440eb6d585 | [
"MIT"
] | 4 | 2020-07-15T06:40:55.000Z | 2020-08-13T16:01:30.000Z | Computer & Information Science Core courses/2168/prims/node.py | Vaporjawn/Temple-University-Computer-Science-Resources | 8d54db3a85a1baa8ba344efc90593b440eb6d585 | [
"MIT"
] | null | null | null |
# TODO; input type verification
# Adds an weighted unidirectional edge to another existing node
# TODO: add verification that node exists
# Returns all of the edges connected to the current node
# Returns the weight of the edge connected the specified node to the current node
| 32.217391 | 92 | 0.775978 | class Node:
# TODO; input type verification
def __init__(self, name):
self.name = name
self.connected_nodes = []
self.connected_nodes_weights = {} # weights of the edges accessible by connected node name
# Adds an weighted unidirectional edge to another existing node
# TODO: add verification that node exist... | 350 | -10 | 114 |
94c8cc94a2af46e25ce52873ef6ff30ccc268642 | 4,875 | py | Python | adv_setup.py | Derek318/Adversarial-Squad-CS224N | 9b4a5da2a262f4de9b9b05d7b67dc48b2b857e46 | [
"MIT"
] | 1 | 2020-11-12T02:49:32.000Z | 2020-11-12T02:49:32.000Z | adv_setup.py | Derek318/Adversarial-Squad-CS224N | 9b4a5da2a262f4de9b9b05d7b67dc48b2b857e46 | [
"MIT"
] | null | null | null | adv_setup.py | Derek318/Adversarial-Squad-CS224N | 9b4a5da2a262f4de9b9b05d7b67dc48b2b857e46 | [
"MIT"
] | null | null | null | import logging
import os
import queue
import random
import re
from args import get_setup_args
import shutil
import string
import setup
import torch
import torch.nn.functional as F
import torch.utils.data as data
from collections import Counter
import tqdm
import numpy as np
import ujson as json
import spacy
import json... | 39.314516 | 159 | 0.694359 | import logging
import os
import queue
import random
import re
from args import get_setup_args
import shutil
import string
import setup
import torch
import torch.nn.functional as F
import torch.utils.data as data
from collections import Counter
import tqdm
import numpy as np
import ujson as json
import spacy
import json... | 4,322 | 0 | 58 |
62db68da161d1ea9d14e592b1e3cf0ae819a76bf | 1,612 | py | Python | udacity/self-driving-intro/2-bayesian-thinking/12/test.py | adriancarriger/experiments | 7e4248592dc8fbb08522c9b5f0393c80dc7e2699 | [
"MIT"
] | 1 | 2021-06-22T13:38:36.000Z | 2021-06-22T13:38:36.000Z | udacity/self-driving-intro/2-bayesian-thinking/12/test.py | adriancarriger/experiments | 7e4248592dc8fbb08522c9b5f0393c80dc7e2699 | [
"MIT"
] | 108 | 2019-05-23T16:12:32.000Z | 2020-09-04T15:47:33.000Z | udacity/self-driving-intro/2-bayesian-thinking/12/test.py | adriancarriger/experiments | 7e4248592dc8fbb08522c9b5f0393c80dc7e2699 | [
"MIT"
] | null | null | null | # from './localizer' import localizer
import localizer
import helpers
test_sense()
| 23.362319 | 75 | 0.604218 | # from './localizer' import localizer
import localizer
import helpers
def test_sense():
R = 'r'
_ = 'g'
simple_grid = [
[_, _, _],
[_, R, _],
[_, _, _]
]
p = 1.0 / 9
initial_beliefs = [
[p, p, p],
[p, p, p],
[p, p, p]
]
observation = R... | 1,503 | 0 | 23 |
deecfb2ff8809fa583a186388e95973a391ea0c6 | 3,577 | py | Python | volDB/migrations/0001_initial.py | leg2015/CSCapstone19Volunteers | ae0fcf1e8ce4fafe8578edd0a3943574703046fa | [
"MIT"
] | 4 | 2020-01-13T23:30:34.000Z | 2021-03-17T21:23:57.000Z | volDB/migrations/0001_initial.py | leg2015/CSCapstone19Volunteers | ae0fcf1e8ce4fafe8578edd0a3943574703046fa | [
"MIT"
] | 5 | 2020-02-12T03:25:17.000Z | 2021-06-10T22:29:16.000Z | volDB/migrations/0001_initial.py | leg2015/CSCapstone19Volunteers | ae0fcf1e8ce4fafe8578edd0a3943574703046fa | [
"MIT"
] | null | null | null | # Generated by Django 2.1.7 on 2019-02-23 18:47
from django.db import migrations, models
import django.db.models.deletion
| 41.593023 | 137 | 0.574224 | # Generated by Django 2.1.7 on 2019-02-23 18:47
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Address',
fields=[
... | 0 | 3,430 | 23 |
5bf95b53dad15597c23e37c17856b5c97c6c0117 | 627 | py | Python | Python Fundamentals/Dictionaries/Exercise/Task10.py | IvanTodorovBG/SoftUni | 7b667f6905d9f695ab1484efbb02b6715f6d569e | [
"MIT"
] | 1 | 2022-03-16T10:23:04.000Z | 2022-03-16T10:23:04.000Z | Python Fundamentals/Dictionaries/Exercise/Task10.py | IvanTodorovBG/SoftUni | 7b667f6905d9f695ab1484efbb02b6715f6d569e | [
"MIT"
] | null | null | null | Python Fundamentals/Dictionaries/Exercise/Task10.py | IvanTodorovBG/SoftUni | 7b667f6905d9f695ab1484efbb02b6715f6d569e | [
"MIT"
] | null | null | null | command = input()
company_users = {}
# add all company users in dictionary
while command != "End":
command = command.split(" -> ")
company = command[0]
users = command[1]
company_users.setdefault(company, []).append(users)
command = input()
# remove duplicating users
for k, v in company_users.i... | 23.222222 | 78 | 0.669856 | command = input()
company_users = {}
# add all company users in dictionary
while command != "End":
command = command.split(" -> ")
company = command[0]
users = command[1]
company_users.setdefault(company, []).append(users)
command = input()
# remove duplicating users
for k, v in company_users.i... | 0 | 0 | 0 |
dbc4c3310857e85d9121fdbadd2b16c4be0bc6f2 | 5,045 | py | Python | django_op/oidc_op/users.py | peppelinux/oidc-op | c0385b5cbdb48fe2f74a556174d26444a48e6bed | [
"Apache-2.0"
] | 1 | 2020-09-30T13:07:48.000Z | 2020-09-30T13:07:48.000Z | django_op/oidc_op/users.py | peppelinux/oidc-op | c0385b5cbdb48fe2f74a556174d26444a48e6bed | [
"Apache-2.0"
] | null | null | null | django_op/oidc_op/users.py | peppelinux/oidc-op | c0385b5cbdb48fe2f74a556174d26444a48e6bed | [
"Apache-2.0"
] | null | null | null | import copy
from django.contrib.auth import authenticate, get_user_model
from django.contrib.auth import get_user_model
from django.template.loader import render_to_string
from oidcendpoint.util import instantiate
from oidcendpoint.user_authn.user import (create_signed_jwt,
v... | 34.319728 | 96 | 0.595639 | import copy
from django.contrib.auth import authenticate, get_user_model
from django.contrib.auth import get_user_model
from django.template.loader import render_to_string
from oidcendpoint.util import instantiate
from oidcendpoint.user_authn.user import (create_signed_jwt,
v... | 1,167 | 0 | 108 |
b88cd470cbd6ea92ae15dc576cddd38972675cdd | 2,608 | py | Python | foxylib/tools/native/typing/typing_tool.py | foxytrixy-com/foxylib | 94b8c5b9f8b12423393c68f7d9f910258840ed18 | [
"BSD-3-Clause"
] | null | null | null | foxylib/tools/native/typing/typing_tool.py | foxytrixy-com/foxylib | 94b8c5b9f8b12423393c68f7d9f910258840ed18 | [
"BSD-3-Clause"
] | 3 | 2019-12-12T05:17:44.000Z | 2022-03-11T23:40:50.000Z | foxylib/tools/native/typing/typing_tool.py | foxytrixy-com/foxylib | 94b8c5b9f8b12423393c68f7d9f910258840ed18 | [
"BSD-3-Clause"
] | 2 | 2019-10-16T17:39:34.000Z | 2020-02-10T06:32:08.000Z | from collections import Hashable
from typing import Union, Any, TypeVar, Optional, Tuple, List
from foxylib.tools.native.typing._typing_tool_helper import is_instance, \
is_subtype, is_generic
T = TypeVar("T")
| 24.603774 | 74 | 0.609663 | from collections import Hashable
from typing import Union, Any, TypeVar, Optional, Tuple, List
from foxylib.tools.native.typing._typing_tool_helper import is_instance, \
is_subtype, is_generic
T = TypeVar("T")
class TypingTool:
class NotAnnotationError(Exception):
pass
@classmethod
def pair... | 1,290 | 1,076 | 23 |
609ab129a24150af072b34c2796b2e752a5d40c4 | 2,111 | py | Python | nex2art/menu/UserEdit.py | ghl1024/nexus2artifactory | 1b300e1ea9c51d51a89096e8b710a0763750c38d | [
"Apache-2.0"
] | 50 | 2018-08-30T00:39:16.000Z | 2022-01-27T10:08:19.000Z | nex2art/menu/UserEdit.py | ghl1024/nexus2artifactory | 1b300e1ea9c51d51a89096e8b710a0763750c38d | [
"Apache-2.0"
] | 68 | 2018-06-12T10:37:01.000Z | 2022-01-10T02:47:12.000Z | nex2art/menu/UserEdit.py | ghl1024/nexus2artifactory | 1b300e1ea9c51d51a89096e8b710a0763750c38d | [
"Apache-2.0"
] | 38 | 2018-06-11T10:38:03.000Z | 2021-11-12T15:00:21.000Z | from ..core import Menu
from . import ItemListEdit
from . import ChooseList
| 39.830189 | 78 | 0.54145 | from ..core import Menu
from . import ItemListEdit
from . import ChooseList
class UserEdit(Menu):
def __init__(self, scr, path):
Menu.__init__(self, scr, path, "Edit User Options")
f, g, h = self.buildgroupedit, self.makegroupedit, lambda x: x['text']
grp = self.submenu(ItemListEdit, "Group... | 1,878 | 0 | 157 |
4e3ee5226a352745afd75a2808d1f691fc9cc9b1 | 2,512 | py | Python | MoleculeMOTScripts/optimas/motmaster_wrapper.py | ColdMatter/EDMSuite | 80a8bc0f3fd9d33a081f606707140de51512b28a | [
"MIT"
] | 6 | 2017-02-02T17:54:23.000Z | 2021-07-03T12:41:36.000Z | MoleculeMOTScripts/optimas/motmaster_wrapper.py | ColdMatter/EDMSuite | 80a8bc0f3fd9d33a081f606707140de51512b28a | [
"MIT"
] | null | null | null | MoleculeMOTScripts/optimas/motmaster_wrapper.py | ColdMatter/EDMSuite | 80a8bc0f3fd9d33a081f606707140de51512b28a | [
"MIT"
] | 11 | 2015-03-19T18:23:38.000Z | 2021-02-18T11:05:51.000Z | from __future__ import print_function
import clr
import sys
from System.IO import Path
import time
sys.path.append(Path.GetFullPath("C:\\ControlPrograms\\EDMSuite\\MOTMaster\\bin\\CaF\\"))
clr.AddReference("C:\\ControlPrograms\\EDMSuite\\MOTMaster\\bin\\CaF\\MOTMaster.exe")
sys.path.append(Path.GetFullPath("C:\\Cont... | 36.941176 | 130 | 0.789013 | from __future__ import print_function
import clr
import sys
from System.IO import Path
import time
sys.path.append(Path.GetFullPath("C:\\ControlPrograms\\EDMSuite\\MOTMaster\\bin\\CaF\\"))
clr.AddReference("C:\\ControlPrograms\\EDMSuite\\MOTMaster\\bin\\CaF\\MOTMaster.exe")
sys.path.append(Path.GetFullPath("C:\\Cont... | 694 | 0 | 46 |
978386cf7120391264f4a613312715b934b28b6f | 1,383 | py | Python | pyverilog/utils/op2mark.py | stdavids/Pyverilog | a201b86e1d1b237d205dce897dc823725abcd79b | [
"Apache-2.0"
] | 4 | 2019-09-26T18:59:43.000Z | 2021-12-07T01:25:09.000Z | pyverilog/utils/op2mark.py | stdavids/Pyverilog | a201b86e1d1b237d205dce897dc823725abcd79b | [
"Apache-2.0"
] | 1 | 2022-01-30T12:30:01.000Z | 2022-01-30T12:30:01.000Z | pyverilog/utils/op2mark.py | stdavids/Pyverilog | a201b86e1d1b237d205dce897dc823725abcd79b | [
"Apache-2.0"
] | 2 | 2020-06-18T02:23:14.000Z | 2022-01-30T10:04:46.000Z | #-------------------------------------------------------------------------------
# op2mark.py
#
# converting an operator to its mark
#
# Copyright (C) 2013, Shinya Takamaeda-Yamazaki
# License: Apache 2.0
#-------------------------------------------------------------------------------
operator_mark = {
'Uminus':'... | 30.065217 | 80 | 0.415763 | #-------------------------------------------------------------------------------
# op2mark.py
#
# converting an operator to its mark
#
# Copyright (C) 2013, Shinya Takamaeda-Yamazaki
# License: Apache 2.0
#-------------------------------------------------------------------------------
operator_mark = {
'Uminus':'... | 155 | 0 | 46 |
0e81cd9725bccb7cfae13d7c944aa28d1ae47af7 | 727 | py | Python | script/dataset-txt-to-binary.py | rvs314/Montage | d4c49e66addefe947c03ff2bd0c463ebd2c34436 | [
"MIT"
] | 9 | 2020-10-04T22:03:31.000Z | 2021-10-08T01:52:57.000Z | script/dataset-txt-to-binary.py | rvs314/Montage | d4c49e66addefe947c03ff2bd0c463ebd2c34436 | [
"MIT"
] | 18 | 2020-10-20T02:39:12.000Z | 2021-08-30T00:23:32.000Z | script/dataset-txt-to-binary.py | rvs314/Montage | d4c49e66addefe947c03ff2bd0c463ebd2c34436 | [
"MIT"
] | 9 | 2020-10-04T22:06:11.000Z | 2021-02-19T17:23:17.000Z | #!/bin/python
import sys
import os
import re
import multiprocessing
pool = multiprocessing.Pool(multiprocessing.cpu_count())
for f in os.listdir('graph_data/'):
tmp = re.findall("orkut-edge-list_[0-9]+.txt", f)
if len(tmp) != 0:
pool.apply_async(work, (f,))
pool.close()
pool.join() | 26.925926 | 56 | 0.580468 | #!/bin/python
import sys
import os
import re
import multiprocessing
def work(f):
output = 'graph_data/' + f[:-4] + '.bin'
with open('graph_data/' + f) as i:
inputLines = i.readlines()
assert len(inputLines) > 0
with open(output, 'wb') as o:
for line in inputLines:
m = r... | 403 | 0 | 23 |
371254aa1ac49e4953c6a896823e19560b4024b9 | 3,900 | py | Python | waste/cli.py | tim-littlefair/tl-waste | 522110d049d77f0689feef66ad51894331521fce | [
"MIT"
] | null | null | null | waste/cli.py | tim-littlefair/tl-waste | 522110d049d77f0689feef66ad51894331521fce | [
"MIT"
] | null | null | null | waste/cli.py | tim-littlefair/tl-waste | 522110d049d77f0689feef66ad51894331521fce | [
"MIT"
] | null | null | null | # python3
# waste/cli.py
# Copyright Tim Littlefair 2020-
# This file is open source software under the MIT license.
# For terms of this license, see the file LICENSE in the source
# code distribution or visit
# https://opensource.org/licenses/mit-license.php
# This file defines the command line interface of the ... | 33.333333 | 89 | 0.634103 | # python3
# waste/cli.py
# Copyright Tim Littlefair 2020-
# This file is open source software under the MIT license.
# For terms of this license, see the file LICENSE in the source
# code distribution or visit
# https://opensource.org/licenses/mit-license.php
# This file defines the command line interface of the ... | 1,744 | 20 | 49 |
e7ef009d0fb5ad446ef872c0338222f7866a959e | 758 | py | Python | _gather_docs.py | gh640/shell-utils | 2bb23a1a4238ca812b7080ded8f687beca3bff4e | [
"MIT"
] | null | null | null | _gather_docs.py | gh640/shell-utils | 2bb23a1a4238ca812b7080ded8f687beca3bff4e | [
"MIT"
] | 6 | 2018-07-02T13:40:46.000Z | 2019-03-10T03:27:54.000Z | _gather_docs.py | gh640/shell-utils | 2bb23a1a4238ca812b7080ded8f687beca3bff4e | [
"MIT"
] | null | null | null | '''Gathers the module docs in `.py`.
'''
import importlib
from pathlib import Path
TARGET_SUFFIXES = ('.py',)
EXCLUDED_PREFIX = '_'
TEMPLATE_ITEM = '- `{}`: {}'
if __name__ == '__main__':
main()
| 20.486486 | 70 | 0.672823 | '''Gathers the module docs in `.py`.
'''
import importlib
from pathlib import Path
TARGET_SUFFIXES = ('.py',)
EXCLUDED_PREFIX = '_'
TEMPLATE_ITEM = '- `{}`: {}'
def main():
print_module_doc(x for x in get_entries_in_script_dir(is_target))
def get_entries_in_script_dir(rule):
path = Path(__file__).resolve(... | 459 | 0 | 92 |
33243a156837ff8e81b84b33b3fe60babe6f38c8 | 1,132 | py | Python | seriouslylib/iterable.py | Mego/Seriously | 07b256e4f35f5efec3b01434300f9ccc551b1c3e | [
"MIT"
] | 104 | 2015-11-02T00:08:32.000Z | 2022-02-17T23:17:14.000Z | seriouslylib/iterable.py | Mego/Seriously | 07b256e4f35f5efec3b01434300f9ccc551b1c3e | [
"MIT"
] | 68 | 2015-11-09T05:33:24.000Z | 2020-04-10T06:46:54.000Z | seriouslylib/iterable.py | Mego/Seriously | 07b256e4f35f5efec3b01434300f9ccc551b1c3e | [
"MIT"
] | 25 | 2015-11-19T05:34:09.000Z | 2021-07-20T13:54:03.000Z | #!/usr/bin/env python3
from collections import deque as _deque
from collections import Iterable
from itertools import islice, zip_longest as izip
| 31.444444 | 78 | 0.603357 | #!/usr/bin/env python3
from collections import deque as _deque
from collections import Iterable
from itertools import islice, zip_longest as izip
def as_list(val, wrap=True):
#strings are iterables all the way down, so an exception needs to be made
# else we get infinite recursion, which is bad
#... | 799 | -1 | 183 |
54cdc86a431feab1e8839c566bd4ed3eb49fab86 | 513 | py | Python | visualizeXY.py | Myunghee13/DSCI560_HW2 | b951a10f3fa0ad5807e980c3f172f8f66d7d3796 | [
"CC0-1.0"
] | null | null | null | visualizeXY.py | Myunghee13/DSCI560_HW2 | b951a10f3fa0ad5807e980c3f172f8f66d7d3796 | [
"CC0-1.0"
] | null | null | null | visualizeXY.py | Myunghee13/DSCI560_HW2 | b951a10f3fa0ad5807e980c3f172f8f66d7d3796 | [
"CC0-1.0"
] | null | null | null | # 1. c. Visualize the results
from pathlib import Path
import matplotlib.pyplot as plt
output_folder = Path("output")
# read intermediate results
with open(output_folder / "xNumbers.txt",'r') as f:
xNum = [int(ele.strip()) for ele in f.readlines()]
with open(output_folder / "yNumbers.txt",'r') as f:
yNum = ... | 22.304348 | 54 | 0.695906 | # 1. c. Visualize the results
from pathlib import Path
import matplotlib.pyplot as plt
output_folder = Path("output")
# read intermediate results
with open(output_folder / "xNumbers.txt",'r') as f:
xNum = [int(ele.strip()) for ele in f.readlines()]
with open(output_folder / "yNumbers.txt",'r') as f:
yNum = ... | 0 | 0 | 0 |
8c47558185e3e4480a104cedaaf10616e8918a93 | 1,159 | py | Python | env/Lib/site-packages/pylint/__init__.py | aammjian/cotton | f72b814f795f79a4054688e465c8b0ae5560f3b7 | [
"Apache-2.0"
] | 33 | 2020-10-05T01:04:55.000Z | 2021-06-24T01:52:31.000Z | env/Lib/site-packages/pylint/__init__.py | aammjian/cotton | f72b814f795f79a4054688e465c8b0ae5560f3b7 | [
"Apache-2.0"
] | 14 | 2020-10-07T03:15:12.000Z | 2021-01-15T11:53:29.000Z | env/Lib/site-packages/pylint/__init__.py | aammjian/cotton | f72b814f795f79a4054688e465c8b0ae5560f3b7 | [
"Apache-2.0"
] | 11 | 2020-07-31T08:20:43.000Z | 2020-08-21T04:08:29.000Z | # Copyright (c) 2008, 2012 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014, 2016-2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2014 Arun Persaud <arun@nubati.net>
# Copyright (c) 2015 Ionel Cristian Maries <contact@ionelmc.ro>
# Copyright (c) 2018 Nick Drozd <nicholasdrozd@gmail.com>
... | 25.755556 | 80 | 0.719586 | # Copyright (c) 2008, 2012 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014, 2016-2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2014 Arun Persaud <arun@nubati.net>
# Copyright (c) 2015 Ionel Cristian Maries <contact@ionelmc.ro>
# Copyright (c) 2018 Nick Drozd <nicholasdrozd@gmail.com>
... | 197 | 0 | 46 |
8f8d1f53882f5c349d916c1ca9e5d20ba3603757 | 3,357 | py | Python | tests/test_conf.py | hero0926/bottery | 1c724b867fa16708d59a3dbba5dd2c3de85147a9 | [
"MIT"
] | 250 | 2017-09-16T14:40:51.000Z | 2021-05-25T12:27:47.000Z | tests/test_conf.py | hero0926/bottery | 1c724b867fa16708d59a3dbba5dd2c3de85147a9 | [
"MIT"
] | 135 | 2017-09-16T14:48:53.000Z | 2019-07-25T12:10:46.000Z | tests/test_conf.py | hero0926/bottery | 1c724b867fa16708d59a3dbba5dd2c3de85147a9 | [
"MIT"
] | 78 | 2017-09-28T23:34:23.000Z | 2021-08-03T15:24:38.000Z | from unittest import mock
import pytest
from bottery.conf import (LazySettings, Settings, UserSettingsHolder,
lazy_obj_method)
@mock.patch('bottery.conf.Settings')
@mock.patch('bottery.conf.sys')
@mock.patch('bottery.conf.import_module')
@mock.patch('bottery.conf.os.getcwd', retur... | 25.431818 | 76 | 0.705392 | from unittest import mock
import pytest
from bottery.conf import (LazySettings, Settings, UserSettingsHolder,
lazy_obj_method)
def test_lazy_obj_method():
class Settings:
_wrapped = None
_setup = mock.Mock()
__dir__ = lazy_obj_method(dir)
settings = Setting... | 2,693 | 0 | 273 |
95a47d457bca06a93badfbde56f90233f91eb246 | 1,172 | py | Python | scripts/tiffs_from_h5.py | glemaitre/hexrd | b68b1ba72e0f480d29bdaae2adbd6c6e2380cc7c | [
"BSD-3-Clause"
] | 27 | 2020-02-18T12:15:08.000Z | 2022-03-24T17:53:46.000Z | scripts/tiffs_from_h5.py | glemaitre/hexrd | b68b1ba72e0f480d29bdaae2adbd6c6e2380cc7c | [
"BSD-3-Clause"
] | 259 | 2020-02-02T22:18:29.000Z | 2022-03-30T19:59:58.000Z | scripts/tiffs_from_h5.py | glemaitre/hexrd | b68b1ba72e0f480d29bdaae2adbd6c6e2380cc7c | [
"BSD-3-Clause"
] | 11 | 2020-02-18T12:14:44.000Z | 2022-03-04T16:19:11.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 31 18:30:53 2019
@author: bernier2
"""
import os
import numpy as np
from hexrd import imageseries
from skimage import io
# dirs
working_dir = '/Users/Shared/APS/PUP_AFRL_Feb19'
image_dir = os.path.join(working_dir, 'image_data')
samp_name = '... | 17.757576 | 66 | 0.66041 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 31 18:30:53 2019
@author: bernier2
"""
import os
import numpy as np
from hexrd import imageseries
from skimage import io
# dirs
working_dir = '/Users/Shared/APS/PUP_AFRL_Feb19'
image_dir = os.path.join(working_dir, 'image_data')
samp_name = '... | 0 | 0 | 0 |
785bac4558f57f6693632e4bc7ad5d2d9a110e05 | 45 | py | Python | fHDHR/__init__.py | crackers8199/fHDHR_Locast | cad9cc0bf64f70bbcd2e702a938794d4eacad6cf | [
"WTFPL"
] | null | null | null | fHDHR/__init__.py | crackers8199/fHDHR_Locast | cad9cc0bf64f70bbcd2e702a938794d4eacad6cf | [
"WTFPL"
] | null | null | null | fHDHR/__init__.py | crackers8199/fHDHR_Locast | cad9cc0bf64f70bbcd2e702a938794d4eacad6cf | [
"WTFPL"
] | null | null | null | # coding=utf-8
fHDHR_VERSION = "v0.3.0-beta"
| 15 | 29 | 0.688889 | # coding=utf-8
fHDHR_VERSION = "v0.3.0-beta"
| 0 | 0 | 0 |
5d52d54afc4948ea4b7febdfa8d2714599820780 | 2,781 | py | Python | test/test_compare_license_template_script.py | anshuldutt21/spdx_python_licensematching | a409d7e1d024bc64d13c831989e61e0e3355eea1 | [
"Apache-2.0"
] | 1 | 2021-05-31T03:09:12.000Z | 2021-05-31T03:09:12.000Z | test/test_compare_license_template_script.py | anshuldutt21/spdx_python_licensematching | a409d7e1d024bc64d13c831989e61e0e3355eea1 | [
"Apache-2.0"
] | 5 | 2020-09-17T14:41:48.000Z | 2020-10-07T07:24:11.000Z | test/test_compare_license_template_script.py | anshuldutt21/spdx_python_licensematching | a409d7e1d024bc64d13c831989e61e0e3355eea1 | [
"Apache-2.0"
] | null | null | null | import unittest
import os
from pathlib import Path
from normalize_license_text.normalize_class import NormalizeText
from configuration.config import PACKAGE_PATH
from compare_template_text.normalize_template_text import NormalizeTemplate
from compare_template_text.compare_normalized_files import CompareNormalizedFiles... | 40.304348 | 106 | 0.701546 | import unittest
import os
from pathlib import Path
from normalize_license_text.normalize_class import NormalizeText
from configuration.config import PACKAGE_PATH
from compare_template_text.normalize_template_text import NormalizeTemplate
from compare_template_text.compare_normalized_files import CompareNormalizedFiles... | 1,923 | 17 | 84 |
379dd518a9f7ab68255775b31015a88d60d5cd9d | 5,881 | py | Python | voipms/entities/clientsget.py | 4doom4/python-voipms | 3159ccfaf1ed9f5fef431fa3d2fdd54b9d3b1b3c | [
"MIT"
] | 14 | 2017-06-26T16:22:59.000Z | 2022-03-10T13:22:49.000Z | voipms/entities/clientsget.py | judahpaul16/python-voipms | 4e1eb51f927b9e0924091f7bbf25ccc2193c3bac | [
"MIT"
] | 8 | 2018-02-15T18:25:48.000Z | 2022-03-29T06:17:00.000Z | voipms/entities/clientsget.py | judahpaul16/python-voipms | 4e1eb51f927b9e0924091f7bbf25ccc2193c3bac | [
"MIT"
] | 8 | 2019-02-22T00:42:25.000Z | 2022-02-14T19:50:41.000Z | # coding=utf-8
"""
The Clients API endpoint get
Documentation: https://voip.ms/m/apidocs.php
"""
from voipms.baseapi import BaseApi
class ClientsGet(BaseApi):
"""
Get for the Clients endpoint.
"""
def __init__(self, *args, **kwargs):
"""
Initialize the endpoint
"""
sup... | 33.99422 | 114 | 0.606019 | # coding=utf-8
"""
The Clients API endpoint get
Documentation: https://voip.ms/m/apidocs.php
"""
from voipms.baseapi import BaseApi
class ClientsGet(BaseApi):
"""
Get for the Clients endpoint.
"""
def __init__(self, *args, **kwargs):
"""
Initialize the endpoint
"""
sup... | 0 | 0 | 0 |
c021a1ce6f4526c4f085e79c8722a08cd4e00528 | 560 | py | Python | altair/display/__init__.py | jakevdp/altair2 | 46d391034c5b72867c9e4d01f3a7c7c536533add | [
"BSD-3-Clause"
] | 2 | 2018-02-03T05:35:52.000Z | 2018-02-05T21:00:18.000Z | altair/display/__init__.py | jakevdp/altair2 | 46d391034c5b72867c9e4d01f3a7c7c536533add | [
"BSD-3-Clause"
] | null | null | null | altair/display/__init__.py | jakevdp/altair2 | 46d391034c5b72867c9e4d01f3a7c7c536533add | [
"BSD-3-Clause"
] | null | null | null | from .mixins import VegaDisplayMixin
from . import utils
| 24.347826 | 64 | 0.651786 | from .mixins import VegaDisplayMixin
from . import utils
class VegaLite(VegaDisplayMixin):
def __init__(self, spec, data=None):
self.spec = spec
self.data = data
def _get_spec_info(self):
spec = utils.prepare_vegalite_spec(self.spec, self.data)
return (spec, 'vega-lite')
cla... | 329 | 20 | 152 |
13b429b81010ca853bf0a7c55e57c20f41b5c98f | 1,540 | py | Python | matrix_traversal/utils.py | SiberiaMan/Avitotech | 0f17bedd157973ad3f5a3fa748a4892eb1a42204 | [
"MIT"
] | null | null | null | matrix_traversal/utils.py | SiberiaMan/Avitotech | 0f17bedd157973ad3f5a3fa748a4892eb1a42204 | [
"MIT"
] | null | null | null | matrix_traversal/utils.py | SiberiaMan/Avitotech | 0f17bedd157973ad3f5a3fa748a4892eb1a42204 | [
"MIT"
] | null | null | null | import validators
import aiohttp
from typing import List
from typing import Optional
def check_url(url: str) -> Optional[bool]:
"""
This function checks is valid URL or not
:param url: URL
:return: True if is valid, else False
"""
if validators.url(url):
return True
return False
... | 29.056604 | 87 | 0.625974 | import validators
import aiohttp
from typing import List
from typing import Optional
def check_url(url: str) -> Optional[bool]:
"""
This function checks is valid URL or not
:param url: URL
:return: True if is valid, else False
"""
if validators.url(url):
return True
return False
... | 0 | 0 | 0 |
342069d7d55981fcab3a1c5635c7a9b5c1fab879 | 5,886 | py | Python | cats/v2/server/server.py | Cifrazia/cats-python | de75b8b5b6ab60d7e250cb4c041c1515aa749d79 | [
"MIT"
] | 2 | 2021-10-04T05:39:03.000Z | 2021-10-07T06:44:19.000Z | cats/v2/server/server.py | Cifrazia/cats-python | de75b8b5b6ab60d7e250cb4c041c1515aa749d79 | [
"MIT"
] | 3 | 2021-10-07T07:07:48.000Z | 2021-12-27T14:04:51.000Z | cats/v2/server/server.py | Cifrazia/cats-python | de75b8b5b6ab60d7e250cb4c041c1515aa749d79 | [
"MIT"
] | 2 | 2021-10-01T20:58:25.000Z | 2021-10-04T05:40:35.000Z | import asyncio
import socket
import ssl
from contextlib import asynccontextmanager
from logging import getLogger
from typing import Callable
from tornado.iostream import IOStream
from tornado.tcpserver import TCPServer
from tornado.testing import bind_unused_port
from cats.errors import CatsError
from cats.utils impo... | 31.142857 | 89 | 0.579001 | import asyncio
import socket
import ssl
from contextlib import asynccontextmanager
from logging import getLogger
from typing import Callable
from tornado.iostream import IOStream
from tornado.tcpserver import TCPServer
from tornado.testing import bind_unused_port
from cats.errors import CatsError
from cats.utils impo... | 4,619 | 614 | 23 |
66ee06f9edf175407996d4f1645346491097442e | 3,900 | py | Python | activity/prepare_data.py | gorgitko/MI-PDD_2016 | 6aabf0d588ee62814cd625526795cacd2810058a | [
"MIT"
] | null | null | null | activity/prepare_data.py | gorgitko/MI-PDD_2016 | 6aabf0d588ee62814cd625526795cacd2810058a | [
"MIT"
] | null | null | null | activity/prepare_data.py | gorgitko/MI-PDD_2016 | 6aabf0d588ee62814cd625526795cacd2810058a | [
"MIT"
] | null | null | null | import sys
from pathlib import Path
sys.path.append(str(Path('.').absolute().parent))
from helper_functions import encode_smiles, save_smiles_charcodes, canonize_smiles
import pandas as pd
import numpy as np
def save_active_compounds(input_file, output_file, encode=True, longest_smiles=0, smiles_charcodes_file="data... | 39.393939 | 159 | 0.698974 | import sys
from pathlib import Path
sys.path.append(str(Path('.').absolute().parent))
from helper_functions import encode_smiles, save_smiles_charcodes, canonize_smiles
import pandas as pd
import numpy as np
def save_active_compounds(input_file, output_file, encode=True, longest_smiles=0, smiles_charcodes_file="data... | 0 | 0 | 0 |
154e90498cf56f92c3e1e5d17dc97bd08d50c31d | 438 | py | Python | src/apetest/version.py | boxingbeetle/apetest | c6dd7aaca014c64eec4bde7e755c4a3dec72404a | [
"BSD-3-Clause"
] | 6 | 2019-04-01T09:42:31.000Z | 2020-05-20T15:23:17.000Z | src/apetest/version.py | boxingbeetle/apetest | c6dd7aaca014c64eec4bde7e755c4a3dec72404a | [
"BSD-3-Clause"
] | 31 | 2019-02-04T11:38:32.000Z | 2022-03-03T02:51:15.000Z | src/apetest/version.py | boxingbeetle/apetest | c6dd7aaca014c64eec4bde7e755c4a3dec72404a | [
"BSD-3-Clause"
] | null | null | null | # SPDX-License-Identifier: BSD-3-Clause
"""Package version info."""
from typing import TYPE_CHECKING
# On Python 3.8+, use importlib.metadata from the standard library.
# On older versions, a compatibility package can be installed from PyPI.
try:
if not TYPE_CHECKING:
import importlib.metadata as importl... | 27.375 | 72 | 0.773973 | # SPDX-License-Identifier: BSD-3-Clause
"""Package version info."""
from typing import TYPE_CHECKING
# On Python 3.8+, use importlib.metadata from the standard library.
# On older versions, a compatibility package can be installed from PyPI.
try:
if not TYPE_CHECKING:
import importlib.metadata as importl... | 0 | 0 | 0 |
c50e420a81401ab570df899e6cf676f21d07adb7 | 2,476 | py | Python | data/dataset/wider_mafa_face.py | donnyyou/centerX | 6e381cb669a6014d02e31a43915271237690531c | [
"Apache-2.0"
] | 350 | 2020-12-01T09:55:16.000Z | 2020-12-23T13:47:43.000Z | data/dataset/wider_mafa_face.py | powerlic/centerX | 1073753533f26483c3ab053a7d8753708fcacde7 | [
"Apache-2.0"
] | 39 | 2020-12-24T13:42:29.000Z | 2022-02-10T01:09:56.000Z | data/dataset/wider_mafa_face.py | powerlic/centerX | 1073753533f26483c3ab053a7d8753708fcacde7 | [
"Apache-2.0"
] | 49 | 2020-12-01T11:39:14.000Z | 2020-12-21T01:45:39.000Z | import os
import json
import cv2
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.structures import BoxMode
import pickle
import xml.etree.ElementTree as ET
from typing import List, Tuple, Union
from fvcore.common.file_io import PathManager
import logging
__all__ = ["load_face_instances", "... | 33.013333 | 112 | 0.620759 | import os
import json
import cv2
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.structures import BoxMode
import pickle
import xml.etree.ElementTree as ET
from typing import List, Tuple, Union
from fvcore.common.file_io import PathManager
import logging
__all__ = ["load_face_instances", "... | 259 | 0 | 23 |
bfc4f24e4344f53688f6ad04ec5eda7354d3977a | 191 | py | Python | datasets/__init__.py | marsggbo/CovidNet3D | 0aeca91a775f938a0e568dd88d8162473dacf3ce | [
"MIT"
] | 5 | 2021-02-23T06:43:31.000Z | 2021-07-05T15:24:05.000Z | datasets/__init__.py | etherx-dev/CovidNet3D | b107d7d965cad07f1890ee492857273f3468cc01 | [
"MIT"
] | 1 | 2021-06-08T21:06:10.000Z | 2021-06-08T21:06:10.000Z | datasets/__init__.py | etherx-dev/CovidNet3D | b107d7d965cad07f1890ee492857273f3468cc01 | [
"MIT"
] | 4 | 2021-02-01T03:29:16.000Z | 2021-08-05T09:13:37.000Z | from .build import *
from .common_datasets import *
from .transforms import *
from .albumentations_transforms import *
from .ct_data import *
from .ct_transforms import *
from .utils import * | 27.285714 | 40 | 0.78534 | from .build import *
from .common_datasets import *
from .transforms import *
from .albumentations_transforms import *
from .ct_data import *
from .ct_transforms import *
from .utils import * | 0 | 0 | 0 |
3285f565ffab54ab3ae9b30830d036649c61a32d | 5,697 | py | Python | pyaugmecon/model.py | vishalbelsare/pyaugmecon | b9b6310b66007d1be7035f50a7e2691e7669f74e | [
"MIT"
] | 5 | 2021-05-29T20:18:06.000Z | 2022-01-20T08:56:26.000Z | pyaugmecon/model.py | vishalbelsare/pyaugmecon | b9b6310b66007d1be7035f50a7e2691e7669f74e | [
"MIT"
] | null | null | null | pyaugmecon/model.py | vishalbelsare/pyaugmecon | b9b6310b66007d1be7035f50a7e2691e7669f74e | [
"MIT"
] | 3 | 2021-08-20T19:27:28.000Z | 2022-01-21T13:42:49.000Z | import os
import logging
import cloudpickle
import numpy as np
import pyomo.environ as pyo
from pyaugmecon.options import Options
from pyaugmecon.helper import Counter, ProgressBar
from pyomo.core.base import (
Var,
ConstraintList,
maximize,
minimize,
Set,
Param,
NonNegativeReals,
Any,
)... | 31.475138 | 88 | 0.582236 | import os
import logging
import cloudpickle
import numpy as np
import pyomo.environ as pyo
from pyaugmecon.options import Options
from pyaugmecon.helper import Counter, ProgressBar
from pyomo.core.base import (
Var,
ConstraintList,
maximize,
minimize,
Set,
Param,
NonNegativeReals,
Any,
)... | 4,868 | -1 | 508 |
c4d42648c717a474389b6ca6d39d2e3139ef1739 | 649 | py | Python | server/websocket.py | ikiler/MagicRobot | 5e0764060b61aa155082b3387c033430bd0ec8b6 | [
"MIT"
] | null | null | null | server/websocket.py | ikiler/MagicRobot | 5e0764060b61aa155082b3387c033430bd0ec8b6 | [
"MIT"
] | null | null | null | server/websocket.py | ikiler/MagicRobot | 5e0764060b61aa155082b3387c033430bd0ec8b6 | [
"MIT"
] | null | null | null | from tornado.websocket import WebSocketHandler
| 24.037037 | 50 | 0.620955 | from tornado.websocket import WebSocketHandler
class SocketHandler(WebSocketHandler):
def __init__(self):
print("")
users = set() # 用来存放在线用户的容器
def open(self):
self.users.add(self) # 建立连接后添加用户到容器中
for u in self.users: # 向已在线用户发送消息
u.write_message("hello")
def... | 500 | 208 | 23 |
f52617a12608ce90e4e74a77b0a04560f750f451 | 1,365 | py | Python | setup.py | kgaughan/uwhoisd | 0b781e2eb6f6230ac5e64a79985b9d119e495164 | [
"MIT"
] | 32 | 2015-05-13T11:02:29.000Z | 2021-12-24T08:17:16.000Z | setup.py | kgaughan/uwhoisd | 0b781e2eb6f6230ac5e64a79985b9d119e495164 | [
"MIT"
] | 15 | 2015-11-25T18:58:08.000Z | 2020-03-24T09:48:51.000Z | setup.py | kgaughan/uwhoisd | 0b781e2eb6f6230ac5e64a79985b9d119e495164 | [
"MIT"
] | 3 | 2015-02-01T14:43:34.000Z | 2018-08-27T10:10:23.000Z | #!/usr/bin/env python3
import os.path
from setuptools import find_packages, setup
def read(filename):
"""Read files relative to this file."""
full_path = os.path.join(os.path.dirname(__file__), filename)
with open(full_path, "r") as fh:
return fh.read()
setup(
name="uwhoisd",
version="... | 30.333333 | 65 | 0.625641 | #!/usr/bin/env python3
import os.path
from setuptools import find_packages, setup
def read(filename):
"""Read files relative to this file."""
full_path = os.path.join(os.path.dirname(__file__), filename)
with open(full_path, "r") as fh:
return fh.read()
setup(
name="uwhoisd",
version="... | 0 | 0 | 0 |
202f6e0f854d82bdb8312b85ad45d6d42e389d12 | 1,115 | py | Python | infra/controller.py | tukeJonny/NTPAmpMitigator | 91abcfb107166b411596b26678a03a037165f188 | [
"MIT"
] | 1 | 2020-06-20T04:21:15.000Z | 2020-06-20T04:21:15.000Z | infra/controller.py | tukeJonny/NTPAmpMitigator | 91abcfb107166b411596b26678a03a037165f188 | [
"MIT"
] | null | null | null | infra/controller.py | tukeJonny/NTPAmpMitigator | 91abcfb107166b411596b26678a03a037165f188 | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
#from ryu.app import simple_switch_13
#import mitigate_switch_13#my custom simple_switch_13
from ryu.controller import ofp_event
from ryu.controller.handler import (
MAIN_DISPATCHER,
DEAD_DISPATCHER
)
from ryu.controller.handler import set_ev_cls
MITIGATE_MODE_ON = False
if MITIGATE_MOD... | 30.972222 | 82 | 0.715695 | #-*- coding: utf-8 -*-
#from ryu.app import simple_switch_13
#import mitigate_switch_13#my custom simple_switch_13
from ryu.controller import ofp_event
from ryu.controller.handler import (
MAIN_DISPATCHER,
DEAD_DISPATCHER
)
from ryu.controller.handler import set_ev_cls
MITIGATE_MODE_ON = False
if MITIGATE_MOD... | 434 | 151 | 23 |
501edd92a20a95745c9193c57c47f62a89b7c69c | 2,888 | py | Python | module/pages/gas_info.py | medivhXu/AT-M | e1c215ae95085d1be24a7566fd365eb6bfae5e53 | [
"Apache-2.0"
] | 1 | 2019-06-05T08:53:47.000Z | 2019-06-05T08:53:47.000Z | module/pages/gas_info.py | medivhXu/AT-M | e1c215ae95085d1be24a7566fd365eb6bfae5e53 | [
"Apache-2.0"
] | null | null | null | module/pages/gas_info.py | medivhXu/AT-M | e1c215ae95085d1be24a7566fd365eb6bfae5e53 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
"""
@author: Medivh Xu
@file: gas.py
@time: 2020-03-30 15:29
"""
from base.element_manager import *
class GasInfo(BasePage):
"""油站详情"""
gun_name_btn = (By.ID, 'com.xxx.xxx:id/gunName')
money_input_box = (By.ID, 'com.xxx.xxx:id/et_input_money')
money_btn = (By.... | 29.469388 | 115 | 0.601108 | #!/usr/bin/env python3
# encoding: utf-8
"""
@author: Medivh Xu
@file: gas.py
@time: 2020-03-30 15:29
"""
from base.element_manager import *
class GasInfo(BasePage):
"""油站详情"""
gun_name_btn = (By.ID, 'com.xxx.xxx:id/gunName')
money_input_box = (By.ID, 'com.xxx.xxx:id/et_input_money')
money_btn = (By.... | 0 | 0 | 0 |
5df2e1d7267e97e10be3b5bc51334ba0353d8569 | 1,169 | py | Python | grafana_backup/save.py | suhlig/grafana-backup-tool | 3e1e280756efedd2530d5240dc2ec6d3f37d65c9 | [
"MIT"
] | null | null | null | grafana_backup/save.py | suhlig/grafana-backup-tool | 3e1e280756efedd2530d5240dc2ec6d3f37d65c9 | [
"MIT"
] | null | null | null | grafana_backup/save.py | suhlig/grafana-backup-tool | 3e1e280756efedd2530d5240dc2ec6d3f37d65c9 | [
"MIT"
] | null | null | null | from grafana_backup.save_dashboards import main as save_dashboards
from grafana_backup.save_datasources import main as save_datasources
from grafana_backup.save_folders import main as save_folders
from grafana_backup.save_alert_channels import main as save_alert_channels
from grafana_backup.archive import main as archi... | 40.310345 | 74 | 0.706587 | from grafana_backup.save_dashboards import main as save_dashboards
from grafana_backup.save_datasources import main as save_datasources
from grafana_backup.save_folders import main as save_folders
from grafana_backup.save_alert_channels import main as save_alert_channels
from grafana_backup.archive import main as archi... | 822 | 0 | 23 |
bd3d12d49d8826b3181b830e13cb243a0218dffb | 14,182 | py | Python | main.py | ks-tec/Hydroponic | d9347f82698841d85c0a45908e8671b36c50ffce | [
"MIT"
] | 1 | 2021-05-27T13:32:45.000Z | 2021-05-27T13:32:45.000Z | main.py | ks-tec/Hydroponic | d9347f82698841d85c0a45908e8671b36c50ffce | [
"MIT"
] | null | null | null | main.py | ks-tec/Hydroponic | d9347f82698841d85c0a45908e8671b36c50ffce | [
"MIT"
] | null | null | null | # This is Hydroponic project in MicroPython with the ESP32 board.
# Using devices are SSD1306 OLED, DS18B20, BME280, and Touch Pin.
#
# Copyright (c) 2020 ks-tec
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to ... | 34.506083 | 140 | 0.675152 | # This is Hydroponic project in MicroPython with the ESP32 board.
# Using devices are SSD1306 OLED, DS18B20, BME280, and Touch Pin.
#
# Copyright (c) 2020 ks-tec
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to ... | 0 | 0 | 0 |
f19d270dc48a4d8e462331fd511b2c2742b7e7b5 | 689 | py | Python | stats_job/database_test.py | arxcruz/tripleo-stats-backend | c4cfb971bbc8e67825d357df2dc9214fda81f2fa | [
"Apache-2.0"
] | null | null | null | stats_job/database_test.py | arxcruz/tripleo-stats-backend | c4cfb971bbc8e67825d357df2dc9214fda81f2fa | [
"Apache-2.0"
] | null | null | null | stats_job/database_test.py | arxcruz/tripleo-stats-backend | c4cfb971bbc8e67825d357df2dc9214fda81f2fa | [
"Apache-2.0"
] | null | null | null | import datetime
from sqlalchemy import Date, func, cast
from sqlalchemy.orm import sessionmaker
from database.model import engine
from database.model import JobRun
if __name__ == '__main__':
show_data()
| 28.708333 | 107 | 0.692308 | import datetime
from sqlalchemy import Date, func, cast
from sqlalchemy.orm import sessionmaker
from database.model import engine
from database.model import JobRun
def show_data():
Session = sessionmaker(engine)
session = Session()
query = session.query(func.count().label('count'), JobRun.failure_type).... | 456 | 0 | 23 |
30b3a8a367927c57abd32d63596d445e1516ee84 | 9,496 | py | Python | qlknn/dataset/data_io.py | Karel-van-de-Plassche/QLKNN-develop | f2d29be625c2ddbddad6c1e98e5c03a43cf2797f | [
"MIT"
] | null | null | null | qlknn/dataset/data_io.py | Karel-van-de-Plassche/QLKNN-develop | f2d29be625c2ddbddad6c1e98e5c03a43cf2797f | [
"MIT"
] | null | null | null | qlknn/dataset/data_io.py | Karel-van-de-Plassche/QLKNN-develop | f2d29be625c2ddbddad6c1e98e5c03a43cf2797f | [
"MIT"
] | 2 | 2018-02-28T14:18:43.000Z | 2018-11-26T11:06:08.000Z | import gc
from collections import OrderedDict
import warnings
import re
import pandas as pd
import numpy as np
from IPython import embed
try:
import dask.dataframe as dd
has_dask = True
except ImportError:
warnings.warn('Dask not found')
has_dask = False
try:
profile
except NameError:
from qlk... | 40.931034 | 165 | 0.542544 | import gc
from collections import OrderedDict
import warnings
import re
import pandas as pd
import numpy as np
from IPython import embed
try:
import dask.dataframe as dd
has_dask = True
except ImportError:
warnings.warn('Dask not found')
has_dask = False
try:
profile
except NameError:
from qlk... | 8,807 | 0 | 113 |
d9329a55db13e5baab08945f156f37224d82a09e | 9,688 | py | Python | src/nn.py | mountain/planetarium | 14c5a75f9ac0be36f28d059c7bf7a77635d617da | [
"MIT"
] | 1 | 2018-03-03T18:58:01.000Z | 2018-03-03T18:58:01.000Z | src/nn.py | mountain/planetarium | 14c5a75f9ac0be36f28d059c7bf7a77635d617da | [
"MIT"
] | null | null | null | src/nn.py | mountain/planetarium | 14c5a75f9ac0be36f28d059c7bf7a77635d617da | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import matplotlib
matplotlib.use('Agg')
import sys
import time
import numpy as np
from physics import ode, hamilton, nbody
import unit.au as au
from os import environ
xp = np
if environ.get('CUDA_HOME') is not None:
xp = np
import torch as th
import torch.nn as nn
import torch.optim a... | 29.357576 | 130 | 0.54872 | # -*- coding: utf-8 -*-
import matplotlib
matplotlib.use('Agg')
import sys
import time
import numpy as np
from physics import ode, hamilton, nbody
import unit.au as au
from os import environ
xp = np
if environ.get('CUDA_HOME') is not None:
xp = np
import torch as th
import torch.nn as nn
import torch.optim a... | 6,617 | 5 | 289 |
49ad0529acc7b30e818083fbddf61cedb7ec9149 | 1,616 | py | Python | test_question4.py | fmakawa/Practice | 7f6eaa1dde4e46088ca5dcee76de1bb56a363238 | [
"MIT"
] | null | null | null | test_question4.py | fmakawa/Practice | 7f6eaa1dde4e46088ca5dcee76de1bb56a363238 | [
"MIT"
] | null | null | null | test_question4.py | fmakawa/Practice | 7f6eaa1dde4e46088ca5dcee76de1bb56a363238 | [
"MIT"
] | null | null | null | """
Question 4
Level 1
Question:
Write a program which accepts a sequence of comma-separated numbers from console and generate a list and a tuple which contains every number.
Suppose the following input is supplied to the program:
34,67,55,33,12,98
Then, the output should be:
['34', '67', '55', '33', '12', '98']
('34'... | 36.727273 | 141 | 0.61448 | """
Question 4
Level 1
Question:
Write a program which accepts a sequence of comma-separated numbers from console and generate a list and a tuple which contains every number.
Suppose the following input is supplied to the program:
34,67,55,33,12,98
Then, the output should be:
['34', '67', '55', '33', '12', '98']
('34'... | 587 | 289 | 23 |
938385e28f9b2ed19e39302cb8539a14a9ba38f9 | 225 | py | Python | ex007.py | EduFelix/Exercicios-Python | 4dc6a33653f8171684a8628f5629b137b4bfef94 | [
"MIT"
] | null | null | null | ex007.py | EduFelix/Exercicios-Python | 4dc6a33653f8171684a8628f5629b137b4bfef94 | [
"MIT"
] | null | null | null | ex007.py | EduFelix/Exercicios-Python | 4dc6a33653f8171684a8628f5629b137b4bfef94 | [
"MIT"
] | null | null | null | n1 = float(input('Digite a primeira nota?'))
n2 = float(input('Digite a segunda nota?'))
media = (n1 + n2)/ 2
print("Primeira nota do aluno {}, \n Segunda nota do aluno {}\n Média das notas do aluno {}".format(n1, n2, media)) | 56.25 | 115 | 0.666667 | n1 = float(input('Digite a primeira nota?'))
n2 = float(input('Digite a segunda nota?'))
media = (n1 + n2)/ 2
print("Primeira nota do aluno {}, \n Segunda nota do aluno {}\n Média das notas do aluno {}".format(n1, n2, media)) | 0 | 0 | 0 |
06256fd0dd0875fdd476dc40b3f7caf74bf649c8 | 2,224 | py | Python | algorithms_comparisons/analysis/benchmark.py | eryktrzeciakiewicz/algorithms-comparisons | 101cbb4ccf13c3dc607b0e6c192ab2237c78b13e | [
"MIT"
] | null | null | null | algorithms_comparisons/analysis/benchmark.py | eryktrzeciakiewicz/algorithms-comparisons | 101cbb4ccf13c3dc607b0e6c192ab2237c78b13e | [
"MIT"
] | null | null | null | algorithms_comparisons/analysis/benchmark.py | eryktrzeciakiewicz/algorithms-comparisons | 101cbb4ccf13c3dc607b0e6c192ab2237c78b13e | [
"MIT"
] | null | null | null | import sys
import abc
from algorithms_comparisons.utility.timer import timed
| 38.344828 | 99 | 0.692896 | import sys
import abc
from algorithms_comparisons.utility.timer import timed
class Benchmark(abc.ABC):
@abc.abstractmethod
def measure_time_of_execution(self,timed_functions, parameters):
pass
@abc.abstractmethod
def build_output(self, functions, time_results, parameters):
pass
... | 1,750 | 220 | 176 |
9d3e5450887e6602ff1d30172f1a8cc5caf85669 | 78 | py | Python | main.py | BigSmokeCuba/BotTelegram | 65636ff1ce1bee27575144b21ac9bdd3c69a2735 | [
"MIT"
] | null | null | null | main.py | BigSmokeCuba/BotTelegram | 65636ff1ce1bee27575144b21ac9bdd3c69a2735 | [
"MIT"
] | null | null | null | main.py | BigSmokeCuba/BotTelegram | 65636ff1ce1bee27575144b21ac9bdd3c69a2735 | [
"MIT"
] | null | null | null | import bot.app
from threading import Thread
Thread(target=bot.app).start() | 19.5 | 30 | 0.769231 | import bot.app
from threading import Thread
Thread(target=bot.app).start() | 0 | 0 | 0 |
5bb4f222e235e9d7070a669c4bfcfbbeadb8de75 | 1,406 | py | Python | webapp/blaster/quickstart.py | 128technology/blaster | ed4f94a8d068e7ee522e246f61ba3425a68041d2 | [
"MIT"
] | null | null | null | webapp/blaster/quickstart.py | 128technology/blaster | ed4f94a8d068e7ee522e246f61ba3425a68041d2 | [
"MIT"
] | 17 | 2020-09-16T09:32:32.000Z | 2021-07-22T18:54:13.000Z | webapp/blaster/quickstart.py | 128technology/blaster | ed4f94a8d068e7ee522e246f61ba3425a68041d2 | [
"MIT"
] | null | null | null | import functools
from flask import (
current_app, Blueprint, flash, Flask, g, redirect, render_template, request, session, url_for, jsonify
)
import json
from blaster.db import get_db
from . import constants
bp = Blueprint('quickstart', __name__, url_prefix='/quickstart')
@bp.route('/<instance>')
| 33.47619 | 139 | 0.668563 | import functools
from flask import (
current_app, Blueprint, flash, Flask, g, redirect, render_template, request, session, url_for, jsonify
)
import json
from blaster.db import get_db
from . import constants
bp = Blueprint('quickstart', __name__, url_prefix='/quickstart')
@bp.route('/<instance>')
def instanti... | 1,076 | 0 | 22 |
251449e248fb046c8e513ed9c8761edc71196595 | 306 | py | Python | close-server.py | cyanobacterium/Minecraft-Automated-Forge-Server | 587df4dc8100415a6b0d87d4f1c144c98a88098a | [
"MIT"
] | null | null | null | close-server.py | cyanobacterium/Minecraft-Automated-Forge-Server | 587df4dc8100415a6b0d87d4f1c144c98a88098a | [
"MIT"
] | 1 | 2016-09-17T13:04:55.000Z | 2016-09-19T18:34:29.000Z | close-server.py | cyanobacterium/Minecraft-Automated-Forge-Server | 587df4dc8100415a6b0d87d4f1c144c98a88098a | [
"MIT"
] | null | null | null |
import os
local_dir = os.path.dirname(os.path.realpath(__file__))
dir_name = get_filename(local_dir)
command_file = local_dir+"/command-stack.txt"
f_out = open(command_file, "w")
f_out.write("stop\n")
f_out.close()
| 19.125 | 56 | 0.673203 |
import os
def get_filename(path):
return path.replace("\\","/").split("/")[-1]
local_dir = os.path.dirname(os.path.realpath(__file__))
dir_name = get_filename(local_dir)
command_file = local_dir+"/command-stack.txt"
f_out = open(command_file, "w")
f_out.write("stop\n")
f_out.close()
| 49 | 0 | 25 |
31e3fc4c3daa23bcf9ebfa1f70cac64480721f36 | 405 | py | Python | app/django/photo/migrations/0004_rename_dimentions_descriptionimage_dimensions.py | Murabei-OpenSource-Codes/ai-photo-sampler--backend | c098a5cb544da89623a000d87daa18f22cfecfce | [
"BSD-3-Clause"
] | null | null | null | app/django/photo/migrations/0004_rename_dimentions_descriptionimage_dimensions.py | Murabei-OpenSource-Codes/ai-photo-sampler--backend | c098a5cb544da89623a000d87daa18f22cfecfce | [
"BSD-3-Clause"
] | null | null | null | app/django/photo/migrations/0004_rename_dimentions_descriptionimage_dimensions.py | Murabei-OpenSource-Codes/ai-photo-sampler--backend | c098a5cb544da89623a000d87daa18f22cfecfce | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.2.4 on 2022-04-12 02:21
from django.db import migrations
| 21.315789 | 71 | 0.62716 | # Generated by Django 3.2.4 on 2022-04-12 02:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('photo', '0003_rename_dimension_descriptionimage_dimentions'),
]
operations = [
migrations.RenameField(
model_name='descriptionimage',
... | 0 | 299 | 23 |