hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f92cdd22cf4844b160d0d875a200886844e27e74 | 1,111 | py | Python | anchore_engine/subsys/events/__init__.py | rbrady/anchore-engine | 5a5c492d76b5f911e60be422912fe8d42a74872b | [
"Apache-2.0"
] | 1,484 | 2017-09-11T19:08:42.000Z | 2022-03-29T07:47:44.000Z | anchore_engine/subsys/events/__init__.py | rbrady/anchore-engine | 5a5c492d76b5f911e60be422912fe8d42a74872b | [
"Apache-2.0"
] | 913 | 2017-09-27T20:37:53.000Z | 2022-03-29T17:21:28.000Z | anchore_engine/subsys/events/__init__.py | rbrady/anchore-engine | 5a5c492d76b5f911e60be422912fe8d42a74872b | [
"Apache-2.0"
] | 294 | 2017-09-12T16:54:03.000Z | 2022-03-14T01:28:51.000Z | """
Holds event definitions to be used by services for generating events
"""
## TODO: Update refs in __init__ to types.py and fix code instances for invocation of events. Then, add API call.
| 25.837209 | 113 | 0.766877 | """
Holds event definitions to be used by services for generating events
"""
from .base import EventBase
from .types import (
ActivePolicyBundleContentChanged,
ActivePolicyBundleIdChanged,
FeedGroupSyncCompleted,
FeedGroupSyncFailed,
FeedGroupSyncStarted,
FeedSyncCompleted,
FeedSyncFailed,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 874 | 45 |
8ca45349b1eb064280c58e148b0a0e9c51b9dece | 442 | py | Python | ambari-agent/src/main/python/resource_management/core/resources/packaging.py | flipkart-incubator/incubator-ambari | bf747346312170834c6beb89a60c8624b47aa288 | [
"Apache-2.0"
] | 2 | 2015-07-29T22:50:10.000Z | 2021-11-10T16:05:59.000Z | ambari-agent/src/main/python/resource_management/core/resources/packaging.py | boydos/incubator-ambari | e10d85756dd55729c20aeda2baa0d6c93c4ca31d | [
"Apache-2.0"
] | 1 | 2021-11-04T13:31:30.000Z | 2021-11-04T13:31:30.000Z | ambari-agent/src/main/python/resource_management/core/resources/packaging.py | isabella232/incubator-ambari | bf747346312170834c6beb89a60c8624b47aa288 | [
"Apache-2.0"
] | 9 | 2016-01-08T21:11:06.000Z | 2021-11-10T16:05:51.000Z | __all__ = ["Package"]
| 34 | 88 | 0.773756 | __all__ = ["Package"]
from resource_management.core.base import Resource, ForcedListArgument, ResourceArgument
class Package(Resource):
action = ForcedListArgument(default="install")
package_name = ResourceArgument(default=lambda obj: obj.name)
location = ResourceArgument(default=lambda obj: obj.package_name)
... | 0 | 0 | 0 | 306 | 0 | 0 | 0 | 67 | 46 |
e324e7c1b36c5460061a6797dbb9a6ac44adb3a8 | 1,391 | py | Python | embedding.py | hyunahOh/mlflow-hyperopts-keras | 05cee0dcbeb03b469b60f495e7806946690f76bf | [
"Apache-2.0"
] | null | null | null | embedding.py | hyunahOh/mlflow-hyperopts-keras | 05cee0dcbeb03b469b60f495e7806946690f76bf | [
"Apache-2.0"
] | 11 | 2020-03-24T18:22:22.000Z | 2022-02-10T00:43:58.000Z | embedding.py | hyunahOh/mlflow-hyperopts-keras | 05cee0dcbeb03b469b60f495e7806946690f76bf | [
"Apache-2.0"
] | null | null | null | '''This code is for Embedding face
author : Hyunah Oh
data : 2020.01.22
flow : Detection -> Alignment -> Normalization -> Embedding(load pretrained) -> Training Classification
'''
import numpy as np
from data import load_metadata
from model import create_model
from align import AlignDlib
from sklearn.externals impo... | 31.613636 | 104 | 0.721783 | '''This code is for Embedding face
author : Hyunah Oh
data : 2020.01.22
flow : Detection -> Alignment -> Normalization -> Embedding(load pretrained) -> Training Classification
'''
import numpy as np
import cv2
from data import load_metadata
from model import create_model
from align import AlignDlib
from sklearn.ext... | 0 | 0 | 0 | 0 | 0 | 301 | 0 | -11 | 67 |
b879f1e8e657c94441abdc0112a00c1c4aba52e5 | 3,979 | py | Python | pw_console/py/text_formatting_test.py | curtin-space/pigweed | fe2e1743e03fabd2676f01d9de0ac9d34a426076 | [
"Apache-2.0"
] | 86 | 2021-03-09T23:49:40.000Z | 2022-03-30T08:14:51.000Z | pw_console/py/text_formatting_test.py | curtin-space/pigweed | fe2e1743e03fabd2676f01d9de0ac9d34a426076 | [
"Apache-2.0"
] | 4 | 2021-07-27T20:32:03.000Z | 2022-03-08T10:39:07.000Z | pw_console/py/text_formatting_test.py | curtin-space/pigweed | fe2e1743e03fabd2676f01d9de0ac9d34a426076 | [
"Apache-2.0"
] | 22 | 2021-03-11T15:15:47.000Z | 2022-02-09T06:16:36.000Z | # Copyright 2021 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 41.884211 | 79 | 0.520483 | # Copyright 2021 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 0 | 3,054 | 0 | 96 | 0 | 0 | 0 | 51 | 84 |
4b3cb441266c341a2e56d44ffcb1690ec5abff9b | 4,327 | py | Python | FirstQT/main.py | BlackIQ/Cute | 5835e989d661f23b04b6e436589c6e844167522e | [
"Apache-2.0"
] | 5 | 2021-11-21T10:59:47.000Z | 2022-01-16T11:57:14.000Z | FirstQT/main.py | BlackIQ/Cute | 5835e989d661f23b04b6e436589c6e844167522e | [
"Apache-2.0"
] | null | null | null | FirstQT/main.py | BlackIQ/Cute | 5835e989d661f23b04b6e436589c6e844167522e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'amir.ui'
#
# Created by: PyQt5 UI code generator 5.14.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtWidgets
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.a... | 40.820755 | 121 | 0.629073 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'amir.ui'
#
# Created by: PyQt5 UI code generator 5.14.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
... | 0 | 0 | 0 | 3,815 | 0 | 0 | 0 | 15 | 25 |
6d7f765d388547e0941cf83e32109d3d03464cd6 | 23,382 | py | Python | zhmccli/_cmd_cpc.py | mhartmay/zhmccli | 9cb627406c38cf32b0a07cea6d50ac6b6a505802 | [
"Apache-2.0"
] | null | null | null | zhmccli/_cmd_cpc.py | mhartmay/zhmccli | 9cb627406c38cf32b0a07cea6d50ac6b6a505802 | [
"Apache-2.0"
] | null | null | null | zhmccli/_cmd_cpc.py | mhartmay/zhmccli | 9cb627406c38cf32b0a07cea6d50ac6b6a505802 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2019 IBM Corp. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 36.195046 | 80 | 0.67274 | # Copyright 2016-2019 IBM Corp. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 0 | 9,644 | 0 | 0 | 0 | 9,414 | 0 | 164 | 551 |
13fa62ca2dc5b21125cd0a56d545b18d469c9039 | 3,766 | py | Python | test/integration/python/tornado/vanilla_server.py | ariasheets-wk/frugal | 81d41af7fb573c1f97afea99a1b4dfa6ccae29e8 | [
"Apache-2.0"
] | 144 | 2017-08-17T15:51:58.000Z | 2022-01-14T21:36:55.000Z | test/integration/python/tornado/vanilla_server.py | ariasheets-wk/frugal | 81d41af7fb573c1f97afea99a1b4dfa6ccae29e8 | [
"Apache-2.0"
] | 930 | 2017-08-17T17:53:30.000Z | 2022-03-28T14:04:49.000Z | test/integration/python/tornado/vanilla_server.py | ariasheets-wk/frugal | 81d41af7fb573c1f97afea99a1b4dfa6ccae29e8 | [
"Apache-2.0"
] | 77 | 2017-08-17T15:54:31.000Z | 2021-12-25T15:18:34.000Z | from __future__ import print_function
import sys
sys.path.append('..')
sys.path.append('gen-py')
# Explicitly importing from gen_py_tornado
# Use the tornado pub/sub since vanilla python code generation doesn't support it
# Clients in the cross language tests will fail if they try to publish and don't receive a res... | 37.66 | 130 | 0.745088 | from __future__ import print_function
import argparse
import sys
import thread
sys.path.append('..')
sys.path.append('gen-py')
from frugal.context import FContext
from frugal.provider import FScopeProvider
from frugal.server.http_server import FHttpServer
from frugal.tornado.transport import FNatsPublisherTransportF... | 0 | 2,403 | 0 | 0 | 0 | 145 | 0 | 371 | 401 |
519d7183b21627a78c8944fde84e92d25f4bd3ef | 2,986 | py | Python | src/module/embedding.py | wangqi1996/joeynmt_test | b9d1cd1038a9e9d3ba378eb2d1efaefbdbfba800 | [
"MIT"
] | null | null | null | src/module/embedding.py | wangqi1996/joeynmt_test | b9d1cd1038a9e9d3ba378eb2d1efaefbdbfba800 | [
"MIT"
] | null | null | null | src/module/embedding.py | wangqi1996/joeynmt_test | b9d1cd1038a9e9d3ba378eb2d1efaefbdbfba800 | [
"MIT"
] | null | null | null | # coding=utf-8
| 30.161616 | 118 | 0.566644 | # coding=utf-8
import math
import torch
from torch import Tensor
from torch import nn
from src.util.model_util import freeze_params
class Embeddings(nn.Module):
"""
simple embedding class
"""
def __init__(self, embedding_dim: int = 64, scale: bool = False, vocab_size: int = 0,
... | 24 | 0 | 0 | 2,784 | 0 | 0 | 0 | 7 | 167 |
daefbbe84e3a59594d63abdc51c61cbd5d4cd301 | 14,103 | py | Python | IRIS_data_download/IRIS_download_support/obspy/io/shapefile/core.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-03-05T01:03:01.000Z | 2020-12-17T05:04:07.000Z | IRIS_data_download/IRIS_download_support/obspy/io/shapefile/core.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 4 | 2021-03-31T19:25:55.000Z | 2021-12-13T20:32:46.000Z | IRIS_data_download/IRIS_download_support/obspy/io/shapefile/core.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-09-08T19:33:40.000Z | 2021-04-05T09:47:50.000Z | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import re
import warnings
from obspy import Catalog
from obspy.core.event import Origin, Magnitude
from obspy.core.inventory import Inventory
from obspy.core.util.misc import to_int_or_z... | 39.726761 | 79 | 0.582287 | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import * # NOQA
from future.utils import native_str
import datetime
import re
import warnings
from obspy import Catalog, UTCDateTime
from obspy.core.event import O... | 0 | 0 | 0 | 0 | 0 | 3,122 | 0 | 29 | 144 |
b40d5bee8e900dbc24a46b079720cea40ee58eaa | 2,768 | py | Python | app/requests.py | KiyaiB/News-App | a4baa1757ed80076d0084f96b50d0882d7c9a421 | [
"MIT"
] | 1 | 2022-01-08T17:28:06.000Z | 2022-01-08T17:28:06.000Z | app/requests.py | KiyaiB/News-App | a4baa1757ed80076d0084f96b50d0882d7c9a421 | [
"MIT"
] | null | null | null | app/requests.py | KiyaiB/News-App | a4baa1757ed80076d0084f96b50d0882d7c9a421 | [
"MIT"
] | 1 | 2021-11-01T16:37:32.000Z | 2021-11-01T16:37:32.000Z | import urllib.request, json
from .models import NewsSource, NewsArticle
#getting api key
api_key = None
#getting news base url
base_url = None
#getting articles url
articles_url = None
def get_news_source(category):
'''
Function that gets the json response to our url request
'''
get_news_source_url = base_url.f... | 29.446809 | 87 | 0.78685 | import urllib.request,json
from .models import NewsSource,NewsArticle
from datetime import date
#getting api key
api_key = None
#getting news base url
base_url = None
#getting articles url
articles_url = None
def configure_request(app):
global api_key,base_url,articles_url
api_key = app.config['NEWS_API_KEY']
ba... | 0 | 0 | 0 | 0 | 0 | 174 | 0 | 2 | 45 |
d3d9620abca9eca6b0c21af810fb2fc16fb001fa | 16,151 | py | Python | tests/test_services/test_set_207.py | yangyimincn/ucloud-sdk-python3 | 9732d67f32ec5f46467458ba655c44c193a6bbff | [
"Apache-2.0"
] | 37 | 2019-06-19T09:41:34.000Z | 2022-02-18T08:06:00.000Z | tests/test_services/test_set_207.py | yangyimincn/ucloud-sdk-python3 | 9732d67f32ec5f46467458ba655c44c193a6bbff | [
"Apache-2.0"
] | 90 | 2019-08-09T09:27:33.000Z | 2022-03-30T15:54:55.000Z | tests/test_services/test_set_207.py | yangyimincn/ucloud-sdk-python3 | 9732d67f32ec5f46467458ba655c44c193a6bbff | [
"Apache-2.0"
] | 19 | 2019-06-13T02:46:01.000Z | 2021-11-01T07:22:18.000Z | """ Code is generated by ucloud-model, DO NOT EDIT IT. """
import logging
from ucloud.testing import utest
logger = logging.getLogger(__name__)
scenario = utest.Scenario(207)
| 26.261789 | 78 | 0.611046 | """ Code is generated by ucloud-model, DO NOT EDIT IT. """
import pytest
import logging
from ucloud.core import exc
from ucloud.testing import env, funcs, op, utest
logger = logging.getLogger(__name__)
scenario = utest.Scenario(207)
@pytest.mark.skipif(env.is_ut(), reason=env.get_skip_reason())
def test_set_207(... | 0 | 15,385 | 0 | 0 | 0 | 0 | 0 | 14 | 552 |
beac2ac8e5d1ff955264ee8cc1c57261d7898f3e | 758 | py | Python | cryptorip/cryptorip.py | bradagy/cryptorip | 648b12eccfea1edebb4ce53fa1b613d4b1bdf581 | [
"MIT"
] | null | null | null | cryptorip/cryptorip.py | bradagy/cryptorip | 648b12eccfea1edebb4ce53fa1b613d4b1bdf581 | [
"MIT"
] | 1 | 2021-06-02T00:45:30.000Z | 2021-06-02T00:45:30.000Z | cryptorip/cryptorip.py | bradagy/cryptorip | 648b12eccfea1edebb4ce53fa1b613d4b1bdf581 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
from crfunctions import btcprice
from crfunctions import ltcprice
from crfunctions import ethprice
parser = argparse.ArgumentParser()
parser.add_argument('--btc', dest='btcprice', help='Displays the current price of Bitcoin.',default=False,
action='store_... | 28.074074 | 108 | 0.69657 | #!/usr/bin/env python3
import argparse
from crfunctions import btcprice
from crfunctions import ltcprice
from crfunctions import ethprice
parser = argparse.ArgumentParser()
parser.add_argument('--btc', dest='btcprice', help='Displays the current price of Bitcoin.',default=False,
action='store_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dd58cfb203f483892b3faa9c4ab5ed2f674592f6 | 151 | py | Python | 0x03-python-data_structures/8-multiple_returns.py | malu17/alx-higher_level_programming | 75a24d98c51116b737f339697c75855e34254d3a | [
"MIT"
] | null | null | null | 0x03-python-data_structures/8-multiple_returns.py | malu17/alx-higher_level_programming | 75a24d98c51116b737f339697c75855e34254d3a | [
"MIT"
] | null | null | null | 0x03-python-data_structures/8-multiple_returns.py | malu17/alx-higher_level_programming | 75a24d98c51116b737f339697c75855e34254d3a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
| 21.571429 | 43 | 0.622517 | #!/usr/bin/python3
def multiple_returns(sentence):
if not sentence:
return (0, None)
else:
return (len(sentence), sentence[0])
| 0 | 0 | 0 | 0 | 0 | 110 | 0 | 0 | 22 |
a97180fa0444208f232dbc128ac2eaf607fa559a | 1,747 | py | Python | common/mongo_client.py | fangcode/DoubanSpider | fed60f449d441a0470b90f29038477525391fffa | [
"MIT"
] | 1 | 2017-02-25T10:15:58.000Z | 2017-02-25T10:15:58.000Z | common/mongo_client.py | fangcode/DoubanSpider | fed60f449d441a0470b90f29038477525391fffa | [
"MIT"
] | null | null | null | common/mongo_client.py | fangcode/DoubanSpider | fed60f449d441a0470b90f29038477525391fffa | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*_
"""
@author: Fang Wang
@date: 2017.02.25
@desc: mongodb client
"""
import pymongo
from pymongo import MongoClient
if __name__ == "__main__":
print insert_data({"a": 1})
print query_data({"a": 1})
| 22.688312 | 70 | 0.616485 | # -*- coding:utf-8 -*_
"""
@author: Fang Wang
@date: 2017.02.25
@desc: mongodb client
"""
import pymongo
from pymongo import MongoClient
def get_client():
try:
client = MongoClient(host="localhost", port=27017)
return client
except Exception, e:
print "get mongodb client failed", str... | 0 | 0 | 0 | 0 | 0 | 1,397 | 0 | 0 | 115 |
6a3071fc9f2b13e0a963c688d7c2a721ed226989 | 3,435 | py | Python | icscalendar.py | minrk/DnDTools | 3884f7812d1f4d758764fb63580176b79c832c06 | [
"Unlicense"
] | 2 | 2018-10-23T12:22:04.000Z | 2021-02-11T02:32:38.000Z | icscalendar.py | minrk/DnDTools | 3884f7812d1f4d758764fb63580176b79c832c06 | [
"Unlicense"
] | null | null | null | icscalendar.py | minrk/DnDTools | 3884f7812d1f4d758764fb63580176b79c832c06 | [
"Unlicense"
] | 1 | 2016-05-13T18:03:34.000Z | 2016-05-13T18:03:34.000Z | #!/usr/bin/env python
"""Simple Python script to generate iCalendar from the D&D content calendar.
This depends on BeautifulSoup and icalendar, both of which are easy_install-able."""
import urllib2
from BeautifulSoup import BeautifulSoup
from datetime import date, timedelta
from icalendar import Event, Calendar
bas... | 31.227273 | 84 | 0.602038 | #!/usr/bin/env python
"""Simple Python script to generate iCalendar from the D&D content calendar.
This depends on BeautifulSoup and icalendar, both of which are easy_install-able."""
import urllib2
from BeautifulSoup import BeautifulSoup
from datetime import date, timedelta
from icalendar import Event, Calendar
bas... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cf0ddbc109a1f7862e90c770ce9be0da781c9aee | 671 | py | Python | webdispatch/paster.py | aodag/WebDispatch | 55f8658a2b4100498e098a80303a346c3940f1bc | [
"MIT"
] | 1 | 2016-09-03T00:32:47.000Z | 2016-09-03T00:32:47.000Z | webdispatch/paster.py | aodag/WebDispatch | 55f8658a2b4100498e098a80303a346c3940f1bc | [
"MIT"
] | 15 | 2017-07-25T08:00:38.000Z | 2019-02-21T03:23:42.000Z | webdispatch/paster.py | aodag/WebDispatch | 55f8658a2b4100498e098a80303a346c3940f1bc | [
"MIT"
] | 1 | 2018-03-05T17:37:18.000Z | 2018-03-05T17:37:18.000Z | """ entry points to pastescript
"""
import sys
from .urldispatcher import URLDispatcher
def make_urldispatch_application(_, **settings):
""" paste.app_factory interface for URLDispatcher"""
patterns = [p.split("=", 1)
for p in settings['patterns'].split('\n')
if p]
applicat... | 26.84 | 57 | 0.597615 | """ entry points to pastescript
"""
import sys
from .urldispatcher import URLDispatcher
def make_urldispatch_application(_, **settings):
""" paste.app_factory interface for URLDispatcher"""
patterns = [p.split("=", 1)
for p in settings['patterns'].split('\n')
if p]
applicat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
76acd632d5d8c015c5bce720b4f37d1a4d51789d | 2,619 | py | Python | login.py | RFYoung/swjtu-course-schedule-kit | d8718b4b28526b68aabce91063344b2f649f2c2d | [
"Apache-2.0"
] | null | null | null | login.py | RFYoung/swjtu-course-schedule-kit | d8718b4b28526b68aabce91063344b2f649f2c2d | [
"Apache-2.0"
] | null | null | null | login.py | RFYoung/swjtu-course-schedule-kit | d8718b4b28526b68aabce91063344b2f649f2c2d | [
"Apache-2.0"
] | null | null | null |
DEAN_INDEX_PATH = "service/login.html"
POST_LOGIN_FORM_PATH = "vatuu/UserLoginAction"
POST_USER_LOADING_PATH = "vatuu/UserLoadingAction"
GET_CAPTCHA_IMG_PATH = "vatuu/GetRandomNumberToJPEG"
| 36.375 | 109 | 0.600611 | import logging
import cv2
import numpy
import pytesseract
import requests
from config import DEAN_URL, STUDENT_ID, PASSWORD
DEAN_INDEX_PATH = "service/login.html"
POST_LOGIN_FORM_PATH = "vatuu/UserLoginAction"
POST_USER_LOADING_PATH = "vatuu/UserLoadingAction"
GET_CAPTCHA_IMG_PATH = "vatuu/GetRandomNumberToJPEG"
d... | 0 | 0 | 0 | 0 | 0 | 2,254 | 0 | -8 | 180 |
d3bd63e9437d8eb28b34e235c9dc8f6143fac59f | 1,961 | py | Python | secretpy/ciphers/zigzag.py | tigertv/crypt | e464f998e5540f52e269fe360ec9d3a08e976b2e | [
"MIT"
] | 51 | 2019-01-09T02:38:03.000Z | 2022-03-19T19:08:02.000Z | secretpy/ciphers/zigzag.py | tigertv/crypt | e464f998e5540f52e269fe360ec9d3a08e976b2e | [
"MIT"
] | 7 | 2019-10-03T19:50:32.000Z | 2021-05-28T22:52:09.000Z | secretpy/ciphers/zigzag.py | tigertv/crypt | e464f998e5540f52e269fe360ec9d3a08e976b2e | [
"MIT"
] | 13 | 2019-04-16T16:39:44.000Z | 2021-06-01T21:50:12.000Z | #!/usr/bin/python
# -*- encoding: utf-8 -*-
| 25.141026 | 53 | 0.470678 | #!/usr/bin/python
# -*- encoding: utf-8 -*-
class Zigzag:
"""
The Zigzag Cipher (Rail-Fence)
"""
def encrypt(self, text, key, alphabet=None):
"""
Encryption method
:param text: Text to encrypt
:param key: Encryption key
:param alphabet: unused
:type te... | 0 | 0 | 0 | 1,893 | 0 | 0 | 0 | 0 | 23 |
dbbdd8aca5974ecad38b1c6a9316c9f382b5a73d | 20 | py | Python | pyugt/_version.py | teristam/pyugt | 20f1da6ce7fde5595473061a49e3d38435eaeab1 | [
"MIT"
] | 12 | 2020-03-12T13:49:54.000Z | 2022-02-16T10:58:09.000Z | pyugt/_version.py | teristam/pyugt | 20f1da6ce7fde5595473061a49e3d38435eaeab1 | [
"MIT"
] | 2 | 2020-03-18T16:32:08.000Z | 2021-04-05T09:54:48.000Z | pyugt/_version.py | teristam/pyugt | 20f1da6ce7fde5595473061a49e3d38435eaeab1 | [
"MIT"
] | 2 | 2022-02-14T11:34:44.000Z | 2022-02-16T10:59:59.000Z | __version__="0.5.3"
| 10 | 19 | 0.7 | __version__="0.5.3"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e28d8266a59a00b4d0388682ded3b651e5b4aed9 | 21,705 | py | Python | JDjango/dialogs/dialogViews/dialogViews.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | 3 | 2020-12-28T05:09:02.000Z | 2021-06-23T10:02:03.000Z | JDjango/dialogs/dialogViews/dialogViews.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | null | null | null | JDjango/dialogs/dialogViews/dialogViews.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | null | null | null |
"""
###
"""
###
"""
### urls.pyDjangourls.py
###
### urlpatterns
"""
LABEL_COL_LEN = 200
| 47.49453 | 169 | 0.675144 | from ..common import *
"""
### 使用者自定义视图模板并为此模板编辑逻辑的步骤:【后期补全】
"""
###
"""
### 路由默认写入根urls.py文件,也可用新的别名替代第一个名字(不推荐这么做,因为随之改动的地方会很多,除非你很熟悉Django,否则不建议更改urls.py在别名中的位置)。
### 存在隐患,在用户创建路由时应当判断路由明是否冲突,反向名称是否冲突。这将在未来版本中修复。
### urlpatterns参数必须要有一个空行,否则会错误处理。这将在未来版本中修复。
"""
LABEL_COL_LEN = 200
class ViewGenerateDialog(wx... | 2,526 | 0 | 0 | 20,720 | 0 | 0 | 0 | 1 | 45 |
65d9c4d17d4ac1aa35f82159a47deab8779faa3c | 475 | py | Python | findost/foundation/enum.py | BongOST/FindOST | bef3c8991b7494ad08c06ed1c9fb0bc41996ec8b | [
"Apache-2.0"
] | 1 | 2017-11-12T03:10:25.000Z | 2017-11-12T03:10:25.000Z | findost/foundation/enum.py | BongOST/FindOST | bef3c8991b7494ad08c06ed1c9fb0bc41996ec8b | [
"Apache-2.0"
] | null | null | null | findost/foundation/enum.py | BongOST/FindOST | bef3c8991b7494ad08c06ed1c9fb0bc41996ec8b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'LexusLee'
"""
"""
if __name__ == '__main__':
print 'Test begin.'
print 'Test end.' | 19 | 65 | 0.593684 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'LexusLee'
"""
构造枚举类
"""
class Enum:
"""
枚举类
"""
def __setattr__(self, key, value):
if key in self.__dict__.keys():
raise AttributeError("don't allow to set attribute.")
self.__dict__[key] = value
def __delattr_... | 24 | 0 | 0 | 290 | 0 | 0 | 0 | 0 | 23 |
18b19543364b6e55110f32e50888b9fa59094bdb | 2,234 | py | Python | networks/nms/nms.py | lesleelichong/Detection2D | 196ad66610dca63fe48d5ca3e32629f8b654fd38 | [
"Apache-2.0"
] | null | null | null | networks/nms/nms.py | lesleelichong/Detection2D | 196ad66610dca63fe48d5ca3e32629f8b654fd38 | [
"Apache-2.0"
] | null | null | null | networks/nms/nms.py | lesleelichong/Detection2D | 196ad66610dca63fe48d5ca3e32629f8b654fd38 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
"""
@author: Chong Li
@time: 2021/06/25 16:35
@desc:
"""
| 34.369231 | 109 | 0.520143 | # encoding: utf-8
"""
@author: Chong Li
@time: 2021/06/25 16:35
@desc:
"""
import torch
import numpy as np
class nms(object):
def __init__(self, score_thresh, nms_thresh):
self.score_thresh = score_thresh
self.nms_thresh = nms_thresh
def _score_filter(self, res):
mask = res[...... | 3 | 0 | 0 | 2,101 | 0 | 0 | 0 | -12 | 68 |
d7a058974abb063f40cff8426a789352e5b7f894 | 1,939 | py | Python | 08_Introduction to Data Visualization with Matplotlib/02_Plotting time-series/08_Plotting time-series putting it all together.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | 5 | 2021-02-03T14:36:58.000Z | 2022-01-01T10:29:26.000Z | 08_Introduction to Data Visualization with Matplotlib/02_Plotting time-series/08_Plotting time-series putting it all together.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | null | null | null | 08_Introduction to Data Visualization with Matplotlib/02_Plotting time-series/08_Plotting time-series putting it all together.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | 3 | 2021-02-08T00:31:16.000Z | 2022-03-17T13:52:32.000Z | '''
08 - Plotting time-series: putting it all together
In this exercise, you will plot two time-series with different scales on the
same Axes, and annotate the data from one of these series.
The CO2/temperatures data is provided as a DataFrame called climate_change. You
should also use the function that we have ... | 42.152174 | 152 | 0.731305 | '''
08 - Plotting time-series: putting it all together
In this exercise, you will plot two time-series with different scales on the
same Axes, and annotate the data from one of these series.
The CO2/temperatures data is provided as a DataFrame called climate_change. You
should also use the function that we have ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0cea399a3f97b0c5b1dc8e465e607ed1a17fe943 | 967 | py | Python | projectCode/__init__.py | TheBrokenEstate/dbcoursework | 0016f820ca8b0ea862e929337d8f7ad0fbfcf863 | [
"MIT"
] | null | null | null | projectCode/__init__.py | TheBrokenEstate/dbcoursework | 0016f820ca8b0ea862e929337d8f7ad0fbfcf863 | [
"MIT"
] | null | null | null | projectCode/__init__.py | TheBrokenEstate/dbcoursework | 0016f820ca8b0ea862e929337d8f7ad0fbfcf863 | [
"MIT"
] | null | null | null | # Initialization file contains the server settings and config options. It also
# builds the app and initializes the server.
import os
import secrets
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
from flask_login import LoginManager
from flask_mail import Mail
secret_k... | 30.21875 | 78 | 0.784902 | # Initialization file contains the server settings and config options. It also
# builds the app and initializes the server.
import os
import secrets
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
from flask_login import LoginManager
from flask_mail import Mail
secret_k... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 23 |
0e57229c81e2c0c4409d2a451e2cf30f26b6cd8d | 15,325 | py | Python | discordbot.py | Farrule/discordpy-startup | 015304f16add15cd362827cc273877cf82545e08 | [
"MIT"
] | null | null | null | discordbot.py | Farrule/discordpy-startup | 015304f16add15cd362827cc273877cf82545e08 | [
"MIT"
] | null | null | null | discordbot.py | Farrule/discordpy-startup | 015304f16add15cd362827cc273877cf82545e08 | [
"MIT"
] | null | null | null | """
////////
/ ver 1.0.2 /
_////////
"""
import discord
from discord.ext import commands
import os
# TODO:os.environ['DISCORD_BOT_TOKEN']
TOKEN = os.environ['DISCORD_BOT_TOKEN']
# TODO:
bot = commands.Bot(command_prefix='!')
Emcompre = '!'
# TODO:
botver = '1.0.2'
flag = True
b_count = 0
o_flag = 0
m_count = 0... | 32.815846 | 80 | 0.490114 | """
_/_/_/_/_/_/_/_/
_/ ver 1.0.2 _/
_/_/_/_/_/_/_/_/
"""
import asyncio
import discord
from discord.ext import commands
import re
import sys
import os
# TODO:os.environ['DISCORD_BOT_TOKEN']
TOKEN = os.environ['DISCORD_BOT_TOKEN']
# TODO:コマンド変更時
bot = commands.Bot(command_prefix='!')
Emcompre = '!'
# TODO:バージョ... | 3,048 | 11,855 | 0 | 0 | 0 | 169 | 0 | -30 | 245 |
2959e4d34d8c4e6f04454c48f10372abc485be57 | 81 | py | Python | jp.atcoder/arc025/arc025_1/30797423.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/arc025/arc025_1/30797423.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/arc025/arc025_1/30797423.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | print(sum(map(max, zip(map(int, input().split()), map(int, input().split())))))
| 40.5 | 80 | 0.604938 | print(sum(map(max, zip(map(int, input().split()), map(int, input().split())))))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6d6245173ff2c471b2e9485d27570adcc1bc3c40 | 165 | py | Python | exercicios nivel 0/ex014.py | Carlosxc-dev/LINGUAGEM_PYTHON | 5d512038d9c841dea96e4ccea18da76265318199 | [
"MIT"
] | 1 | 2021-11-25T00:29:07.000Z | 2021-11-25T00:29:07.000Z | exercicios nivel 0/ex014.py | Carlosxc-dev/LINGUAGEM_PYTHON | 5d512038d9c841dea96e4ccea18da76265318199 | [
"MIT"
] | null | null | null | exercicios nivel 0/ex014.py | Carlosxc-dev/LINGUAGEM_PYTHON | 5d512038d9c841dea96e4ccea18da76265318199 | [
"MIT"
] | null | null | null | # modulos
import math # bibliotecas com adicionais para o python
n = int(input('digite o n:'))
raiz = math.sqrt(n)
print('a raiz de {} e {:.2f}'.format(n, raiz))
| 20.625 | 55 | 0.654545 | # modulos
import math # bibliotecas com adicionais para o python
n = int(input('digite o n:'))
raiz = math.sqrt(n)
print('a raiz de {} e {:.2f}'.format(n, raiz))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7efaded0632a0876bf92bab173f255288ec5ce81 | 12,283 | py | Python | DP_FL_recreate/F_DPAGD_alltoGPU.py | a8252525/DP_FL_recreation | 6981adc044d40d963b49e662374e9ca2b8f5df5c | [
"Apache-2.0"
] | null | null | null | DP_FL_recreate/F_DPAGD_alltoGPU.py | a8252525/DP_FL_recreation | 6981adc044d40d963b49e662374e9ca2b8f5df5c | [
"Apache-2.0"
] | null | null | null | DP_FL_recreate/F_DPAGD_alltoGPU.py | a8252525/DP_FL_recreation | 6981adc044d40d963b49e662374e9ca2b8f5df5c | [
"Apache-2.0"
] | 1 | 2020-12-09T05:56:32.000Z | 2020-12-09T05:56:32.000Z | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import datasets, transforms
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
import time
import syft as sy
from torch.utils.tensorboard import SummaryWriter
# In[2]:... | 29.037825 | 135 | 0.627941 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
import numpy as np
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import SubsetRandomSampler
import rando... | 0 | 0 | 0 | 1,060 | 0 | 6,929 | 0 | 6 | 430 |
576a98d337376163c915fb73550443bbe9bb7898 | 4,638 | py | Python | hddm_fit.py | anne-urai/2022_Urai_choicehistory_MEG | b9ef84a193eae45f9a9c6748d5ef4efe0c7caf7d | [
"MIT"
] | 2 | 2022-02-23T10:31:54.000Z | 2022-02-23T10:31:56.000Z | hddm_fit.py | anne-urai/2022_Urai_choicehistory_MEG | b9ef84a193eae45f9a9c6748d5ef4efe0c7caf7d | [
"MIT"
] | null | null | null | hddm_fit.py | anne-urai/2022_Urai_choicehistory_MEG | b9ef84a193eae45f9a9c6748d5ef4efe0c7caf7d | [
"MIT"
] | 1 | 2021-10-19T13:46:13.000Z | 2021-10-19T13:46:13.000Z | """
fit HDDM model, with history terms, to data from IBL mice
Anne Urai, 2019, CSHL
"""
# ============================================ #
# GETTING STARTED
# ============================================ #
import matplotlib as mpl
mpl.use('Agg') # to still plot even when no display is defined
from optparse import Opt... | 30.715232 | 93 | 0.555412 | """
fit HDDM model, with history terms, to data from IBL mice
Anne Urai, 2019, CSHL
"""
# ============================================ #
# GETTING STARTED
# ============================================ #
import matplotlib as mpl
mpl.use('Agg') # to still plot even when no display is defined
from optparse import Opt... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
bd898c24cc8b3279692a479e6ea107e5ace24256 | 11,391 | py | Python | solvers/brick_heads/part_selection.py | Anthony102899/Lego-ImageGenerator | 52b19c8bb20f77a3394675e7c037c943a50c1e15 | [
"Unlicense"
] | 1 | 2022-03-20T10:23:38.000Z | 2022-03-20T10:23:38.000Z | solvers/brick_heads/part_selection.py | Anthony102899/Lego-ImageGenerator | 52b19c8bb20f77a3394675e7c037c943a50c1e15 | [
"Unlicense"
] | null | null | null | solvers/brick_heads/part_selection.py | Anthony102899/Lego-ImageGenerator | 52b19c8bb20f77a3394675e7c037c943a50c1e15 | [
"Unlicense"
] | null | null | null |
"""
1: 2: 3. 4: 5: 6: 7: 8: 9:() 10:() 11:() 12:() 13: 14: 15:()
"""
# get the bricks of the indicate files | 30.786486 | 128 | 0.653235 | from bricks_modeling.database import ldraw_colors
from typing import List
import solvers.brick_heads.config as conf
from bricks_modeling.file_IO.model_reader import read_bricks_from_file
import os
from typing import Tuple
from solvers.brick_heads import texture_to_brick
from solvers.brick_heads.lego_util import get_ran... | 204 | 0 | 0 | 0 | 0 | 10,522 | 0 | 183 | 496 |
7880458bccb12da78c7a14002582207fcad7c2d2 | 3,387 | py | Python | example/squeeze_net/model_keras.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | 1 | 2018-07-26T13:52:21.000Z | 2018-07-26T13:52:21.000Z | example/squeeze_net/model_keras.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | null | null | null | example/squeeze_net/model_keras.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | null | null | null | """
This source code is created based on https://github.com/wohlert/keras-squeezenet
---------------------------------------------------------------------------------------------------------------------------------------
https://github.com/wohlert/keras-squeezenet
MIT License
Copyright (c) 2016 Jesper Wohlert
Permi... | 43.987013 | 135 | 0.680543 | """
This source code is created based on https://github.com/wohlert/keras-squeezenet
---------------------------------------------------------------------------------------------------------------------------------------
https://github.com/wohlert/keras-squeezenet
MIT License
Copyright (c) 2016 Jesper Wohlert
Permi... | 0 | 0 | 0 | 0 | 0 | 1,669 | 0 | 132 | 135 |
8a0aabb9016d9eb961db1fd58af12b948aa8dded | 14,934 | py | Python | sonic_package_manager/main.py | sg893052/sonic-utilities | fdb79b8d65b8ca22232f4e6b140f593dd01613d5 | [
"Apache-2.0"
] | 1 | 2022-01-29T01:31:49.000Z | 2022-01-29T01:31:49.000Z | sonic_package_manager/main.py | sg893052/sonic-utilities | fdb79b8d65b8ca22232f4e6b140f593dd01613d5 | [
"Apache-2.0"
] | 6 | 2021-03-17T18:55:32.000Z | 2021-12-17T07:00:27.000Z | sonic_package_manager/main.py | sg893052/sonic-utilities | fdb79b8d65b8ca22232f4e6b140f593dd01613d5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
import typing
import click
import click_log
from sonic_package_manager.database import PackageEntry
from sonic_package_manager.logger import log
BULLET_UC = '\u2022'
def exit_cli(*args, **kwargs):
""" Print a message and exit with rc 1. """
click.secho(*args, **kwargs)
... | 31.978587 | 131 | 0.623878 | #!/usr/bin/env python
import functools
import json
import os
import sys
import typing
import click
import click_log
import tabulate
from natsort import natsorted
from sonic_package_manager.database import PackageEntry, PackageDatabase
from sonic_package_manager.errors import PackageManagerError
from sonic_package_ma... | 0 | 10,169 | 0 | 1,229 | 0 | 95 | 0 | 66 | 554 |
14864e9ce1e48da428f75c8d09596b5ba3faa26e | 627 | py | Python | watermelonbook/3.5linear_discriminant_analysis.py | zjhdota/practice | de28003e7adf6140dfc06a1ffa3a808e514dbbc0 | [
"MIT"
] | 1 | 2018-01-10T11:08:48.000Z | 2018-01-10T11:08:48.000Z | watermelonbook/3.5linear_discriminant_analysis.py | zjhdota/practice | de28003e7adf6140dfc06a1ffa3a808e514dbbc0 | [
"MIT"
] | 1 | 2021-01-31T04:21:48.000Z | 2021-01-31T04:21:48.000Z | watermelonbook/3.5linear_discriminant_analysis.py | zjhdota/practice | de28003e7adf6140dfc06a1ffa3a808e514dbbc0 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.model_selection import train_test_split
from sklearn import metrics
data = np.loadtxt('watermelon_data.csv', delimiter=',')
X = data[:, 1:3]
y = data[:, 3]
X_train, X_test, y_train, y_test = train_test_split(X, y, te... | 29.857143 | 88 | 0.776715 | import numpy as np
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.model_selection import train_test_split
from sklearn import metrics
data = np.loadtxt('watermelon_data.csv', delimiter=',')
X = data[:, 1:3]
y = data[:, 3]
X_train, X_test, y_train, y_test = train_test_split(X, y, te... | 39 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
33a573c0c07d5124e7908c07ee3064cda87eb02d | 18,833 | py | Python | ipapi/ipt/ipt_keep_countours_near_rois.py | tpmp-inra/ipso_cli | 6de4097dcb1536b546d9e2cdeb61057e5f931537 | [
"MIT"
] | null | null | null | ipapi/ipt/ipt_keep_countours_near_rois.py | tpmp-inra/ipso_cli | 6de4097dcb1536b546d9e2cdeb61057e5f931537 | [
"MIT"
] | 1 | 2020-11-10T15:23:41.000Z | 2020-11-10T15:23:41.000Z | ipapi/ipt/ipt_keep_countours_near_rois.py | tpmp-inra/ipso_cli | 6de4097dcb1536b546d9e2cdeb61057e5f931537 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
| 42.899772 | 112 | 0.449636 | import logging
logger = logging.getLogger(__name__)
import numpy as np
import cv2
from ipapi.base.ipt_abstract import IptBase
from ipapi.base import ip_common as ipc
class IptKeepCountoursNearRois(IptBase):
def build_params(self):
self.add_enabled_checkbox()
self.add_roi_selector(... | 0 | 467 | 0 | 18,162 | 0 | 0 | 0 | 26 | 120 |
eb910a9241b0454c8f96bf68d8ce64ff1059a689 | 234 | py | Python | 0/4/4153/4153.py | chr0m3/boj-codes | d71d0a22d0a3ae62c225f382442461275f56fe8f | [
"MIT"
] | 3 | 2017-07-08T16:29:06.000Z | 2020-07-20T00:17:45.000Z | 0/4/4153/4153.py | chr0m3/boj-codes | d71d0a22d0a3ae62c225f382442461275f56fe8f | [
"MIT"
] | null | null | null | 0/4/4153/4153.py | chr0m3/boj-codes | d71d0a22d0a3ae62c225f382442461275f56fe8f | [
"MIT"
] | 2 | 2017-11-20T14:06:06.000Z | 2020-07-20T00:17:47.000Z | while True:
lengths = list(map(int, input().split()))
lengths.sort()
if lengths[2] == 0:
break
if lengths[0] ** 2 + lengths[1] ** 2 == lengths[2] ** 2:
print('right')
else:
print('wrong')
| 19.5 | 60 | 0.495726 | while True:
lengths = list(map(int, input().split()))
lengths.sort()
if lengths[2] == 0:
break
if lengths[0] ** 2 + lengths[1] ** 2 == lengths[2] ** 2:
print('right')
else:
print('wrong')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
105ed07870376eaa6c5b9310a6e97efb05c08b47 | 2,579 | py | Python | identidude/forms.py | laurivosandi/identidude | 7302775bd97ab9f845bc686835c763028adcf76e | [
"MIT"
] | 6 | 2017-06-10T16:21:14.000Z | 2021-01-10T08:03:24.000Z | identidude/forms.py | laurivosandi/ldap2rest | 7302775bd97ab9f845bc686835c763028adcf76e | [
"MIT"
] | null | null | null | identidude/forms.py | laurivosandi/ldap2rest | 7302775bd97ab9f845bc686835c763028adcf76e | [
"MIT"
] | 3 | 2018-08-26T21:53:28.000Z | 2020-05-15T22:51:16.000Z |
import re
RE_CHECKBOX = re.compile(r"(on|yes|1|true)$", re.IGNORECASE)
RE_USERNAME = re.compile(r"[a-z][a-z0-9]{1,31}$")
RE_PASSWORD = re.compile(r"[A-Za-z0-9@#$%^&+=]{8,}$")
RE_DATE = re.compile(r"\d\d\d\d-\d\d-\d\d$")
RE_PHONE = re.compile(r"\+[0-9]+( [0-9]+)*$")
RE_EMAIL = re.compile(r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z... | 47.759259 | 209 | 0.579682 |
import re
import falcon
RE_CHECKBOX = re.compile(r"(on|yes|1|true)$", re.IGNORECASE)
RE_USERNAME = re.compile(r"[a-z][a-z0-9]{1,31}$")
RE_PASSWORD = re.compile(r"[A-Za-z0-9@#$%^&+=]{8,}$")
RE_DATE = re.compile(r"\d\d\d\d-\d\d-\d\d$")
RE_PHONE = re.compile(r"\+[0-9]+( [0-9]+)*$")
RE_EMAIL = re.compile(r"(^[-!#$%&'*+/=... | 0 | 0 | 0 | 0 | 0 | 1,959 | 0 | -8 | 68 |
77fd2f79cb8c85d343c0c09d6554c0a9fe55b593 | 1,515 | py | Python | example/perfbench/protein-time-to-solution.py | yhtang/GraphDot | 3d5ed4fbb2f6912052baa42780b436da76979691 | [
"BSD-3-Clause-LBNL"
] | 9 | 2020-02-14T18:07:39.000Z | 2021-12-15T12:07:31.000Z | example/perfbench/protein-time-to-solution.py | yhtang/graphdot | 3d5ed4fbb2f6912052baa42780b436da76979691 | [
"BSD-3-Clause-LBNL"
] | 3 | 2020-03-19T19:07:26.000Z | 2021-02-24T06:08:51.000Z | example/perfbench/protein-time-to-solution.py | yhtang/graphdot | 3d5ed4fbb2f6912052baa42780b436da76979691 | [
"BSD-3-Clause-LBNL"
] | 3 | 2019-10-17T06:11:18.000Z | 2021-05-07T11:56:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Performance benchmark on molecular graphs generated from protein crystal
structures."""
import json
import sys
import os
import re
from ase import Atoms
from graphdot.graph import Graph
from graphdot.kernel.molecular import Tang2019MolecularKernel
arg_dict = {}
for arg ... | 25.677966 | 75 | 0.623102 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Performance benchmark on molecular graphs generated from protein crystal
structures."""
import json
import sys
import os
import re
from ase import Atoms
from graphdot.graph import Graph
from graphdot.kernel.molecular import Tang2019MolecularKernel
arg_dict = {}
for arg ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
669832230136a3fa9c9693ee1ea936065e9f4912 | 201 | py | Python | codestepbystep/crawl.py | aleeper/python_sandbox | 2c320e043735f99fac68308fe2692c819cf5a636 | [
"MIT"
] | null | null | null | codestepbystep/crawl.py | aleeper/python_sandbox | 2c320e043735f99fac68308fe2692c819cf5a636 | [
"MIT"
] | null | null | null | codestepbystep/crawl.py | aleeper/python_sandbox | 2c320e043735f99fac68308fe2692c819cf5a636 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 14.357143 | 51 | 0.641791 | import os
def crawl(filename, indent = ""):
files = os.listdir(filename)
print(files)
def main():
crawl("/Users/leeper/Documents/aleeper-config")
if __name__ == '__main__':
main()
| 0 | 0 | 0 | 0 | 0 | 104 | 0 | -12 | 68 |
82c99b63b4a52834c56e86aee079a341a11360fb | 4,691 | py | Python | pyscf/lib/tblis_einsum.py | crisely09/pyscf | cb92f7974bd9c87c0ef5b2b52abf5d3219b3d6b6 | [
"Apache-2.0"
] | 1 | 2020-01-05T13:50:50.000Z | 2020-01-05T13:50:50.000Z | pyscf/lib/tblis_einsum.py | crisely09/pyscf | cb92f7974bd9c87c0ef5b2b52abf5d3219b3d6b6 | [
"Apache-2.0"
] | null | null | null | pyscf/lib/tblis_einsum.py | crisely09/pyscf | cb92f7974bd9c87c0ef5b2b52abf5d3219b3d6b6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 35.537879 | 80 | 0.661053 | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 23 |
0c40c949bdd68969b7dad841c9c9d72e0c453b92 | 1,899 | py | Python | addTweetTextColumn.py | AntonisKotsis/Polarization-Measurements | 777c22616a7915d878080f23015f08b1121d4f9c | [
"MIT"
] | null | null | null | addTweetTextColumn.py | AntonisKotsis/Polarization-Measurements | 777c22616a7915d878080f23015f08b1121d4f9c | [
"MIT"
] | null | null | null | addTweetTextColumn.py | AntonisKotsis/Polarization-Measurements | 777c22616a7915d878080f23015f08b1121d4f9c | [
"MIT"
] | null | null | null | import sqlite3
import tweepy as tw
# Author:Mitos-Kotsis Antonios #
# cs3028@uoi.gr #
#========================================================#
db_connection=sqlite3.connect('tweet.db')
cursor=db_connection.cursor()
update_cursor=db_connection.cursor()
#Defining personal dev keys
consumer_key=''
c... | 33.910714 | 98 | 0.745656 | import sqlite3
import tweepy as tw
# Author:Mitos-Kotsis Antonios #
# cs3028@uoi.gr #
#========================================================#
db_connection=sqlite3.connect('tweet.db')
cursor=db_connection.cursor()
update_cursor=db_connection.cursor()
#Defining personal dev keys
consumer_key=''
c... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4cf9383fedde96336a4c27bc7722954acadef078 | 6,581 | py | Python | scripts/svi_mlp_regression_demo_tfp.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 4,895 | 2016-08-17T22:28:34.000Z | 2022-03-31T17:07:15.000Z | scripts/svi_mlp_regression_demo_tfp.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 446 | 2016-09-17T14:35:29.000Z | 2022-03-31T19:59:33.000Z | scripts/svi_mlp_regression_demo_tfp.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 1,160 | 2016-08-18T23:19:27.000Z | 2022-03-31T12:44:07.000Z | # Nonlinear regression using variational inference for parameters.
# For simplicity we treat output noise variance as a fixed parameter.
# Adapted from
# https://brendanhasz.github.io/2019/07/23/bayesian-density-net.html
from __future__ import absolute_import
from __future__ import division
from __future__ import pri... | 29.511211 | 90 | 0.631211 | # Nonlinear regression using variational inference for parameters.
# For simplicity we treat output noise variance as a fixed parameter.
# Adapted from
# https://brendanhasz.github.io/2019/07/23/bayesian-density-net.html
import superimport
from __future__ import absolute_import
from __future__ import division
from _... | 0 | 511 | 0 | 0 | 0 | 834 | 0 | -11 | 139 |
55c26a4c4c096f33b6dfc385c41bb9fb67347a02 | 2,744 | py | Python | molsysmt/_private_tools/set_arguments.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/_private_tools/set_arguments.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/_private_tools/set_arguments.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null |
where_set_argument = {
'atom_name' : ['elements'],
'atom_id' : ['elements'],
'atom_type' : ['elements'],
'group_name' : ['elements'],
'group_id' : ['elements'],
'group_type' : ['elements'],
'component_name' : ['elements'],
'component_id' : ['elements'],
'component_type' : ['element... | 29.191489 | 84 | 0.62172 | from molsysmt._private_tools.exceptions import BadCallError
where_set_argument = {
'atom_name' : ['elements'],
'atom_id' : ['elements'],
'atom_type' : ['elements'],
'group_name' : ['elements'],
'group_id' : ['elements'],
'group_type' : ['elements'],
'component_name' : ['elements'],
'co... | 0 | 0 | 0 | 0 | 0 | 446 | 0 | 38 | 45 |
a291384b8569c033af6f2f699fda803cc7a2f55d | 121 | py | Python | tools/nuitka-run-script.py | philicheese2003/ToontownProjectAltisServer | cfa225d1bdddacdbd29b621382347fce17e1dc66 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | tools/nuitka-run-script.py | philicheese2003/ToontownProjectAltisServer | cfa225d1bdddacdbd29b621382347fce17e1dc66 | [
"Apache-2.0"
] | null | null | null | tools/nuitka-run-script.py | philicheese2003/ToontownProjectAltisServer | cfa225d1bdddacdbd29b621382347fce17e1dc66 | [
"Apache-2.0"
] | 1 | 2020-03-11T17:38:45.000Z | 2020-03-11T17:38:45.000Z | #!C:\Python27_64\python.exe
# -*- coding: utf-8 -*-
# Launcher for Nuitka
import nuitka.__main__
nuitka.__main__.main()
| 17.285714 | 27 | 0.710744 | #!C:\Python27_64\python.exe
# -*- coding: utf-8 -*-
# Launcher for Nuitka
import nuitka.__main__
nuitka.__main__.main()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
82921f345e7e759c12f6954fa2b4d83ac0c8834a | 5,396 | py | Python | aha/components/dg_sae.py | ProjectAGI/aha | 53a98ea42526dca56517dc97fffad874772f10f2 | [
"Apache-2.0"
] | 2 | 2020-10-08T13:35:24.000Z | 2020-12-19T18:33:36.000Z | aha/components/dg_sae.py | ProjectAGI/aha | 53a98ea42526dca56517dc97fffad874772f10f2 | [
"Apache-2.0"
] | null | null | null | aha/components/dg_sae.py | ProjectAGI/aha | 53a98ea42526dca56517dc97fffad874772f10f2 | [
"Apache-2.0"
] | 1 | 2021-02-02T08:28:06.000Z | 2021-02-02T08:28:06.000Z | # Copyright (C) 2019 Project AGI
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 39.101449 | 99 | 0.676983 | # Copyright (C) 2019 Project AGI
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 0 | 233 | 0 | 4,165 | 0 | 0 | 0 | 94 | 113 |
e8b188c6e1235de44d96bcb85ef83f96ec08fca9 | 2,659 | py | Python | Test1.py | cfuser/GraphSAGE_in_dgl | 79cc290da76020fdebf52ec9a7cc20505f3b1daa | [
"Apache-2.0"
] | 3 | 2021-12-22T10:57:31.000Z | 2022-03-06T18:58:55.000Z | Test1.py | cfuser/GraphSAGE_in_dgl | 79cc290da76020fdebf52ec9a7cc20505f3b1daa | [
"Apache-2.0"
] | null | null | null | Test1.py | cfuser/GraphSAGE_in_dgl | 79cc290da76020fdebf52ec9a7cc20505f3b1daa | [
"Apache-2.0"
] | null | null | null | import dgl.data
import dgl
import torch.nn as nn
import numpy as np
import scipy.sparse as sp
dataset = dgl.data.CoraGraphDataset()
g = dataset[0]
# Split edge set for training and testing
u, v = g.edges()
eids = np.arange(g.number_of_edges())
eids = np.random.permutation(eids)
test_size = int(len(eids) * 0.1)
trai... | 34.532468 | 89 | 0.690861 | import dgl.data
import dgl
import torch
import torch.nn as nn
import torch.nn.functional as F
import itertools
import numpy as np
import scipy.sparse as sp
dataset = dgl.data.CoraGraphDataset()
g = dataset[0]
# Split edge set for training and testing
u, v = g.edges()
eids = np.arange(g.number_of_edges())
eids = np.... | 0 | 0 | 0 | 785 | 0 | 0 | 0 | 6 | 155 |
ade56a79540ccbee057d3f2ee5d799c095c3e15e | 6,790 | py | Python | AWD_Auto_Defend_Framework/File_Protect.py | hillmanyoung/AWD | 6abe8f96c1b457a22f0bb15ca6ed901e922fc38c | [
"MIT"
] | 146 | 2019-07-05T12:36:33.000Z | 2021-12-05T18:20:26.000Z | AWD_Auto_Defend_Framework/File_Protect.py | ZacharyZcR/AWD- | 6abe8f96c1b457a22f0bb15ca6ed901e922fc38c | [
"MIT"
] | null | null | null | AWD_Auto_Defend_Framework/File_Protect.py | ZacharyZcR/AWD- | 6abe8f96c1b457a22f0bb15ca6ed901e922fc38c | [
"MIT"
] | 36 | 2019-07-05T12:38:21.000Z | 2021-05-26T11:44:13.000Z | # -*- coding:utf-8 -*-
import os
import hashlib
import time
import shutil
print "*******************************************************"
print "**************AWD_Auto_Defend_Framework****************"
print "*******************************************************"
global tgt
tgt = './backup'
while (1):
print "*****... | 27.601626 | 98 | 0.561856 | # -*- coding:utf-8 -*-
import os
import hashlib
import time
import shutil
def file_tree(startpath):
for root,dirs,files in os.walk(startpath,topdown=True):
level = root.replace(startpath,'').count(os.sep)
dir_indent = "|---" * (level-1) + "|---"
file_indent = "|---" * level + "|---"
if not level:
print ro... | 0 | 0 | 0 | 0 | 0 | 5,717 | 0 | 0 | 191 |
7503d7ea36e601ae03dc6c8f1601a8fbb3002e8e | 1,527 | py | Python | people/loader/util.py | datalets/mri-connect | d54125be7d6adb3a11349487d7ad4ea1364ab338 | [
"MIT"
] | null | null | null | people/loader/util.py | datalets/mri-connect | d54125be7d6adb3a11349487d7ad4ea1364ab338 | [
"MIT"
] | null | null | null | people/loader/util.py | datalets/mri-connect | d54125be7d6adb3a11349487d7ad4ea1364ab338 | [
"MIT"
] | 1 | 2020-11-30T10:22:14.000Z | 2020-11-30T10:22:14.000Z |
# Correct commas inside of a linked field
# Check for valid link
# Correct publication lists
# Create linked objects
# Fetch an object by source_id (numeric identifier used in source DB)
# Quick check of the number of lines
| 28.277778 | 69 | 0.595285 | import re
# Correct commas inside of a linked field
def fix_bracketed_lists(data):
for fix in re.findall(r'\([^\s]*,[ ]*[^\s]*\)', data):
data = data.replace(fix, fix.replace(',', ' /'))
return data
# Check for valid link
def fix_url(link):
link = link.strip()
if len(link) > 3 and not link.sta... | 2 | 0 | 0 | 0 | 0 | 1,154 | 0 | -12 | 154 |
513d4bbc42843a9e9ee2749cdcd9ba3ef61e891b | 1,777 | py | Python | functions/figure.py | chiluf/visvis.dev | 373846ea25044b7ca50f44c63dab4248e14deacd | [
"BSD-3-Clause"
] | null | null | null | functions/figure.py | chiluf/visvis.dev | 373846ea25044b7ca50f44c63dab4248e14deacd | [
"BSD-3-Clause"
] | null | null | null | functions/figure.py | chiluf/visvis.dev | 373846ea25044b7ca50f44c63dab4248e14deacd | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
import visvis.backends as backends
from visvis import BaseFigure
def figure(fig=None):
""" figure(fig=None)
Set the specified fi... | 30.118644 | 71 | 0.602701 | # -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
import visvis.backends as backends
from visvis import BaseFigure
def figure(fig=None):
""" figure(fig=None)
Set the specified fi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5d6a2b9f7b9031b053920939652fa79e28ebb77c | 2,802 | py | Python | pcg_libraries/src/pcg_gazebo/log.py | boschresearch/pcg_gazebo_pkgs | 1c112d01847ca4f8da61ce9b273e13d13bc7eb73 | [
"Apache-2.0",
"BSD-3-Clause"
] | 42 | 2019-06-26T09:46:03.000Z | 2022-03-18T17:56:26.000Z | pcg_libraries/src/pcg_gazebo/log.py | boschresearch/pcg_gazebo_pkgs | 1c112d01847ca4f8da61ce9b273e13d13bc7eb73 | [
"Apache-2.0",
"BSD-3-Clause"
] | 9 | 2019-07-18T10:36:05.000Z | 2020-10-02T15:26:32.000Z | pcg_libraries/src/pcg_gazebo/log.py | boschresearch/pcg_gazebo_pkgs | 1c112d01847ca4f8da61ce9b273e13d13bc7eb73 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2019-11-01T03:20:11.000Z | 2020-10-15T23:23:44.000Z | # Copyright (c) 2019 - The Procedural Generation for Gazebo authors
# For information on the respective copyright owner see the NOTICE file
#
# 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
#
#... | 32.206897 | 81 | 0.67202 | # Copyright (c) 2019 - The Procedural Generation for Gazebo authors
# For information on the respective copyright owner see the NOTICE file
#
# 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
#
#... | 0 | 0 | 0 | 0 | 0 | 1,617 | 0 | -18 | 136 |
070884e0364a80571896b92062fe0317bb15be1b | 4,798 | py | Python | ob2/dockergrader/rpc.py | octobear2/ob2 | 864d833f41eea99930847d7e8d8b6f62f81f50db | [
"BSD-2-Clause"
] | 17 | 2016-01-08T04:39:55.000Z | 2019-09-02T21:50:53.000Z | ob2/dockergrader/rpc.py | octobear2/ob2 | 864d833f41eea99930847d7e8d8b6f62f81f50db | [
"BSD-2-Clause"
] | 15 | 2016-01-08T00:32:16.000Z | 2019-05-12T20:03:49.000Z | ob2/dockergrader/rpc.py | octobear2/ob2 | 864d833f41eea99930847d7e8d8b6f62f81f50db | [
"BSD-2-Clause"
] | 6 | 2016-01-27T22:54:24.000Z | 2019-05-12T01:02:03.000Z |
import ob2.config as config
| 42.087719 | 96 | 0.61609 | import docker
from docker.utils import create_host_config
from docker.utils.types import Ulimit
from requests.exceptions import ConnectionError, ReadTimeout
import ob2.config as config
class DockerClient(object):
def __init__(self, sock="unix://var/run/docker.sock"):
self.client = docker.Client(base_url=... | 0 | 0 | 0 | 4,540 | 0 | 0 | 0 | 69 | 157 |
c9c37fd34f672efd901c4e655257231f4eb42817 | 4,285 | py | Python | tyler.py | mastro35/tyler | 9f26ca4db45308a006f7848fa58079ca28eb9873 | [
"Apache-2.0"
] | 1 | 2020-05-03T09:09:07.000Z | 2020-05-03T09:09:07.000Z | tyler.py | mastro35/tyler | 9f26ca4db45308a006f7848fa58079ca28eb9873 | [
"Apache-2.0"
] | null | null | null | tyler.py | mastro35/tyler | 9f26ca4db45308a006f7848fa58079ca28eb9873 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Tyler - a python tail supporting rolling files
# Copyright (C) 2016 Davide Mastromatteo - @mastro35
# ----------------------------------------------------
import sys
import os
import time
def main():
'''Entry point'''
if len(sys.argv) == 1:
print("Us... | 26.288344 | 76 | 0.518553 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Tyler - a python tail supporting rolling files
# Copyright (C) 2016 Davide Mastromatteo - @mastro35
# ----------------------------------------------------
import sys
import os
import time
import platform
class Tyler(object):
"""
Creates an iterable object tha... | 0 | 0 | 0 | 3,451 | 0 | 0 | 0 | -6 | 45 |
8b59242e63d79f99f0760b0785f1a54d63c7df86 | 1,520 | py | Python | tests/test_submission_builder.py | mverteuil/mig3-client | 2603e78ac37b76dcd1e162ff3a0a042ab1d77269 | [
"MIT"
] | 3 | 2019-04-26T19:43:47.000Z | 2019-05-04T02:23:36.000Z | tests/test_submission_builder.py | mverteuil/mig3-client | 2603e78ac37b76dcd1e162ff3a0a042ab1d77269 | [
"MIT"
] | 32 | 2019-05-04T02:22:46.000Z | 2021-07-14T10:22:05.000Z | tests/test_submission_builder.py | mverteuil/mig3-client | 2603e78ac37b76dcd1e162ff3a0a042ab1d77269 | [
"MIT"
] | 2 | 2019-05-02T20:49:31.000Z | 2019-05-04T02:20:55.000Z | # -*- coding: utf-8 -*-
import mock
from mig3_client import SubmissionBuilder
def test_minimum_viable_submission(converted_tests):
"""Should produce something"""
submission = SubmissionBuilder("t", "b", converted_tests).build()
assert submission is not None
def test_configuration_id(converted_tests):
... | 38 | 90 | 0.701974 | # -*- coding: utf-8 -*-
import mock
from mig3_client import SubmissionBuilder
def test_minimum_viable_submission(converted_tests):
"""Should produce something"""
submission = SubmissionBuilder("t", "b", converted_tests).build()
assert submission is not None
def test_configuration_id(converted_tests):
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ee9aab0826782f6ab2df4d71ea72cc622f596803 | 2,865 | py | Python | termicoder/utils/code.py | apb7/termicoder | f0540a2fb4fe0858fa6a9d63e722ad5aa525e14a | [
"MIT"
] | 1 | 2018-06-22T06:59:24.000Z | 2018-06-22T06:59:24.000Z | termicoder/utils/code.py | apb7/termicoder | f0540a2fb4fe0858fa6a9d63e722ad5aa525e14a | [
"MIT"
] | null | null | null | termicoder/utils/code.py | apb7/termicoder | f0540a2fb4fe0858fa6a9d63e722ad5aa525e14a | [
"MIT"
] | null | null | null | import termicoder.utils.display as display
lang_map = {
".py": "python",
".c": "c",
".cpp": "cpp",
".cc": "cpp",
".c++": "cpp",
".java": "java"
}
# TODO: a default name for code file
| 28.088235 | 78 | 0.588831 | import click
import os
import sys
import subprocess
import termicoder.utils.display as display
import json
lang_map = {
".py": "python",
".c": "c",
".cpp": "cpp",
".cc": "cpp",
".c++": "cpp",
".java": "java"
}
def edit_templates():
click.confirm("This will open the templates folder in fil... | 0 | 0 | 0 | 0 | 0 | 2,496 | 0 | -46 | 202 |
217378a3c46509843d298f90c41c54e498db1d5d | 3,109 | py | Python | test.py | brotchie/pyevmc | fca18cc4b6840997a5c012d2ee20e052674b8858 | [
"MIT"
] | null | null | null | test.py | brotchie/pyevmc | fca18cc4b6840997a5c012d2ee20e052674b8858 | [
"MIT"
] | null | null | null | test.py | brotchie/pyevmc | fca18cc4b6840997a5c012d2ee20e052674b8858 | [
"MIT"
] | null | null | null | """Tests for EVMC Python bindings.
Note, these tests rely on a valid EVMC implementation. Set the EVMC_MODULE
environment variable to your EMVC shared library. For example, if using
evmone compiled in the parent directory:
$ EVMC_MODULE=../evmone/build/lib/libevmone.so python3 test.py
"""
import os
import unittes... | 28.522936 | 96 | 0.627855 | """Tests for EVMC Python bindings.
Note, these tests rely on a valid EVMC implementation. Set the EVMC_MODULE
environment variable to your EMVC shared library. For example, if using
evmone compiled in the parent directory:
$ EVMC_MODULE=../evmone/build/lib/libevmone.so python3 test.py
"""
import os
import unittes... | 0 | 0 | 0 | 1,872 | 0 | 130 | 0 | 2 | 114 |
0623f1f660d231bc13e4c31bc2c6cd4b10effbc6 | 238 | py | Python | tests/test_comparisons.py | thegreathippo/ezparse | 1dc3184e74b8b1f85ff5c7248efa78613e65d837 | [
"MIT"
] | null | null | null | tests/test_comparisons.py | thegreathippo/ezparse | 1dc3184e74b8b1f85ff5c7248efa78613e65d837 | [
"MIT"
] | null | null | null | tests/test_comparisons.py | thegreathippo/ezparse | 1dc3184e74b8b1f85ff5c7248efa78613e65d837 | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 15.866667 | 47 | 0.672269 | from .context import ezparse
import unittest
class TestParserComparisons(unittest.TestCase):
def setUp(self):
self.parser = ezparse.Parser()
def test(self):
pass
if __name__ == '__main__':
unittest.main()
| 0 | 0 | 0 | 121 | 0 | 0 | 0 | 7 | 45 |
b11cd90a3f9a9b8349f3a05a003622b0bfd70fda | 3,454 | py | Python | PytorchRouting/DecisionLayers/Others/GumbelSoftmax.py | oleksost/RoutingNetworks | 7e3e9219b7389d5af2a832a4882bc9fda0e7fd21 | [
"Apache-2.0"
] | 63 | 2018-07-19T20:12:55.000Z | 2022-03-31T14:59:37.000Z | PytorchRouting/DecisionLayers/Others/GumbelSoftmax.py | oleksost/RoutingNetworks | 7e3e9219b7389d5af2a832a4882bc9fda0e7fd21 | [
"Apache-2.0"
] | 2 | 2019-08-08T18:28:13.000Z | 2019-09-24T16:46:22.000Z | PytorchRouting/DecisionLayers/Others/GumbelSoftmax.py | oleksost/RoutingNetworks | 7e3e9219b7389d5af2a832a4882bc9fda0e7fd21 | [
"Apache-2.0"
] | 16 | 2018-07-25T05:56:51.000Z | 2021-01-09T02:47:05.000Z | """
This file defines class GumbelSoftmax.
@author: Clemens Rosenbaum :: cgbr@cs.umass.edu
@created: 6/12/18
"""
import torch.nn as nn
| 35.244898 | 112 | 0.649392 | """
This file defines class GumbelSoftmax.
@author: Clemens Rosenbaum :: cgbr@cs.umass.edu
@created: 6/12/18
"""
import math
import torch
import torch.nn as nn
from torch.autograd import Variable
from ..Decision import Decision
class GumbelSoftmax(Decision):
"""
Class GumbelSoftmax defines a decision making... | 0 | 339 | 0 | 2,837 | 0 | 0 | 0 | 5 | 135 |
dc44532d91f8ff6f92c01f0d475ba8e57b156932 | 1,784 | py | Python | plos_bio_scripts/concatenate_fastq_sample_replicates_from_same_visno.py | zhiru-liu/microbiome_evolution | 5a08fbf41357d845236e3ff46c31315929d2b649 | [
"BSD-2-Clause"
] | null | null | null | plos_bio_scripts/concatenate_fastq_sample_replicates_from_same_visno.py | zhiru-liu/microbiome_evolution | 5a08fbf41357d845236e3ff46c31315929d2b649 | [
"BSD-2-Clause"
] | null | null | null | plos_bio_scripts/concatenate_fastq_sample_replicates_from_same_visno.py | zhiru-liu/microbiome_evolution | 5a08fbf41357d845236e3ff46c31315929d2b649 | [
"BSD-2-Clause"
] | null | null | null | import os
import sys
from parsers import parse_midas_data
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("subject_id", help="name of subject to process")
args = parser.parse_args()
subject = args.subject_id
subject_sample_time_map = parse_midas_data.parse_subject_sample_time_map()
for visno i... | 68.615385 | 329 | 0.785314 | import os
import sys
from parsers import parse_midas_data
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("subject_id", help="name of subject to process")
args = parser.parse_args()
subject = args.subject_id
subject_sample_time_map = parse_midas_data.parse_subject_sample_time_map()
for visno i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f916686f5798eb1904edfc4ef91c835b783c9add | 383 | py | Python | recreate.py | tjguk/incident-database | 88beef4581185a9f465166f014a31d97465cb216 | [
"MIT"
] | 1 | 2018-07-10T13:56:41.000Z | 2018-07-10T13:56:41.000Z | recreate.py | tjguk/incident-database | 88beef4581185a9f465166f014a31d97465cb216 | [
"MIT"
] | null | null | null | recreate.py | tjguk/incident-database | 88beef4581185a9f465166f014a31d97465cb216 | [
"MIT"
] | null | null | null | import os
from incidents import db, IncidentStatus
if __name__ == '__main__':
if os.path.exists("incidents/incidents.db"):
os.remove("incidents/incidents.db")
db.create_all()
db.session.add(IncidentStatus("Open", 1))
db.session.add(IncidentStatus("Pending", 2))
db.session.add... | 23.9375 | 49 | 0.655352 | import os, sys
from incidents import db, IncidentStatus
if __name__ == '__main__':
if os.path.exists("incidents/incidents.db"):
os.remove("incidents/incidents.db")
db.create_all()
db.session.add(IncidentStatus("Open", 1))
db.session.add(IncidentStatus("Pending", 2))
db.sessio... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0 |
62a055a8f85843d8830c623dd866958f97102a0e | 77,866 | py | Python | factory/glideFactoryMonitoring.py | ddbox/glideinwms | 1d0efbc1186ff9bd4cc3010fde6681b4cbe7cd54 | [
"Apache-2.0"
] | null | null | null | factory/glideFactoryMonitoring.py | ddbox/glideinwms | 1d0efbc1186ff9bd4cc3010fde6681b4cbe7cd54 | [
"Apache-2.0"
] | null | null | null | factory/glideFactoryMonitoring.py | ddbox/glideinwms | 1d0efbc1186ff9bd4cc3010fde6681b4cbe7cd54 | [
"Apache-2.0"
] | null | null | null | # SPDX-FileCopyrightText: 2009 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# This module implements the functions needed
# to monitor the glidein factory
#
# Author:
# Igor Sfiligoi (Dec 11th 2006)
#
# list of rrd files that e... | 39.972279 | 352 | 0.541173 | # SPDX-FileCopyrightText: 2009 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# This module implements the functions needed
# to monitor the glidein factory
#
# Author:
# Igor Sfiligoi (Dec 11th 2006)
#
import copy
import json
im... | 0 | 1,531 | 0 | 70,558 | 0 | 2,445 | 0 | 5 | 497 |
c42cb4c8f64eb4a905c75fe882d39f12d4de36b5 | 2,401 | py | Python | webapp/element43/apps/feedreader/tasks.py | Ososope/eve_online | b368f77aaff403e5f1523a1a0e01d105fed0ada9 | [
"BSD-3-Clause"
] | null | null | null | webapp/element43/apps/feedreader/tasks.py | Ososope/eve_online | b368f77aaff403e5f1523a1a0e01d105fed0ada9 | [
"BSD-3-Clause"
] | null | null | null | webapp/element43/apps/feedreader/tasks.py | Ososope/eve_online | b368f77aaff403e5f1523a1a0e01d105fed0ada9 | [
"BSD-3-Clause"
] | null | null | null | # Datetime Packages
# Celery Imports
from celery.utils.log import get_task_logger
# Feedparser
# Models
# Logger object
LOGGER = get_task_logger(__name__)
| 28.583333 | 120 | 0.607663 | # Datetime Packages
from time import mktime
from datetime import timedelta
from datetime import datetime
import pytz
# Celery Imports
from celery.task import Task, PeriodicTask
from celery.utils.log import get_task_logger
# Feedparser
import feedparser
# Models
from models import Feed, FeedItem
# Logger object
LOGG... | 0 | 0 | 0 | 2,002 | 0 | 0 | 0 | 38 | 200 |
edb782c7f6267005dd2b8b742261b90c442c3db4 | 5,277 | py | Python | markov.py | nbowen/codebro-bot | c40dc8c560d671b8871b6af2884d9ceaa4734679 | [
"MIT"
] | null | null | null | markov.py | nbowen/codebro-bot | c40dc8c560d671b8871b6af2884d9ceaa4734679 | [
"MIT"
] | 2 | 2017-08-08T16:45:38.000Z | 2021-08-23T04:02:01.000Z | markov.py | nbowen/codebro-bot | c40dc8c560d671b8871b6af2884d9ceaa4734679 | [
"MIT"
] | 6 | 2017-11-03T01:16:59.000Z | 2021-08-24T20:31:29.000Z |
START_TOK = "<START>"
STOP_TOK = "<STOP>"
STOP = object()
START = object()
# instantiate a Markov object with the source file
| 34.717105 | 93 | 0.55126 | import random
import yaml
from itertools import chain, groupby
START_TOK = "<START>"
STOP_TOK = "<STOP>"
STOP = object()
START = object()
# instantiate a Markov object with the source file
class Markov:
def __init__(self, input_file: str, output_file: str, ignore_words):
if input_file == output_file:
... | 0 | 452 | 0 | 4,611 | 0 | 0 | 0 | -3 | 88 |
1d93bfa334af183d98404abf2081bbc7654e005f | 78 | py | Python | tests/__init__.py | shridarpatil/desktop_recorder | 838c99354d6eadb9cb939612958c141ad463c748 | [
"MIT"
] | null | null | null | tests/__init__.py | shridarpatil/desktop_recorder | 838c99354d6eadb9cb939612958c141ad463c748 | [
"MIT"
] | 64 | 2017-09-29T18:02:33.000Z | 2019-02-28T06:00:35.000Z | tests/__init__.py | shridarpatil/desktop_recorder | 838c99354d6eadb9cb939612958c141ad463c748 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Unit test package for desktop_screen_recorder."""
| 19.5 | 52 | 0.653846 | # -*- coding: utf-8 -*-
"""Unit test package for desktop_screen_recorder."""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
266e24140a234db040762b3648f07f9379631e25 | 543 | py | Python | src/posts/sitemaps.py | pratik-devkota/notesewa | f93e8da43ce48aba43d86ed21861acf099b03f40 | [
"MIT"
] | null | null | null | src/posts/sitemaps.py | pratik-devkota/notesewa | f93e8da43ce48aba43d86ed21861acf099b03f40 | [
"MIT"
] | null | null | null | src/posts/sitemaps.py | pratik-devkota/notesewa | f93e8da43ce48aba43d86ed21861acf099b03f40 | [
"MIT"
] | 1 | 2021-04-12T12:12:23.000Z | 2021-04-12T12:12:23.000Z | # core django imports
# app imports
| 20.111111 | 66 | 0.661142 | # core django imports
from django.contrib.sitemaps import Sitemap
# app imports
from posts.models import Post
class PostSiteMap(Sitemap):
"""
A sitemap class indicating the objects, change frequency, and
various pages of our website for better search engine indexing
"""
changefreq = 'weekly'
... | 0 | 0 | 0 | 404 | 0 | 0 | 0 | 30 | 67 |
0557cafa6452a8390e1a39347eceeb73cdfb441e | 3,164 | py | Python | orgs/migrations/0009_auto_20200418_1855.py | PudgyPoppins/caps | 8e57d1ab970bcb850938b4103e8d736e5afb8e80 | [
"Apache-2.0"
] | null | null | null | orgs/migrations/0009_auto_20200418_1855.py | PudgyPoppins/caps | 8e57d1ab970bcb850938b4103e8d736e5afb8e80 | [
"Apache-2.0"
] | null | null | null | orgs/migrations/0009_auto_20200418_1855.py | PudgyPoppins/caps | 8e57d1ab970bcb850938b4103e8d736e5afb8e80 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.5 on 2020-04-18 18:55
import django.db.models.deletion
| 45.855072 | 162 | 0.632427 | # Generated by Django 3.0.5 on 2020-04-18 18:55
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('network', '0003_auto_20200128_2104'),
migrations.swapp... | 0 | 0 | 0 | 2,955 | 0 | 0 | 0 | 37 | 90 |
73a5e2762c70a64047bbba2bad7b2659fa7a78d2 | 1,648 | py | Python | spacy/lang/az/lex_attrs.py | snosrap/spaCy | 3f68bbcfec44ef55d101e6db742d353b72652129 | [
"MIT"
] | 22,040 | 2016-10-03T11:58:15.000Z | 2022-03-31T21:08:19.000Z | spacy/lang/az/lex_attrs.py | snosrap/spaCy | 3f68bbcfec44ef55d101e6db742d353b72652129 | [
"MIT"
] | 6,927 | 2016-10-03T13:11:11.000Z | 2022-03-31T17:01:25.000Z | spacy/lang/az/lex_attrs.py | snosrap/spaCy | 3f68bbcfec44ef55d101e6db742d353b72652129 | [
"MIT"
] | 4,403 | 2016-10-04T03:36:33.000Z | 2022-03-31T14:12:34.000Z | from ...attrs import LIKE_NUM
# Eleven, twelve etc. are written separate: on bir, on iki
_num_words = [
"bir",
"iki",
"",
"drd",
"be",
"alt",
"yeddi",
"skkiz",
"doqquz",
"on",
"iyirmi",
"otuz",
"qrx",
"lli",
"altm",
"yetmi",
"sksn",
"doxsan",
... | 18.311111 | 66 | 0.529733 | from ...attrs import LIKE_NUM
# Eleven, twelve etc. are written separate: on bir, on iki
_num_words = [
"bir",
"iki",
"üç",
"dörd",
"beş",
"altı",
"yeddi",
"səkkiz",
"doqquz",
"on",
"iyirmi",
"otuz",
"qırx",
"əlli",
"altmış",
"yetmiş",
"səksən",
... | 98 | 0 | 0 | 0 | 0 | 645 | 0 | 0 | 23 |
3be10189c54d298dbd30664473dab5cbc74413ef | 810 | py | Python | Project Euler Questions 1 - 10/Project Euler Question 5.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Questions 1 - 10/Project Euler Question 5.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Questions 1 - 10/Project Euler Question 5.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Queestion 5
#2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
#What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
highest_factor = 20
factor = highest_factor
x = highest_factor
while x >= 0:
if ... | 33.75 | 118 | 0.669136 | #Project Euler Queestion 5
#2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
#What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
highest_factor = 20
factor = highest_factor
x = highest_factor
while x >= 0:
if ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
63b8909a6a3bfda3dce10c5f3a8be6bb08158572 | 1,634 | py | Python | midterm_16012020/alessandro_reggiani_script.py | allereggiani22/programming_alessandro_reggiani | 4b8f9ee1805a29cc6cd3a8b8d93bda5a7efb97ea | [
"MIT"
] | 1 | 2020-01-13T13:46:48.000Z | 2020-01-13T13:46:48.000Z | midterm_16012020/alessandro_reggiani_script.py | allereggiani22/programming_alessandro_reggiani | 4b8f9ee1805a29cc6cd3a8b8d93bda5a7efb97ea | [
"MIT"
] | null | null | null | midterm_16012020/alessandro_reggiani_script.py | allereggiani22/programming_alessandro_reggiani | 4b8f9ee1805a29cc6cd3a8b8d93bda5a7efb97ea | [
"MIT"
] | null | null | null | """
Define a function to generate dictionary from matrix
do the same for other matrix
read sequences from fasta file
define function with arguments (seq1, seq2, matrix) to score the alignments
call the function for each matrix and each alignment
print results in some nice way
"""
BLOSUM=matrix_to_dict("./BLOSUM62_squ... | 22.694444 | 75 | 0.658507 | """
Define a function to generate dictionary from matrix
do the same for other matrix
read sequences from fasta file
define function with arguments (seq1, seq2, matrix) to score the alignments
call the function for each matrix and each alignment
print results in some nice way
"""
def matrix_to_dict(filepath):
fil... | 0 | 0 | 0 | 0 | 0 | 586 | 0 | 0 | 69 |
a5e1bda80068ec02ba1b78a61b76c95409209ae3 | 3,014 | py | Python | scripts/keras-regression-cnns/cnn_regression.py | MattBixley/Histology | 159655dc55d7959dadefbd2f5a490b8a03034ffb | [
"MIT"
] | null | null | null | scripts/keras-regression-cnns/cnn_regression.py | MattBixley/Histology | 159655dc55d7959dadefbd2f5a490b8a03034ffb | [
"MIT"
] | 3 | 2021-09-08T01:56:43.000Z | 2022-03-12T00:26:33.000Z | scripts/keras-regression-cnns/cnn_regression.py | MattBixley/Histology | 159655dc55d7959dadefbd2f5a490b8a03034ffb | [
"MIT"
] | null | null | null | # USAGE
# python cnn_regression.py --dataset Houses-dataset/Houses\ Dataset/
# import the necessary packages
from tensorflow.keras.optimizers import Adam
from sklearn.model_selection import train_test_split
from pyimagesearch import datasets
from pyimagesearch import models
import numpy as np
import argparse
import lo... | 38.151899 | 69 | 0.757133 | # USAGE
# python cnn_regression.py --dataset Houses-dataset/Houses\ Dataset/
# import the necessary packages
from tensorflow.keras.optimizers import Adam
from sklearn.model_selection import train_test_split
from pyimagesearch import datasets
from pyimagesearch import models
import numpy as np
import argparse
import lo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
699a5027b6e478683fd3e6fcf46b9e27bf77421b | 2,639 | py | Python | test/sqlite_test.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | test/sqlite_test.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | test/sqlite_test.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | # https://www.jianshu.com/p/ba8a27cf7da1
# https://www.cnblogs.com/goldsunshine/p/15259246.html
import peewee
import core.orm as orm
db = peewee.SqliteDatabase('../db/auto_work.db')
if __name__ == "__main__":
pass
# test_insert_record()
# test_select_record()
# test_update_record()
# test... | 26.128713 | 112 | 0.67033 | # https://www.jianshu.com/p/ba8a27cf7da1
# https://www.cnblogs.com/goldsunshine/p/15259246.html
import sqlite3
import peewee
import datetime
import core.orm as orm
db = peewee.SqliteDatabase('../db/auto_work.db')
class BaseModel(peewee.Model):
class Meta:
database = db
class WorkItem(BaseModel):
na... | 228 | 0 | 0 | 336 | 0 | 1,119 | 0 | -13 | 205 |
a3d57364826178addf9f55884ab9f6adce826f83 | 1,413 | py | Python | spikeinterface/widgets/probemap.py | JuliaSprenger/spikeinterface | d5d3d3992a6d430d7008e16db4ee030734e685e5 | [
"MIT"
] | 116 | 2019-07-12T14:33:43.000Z | 2022-03-29T01:10:00.000Z | spikeinterface/widgets/probemap.py | JuliaSprenger/spikeinterface | d5d3d3992a6d430d7008e16db4ee030734e685e5 | [
"MIT"
] | 424 | 2019-07-15T13:29:34.000Z | 2022-03-30T13:30:45.000Z | spikeinterface/widgets/probemap.py | JuliaSprenger/spikeinterface | d5d3d3992a6d430d7008e16db4ee030734e685e5 | [
"MIT"
] | 60 | 2019-08-26T11:59:07.000Z | 2022-03-24T20:05:38.000Z |
plot_probe_map.__doc__ = ProbeMapWidget.__doc__
| 25.690909 | 92 | 0.673036 | import numpy as np
import matplotlib.pylab as plt
from .basewidget import BaseWidget
from probeinterface.plotting import plot_probe
class ProbeMapWidget(BaseWidget):
"""
Plot the probe of a recording.
Parameters
----------
recording: RecordingExtractor
The recording extractor object
... | 0 | 0 | 0 | 1,100 | 0 | 81 | 0 | 44 | 136 |
49ce4847193866e5c312b3091e78e2bddf49c7e1 | 6,229 | py | Python | pads/circle_pack.py | thisiscam/PADS | 13eb364e3b248cffd03ec796d9bd93747e6afffb | [
"MIT"
] | 9 | 2018-03-15T12:40:29.000Z | 2022-03-07T03:05:22.000Z | pads/circle_pack.py | thisiscam/PADS | 13eb364e3b248cffd03ec796d9bd93747e6afffb | [
"MIT"
] | null | null | null | pads/circle_pack.py | thisiscam/PADS | 13eb364e3b248cffd03ec796d9bd93747e6afffb | [
"MIT"
] | 7 | 2015-12-19T14:11:30.000Z | 2022-02-15T23:42:12.000Z | """circle_pack.py
Compute circle packings according to the Koebe-Thurston-Andreev theory,
Following a numerical algorithm by C. R. Collins and K. Stephenson,
"A Circle Packing Algorithm", Comp. Geom. Theory and Appl. 2003.
"""
from __future__ import division
from math import pi, acos, sin, e
tolerance = 1 + 10e-12 ... | 37.524096 | 79 | 0.569754 | """circle_pack.py
Compute circle packings according to the Koebe-Thurston-Andreev theory,
Following a numerical algorithm by C. R. Collins and K. Stephenson,
"A Circle Packing Algorithm", Comp. Geom. Theory and Appl. 2003.
"""
from __future__ import division
from math import pi, acos, sin, e
tolerance = 1 + 10e-12 ... | 0 | 0 | 0 | 0 | 442 | 0 | 0 | 0 | 23 |
3e6e3a53dfa76d727f29154f57e1d78a575aae6e | 12,468 | py | Python | lavavu/server.py | rbeucher/LavaVu | 317a234d69ba3eb06a827a1f8658feb031fe358b | [
"CC-BY-4.0"
] | 23 | 2016-01-26T23:06:53.000Z | 2019-06-11T08:31:32.000Z | lavavu/server.py | rbeucher/LavaVu | 317a234d69ba3eb06a827a1f8658feb031fe358b | [
"CC-BY-4.0"
] | 73 | 2016-03-16T03:02:35.000Z | 2019-07-18T07:29:52.000Z | lavavu/server.py | rbeucher/LavaVu | 317a234d69ba3eb06a827a1f8658feb031fe358b | [
"CC-BY-4.0"
] | 6 | 2016-03-25T23:22:49.000Z | 2018-01-16T14:38:09.000Z |
"""
HTTP Server interface
"""
#Optional thread per request version:
"""
HTTP Server manager class
"""
#Ignore SIGPIPE altogether (does not apply on windows)
import sys
if sys.platform != 'win32':
from signal import signal, SIGPIPE, SIG_IGN
signal(SIGPIPE, SIG_IGN)
"""
Main entry point - run server and open... | 36.244186 | 117 | 0.549968 | import urllib
import os
import threading
import time
import errno
from functools import partial
import weakref
import base64
import json
import socket
from socketserver import ThreadingMixIn
from http.server import SimpleHTTPRequestHandler, HTTPServer
from urllib.parse import unquote
from urllib.parse import urlparse
... | 0 | 0 | 0 | 11,247 | 0 | 206 | 0 | 23 | 420 |
35379bf364e71424562fe1367e0c3c4565f9ab2b | 193 | py | Python | authentication/urls.py | king-11/Images_backend | c0223e551fc5c2f42b960161e06d688678d13e22 | [
"MIT"
] | 1 | 2021-05-04T09:38:01.000Z | 2021-05-04T09:38:01.000Z | authentication/urls.py | king-11/Images_backend | c0223e551fc5c2f42b960161e06d688678d13e22 | [
"MIT"
] | 6 | 2021-04-06T18:24:10.000Z | 2021-09-22T19:30:21.000Z | authentication/urls.py | king-11/Images_backend | c0223e551fc5c2f42b960161e06d688678d13e22 | [
"MIT"
] | null | null | null | from django.urls import path
urlpatterns = [
path('login/', LoginView.as_view()),
path('register/', RegisterView.as_view()),
path('me/', UserView.as_view())
]
| 21.444444 | 46 | 0.658031 | from .views import *
from django.urls import path
urlpatterns = [
path('login/', LoginView.as_view()),
path('register/', RegisterView.as_view()),
path('me/', UserView.as_view())
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 22 |
e3e20958857abf5f383239059b5095d65eebfea8 | 12,231 | py | Python | river/datasets/synth/agrawal.py | f3d3r1c00/river | bbf8af07ee75c30f416d5d4dc7ce4c61efc70fab | [
"BSD-3-Clause"
] | 2 | 2021-04-13T09:19:42.000Z | 2021-12-22T13:43:15.000Z | river/datasets/synth/agrawal.py | f3d3r1c00/river | bbf8af07ee75c30f416d5d4dc7ce4c61efc70fab | [
"BSD-3-Clause"
] | null | null | null | river/datasets/synth/agrawal.py | f3d3r1c00/river | bbf8af07ee75c30f416d5d4dc7ce4c61efc70fab | [
"BSD-3-Clause"
] | null | null | null |
from .. import base
| 38.102804 | 96 | 0.579102 | import numpy as np
from river.utils.skmultiflow_utils import check_random_state
from .. import base
class Agrawal(base.SyntheticDataset):
r"""Agrawal stream generator.
The generator was introduced by Agrawal et al. [^1], and was a common
source of data for early work on scaling up decision tree learner... | 0 | 3,956 | 0 | 8,149 | 0 | 0 | 0 | 36 | 68 |
a84223e69f00c547c566010230e0ae6b340bcc19 | 1,942 | py | Python | sdg/data_schemas/DataSchemaInputBase.py | Defra-Data-Science-Centre-of-Excellence/sdg-build | 716a7597e5cb7de248915b21fa1a9e4a5cd1e0e0 | [
"MIT"
] | 7 | 2019-02-25T03:50:17.000Z | 2022-03-31T12:58:42.000Z | sdg/data_schemas/DataSchemaInputBase.py | Defra-Data-Science-Centre-of-Excellence/sdg-build | 716a7597e5cb7de248915b21fa1a9e4a5cd1e0e0 | [
"MIT"
] | 185 | 2019-01-14T15:35:53.000Z | 2022-03-28T19:16:37.000Z | sdg/data_schemas/DataSchemaInputBase.py | Defra-Data-Science-Centre-of-Excellence/sdg-build | 716a7597e5cb7de248915b21fa1a9e4a5cd1e0e0 | [
"MIT"
] | 18 | 2019-01-14T11:20:05.000Z | 2022-02-08T14:10:17.000Z | # -*- coding: utf-8 -*-
| 29.424242 | 90 | 0.615345 | # -*- coding: utf-8 -*-
import frictionless
from pprint import pprint
class DataSchemaInputBase:
"""A base class for importing a data schema, querying it, and validating with it.
This class assumes imported schema are valid Table Schema.
See here: https://specs.frictionlessdata.io/table-schema/
"""
... | 0 | 0 | 0 | 1,848 | 0 | 0 | 0 | 2 | 68 |
beecaaa936e3c7ed89ba6461a22917b7f985debc | 4,366 | py | Python | alipay/aop/api/domain/AlipayInsCooperationRegionQrcodeApplyModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayInsCooperationRegionQrcodeApplyModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayInsCooperationRegionQrcodeApplyModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| 31.410072 | 79 | 0.585662 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayInsCooperationRegionQrcodeApplyModel(object):
def __init__(self):
self._agent_id = None
self._agent_name = None
self._agent_phone = None
self._... | 0 | 1,527 | 0 | 2,687 | 0 | 0 | 0 | 35 | 68 |
dc7fa411fdf281048ffb09830e9fe26a61c47623 | 2,860 | py | Python | function/spider/spider_charpter_info.py | txu2k8/novel-web-server | 1b77d637a6229d916b724ca2735afc00c6175368 | [
"MIT"
] | null | null | null | function/spider/spider_charpter_info.py | txu2k8/novel-web-server | 1b77d637a6229d916b724ca2735afc00c6175368 | [
"MIT"
] | null | null | null | function/spider/spider_charpter_info.py | txu2k8/novel-web-server | 1b77d637a6229d916b724ca2735afc00c6175368 | [
"MIT"
] | null | null | null | '''
MYSQL
'''
import pymysql
from selenium import webdriver
#url = 'https://book.tianya.cn/chapter-83237-9175309'
#https://book.tianya.cn/chapter-89223
# url = 'https://book.tianya.cn/chapter-89223'
browser = webdriver.Chrome(executable_path='D:\chromedriver_win32\chromedriver.exe')
db = pymysql.connect(host='loca... | 30.425532 | 99 | 0.637762 | '''
将一本小说内容插入到MYSQL中
'''
import time
import pymysql
from selenium import webdriver
from pyquery import PyQuery as pq
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
#url = 'https://book.tianya.cn/chapte... | 315 | 0 | 0 | 0 | 0 | 1,639 | 0 | 101 | 223 |
e572f5c1e3667bd0ddfa07d24d44b0c3fe020f3b | 14,584 | py | Python | gui/view_model.py | zmyml/parking_labeler | 62ab975c3aae161469b6469d38469c03169ee467 | [
"MIT"
] | null | null | null | gui/view_model.py | zmyml/parking_labeler | 62ab975c3aae161469b6469d38469c03169ee467 | [
"MIT"
] | null | null | null | gui/view_model.py | zmyml/parking_labeler | 62ab975c3aae161469b6469d38469c03169ee467 | [
"MIT"
] | null | null | null |
ImageViewWidth = 800
ImageViewHeight = 600
| 31.842795 | 119 | 0.577208 | from .model import ImageWidth, ImageHeight, Camera, ImageList, Record, RecordList
from .view import OpenDialog, ErrorDialog, MainWindow
import datetime
from functools import reduce
import PIL.ImageQt
from PySide2 import QtCore, QtGui, QtWidgets
ImageViewWidth = 800
ImageViewHeight = 600
def _strftime(timestamp):
... | 165 | 4,115 | 0 | 9,925 | 0 | 79 | 0 | 113 | 247 |
8c37ae1787f946e862a857ab4b5c48cfc750ca59 | 9,273 | py | Python | vendor/pyLibrary/env/flask_wrappers.py | klahnakoski/auth0-api | eda9c2554c641da76687f64445b8d35543d012d9 | [
"MIT"
] | null | null | null | vendor/pyLibrary/env/flask_wrappers.py | klahnakoski/auth0-api | eda9c2554c641da76687f64445b8d35543d012d9 | [
"MIT"
] | null | null | null | vendor/pyLibrary/env/flask_wrappers.py | klahnakoski/auth0-api | eda9c2554c641da76687f64445b8d35543d012d9 | [
"MIT"
] | null | null | null | # encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, division,... | 30.009709 | 101 | 0.585787 | # encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, division,... | 0 | 2,571 | 0 | 0 | 0 | 1,493 | 0 | 70 | 364 |
b9274fb0b48365fcc0159de099c8bdec3f97941b | 710 | py | Python | cipherInterface.py | Kchao1910/Playfair-Cipher | 57b2771134d041d2c8dd23e3c577efb10e14a26c | [
"MIT"
] | 1 | 2019-03-17T04:31:47.000Z | 2019-03-17T04:31:47.000Z | cipher.py | Kchao1910/Playfair-Cipher | 57b2771134d041d2c8dd23e3c577efb10e14a26c | [
"MIT"
] | null | null | null | cipher.py | Kchao1910/Playfair-Cipher | 57b2771134d041d2c8dd23e3c577efb10e14a26c | [
"MIT"
] | 1 | 2021-04-09T06:58:03.000Z | 2021-04-09T06:58:03.000Z | import sys
import cipherCheck
# start of main()
cipherList = ['PLF', 'RTS', 'RFC', 'VIG', 'CES']
# Remember that the first argument of the script is the file name, thus start at index 1
cipherName = str(sys.argv[1])
key = str(sys.argv[2])
encDec = str(sys.argv[3])
inputFile = str(sys.argv[4])
outputFile = str(sys.ar... | 29.583333 | 88 | 0.777465 | import sys
import re
from collections import OrderedDict
import cipherCheck
import playfair_cipher
import vigenere_cipher
# start of main()
cipherList = ['PLF', 'RTS', 'RFC', 'VIG', 'CES']
# Remember that the first argument of the script is the file name, thus start at index 1
cipherName = str(sys.argv[1])
key = str... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 88 |
4b6d0cdd99151ef98a2509f8b36bf9dfc902ff55 | 313 | py | Python | airtech_api/flight/migrations/0002_auto_20190404_1621.py | chidioguejiofor/airtech-api | 45d77da0cc4230dd3cb7ab4cbb5168a9239850f5 | [
"MIT"
] | 1 | 2019-04-04T12:27:55.000Z | 2019-04-04T12:27:55.000Z | airtech_api/flight/migrations/0002_auto_20190404_1621.py | chidioguejiofor/airtech-api | 45d77da0cc4230dd3cb7ab4cbb5168a9239850f5 | [
"MIT"
] | 34 | 2019-03-26T11:18:17.000Z | 2022-02-10T08:12:36.000Z | airtech_api/flight/migrations/0002_auto_20190404_1621.py | chidioguejiofor/airtech-api | 45d77da0cc4230dd3cb7ab4cbb5168a9239850f5 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2019-04-04 16:21
| 17.388889 | 45 | 0.57508 | # Generated by Django 2.2 on 2019-04-04 16:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('flight', '0001_initial'),
]
operations = [
migrations.AlterModelTable(
name='flight',
table='Flight',
),
]
| 0 | 0 | 0 | 209 | 0 | 0 | 0 | 11 | 46 |
18162c4587efee7db2f7c7eafed92cdf1dd67fee | 740 | py | Python | payments/migrations/0007_finalize_payments_organization_meta.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 13 | 2015-11-29T12:19:12.000Z | 2021-02-21T15:42:11.000Z | payments/migrations/0007_finalize_payments_organization_meta.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 23 | 2015-04-29T19:43:34.000Z | 2021-02-10T05:50:17.000Z | payments/migrations/0007_finalize_payments_organization_meta.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 11 | 2015-09-20T18:59:00.000Z | 2020-02-07T08:47:34.000Z | # Generated by Django 2.2.10 on 2020-07-21 17:16
| 29.6 | 121 | 0.647297 | # Generated by Django 2.2.10 on 2020-07-21 17:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('payments', '0006_populate_payments_organization_meta'),
]
operations = [
migrations.AlterField(
... | 0 | 0 | 0 | 592 | 0 | 0 | 0 | 30 | 68 |
91f079ecdad8c3e1affeb142399ec62ba4e52a45 | 12,238 | py | Python | server.py | sagarsangwan/student-portal | 420195a733b207776b661835fd0db840101e2088 | [
"MIT"
] | null | null | null | server.py | sagarsangwan/student-portal | 420195a733b207776b661835fd0db840101e2088 | [
"MIT"
] | null | null | null | server.py | sagarsangwan/student-portal | 420195a733b207776b661835fd0db840101e2088 | [
"MIT"
] | null | null | null | from flask import Flask
import os
from flask_mysqldb import MySQL
from dotenv import load_dotenv
app = Flask(__name__)
app.config["MYSQL_HOST"] = os.environ.get('MYSQL_HOST')
app.config["MYSQL_USER"] = os.environ.get('MYSQL_USER')
app.config["MYSQL_PASSWORD"] = os.environ.get('MYSQL_PASSWORD')
app.config["MYSQL_DB"] =... | 34.866097 | 120 | 0.60353 | from flask import Flask, render_template, request, make_response, send_file, redirect
import os
import secrets
import json
import requests
import re
import difflib
from flask_mysqldb import MySQL
from difflib import get_close_matches
from dotenv import load_dotenv
from googleapiclient.http import MediaFileUpload
from g... | 0 | 9,843 | 0 | 0 | 0 | 853 | 0 | 134 | 611 |
b41b31e3c81a5da38164ad09513e8c38724bfe19 | 5,050 | py | Python | pysit/solvers/wavefield_vector.py | zfang-slim/pysit | 8fca42b9749841abc302d1f8195a1437fad7ae4d | [
"BSD-3-Clause"
] | 64 | 2015-09-08T06:23:27.000Z | 2022-03-09T23:35:24.000Z | pysit/solvers/wavefield_vector.py | zfang-slim/pysit | 8fca42b9749841abc302d1f8195a1437fad7ae4d | [
"BSD-3-Clause"
] | 23 | 2015-10-08T01:14:24.000Z | 2021-07-15T11:37:05.000Z | pysit/solvers/wavefield_vector.py | zfang-slim/pysit | 8fca42b9749841abc302d1f8195a1437fad7ae4d | [
"BSD-3-Clause"
] | 48 | 2015-06-25T14:48:22.000Z | 2021-12-06T19:50:25.000Z | import numpy as np
__all__ = ['WavefieldVectorBase']
if __name__ == '__main__':
m = Mesh()
W = WavefieldVectorBase(m)
MW = MyWFV(m)
W._data += np.arange(5).reshape(W._data.shape)
MW._data += np.arange(MW._data.shape[0]).reshape(MW._data.shape) | 30.606061 | 119 | 0.574059 | import numpy as np
import warnings
__all__ = ['WavefieldVectorBase']
class WavefieldVectorBase(object):
aux_names = []
def __init__(self, mesh, dtype=np.double, data=None):
self.mesh = mesh
#these if statements manage the compact operator flag
if self.mesh.z.lbc.type == 'pml':
... | 0 | 306 | 0 | 4,378 | 0 | 0 | 0 | -6 | 99 |
d4389c6e3b2c0437ccff9623eeaeac1ea52ec11b | 4,415 | py | Python | examples/kubernetes/scripts/analyzer/serializator.py | katarzyna-z/workload-collocation-agent | 49e7e5f0cb13ffd81552e7722d40b3900053e56a | [
"Apache-2.0"
] | null | null | null | examples/kubernetes/scripts/analyzer/serializator.py | katarzyna-z/workload-collocation-agent | 49e7e5f0cb13ffd81552e7722d40b3900053e56a | [
"Apache-2.0"
] | null | null | null | examples/kubernetes/scripts/analyzer/serializator.py | katarzyna-z/workload-collocation-agent | 49e7e5f0cb13ffd81552e7722d40b3900053e56a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 47.98913 | 99 | 0.634881 | # Copyright (c) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 0 | 0 | 0 | 3,497 | 0 | 103 | 0 | 93 | 135 |
37af31cedf8dcc4a28fc81ce714ff29de954f4f7 | 1,612 | py | Python | cupProject/cupApp/views.py | cs-fullstack-2019-spring/django-moreviews-cw-ChelsGreg | 89a6d1a4c33c87fb6d9cc305c1734e85304cc735 | [
"Apache-2.0"
] | null | null | null | cupProject/cupApp/views.py | cs-fullstack-2019-spring/django-moreviews-cw-ChelsGreg | 89a6d1a4c33c87fb6d9cc305c1734e85304cc735 | [
"Apache-2.0"
] | null | null | null | cupProject/cupApp/views.py | cs-fullstack-2019-spring/django-moreviews-cw-ChelsGreg | 89a6d1a4c33c87fb6d9cc305c1734e85304cc735 | [
"Apache-2.0"
] | null | null | null |
# Create your views here.
#
# TEST FUNCTION
# FUNCTION FOR HELLO, NAME
# FUNCTION FOR NUMBER TIMES 2
# FUNCTION TO ADD NUMBERS TO SUM
# FUNCTION TO CREATE NEW CUP OBJECT
# FILTERS FOR MANUFACTURE DATE
# CHANGE MATERIAL THROUGH MANUFACTURE DATE
# FUNCTION FOR CUP INDEX TO PRINT
| 26.42623 | 92 | 0.701613 | from django.shortcuts import render
from django.http import HttpResponse
from .models import Cup
# Create your views here.
#
# TEST FUNCTION
def index(request):
return HttpResponse("Test URL")
# FUNCTION FOR HELLO, NAME
def helloThere(request, name):
return HttpResponse("Hello, " + name + "!")
# FUNCTION FOR... | 0 | 0 | 0 | 0 | 0 | 1,049 | 0 | 31 | 242 |
5bbbbbc812ea5a0ff3545d0bd30d6e6989bf1a0f | 6,380 | py | Python | workchains/launcher/launch_phonon.py | abelcarreras/aiida_extensions | cce3fe537d041fdae87c5a60ce433e6de3fc30cf | [
"MIT"
] | null | null | null | workchains/launcher/launch_phonon.py | abelcarreras/aiida_extensions | cce3fe537d041fdae87c5a60ce433e6de3fc30cf | [
"MIT"
] | null | null | null | workchains/launcher/launch_phonon.py | abelcarreras/aiida_extensions | cce3fe537d041fdae87c5a60ce433e6de3fc30cf | [
"MIT"
] | null | null | null |
# Works run by the daemon (using submit)
from aiida import load_dbenv, is_dbenv_loaded
if not is_dbenv_loaded():
load_dbenv()
from aiida.orm import CalculationFactory, DataFactory
from aiida.work.run import run, submit, async
from aiida.orm.data.structure import StructureData
from aiida.orm.data.base import Str,... | 36.045198 | 139 | 0.541223 |
# Works run by the daemon (using submit)
from aiida import load_dbenv, is_dbenv_loaded
if not is_dbenv_loaded():
load_dbenv()
from aiida.orm import CalculationFactory, DataFactory
from aiida.work.run import run, submit, async
from aiida.orm.data.structure import StructureData
from aiida.orm.data.base import Str,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f4037134482cd2dce70ff0d781ce82edf71ae942 | 6,315 | py | Python | utils/clustering.py | ficolo/science-radar | 3929493d93aa3712e4f48e7ab23b659daedb3b1f | [
"Apache-2.0"
] | 1 | 2019-10-03T02:04:12.000Z | 2019-10-03T02:04:12.000Z | utils/clustering.py | ficolo/science-radar | 3929493d93aa3712e4f48e7ab23b659daedb3b1f | [
"Apache-2.0"
] | null | null | null | utils/clustering.py | ficolo/science-radar | 3929493d93aa3712e4f48e7ab23b659daedb3b1f | [
"Apache-2.0"
] | null | null | null | import seaborn as sns
sns.set(color_codes=True)
#print(get_clusters_range('publications', 'zika', 'localhost', 27017, 2010, 1, 2018, 1))
# print('Getting terms')
# references, index = get_references_annotations('publications', 'zika', 'localhost', 27017, 2010, 1, 2014, 12)
# # most_cited = get_references_count... | 38.272727 | 142 | 0.685511 | from utils.mongodb_access import get_references_annotations, get_references_count
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import DBSCAN
from time import time
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets.samples_generator import make_blobs
from sklearn... | 0 | 0 | 0 | 0 | 229 | 3,102 | 0 | 297 | 401 |
e976b8214e50743fed1938933b12e0d902966808 | 571 | py | Python | exe28.py | henrique-alvaro/EXERCICIOS | dd2509a682009ee4a01f0ca346d960ab09cc284b | [
"MIT"
] | null | null | null | exe28.py | henrique-alvaro/EXERCICIOS | dd2509a682009ee4a01f0ca346d960ab09cc284b | [
"MIT"
] | null | null | null | exe28.py | henrique-alvaro/EXERCICIOS | dd2509a682009ee4a01f0ca346d960ab09cc284b | [
"MIT"
] | null | null | null | # criando um jogo de adivinha
from random import randint
from time import sleep
# fazendo o computador sortear um numero de 0 ate 5
cpu = randint(0, 5)
print('<< TENTE ADIVINHAR >>')
# pedindo qual numero o jogador vai jogar
jogador = int(input('Jogador tente adivinhar o numero entre (0, 5): '))
# analisando se o jogad... | 33.588235 | 71 | 0.700525 | # criando um jogo de adivinha
from random import randint
from time import sleep
# fazendo o computador sortear um numero de 0 ate 5
cpu = randint(0, 5)
print('<< TENTE ADIVINHAR >>')
# pedindo qual numero o jogador vai jogar
jogador = int(input('Jogador tente adivinhar o numero entre (0, 5): '))
# analisando se o jogad... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2ecfb090fe75914469d0a2b1b91258e07b51bcc8 | 1,550 | py | Python | atados_core/management/commands/changenonprofitslug.py | fidelisrafael/atados-api | 00611115e180b184c68729816a36e094f0f0dcd1 | [
"MIT"
] | null | null | null | atados_core/management/commands/changenonprofitslug.py | fidelisrafael/atados-api | 00611115e180b184c68729816a36e094f0f0dcd1 | [
"MIT"
] | null | null | null | atados_core/management/commands/changenonprofitslug.py | fidelisrafael/atados-api | 00611115e180b184c68729816a36e094f0f0dcd1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 31.632653 | 83 | 0.622581 | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from atados_core.models import Nonprofit, Project
class Command(BaseCommand):
args = '<old_slug new_slug>'
help = 'Change slug name for for nonprofit'
def handle(self, *args, **options):
try:
old_slug, new_slug ... | 0 | 0 | 0 | 1,386 | 0 | 0 | 0 | 72 | 67 |
6d78c4c13d6769d89775cd4bd87f7b8d2a2024ab | 27 | py | Python | multihash/version.py | odesenfans/pymultihash | 093365f20f6d8627c1fae13e0f4e0b35e9b39ad2 | [
"MIT"
] | 18 | 2016-02-10T11:50:52.000Z | 2021-10-01T19:33:56.000Z | multihash/version.py | odesenfans/pymultihash | 093365f20f6d8627c1fae13e0f4e0b35e9b39ad2 | [
"MIT"
] | 12 | 2016-06-06T12:40:23.000Z | 2022-03-02T21:49:25.000Z | multihash/version.py | odesenfans/pymultihash | 093365f20f6d8627c1fae13e0f4e0b35e9b39ad2 | [
"MIT"
] | 9 | 2016-05-14T22:46:39.000Z | 2022-01-21T22:48:16.000Z | __version__ = '0.9.0.dev1'
| 13.5 | 26 | 0.666667 | __version__ = '0.9.0.dev1'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cd6ff40760182eca6a15642ce8d1dd26f88716b9 | 483 | py | Python | test/test.py | kaleksandrov/python-thread-pool-executor | 53aff7eef61332f9dd94bc18d0f56f16aed894d5 | [
"MIT"
] | 1 | 2015-12-15T06:50:14.000Z | 2015-12-15T06:50:14.000Z | test/test.py | kaleksandrov/python-thread-pool-executor | 53aff7eef61332f9dd94bc18d0f56f16aed894d5 | [
"MIT"
] | null | null | null | test/test.py | kaleksandrov/python-thread-pool-executor | 53aff7eef61332f9dd94bc18d0f56f16aed894d5 | [
"MIT"
] | 1 | 2021-08-25T13:15:44.000Z | 2021-08-25T13:15:44.000Z | #!/usr/bin/env python
import sys
sys.path.append('../src')
from random import random
from threading import RLock
from time import sleep
from threadingex.threadpoolexecutor import ThreadPoolExecutor
lock = RLock()
result = {}
executor = ThreadPoolExecutor(10)
for i in range(100):
executor.submit(task, i)
ex... | 15.580645 | 61 | 0.724638 | #!/usr/bin/env python
import sys
sys.path.append('../src')
from random import random
from threading import RLock
from time import sleep
from threadingex.threadpoolexecutor import ThreadPoolExecutor
lock = RLock()
result = {}
def task(value):
sleep(random())
with lock:
result[value] = value ** 2
... | 0 | 0 | 0 | 0 | 0 | 65 | 0 | 0 | 23 |
1fb6da394aa521d67e63346cb2e2105622574250 | 2,510 | py | Python | setup.py | petronije2002/PqrUpload | db22af08dac1243569e5f3dd8cdb4e010b215878 | [
"MIT"
] | null | null | null | setup.py | petronije2002/PqrUpload | db22af08dac1243569e5f3dd8cdb4e010b215878 | [
"MIT"
] | 3 | 2020-03-24T17:35:36.000Z | 2021-02-02T22:12:56.000Z | setup.py | petronije2002/PqrUpload | db22af08dac1243569e5f3dd8cdb4e010b215878 | [
"MIT"
] | null | null | null | import setuptools
from distutils.core import setup
setup(
name = 'PqrUploadModule', # How you named your package folder (MyLib)
packages = ['PqrUploadModule'], # Chose the same as "name"
version = '0.0.12', # Start with a small number and increase it with every change you make
license='MIT', ... | 33.918919 | 146 | 0.655378 | import setuptools
from distutils.core import setup
setup(
name = 'PqrUploadModule', # How you named your package folder (MyLib)
packages = ['PqrUploadModule'], # Chose the same as "name"
version = '0.0.12', # Start with a small number and increase it with every change you make
license='MIT', ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
af51e6002bbc6f380207972586789598a0147a80 | 3,428 | py | Python | docs/sample_code/gradient_accumulation/train_and_eval_boost.py | mindspore-ai/docs | e7cbd69fe2bbd7870aa4591510ed3342ec6a3d41 | [
"Apache-2.0",
"CC-BY-4.0"
] | 288 | 2020-03-28T07:00:25.000Z | 2021-12-26T14:56:31.000Z | docs/sample_code/gradient_accumulation/train_and_eval_boost.py | mindspore-ai/docs | e7cbd69fe2bbd7870aa4591510ed3342ec6a3d41 | [
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-07-21T08:11:58.000Z | 2021-07-21T08:11:58.000Z | docs/sample_code/gradient_accumulation/train_and_eval_boost.py | mindspore-ai/docs | e7cbd69fe2bbd7870aa4591510ed3342ec6a3d41 | [
"Apache-2.0",
"CC-BY-4.0"
] | 37 | 2020-03-30T06:38:37.000Z | 2021-09-17T05:47:59.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 44.519481 | 97 | 0.692824 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 0 | 0 | 0 | 710 | 0 | 0 | 0 | 45 | 45 |
0f22cc5d0281d7dff59ccf6e3b47c7eb49e03b0a | 610 | py | Python | nlidbTranslator/api/__init__.py | DataManagementLab/univerSQL | 1e37f089c1f1dfc8756c183db019a90e5a9a2c2c | [
"MIT"
] | null | null | null | nlidbTranslator/api/__init__.py | DataManagementLab/univerSQL | 1e37f089c1f1dfc8756c183db019a90e5a9a2c2c | [
"MIT"
] | null | null | null | nlidbTranslator/api/__init__.py | DataManagementLab/univerSQL | 1e37f089c1f1dfc8756c183db019a90e5a9a2c2c | [
"MIT"
] | null | null | null | import sys
from api.analysis import translators
from api.paths import PROJECT_ROOT
# allow for imports of translator code as "translator.module"
sys.path.append(str(PROJECT_ROOT / "translators"))
# allow for imports of adapter code as "adapter.translator.module"
sys.path.append(str(PROJECT_ROOT / "nlidbTranslator/a... | 30.5 | 90 | 0.778689 | import sys
from api.analysis import translators
from api.paths import PROJECT_ROOT
# allow for imports of translator code as "translator.module"
sys.path.append(str(PROJECT_ROOT / "translators"))
# allow for imports of adapter code as "adapter.translator.module"
sys.path.append(str(PROJECT_ROOT / "nlidbTranslator/a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
be2b4882c9b9c8c5c38eacb792a6d3280a52f270 | 1,659 | py | Python | tasks.py | RayFoulk/PythonDemo | 2134c51d2fa479308a715ddf692b01189bb757c7 | [
"MIT"
] | null | null | null | tasks.py | RayFoulk/PythonDemo | 2134c51d2fa479308a715ddf692b01189bb757c7 | [
"MIT"
] | null | null | null | tasks.py | RayFoulk/PythonDemo | 2134c51d2fa479308a715ddf692b01189bb757c7 | [
"MIT"
] | null | null | null | import pathlib
ROOT_PATH = pathlib.Path(__file__).resolve().parent
ROOT_PATH_STR = str(ROOT_PATH)
| 23.366197 | 79 | 0.64135 | import os
import pathlib
from invoke import (
task,
)
ROOT_PATH = pathlib.Path(__file__).resolve().parent
ROOT_PATH_STR = str(ROOT_PATH)
@task()
def clean(context):
"""
Clean the project
:param context: invoke context
"""
with context.cd(ROOT_PATH_STR):
context.run('git clean -fd')
... | 0 | 1,397 | 0 | 0 | 0 | 0 | 0 | -1 | 159 |
e6b34aed109e0fb773fcc927112667f38c52e168 | 861 | py | Python | src/moonshot/utils/image_utils.py | rpeloff/moonshot | f58ddaa15c2bea416731e3bd1f2c5de86d6aa115 | [
"MIT"
] | 4 | 2019-10-29T09:50:59.000Z | 2019-11-22T19:01:07.000Z | src/moonshot/utils/image_utils.py | rpeloff/moonshot | f58ddaa15c2bea416731e3bd1f2c5de86d6aa115 | [
"MIT"
] | null | null | null | src/moonshot/utils/image_utils.py | rpeloff/moonshot | f58ddaa15c2bea416731e3bd1f2c5de86d6aa115 | [
"MIT"
] | null | null | null | """Utility functions for manipulating image data.
Author: Ryan Eloff
Contact: ryan.peter.eloff@gmail.com
Date: July 2019
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from skimage.io import imread
def load_image_array(image_pat... | 26.090909 | 84 | 0.708479 | """Utility functions for manipulating image data.
Author: Ryan Eloff
Contact: ryan.peter.eloff@gmail.com
Date: July 2019
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from skimage.io import imread
def load_image_array(image_pat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bf1859ab0665815dab10e43bd66ddd020f612197 | 1,877 | py | Python | src/util/data_util.py | Iliricon/DeepNotebooks | 036c807753254504c8546fbdfc91a86cd94e6a3d | [
"Apache-2.0"
] | 5 | 2019-03-01T14:45:54.000Z | 2020-04-27T02:39:50.000Z | src/util/data_util.py | cvoelcker/DeepNotebooks | 036c807753254504c8546fbdfc91a86cd94e6a3d | [
"Apache-2.0"
] | 3 | 2018-12-13T13:11:13.000Z | 2019-03-18T17:01:43.000Z | src/util/data_util.py | Iliricon/DeepNotebooks | 036c807753254504c8546fbdfc91a86cd94e6a3d | [
"Apache-2.0"
] | 2 | 2020-03-30T16:20:55.000Z | 2020-11-06T02:26:33.000Z | """
@author Claas Voelcker
Utils module containing some data utility functions
"""
import numpy as np
from src.util.spn_util import get_categoricals
def get_categorical_data(spn, df, dictionary, header=1, types=False, date=False, assert_nan=False):
"""
:param spn:
:param df:
:param dictionary:
... | 30.770492 | 128 | 0.661161 | """
@author Claas Voelcker
Utils module containing some data utility functions
"""
import numpy as np
from src.util.spn_util import get_categoricals
def get_categorical_data(spn, df, dictionary, header=1, types=False, date=False, assert_nan=False):
"""
:param spn:
:param df:
:param dictionary:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ef831a67bd75d3d51f3b3e54553dc40350c61b9b | 3,261 | py | Python | src/hades/bin/check_database.py | agdsn/hades | 78782831b840188b14e37c0673a6d6e9712f64ce | [
"MIT"
] | 8 | 2015-04-27T00:41:03.000Z | 2021-11-14T17:15:26.000Z | src/hades/bin/check_database.py | agdsn/hades | 78782831b840188b14e37c0673a6d6e9712f64ce | [
"MIT"
] | 84 | 2015-04-27T12:15:00.000Z | 2021-11-28T19:06:23.000Z | src/hades/bin/check_database.py | agdsn/hades | 78782831b840188b14e37c0673a6d6e9712f64ce | [
"MIT"
] | 4 | 2015-11-14T16:20:40.000Z | 2017-09-05T00:27:49.000Z | #!/usr/bin/env python3
"""Check the status of the Hades database.
Try to select data as the different hades users from the database to check if
the database is running and accessible.
"""
import contextlib
import logging
import pwd
import sys
from typing import Iterable
from sqlalchemy import Table, exists, null, sel... | 32.287129 | 80 | 0.6636 | #!/usr/bin/env python3
"""Check the status of the Hades database.
Try to select data as the different hades users from the database to check if
the database is running and accessible.
"""
import contextlib
import logging
import os
import pwd
import sys
from typing import Iterable
from sqlalchemy import Table, exists,... | 0 | 0 | 0 | 0 | 0 | 1,250 | 0 | 185 | 223 |
133d4af39702f3499201453afadb4d55cb5917a1 | 4,027 | py | Python | scripts/convtransformer/2D.py | TimDettmers/sched | e16735f2c2eb6a51f5cf29ead534041574034e2e | [
"MIT"
] | 1 | 2020-04-22T17:49:48.000Z | 2020-04-22T17:49:48.000Z | scripts/convtransformer/2D.py | TimDettmers/sched | e16735f2c2eb6a51f5cf29ead534041574034e2e | [
"MIT"
] | null | null | null | scripts/convtransformer/2D.py | TimDettmers/sched | e16735f2c2eb6a51f5cf29ead534041574034e2e | [
"MIT"
] | null | null | null | import gpuscheduler
import argparse
from itertools import product
parser = argparse.ArgumentParser(description='Compute script.')
parser.add_argument('--dry', action='store_true')
parser.add_argument('--verbose', action='store_true')
args = parser.parse_args()
#s = gpuscheduler.Scheduler('/home/tim/data/git/sched/con... | 32.475806 | 285 | 0.659051 | import itertools
import gpuscheduler
import argparse
import os
from itertools import product
parser = argparse.ArgumentParser(description='Compute script.')
parser.add_argument('--dry', action='store_true')
parser.add_argument('--verbose', action='store_true')
args = parser.parse_args()
#s = gpuscheduler.Scheduler('/... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -17 | 44 |