hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9d16548fc6a8b1b86bb49107b9c13023f78ef594 | 3,051 | py | Python | publish/tests/models.py | nacady/django-publish | a9b0b0b0ce0a2cd664d256edc4c819180dc882df | [
"BSD-3-Clause"
] | null | null | null | publish/tests/models.py | nacady/django-publish | a9b0b0b0ce0a2cd664d256edc4c819180dc882df | [
"BSD-3-Clause"
] | null | null | null | publish/tests/models.py | nacady/django-publish | a9b0b0b0ce0a2cd664d256edc4c819180dc882df | [
"BSD-3-Clause"
] | 1 | 2021-06-28T03:59:45.000Z | 2021-06-28T03:59:45.000Z | from django.db import models
from datetime import datetime
from publish.models import Publishable
# publishable model with a reverse relation to
# page (as a child)
# non-publishable reverse relation to page (as a child)
update_pub_date.pub_date = datetime.now()
| 29.621359 | 74 | 0.715831 | from django.db import models
from datetime import datetime
from publish.models import Publishable
class Site(models.Model):
title = models.CharField(max_length=100)
domain = models.CharField(max_length=100)
class FlatPage(Publishable):
url = models.CharField(max_length=100, db_index=True)
title = mo... | 364 | 2,160 | 251 |
772b21e88da8f6ee452593fcfccc34cec501a301 | 1,226 | py | Python | flower/db.py | guhaiqiao/Flower_app | eae9b6ce066544e8b505c98d202527d86cea9357 | [
"MIT"
] | 1 | 2020-12-14T01:48:20.000Z | 2020-12-14T01:48:20.000Z | flower/db.py | guhaiqiao/Flower_app | eae9b6ce066544e8b505c98d202527d86cea9357 | [
"MIT"
] | null | null | null | flower/db.py | guhaiqiao/Flower_app | eae9b6ce066544e8b505c98d202527d86cea9357 | [
"MIT"
] | null | null | null | import sqlite3
import glob
import os
import click
from flask import current_app, g
from flask.cli import with_appcontext
@click.command('init-db')
@with_appcontext
| 23.576923 | 72 | 0.615824 | import sqlite3
import glob
import os
import click
from flask import current_app, g
from flask.cli import with_appcontext
def get_db():
if 'db' not in g:
g.db = sqlite3.connect(current_app.config['DATABASE'],
detect_types=sqlite3.PARSE_DECLTYPES)
g.db.row_factory = sq... | 942 | 0 | 114 |
c4bcfd12173f327f06cebc80aa483d7df62edc93 | 3,151 | py | Python | tests/test_ddg_global_var_dependencies.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 6,132 | 2015-08-06T23:24:47.000Z | 2022-03-31T21:49:34.000Z | tests/test_ddg_global_var_dependencies.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 2,272 | 2015-08-10T08:40:07.000Z | 2022-03-31T23:46:44.000Z | tests/test_ddg_global_var_dependencies.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 1,155 | 2015-08-06T23:37:39.000Z | 2022-03-31T05:54:11.000Z | import os
import angr
import nose
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))
arches = {'x86_64'}
if __name__ == "__main__":
main()
| 43.164384 | 171 | 0.720406 | import os
import angr
import nose
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))
arches = {'x86_64'}
def main():
test_ddg_global_var_dependencies()
def test_ddg_global_var_dependencies():
for arch in arches:
run_ddg_global_var_dependencies(arch... | 2,812 | 0 | 138 |
83b0710d125addf1a454b4ea6976092a23001346 | 930 | py | Python | src/IO.py | Rahoo11/Jarvis | 6fac03e6f7bb963d0632ec781323210b3379603b | [
"MIT"
] | null | null | null | src/IO.py | Rahoo11/Jarvis | 6fac03e6f7bb963d0632ec781323210b3379603b | [
"MIT"
] | null | null | null | src/IO.py | Rahoo11/Jarvis | 6fac03e6f7bb963d0632ec781323210b3379603b | [
"MIT"
] | null | null | null | from datetime import datetime
import logging
# LOGGING SETTINGS
# Save detailed information to log file
handler_file = logging.FileHandler("jarvis.log")
handler_file.setFormatter(logging.Formatter(
"%(asctime)s %(levelname)s %(filename)s:%(lineno)d - %(message)s",
"%Y-%m-%d %H:%M:%S"
))
# Output simple infor... | 22.682927 | 76 | 0.691398 | from datetime import datetime
import logging
# LOGGING SETTINGS
# Save detailed information to log file
handler_file = logging.FileHandler("jarvis.log")
handler_file.setFormatter(logging.Formatter(
"%(asctime)s %(levelname)s %(filename)s:%(lineno)d - %(message)s",
"%Y-%m-%d %H:%M:%S"
))
# Output simple infor... | 0 | 0 | 0 |
6bf254e4d47110abc5fa56df01806709a669c1dd | 8,744 | py | Python | sfo.py | ayassinsayed/py.dataformat.sfo | 99b2ad11b162318f7e5251a760bd5b53e1cf826d | [
"MIT"
] | 1 | 2021-09-06T04:27:13.000Z | 2021-09-06T04:27:13.000Z | sfo.py | Jasily/py.dataformat.sfo | 99b2ad11b162318f7e5251a760bd5b53e1cf826d | [
"MIT"
] | null | null | null | sfo.py | Jasily/py.dataformat.sfo | 99b2ad11b162318f7e5251a760bd5b53e1cf826d | [
"MIT"
] | 4 | 2017-10-28T18:31:00.000Z | 2021-01-26T00:24:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 - cologler <skyoflw@gmail.com>
# ----------
#
# ----------
import io
__all__ = [
'FormatError',
'SfoFile',
'PSVGameSfo',
'PSPGameSfo',
]
_BYTE_ORDER = 'little'
if __name__ == '__main__':
for i in ra... | 28.763158 | 98 | 0.589776 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 - cologler <skyoflw@gmail.com>
# ----------
#
# ----------
import io
__all__ = [
'FormatError',
'SfoFile',
'PSVGameSfo',
'PSPGameSfo',
]
class FormatError(Exception):
pass
_BYTE_ORDER = 'little'
class He... | 6,074 | 2,035 | 242 |
73e9bc79d0b58408169e58a0a67fb34a83f478ad | 490 | py | Python | bluebottle/test/factory_models/payments.py | maykinmedia/bluebottle | 355d4729662b5e9a03398efb4fe882e0f8cfa28d | [
"BSD-3-Clause"
] | null | null | null | bluebottle/test/factory_models/payments.py | maykinmedia/bluebottle | 355d4729662b5e9a03398efb4fe882e0f8cfa28d | [
"BSD-3-Clause"
] | null | null | null | bluebottle/test/factory_models/payments.py | maykinmedia/bluebottle | 355d4729662b5e9a03398efb4fe882e0f8cfa28d | [
"BSD-3-Clause"
] | null | null | null | import factory
from bluebottle.payments.models import Payment, OrderPayment
from bluebottle.payments_logger.models import PaymentLogEntry
from .orders import OrderFactory
| 24.5 | 61 | 0.804082 | import factory
from bluebottle.payments.models import Payment, OrderPayment
from bluebottle.payments_logger.models import PaymentLogEntry
from .orders import OrderFactory
class OrderPaymentFactory(factory.DjangoModelFactory):
FACTORY_FOR = OrderPayment
payment_method = 'mock'
amount = 100
order = fa... | 0 | 270 | 46 |
39765b3fa03cc18cbd68dd8b22b2a3c60009bf92 | 2,667 | py | Python | tests/feeds/test_matic_usd_feed.py | tellor-io/telliot-feed-examples | 3f825c90ad372f42c89eee0f5b54250f22ec0728 | [
"MIT"
] | 7 | 2021-11-10T21:14:57.000Z | 2022-03-26T07:27:23.000Z | tests/feeds/test_matic_usd_feed.py | tellor-io/telliot-feed-examples | 3f825c90ad372f42c89eee0f5b54250f22ec0728 | [
"MIT"
] | 86 | 2021-11-09T13:12:58.000Z | 2022-03-31T17:28:56.000Z | tests/feeds/test_matic_usd_feed.py | tellor-io/telliot-feed-examples | 3f825c90ad372f42c89eee0f5b54250f22ec0728 | [
"MIT"
] | 2 | 2021-11-27T12:51:22.000Z | 2022-03-12T16:38:00.000Z | import pytest
from telliot_feed_examples.feeds.matic_usd_feed import matic_usd_median_feed
@pytest.mark.asyncio
| 115.956522 | 1,381 | 0.813648 | import pytest
from telliot_feed_examples.feeds.matic_usd_feed import matic_usd_median_feed
@pytest.mark.asyncio
async def test_fetch_price():
(value, _) = await matic_usd_median_feed.source.fetch_new_datapoint()
assert value > 0
print(value)
def test_query_info():
q = matic_usd_median_feed.query
... | 2,506 | 0 | 45 |
2f90e72ab2ad376594d32a0c909e3065372a297e | 1,066 | py | Python | motelsAPI/settings/dev.py | amartinez1/5letrasAPI | 670b638a8254a0809c9f953350cd1a3264b61bf7 | [
"MIT"
] | 2 | 2015-05-02T12:30:22.000Z | 2015-05-08T18:13:43.000Z | motelsAPI/settings/dev.py | amartinez1/5letrasAPI | 670b638a8254a0809c9f953350cd1a3264b61bf7 | [
"MIT"
] | null | null | null | motelsAPI/settings/dev.py | amartinez1/5letrasAPI | 670b638a8254a0809c9f953350cd1a3264b61bf7 | [
"MIT"
] | null | null | null | from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'motels_db',
}
}
ALLOWED_HOSTS = []
CORS_ORIGIN_ALLOW_ALL = True
DEBUG = True
SECRET_KEY = 'test'
INSTALLED_APPS += (
'autofixture',
'debug_toolbar',
'... | 23.688889 | 80 | 0.661351 | from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'motels_db',
}
}
ALLOWED_HOSTS = []
CORS_ORIGIN_ALLOW_ALL = True
DEBUG = True
SECRET_KEY = 'test'
INSTALLED_APPS += (
'autofixture',
'debug_toolbar',
'... | 0 | 0 | 0 |
a1adb53a7219e0575c94c4f8e32bc32af0a24a42 | 955 | py | Python | snooper.py | boztalay/SuperconCubeCmd | 9cbd685a75dbf9fdf7a04e7a240b07117b1fbe82 | [
"MIT"
] | null | null | null | snooper.py | boztalay/SuperconCubeCmd | 9cbd685a75dbf9fdf7a04e7a240b07117b1fbe82 | [
"MIT"
] | null | null | null | snooper.py | boztalay/SuperconCubeCmd | 9cbd685a75dbf9fdf7a04e7a240b07117b1fbe82 | [
"MIT"
] | null | null | null | import sys
import cubey
if __name__ == "__main__":
if len(sys.argv) != 2:
print "Gimme a serial port!"
sys.exit(1)
serialPort = sys.argv[1]
main(serialPort)
| 23.292683 | 93 | 0.536126 | import sys
import cubey
def main(serialPort):
cube = cubey.Cube(serialPort)
print "Listening, Ctrl-C to stop..."
try:
while True:
rawMessage = cube.sendCommand("m n u")
printMessage(rawMessage)
except KeyboardInterrupt:
print
cube.breakOut()
print "D... | 721 | 0 | 46 |
7ffc97d0a4c41aca77fb73ffa2a8a35b537492b9 | 3,841 | py | Python | src/SgFactory/table.py | WDonegan/psg-factories | 5a6e362d9159a0d5c82960d9e2e7d446f1ab013d | [
"MIT"
] | null | null | null | src/SgFactory/table.py | WDonegan/psg-factories | 5a6e362d9159a0d5c82960d9e2e7d446f1ab013d | [
"MIT"
] | null | null | null | src/SgFactory/table.py | WDonegan/psg-factories | 5a6e362d9159a0d5c82960d9e2e7d446f1ab013d | [
"MIT"
] | null | null | null | import PySimpleGUI as sg
from .base import GeneratorBase
| 43.157303 | 60 | 0.548555 | import PySimpleGUI as sg
from .base import GeneratorBase
class Table(GeneratorBase):
VALUES = 'values'
HEADINGS = 'headings'
VISIBLE_COLUMN_MAP = 'visible_column_map'
COL_WIDTHS = 'col_widths'
DEF_COL_WIDTH = 'def_col_width'
AUTO_SIZE_COLUMNS = 'auto_size_columns'
MAX_COL_WIDTH = 'max_col_... | 2,408 | 1,352 | 23 |
9e5764903cdf85638ab62747d681b0695238c4e3 | 1,411 | py | Python | day-9&10/main.py | a18antsv/Python-Two-Week-Challenge | cfdefe5e2643d1c1ee66d08a16a7ffc175ba1a3a | [
"MIT"
] | null | null | null | day-9&10/main.py | a18antsv/Python-Two-Week-Challenge | cfdefe5e2643d1c1ee66d08a16a7ffc175ba1a3a | [
"MIT"
] | null | null | null | day-9&10/main.py | a18antsv/Python-Two-Week-Challenge | cfdefe5e2643d1c1ee66d08a16a7ffc175ba1a3a | [
"MIT"
] | null | null | null | import requests
from flask import Flask, render_template, request, redirect
base_url = "http://hn.algolia.com/api/v1"
# This URL gets the newest stories.
new = f"{base_url}/search_by_date?tags=story"
# This URL gets the most popular stories
popular = f"{base_url}/search?tags=story"
# This function makes the URL to... | 24.754386 | 70 | 0.690291 | import requests
from flask import Flask, render_template, request, redirect
base_url = "http://hn.algolia.com/api/v1"
# This URL gets the newest stories.
new = f"{base_url}/search_by_date?tags=story"
# This URL gets the most popular stories
popular = f"{base_url}/search?tags=story"
# This function makes the URL to... | 842 | 0 | 66 |
d32135b6fdf1615d5e0b4352267bf443c9e38704 | 2,651 | py | Python | feewaiver/urls.py | dbca-wa/feewaiver | 7938a0e9d18924c12b27c0a411b6d7eccb40166b | [
"Apache-2.0"
] | null | null | null | feewaiver/urls.py | dbca-wa/feewaiver | 7938a0e9d18924c12b27c0a411b6d7eccb40166b | [
"Apache-2.0"
] | 12 | 2021-02-24T02:33:01.000Z | 2022-01-25T02:37:39.000Z | feewaiver/urls.py | mintcoding/feewaiver | 47d69db91386f760dd36d87cbb565a9bb72a27d5 | [
"Apache-2.0"
] | 1 | 2021-01-08T02:15:27.000Z | 2021-01-08T02:15:27.000Z | from django.conf import settings
from django.contrib import admin
from django.conf.urls import url, include
from django.conf.urls.static import static
from rest_framework import routers
#from feewaiver import views, users_api, api
from feewaiver import views, api
from ledger.urls import urlpatterns as ledger_patterns
... | 48.2 | 130 | 0.744247 | from django.conf import settings
from django.contrib import admin
from django.conf.urls import url, include
from django.conf.urls.static import static
from rest_framework import routers
#from feewaiver import views, users_api, api
from feewaiver import views, api
from ledger.urls import urlpatterns as ledger_patterns
... | 0 | 0 | 0 |
54f82229c0438a79d9123d69c7d0467d0c47c179 | 1,758 | py | Python | ros/src/twist_controller/twist_controller.py | Acharya-Kiran/CarND-Capstone | bc5f59ea20271e2e46e156fff86cd2482b52c5f2 | [
"MIT"
] | null | null | null | ros/src/twist_controller/twist_controller.py | Acharya-Kiran/CarND-Capstone | bc5f59ea20271e2e46e156fff86cd2482b52c5f2 | [
"MIT"
] | null | null | null | ros/src/twist_controller/twist_controller.py | Acharya-Kiran/CarND-Capstone | bc5f59ea20271e2e46e156fff86cd2482b52c5f2 | [
"MIT"
] | null | null | null | from pid import PID
from lowpass import LowPassFilter
from yaw_controller import YawController
import rospy
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
| 27.904762 | 101 | 0.755973 | from pid import PID
from lowpass import LowPassFilter
from yaw_controller import YawController
import rospy
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self,vehicle_mass,fuel_capacity,brake_deadband,decel_limit,
accel_limit,wheel_radius,wheel_base,steer_ratio,max_lat_accel,max_st... | 1,525 | 4 | 78 |
9ecb3b223a203a77d74b6711d0796c6b4e890962 | 27,213 | py | Python | others/Pytorch/utilis_rnn.py | jhuebotter/CartpoleSNNdemo | d18a85cbc45bff48295c46c9cd8c9fc00192318c | [
"MIT"
] | null | null | null | others/Pytorch/utilis_rnn.py | jhuebotter/CartpoleSNNdemo | d18a85cbc45bff48295c46c9cd8c9fc00192318c | [
"MIT"
] | null | null | null | others/Pytorch/utilis_rnn.py | jhuebotter/CartpoleSNNdemo | d18a85cbc45bff48295c46c9cd8c9fc00192318c | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.utils import data
from datetime import datetime
import collections
import os
import random as rnd
import copy
from Modeling.Pytorch.utilis_rnn_specific import *
from SI_Toolkit.load_and_normalize import load_normalization_info, load_data, normalize_df, denormalize_df
... | 38.545326 | 132 | 0.614449 | import torch
import torch.nn as nn
from torch.utils import data
from datetime import datetime
import collections
import os
import random as rnd
import copy
from Modeling.Pytorch.utilis_rnn_specific import *
from SI_Toolkit.load_and_normalize import load_normalization_info, load_data, normalize_df, denormalize_df
... | 9,315 | 3,525 | 189 |
a14001fe338c11a2de9e1cb5a8130727cb1dcd35 | 7,654 | py | Python | resto_client/cli/parser/parser_configure_server.py | CNES/resto_client | 7048bd79c739e33882ebd664790dcf0528e81aa4 | [
"Apache-2.0"
] | 6 | 2019-12-20T09:12:30.000Z | 2021-07-08T11:44:55.000Z | resto_client/cli/parser/parser_configure_server.py | CNES/resto_client | 7048bd79c739e33882ebd664790dcf0528e81aa4 | [
"Apache-2.0"
] | null | null | null | resto_client/cli/parser/parser_configure_server.py | CNES/resto_client | 7048bd79c739e33882ebd664790dcf0528e81aa4 | [
"Apache-2.0"
] | 1 | 2019-12-17T20:16:39.000Z | 2019-12-17T20:16:39.000Z | # -*- coding: utf-8 -*-
"""
.. admonition:: License
Copyright 2019 CNES
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 requir... | 44.5 | 100 | 0.74902 | # -*- coding: utf-8 -*-
"""
.. admonition:: License
Copyright 2019 CNES
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 requir... | 0 | 0 | 0 |
472e53d4d44cd3cc04aaf44dbd4aac137138d3f3 | 1,224 | py | Python | src/wlstm/utils.py | tedhuang96/mifwlstm | e1d5a3a1f954952ff5a1f28be08e703d1251e592 | [
"MIT"
] | 11 | 2021-06-21T04:06:45.000Z | 2022-02-22T20:53:45.000Z | src/wlstm/utils.py | tedhuang96/mifwlstm | e1d5a3a1f954952ff5a1f28be08e703d1251e592 | [
"MIT"
] | null | null | null | src/wlstm/utils.py | tedhuang96/mifwlstm | e1d5a3a1f954952ff5a1f28be08e703d1251e592 | [
"MIT"
] | null | null | null | import torch
from os.path import join, isdir, isfile
from os import listdir
import re
from src.wlstm.models import ReBiL
| 42.206897 | 125 | 0.686275 | import torch
from os.path import join, isdir, isfile
from os import listdir
import re
from src.wlstm.models import ReBiL
def load_rebil_model(args, logdir, device='cuda:0'):
if not isdir(logdir):
print('The folder '+logdir+' is not found.')
return None
if args.eval_model_saved_epoch is None:
... | 1,079 | 0 | 23 |
4498832be13a9415d6ca76fd5ad2398b9e886b1d | 1,059 | py | Python | src/push_button.py | albang/arisa | 9b7ea5e7befc92d1febb038476d03e858a622153 | [
"MIT"
] | null | null | null | src/push_button.py | albang/arisa | 9b7ea5e7befc92d1febb038476d03e858a622153 | [
"MIT"
] | null | null | null | src/push_button.py | albang/arisa | 9b7ea5e7befc92d1febb038476d03e858a622153 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
import os, time
os.system('mpg123 -g100 /home/pi/paw_patrol_courte.mp3 &')
GPIO.setwarnings(False) # Ignore warning for now
GPIO.setmode(GPIO.BOARD) # Use physical pin numbering
GPIO.setup(10, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) # Set... | 40.730769 | 128 | 0.756374 | #!/usr/bin/env python3
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
import os, time
def button_callback(channel):
print("Button was pushed!")
os.system('mpg123 /home/pi/minute_courte.mp3 &')
def button_callback2(channel):
print("Button was pushed!")
os.system('mpg123 -g100 /home/pi/paw_... | 198 | 0 | 46 |
4da98b7e4cedd701321a8df23f73f41ffd79cf6e | 1,054 | py | Python | src/utils.py | michaellas/streaming-vid-to-gifs | ee5df22c820d4d631f0437c98a53989ecb76dca3 | [
"MIT"
] | null | null | null | src/utils.py | michaellas/streaming-vid-to-gifs | ee5df22c820d4d631f0437c98a53989ecb76dca3 | [
"MIT"
] | 1 | 2015-04-07T12:24:26.000Z | 2015-04-07T12:28:30.000Z | src/utils.py | michaellas/streaming-vid-to-gifs | ee5df22c820d4d631f0437c98a53989ecb76dca3 | [
"MIT"
] | null | null | null | import time
import sys
if __name__ == '__main__':
'''
@log_called_times_decorator
def ff():
print 'f'
while True:
ff()
time.sleep(1)
'''
print_progress(45)
print ''
print_progress(x=20,max=200) | 26.35 | 107 | 0.578748 | import time
import sys
def log_called_times_decorator(func):
def wrapper(*args):
wrapper.count += 1
# print "The function I modify has been called {0} times(s).".format(wrapper.count)
now = time.time()
if now - wrapper.last_log > wrapper.dt:
print '[DEBUG] In last %ds %s... | 748 | 0 | 46 |
7e9bde1a168f5b214f14f1b43d8d2d70b12ae817 | 11,187 | py | Python | org/hasii/chip8/ui/Chip8UIScreen.py | hasii2011/Chip8Emulator | 96be8c0d01ccae0492ce0f980af905ec5c690f1a | [
"MIT"
] | null | null | null | org/hasii/chip8/ui/Chip8UIScreen.py | hasii2011/Chip8Emulator | 96be8c0d01ccae0492ce0f980af905ec5c690f1a | [
"MIT"
] | 8 | 2019-08-12T23:33:12.000Z | 2020-12-09T01:31:17.000Z | org/hasii/chip8/ui/Chip8UIScreen.py | hasii2011/Chip8Emulator | 96be8c0d01ccae0492ce0f980af905ec5c690f1a | [
"MIT"
] | null | null | null |
from typing import List
from os import getcwd
from os.path import basename
from pkg_resources import resource_filename
from logging import Logger
from logging import getLogger
from pygame import event as Event
from pygame import Surface
from pygame.font import Font
from albow.References import AttrRef
from albow.... | 37.29 | 141 | 0.653169 |
from typing import List
from os import getcwd
from os.path import basename
from pkg_resources import resource_filename
from logging import Logger
from logging import getLogger
from pygame import event as Event
from pygame import Surface
from pygame.font import Font
from albow.References import AttrRef
from albow.... | 4,272 | 5,165 | 23 |
4495fdf8627af041231ecfd1e216c9c24557ea8c | 847 | py | Python | monte_carlo.py | yandexdataschool/pyretina | 300d3cd460ded071d75d3729e9b5dc1489d86d73 | [
"Apache-2.0"
] | 2 | 2016-05-28T15:59:47.000Z | 2018-07-30T21:05:18.000Z | monte_carlo.py | yandexdataschool/pyretina | 300d3cd460ded071d75d3729e9b5dc1489d86d73 | [
"Apache-2.0"
] | null | null | null | monte_carlo.py | yandexdataschool/pyretina | 300d3cd460ded071d75d3729e9b5dc1489d86d73 | [
"Apache-2.0"
] | null | null | null | from pyretina.mc import monte_carlo
import numpy as np
import json
import os
import os.path as osp
import shutil
number_of_events = 10
if __name__ == "__main__":
main("config/mc.json") | 21.175 | 82 | 0.641086 | from pyretina.mc import monte_carlo
import numpy as np
import json
import os
import os.path as osp
import shutil
number_of_events = 10
def main(conf):
with open(conf, 'r') as f:
config = json.load(f)
for N in np.arange(20, 520, 20):
config['scattering']['number_of_particles'] = {
'type' : 'randin... | 634 | 0 | 23 |
18ed809f9eec9232085b1804143efe6ca93e3a6e | 5,950 | py | Python | miner.py | OwlEyes33/crypto-alpha | dc3b39ecf38f3f445ecd94057775220b651633fc | [
"Apache-2.0"
] | null | null | null | miner.py | OwlEyes33/crypto-alpha | dc3b39ecf38f3f445ecd94057775220b651633fc | [
"Apache-2.0"
] | null | null | null | miner.py | OwlEyes33/crypto-alpha | dc3b39ecf38f3f445ecd94057775220b651633fc | [
"Apache-2.0"
] | null | null | null | import logging
import os
import time
from math import inf
from os import environ
from threading import Thread
import requests
from redis import Redis
from block import Block
from blockchain import Blockchain
from peer2peer import PeerToPeerMessage
from transaction import Transaction
logging.basicConfig(level=logging... | 37.421384 | 86 | 0.557479 | import logging
import os
import time
from math import inf
from os import environ
from threading import Thread
import requests
from redis import Redis
from block import Block
from blockchain import Blockchain
from peer2peer import PeerToPeerMessage
from transaction import Transaction
logging.basicConfig(level=logging... | 5,170 | 359 | 23 |
940189421ca5db8b06f5e381219db498733f8003 | 95 | py | Python | mumu/decorators/__init__.py | mingminyu/mumu | e9f6c86a0b678ce4467ffba7f3dc4c0c8f971ff8 | [
"Apache-2.0"
] | 1 | 2021-06-22T16:57:28.000Z | 2021-06-22T16:57:28.000Z | mumu/decorators/__init__.py | mingminyu/mumu | e9f6c86a0b678ce4467ffba7f3dc4c0c8f971ff8 | [
"Apache-2.0"
] | null | null | null | mumu/decorators/__init__.py | mingminyu/mumu | e9f6c86a0b678ce4467ffba7f3dc4c0c8f971ff8 | [
"Apache-2.0"
] | null | null | null | from ._timeit import timeit
from ._progressbar import pbar_sql_query
from ._retry import retry
| 23.75 | 40 | 0.842105 | from ._timeit import timeit
from ._progressbar import pbar_sql_query
from ._retry import retry
| 0 | 0 | 0 |
1486c16002e2c1f7f36eced992718519ad8c6db1 | 959 | py | Python | web2py-appliances-master/MyForum/models/db.py | wantsomechocolate/WantsomeBeanstalk | 8c8a0a80490d04ea52661a3114fd3db8de65a01e | [
"BSD-3-Clause"
] | null | null | null | web2py-appliances-master/MyForum/models/db.py | wantsomechocolate/WantsomeBeanstalk | 8c8a0a80490d04ea52661a3114fd3db8de65a01e | [
"BSD-3-Clause"
] | null | null | null | web2py-appliances-master/MyForum/models/db.py | wantsomechocolate/WantsomeBeanstalk | 8c8a0a80490d04ea52661a3114fd3db8de65a01e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
DEBUG = True
db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])
response.generic_patterns = ['*'] if request.is_local else []
from gluon.tools import Auth, Service, prettydate
auth = Auth(db)
auth.define_tables(username=False, signature=False)
service = Service()
## confi... | 33.068966 | 78 | 0.777894 | # -*- coding: utf-8 -*-
DEBUG = True
db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])
response.generic_patterns = ['*'] if request.is_local else []
from gluon.tools import Auth, Service, prettydate
auth = Auth(db)
auth.define_tables(username=False, signature=False)
service = Service()
## confi... | 0 | 0 | 0 |
0cd0801dcd3a7dfddc9f817c743870fca0f08fa8 | 34 | py | Python | python/cendalytics/report/core/bp/__init__.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | python/cendalytics/report/core/bp/__init__.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | python/cendalytics/report/core/bp/__init__.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | from .report_api import ReportAPI
| 17 | 33 | 0.852941 | from .report_api import ReportAPI
| 0 | 0 | 0 |
9ded2fcc8e677e149baf4d0a230b66939619b9e9 | 8,353 | py | Python | conceptnet5/vectors/retrofit.py | MattCurryCom/conceptnet5 | a16d94e635aee3d35a22aa04fcad7bb87ce927d8 | [
"Apache-2.0"
] | 1 | 2018-11-27T17:00:57.000Z | 2018-11-27T17:00:57.000Z | conceptnet5/vectors/retrofit.py | MattCurryCom/conceptnet5 | a16d94e635aee3d35a22aa04fcad7bb87ce927d8 | [
"Apache-2.0"
] | null | null | null | conceptnet5/vectors/retrofit.py | MattCurryCom/conceptnet5 | a16d94e635aee3d35a22aa04fcad7bb87ce927d8 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.preprocessing import normalize
from .sparse_matrix_builder import build_from_conceptnet_table
from .formats import load_hdf, save_hdf
def retrofit(row_labels, dense_frame, sparse_csr,
iterations=5, verbosity=0, max_cleanup_iters=20,
orig_... | 48.005747 | 130 | 0.704058 | import pandas as pd
import numpy as np
from sklearn.preprocessing import normalize
from .sparse_matrix_builder import build_from_conceptnet_table
from .formats import load_hdf, save_hdf
def sharded_retrofit(dense_hdf_filename, conceptnet_filename, output_filename,
iterations=5, nshards=6, verbosi... | 2,009 | 0 | 46 |
fcd076838a13b16b0181931dfa476968f0b03f64 | 11,297 | py | Python | Stock_Analysis/auto_value_stock.py | parmarsuraj99/Finance | d9f012e33a99b959fdde575feedeb5922b379fe2 | [
"MIT"
] | 1 | 2022-02-25T01:25:21.000Z | 2022-02-25T01:25:21.000Z | Stock_Analysis/auto_value_stock.py | StockScripts/Finance | 330bb46ea8e4c7ad5f3150cfa6d25e356178b189 | [
"MIT"
] | null | null | null | Stock_Analysis/auto_value_stock.py | StockScripts/Finance | 330bb46ea8e4c7ad5f3150cfa6d25e356178b189 | [
"MIT"
] | 2 | 2021-01-28T21:52:30.000Z | 2021-02-16T13:26:35.000Z | # Code from https://medium.com/datadriveninvestor/use-python-to-value-a-stock-automatically-3b520422ab6 by Bohmian
# Importing required modules
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import numpy as np
import time
from config import financial_model_prep
pd.set_option('display.max_column... | 46.681818 | 284 | 0.615208 | # Code from https://medium.com/datadriveninvestor/use-python-to-value-a-stock-automatically-3b520422ab6 by Bohmian
# Importing required modules
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import numpy as np
import time
from config import financial_model_prep
pd.set_option('display.max_column... | 4,418 | 0 | 143 |
901b7a71198943a53f223f18bbc124edf656a124 | 2,580 | py | Python | src/100_simple_aggregation.py | j20232/kaggle_earthquake | 47fac5f2e8d2ad4fab82426a0b6af18b71e4b57b | [
"MIT"
] | null | null | null | src/100_simple_aggregation.py | j20232/kaggle_earthquake | 47fac5f2e8d2ad4fab82426a0b6af18b71e4b57b | [
"MIT"
] | null | null | null | src/100_simple_aggregation.py | j20232/kaggle_earthquake | 47fac5f2e8d2ad4fab82426a0b6af18b71e4b57b | [
"MIT"
] | null | null | null | """Extract simple aggregation features
Reference: https://www.kaggle.com/gpreda/lanl-earthquake-eda-and-prediction
"""
import sys
import numpy as np
import pandas as pd
from pathlib import Path
from tqdm import tqdm
import competition as cc
from common import stop_watch
TRAIN_CSV_DIRECTORY_PATH = cc.INPUT_PATH /... | 38.507463 | 91 | 0.622481 | """Extract simple aggregation features
Reference: https://www.kaggle.com/gpreda/lanl-earthquake-eda-and-prediction
"""
import sys
import numpy as np
import pandas as pd
from pathlib import Path
from tqdm import tqdm
import competition as cc
from common import stop_watch
TRAIN_CSV_DIRECTORY_PATH = cc.INPUT_PATH /... | 1,795 | 0 | 22 |
0b3eba4af37debbbb40bec37c6e9b379c1156729 | 8,817 | py | Python | segment.py | neelsj/syndata-generation | df73cc9a146c34870c3d80acce0ca04b314ec1b0 | [
"MIT"
] | null | null | null | segment.py | neelsj/syndata-generation | df73cc9a146c34870c3d80acce0ca04b314ec1b0 | [
"MIT"
] | null | null | null | segment.py | neelsj/syndata-generation | df73cc9a146c34870c3d80acce0ca04b314ec1b0 | [
"MIT"
] | null | null | null |
import os
from datetime import datetime
import json
import matplotlib.pyplot as plt
from tqdm import tqdm
import torch
import numpy as np
from skimage import measure
from shapely.geometry import Polygon, MultiPolygon
from PIL import Image
import cv2
#model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resn... | 31.830325 | 132 | 0.565612 |
import os
from datetime import datetime
import json
import matplotlib.pyplot as plt
from tqdm import tqdm
import torch
import numpy as np
from skimage import measure
from shapely.geometry import Polygon, MultiPolygon
from PIL import Image
import cv2
#model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resn... | 7,808 | 0 | 69 |
0326330a12bafbdb605fe605d3e7680654a1a51a | 802 | py | Python | tests/unit/common/query/test_expression_query_results_reader.py | ambrosejcarr/matrix-service | f61252d79941fa962240e27062682c9676f07e95 | [
"MIT"
] | 11 | 2018-10-26T20:47:55.000Z | 2022-02-02T10:32:42.000Z | tests/unit/common/query/test_expression_query_results_reader.py | ambrosejcarr/matrix-service | f61252d79941fa962240e27062682c9676f07e95 | [
"MIT"
] | 379 | 2018-06-04T22:44:33.000Z | 2020-06-03T00:20:08.000Z | tests/unit/common/query/test_expression_query_results_reader.py | ambrosejcarr/matrix-service | f61252d79941fa962240e27062682c9676f07e95 | [
"MIT"
] | 4 | 2018-11-22T01:00:27.000Z | 2020-09-01T16:42:05.000Z | import mock
import unittest
from matrix.common.query.expression_query_results_reader import ExpressionQueryResultsReader
| 42.210526 | 94 | 0.786783 | import mock
import unittest
from matrix.common.query.expression_query_results_reader import ExpressionQueryResultsReader
class TestExpressionQueryResultsReader(unittest.TestCase):
@mock.patch("matrix.common.query.query_results_reader.QueryResultsReader._parse_manifest")
def test_load_results(self, mock_parse... | 376 | 280 | 23 |
1abc147f5b65fc34db7ff312e43a5af4e6f6fb0a | 21,660 | py | Python | analysis/graveyard/study_definition.py | opensafely/antibody-and-antiviral-deployment | 27cd171870fdd161468d1cabd1eaee76f1943593 | [
"MIT"
] | null | null | null | analysis/graveyard/study_definition.py | opensafely/antibody-and-antiviral-deployment | 27cd171870fdd161468d1cabd1eaee76f1943593 | [
"MIT"
] | 1 | 2022-03-18T16:20:19.000Z | 2022-03-18T16:20:19.000Z | analysis/graveyard/study_definition.py | opensafely/antibody-and-antiviral-deployment | 27cd171870fdd161468d1cabd1eaee76f1943593 | [
"MIT"
] | null | null | null | ################################################################################
#
# Description: This script provides the formal specification of the study data
# that will be extracted from the OpenSAFELY database.
#
# Output: output/data/input_*.csv.gz
#
# Author(s): M Green (edited by H Curtis)
# Date... | 31.255411 | 128 | 0.673084 | ################################################################################
#
# Description: This script provides the formal specification of the study data
# that will be extracted from the OpenSAFELY database.
#
# Output: output/data/input_*.csv.gz
#
# Author(s): M Green (edited by H Curtis)
# Date... | 0 | 0 | 0 |
9c633934769dee6380c21948f3259c49e26608fa | 5,146 | py | Python | records_mover/db/bigquery/unloader.py | cwegrzyn/records-mover | e3b71d6c09d99d0bcd6a956b9d09d20f8abe98d2 | [
"Apache-2.0"
] | 36 | 2020-03-17T11:56:51.000Z | 2022-01-19T16:03:32.000Z | records_mover/db/bigquery/unloader.py | cwegrzyn/records-mover | e3b71d6c09d99d0bcd6a956b9d09d20f8abe98d2 | [
"Apache-2.0"
] | 60 | 2020-03-02T23:13:29.000Z | 2021-05-19T15:05:42.000Z | records_mover/db/bigquery/unloader.py | cwegrzyn/records-mover | e3b71d6c09d99d0bcd6a956b9d09d20f8abe98d2 | [
"Apache-2.0"
] | 4 | 2020-08-11T13:17:37.000Z | 2021-11-05T21:11:52.000Z | import sqlalchemy
from contextlib import contextmanager
from typing import List, Iterator, Optional, Union, Tuple
import logging
from google.cloud.bigquery.dbapi.connection import Connection
from google.cloud.bigquery.client import Client
from google.cloud.bigquery.job import ExtractJobConfig
from records_mover.db.unlo... | 45.539823 | 115 | 0.666148 | import sqlalchemy
from contextlib import contextmanager
from typing import List, Iterator, Optional, Union, Tuple
import logging
from google.cloud.bigquery.dbapi.connection import Connection
from google.cloud.bigquery.client import Client
from google.cloud.bigquery.job import ExtractJobConfig
from records_mover.db.unlo... | 4,107 | 247 | 23 |
82eca7e21b92148d602ade08730e4aef0f573478 | 1,219 | py | Python | depth_completion/config/resnet18_Baseline_config.py | tsunghan-mama/Depth-Completion | d73328d1d704470a6fd3859e2e1810bc311b1dc3 | [
"MIT"
] | 67 | 2020-07-11T09:44:10.000Z | 2022-03-30T07:38:46.000Z | depth_completion/config/resnet18_Baseline_config.py | tsunghan-mama/Depth-Completion | d73328d1d704470a6fd3859e2e1810bc311b1dc3 | [
"MIT"
] | 8 | 2020-07-14T05:50:03.000Z | 2022-01-19T09:07:46.000Z | depth_completion/config/resnet18_Baseline_config.py | patrickwu2/Depth-Completion | e9c52e2cb2dce558d6787e246bbc51c1670c16ca | [
"MIT"
] | 9 | 2019-10-12T01:09:51.000Z | 2020-05-26T21:35:28.000Z |
common_config = {
}
train_config = {
"dataset_name": "matterport",
"model_name": "ResNet18SkipConnection",
"in_channel": 9,
"device_ids": [0],
"seed": 7122,
"num_workers": 8,
"mode": "train",
"train_path": "/tmp2/tsunghan/new_matterport/v1",
"lr": 1e-4,
"batch_size": 8,
... | 27.088889 | 133 | 0.61854 |
common_config = {
}
train_config = {
"dataset_name": "matterport",
"model_name": "ResNet18SkipConnection",
"in_channel": 9,
"device_ids": [0],
"seed": 7122,
"num_workers": 8,
"mode": "train",
"train_path": "/tmp2/tsunghan/new_matterport/v1",
"lr": 1e-4,
"batch_size": 8,
... | 0 | 0 | 0 |
38b4f6b2219146f62a43cb5525a1f50ceb4102df | 660 | py | Python | scheduler_task/study_apscheduler/examples/demo.py | 2581676612/python | b309564a05838b23044bb8112fd4ef71307266b6 | [
"MIT"
] | 112 | 2017-09-19T17:38:38.000Z | 2020-05-27T18:00:27.000Z | scheduler_task/study_apscheduler/examples/demo.py | tomoncle/Python-notes | ce675486290c3d1c7c2e4890b57e3d0c8a1228cc | [
"MIT"
] | null | null | null | scheduler_task/study_apscheduler/examples/demo.py | tomoncle/Python-notes | ce675486290c3d1c7c2e4890b57e3d0c8a1228cc | [
"MIT"
] | 56 | 2017-09-20T01:24:12.000Z | 2020-04-16T06:19:31.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 17-8-13 上午11:33
# @Author : Tom.Lee
# @CopyRight : 2016-2017 OpenBridge by yihecloud
# @File : demo.py
# @Product : PyCharm
# @Docs :
# @Source :
import os
from apscheduler.schedulers.blocking import B... | 26.4 | 85 | 0.587879 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 17-8-13 上午11:33
# @Author : Tom.Lee
# @CopyRight : 2016-2017 OpenBridge by yihecloud
# @File : demo.py
# @Product : PyCharm
# @Docs :
# @Source :
import os
from apscheduler.schedulers.blocking import B... | 0 | 0 | 0 |
0fc246feb45369af60c1a8007ad889850bd24825 | 4,829 | py | Python | clearblade/ClearBladeCore.py | sraman0302/ClearBlade-Python-SDK | bde192ef86969c8d1c592f7697ca104bc2362408 | [
"Apache-2.0"
] | 2 | 2018-05-10T18:38:04.000Z | 2020-12-19T08:14:21.000Z | clearblade/ClearBladeCore.py | sraman0302/ClearBlade-Python-SDK | bde192ef86969c8d1c592f7697ca104bc2362408 | [
"Apache-2.0"
] | 6 | 2018-01-13T17:05:51.000Z | 2021-09-01T18:25:41.000Z | clearblade/ClearBladeCore.py | sraman0302/ClearBlade-Python-SDK | bde192ef86969c8d1c592f7697ca104bc2362408 | [
"Apache-2.0"
] | 4 | 2018-11-08T21:18:08.000Z | 2021-05-10T01:07:14.000Z | from __future__ import absolute_import
import atexit
from . import Users
from . import Devices
from . import Collections
from . import Messaging
from . import Code
from .Developers import * # allows you to import Developer from ClearBladeCore
from . import cbLogs
#############
# USERS #
#############... | 31.154839 | 168 | 0.600745 | from __future__ import absolute_import
import atexit
from . import Users
from . import Devices
from . import Collections
from . import Messaging
from . import Code
from .Developers import * # allows you to import Developer from ClearBladeCore
from . import cbLogs
class System:
def __exitcode(self):
# for... | 3,669 | -17 | 638 |
78df92a0ac52515a71841949cff2f4cccb3a01f0 | 698 | py | Python | GoogleCodeJam2017/Round0/TidyNumbers/TidyNumbers.py | Jspsun/CompetitiveCoding | a815bbcdab1fb30bd83730a7abd3505bff8bfb78 | [
"MIT"
] | null | null | null | GoogleCodeJam2017/Round0/TidyNumbers/TidyNumbers.py | Jspsun/CompetitiveCoding | a815bbcdab1fb30bd83730a7abd3505bff8bfb78 | [
"MIT"
] | null | null | null | GoogleCodeJam2017/Round0/TidyNumbers/TidyNumbers.py | Jspsun/CompetitiveCoding | a815bbcdab1fb30bd83730a7abd3505bff8bfb78 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
__main__()
| 21.151515 | 71 | 0.465616 | def __main__():
f = open("in.txt", 'r')
o = open("out.txt", 'w')
noOfCases = int(f.readline())
for testNo in range(noOfCases):
counter = 0
data = f.readline()
output = solver(data[:-1])
output = int(output)
o.write("Case #" + str(testNo + 1) + ": " + str(output) ... | 585 | 0 | 68 |
9d9072a0352d441e7a4e2e3e0c976746c5e8f9af | 986 | py | Python | project_dashboard/projects/crud.py | KruizerChick/project-dashboard | aa1d3fa713e49049ac7184dbe44a1f915ff56906 | [
"MIT"
] | null | null | null | project_dashboard/projects/crud.py | KruizerChick/project-dashboard | aa1d3fa713e49049ac7184dbe44a1f915ff56906 | [
"MIT"
] | null | null | null | project_dashboard/projects/crud.py | KruizerChick/project-dashboard | aa1d3fa713e49049ac7184dbe44a1f915ff56906 | [
"MIT"
] | null | null | null | """ CRUD class for Projects app """
from crudbuilder.abstract import BaseCrudBuilder
from .models.project import Project
from .models.stakeholder import Stakeholder
class ProjectCrud(BaseCrudBuilder):
""" CRUD class for Project model """
model = Project
search_fields = ["id", "name", "description"]
t... | 29 | 62 | 0.703854 | """ CRUD class for Projects app """
from crudbuilder.abstract import BaseCrudBuilder
from .models.project import Project
from .models.stakeholder import Stakeholder
class ProjectCrud(BaseCrudBuilder):
""" CRUD class for Project model """
model = Project
search_fields = ["id", "name", "description"]
t... | 0 | 0 | 0 |
db476ed9048fe8a87e8164fd5dd10cfe61c7b0bf | 486 | py | Python | L1Trigger/L1TMuonOverlap/python/fakeOmtfFwVersion_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 2 | 2020-10-26T18:40:32.000Z | 2021-04-10T16:33:25.000Z | L1Trigger/L1TMuonOverlap/python/fakeOmtfFwVersion_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 30 | 2015-11-04T11:42:27.000Z | 2021-12-01T07:56:34.000Z | L1Trigger/L1TMuonOverlap/python/fakeOmtfFwVersion_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 8 | 2016-03-25T07:17:43.000Z | 2021-07-08T17:11:21.000Z | import FWCore.ParameterSet.Config as cms
omtfFwVersionSource = cms.ESSource(
"EmptyESSource",
recordName = cms.string('L1TMuonOverlapFwVersionRcd'),
iovIsRunNotTime = cms.bool(True),
firstValid = cms.vuint32(1)
)
###OMTF FW ESProducer.
omtfFwVersion = cms.ESProducer(
"L1TMuonOverlapFwVersionESProd... | 25.578947 | 58 | 0.716049 | import FWCore.ParameterSet.Config as cms
omtfFwVersionSource = cms.ESSource(
"EmptyESSource",
recordName = cms.string('L1TMuonOverlapFwVersionRcd'),
iovIsRunNotTime = cms.bool(True),
firstValid = cms.vuint32(1)
)
###OMTF FW ESProducer.
omtfFwVersion = cms.ESProducer(
"L1TMuonOverlapFwVersionESProd... | 0 | 0 | 0 |
bccbd46e4500f876a02aadf6e0c1065d389cdf38 | 4,603 | py | Python | planning/planning/page/check_in_out/check_in_out.py | nishta/planning | 5be1574111b9b94ec75c74960ace4314985b0014 | [
"MIT"
] | null | null | null | planning/planning/page/check_in_out/check_in_out.py | nishta/planning | 5be1574111b9b94ec75c74960ace4314985b0014 | [
"MIT"
] | null | null | null | planning/planning/page/check_in_out/check_in_out.py | nishta/planning | 5be1574111b9b94ec75c74960ace4314985b0014 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, validate_email_add, today
import datetime
from planning.planning.myfunction import mail_format_pms,actual_date_update,close_task_update
@frappe.whitelist()
@frappe.whitelist()
@frappe.whitelist()
| 39.681034 | 291 | 0.74169 | from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, validate_email_add, today
import datetime
from planning.planning.myfunction import mail_format_pms,actual_date_update,close_task_update
@frappe.whitelist()
def checking_checkout(task=None,check_status=None,name=None):
cur_date_tim... | 4,243 | 0 | 66 |
bbacbcdb8d4041cc214fabfb3adceb83044c7b88 | 1,674 | py | Python | action.py | yeyeto2788/mudpi-core | dc477eb3ccbe3317d11a8555d245dadbdb34c257 | [
"BSD-4-Clause"
] | null | null | null | action.py | yeyeto2788/mudpi-core | dc477eb3ccbe3317d11a8555d245dadbdb34c257 | [
"BSD-4-Clause"
] | 1 | 2021-03-15T14:32:34.000Z | 2021-03-15T14:32:34.000Z | action.py | yeyeto2788/mudpi-core | dc477eb3ccbe3317d11a8555d245dadbdb34c257 | [
"BSD-4-Clause"
] | null | null | null | import json
import subprocess
import sys
import redis
| 30.436364 | 82 | 0.537037 | import json
import subprocess
import sys
import redis
class Action():
def __init__(self, config):
self.config = config
self.name = config.get("name", "Action")
self.type = config.get("type", "event")
self.key = config.get("key", None).replace(" ",
... | 1,464 | -6 | 158 |
b88cc6b6407fec4332c3df0cdd6f4c0dc8c904b3 | 4,290 | py | Python | packages/girder/plugins/oauth/girder_oauth/providers/google.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | 1 | 2019-11-14T18:13:26.000Z | 2019-11-14T18:13:26.000Z | packages/girder/plugins/oauth/girder_oauth/providers/google.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | 3 | 2018-11-15T19:52:40.000Z | 2022-02-14T21:56:22.000Z | packages/girder/plugins/oauth/girder_oauth/providers/google.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | 3 | 2018-05-21T19:45:19.000Z | 2019-04-08T19:53:07.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You may obtain a copy of ... | 35.75 | 79 | 0.571329 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You may obtain a copy of ... | 2,832 | 435 | 23 |
f00f0283a00861b00d8ace96a341aa1af6392dc8 | 177 | py | Python | todoapp/todos/urls.py | dhavall13/REST-API-TodoCRUD | 5d7179d12c4436e38658d9a7483497c8db99f4be | [
"MIT"
] | null | null | null | todoapp/todos/urls.py | dhavall13/REST-API-TodoCRUD | 5d7179d12c4436e38658d9a7483497c8db99f4be | [
"MIT"
] | null | null | null | todoapp/todos/urls.py | dhavall13/REST-API-TodoCRUD | 5d7179d12c4436e38658d9a7483497c8db99f4be | [
"MIT"
] | null | null | null | from rest_framework import routers
from .api import TodoViewSet
router = routers.DefaultRouter()
router.register('api/todos', TodoViewSet, 'todos')
urlpatterns = router.urls
| 19.666667 | 50 | 0.79096 | from rest_framework import routers
from .api import TodoViewSet
router = routers.DefaultRouter()
router.register('api/todos', TodoViewSet, 'todos')
urlpatterns = router.urls
| 0 | 0 | 0 |
91373743141e577dcbdc22838e0c93cfc222a5cc | 241 | py | Python | Application/get_whitelist.py | soheyldaliraan/instagram_sub_bot_remover | 8ccf7134c79b8a9c9c09413321f526dd388c5609 | [
"MIT"
] | 27 | 2019-02-10T09:04:36.000Z | 2022-03-07T21:44:26.000Z | Application/get_whitelist.py | soheyldaliraan/instagram_sub_bot_remover | 8ccf7134c79b8a9c9c09413321f526dd388c5609 | [
"MIT"
] | 1 | 2022-03-01T02:45:18.000Z | 2022-03-01T02:45:18.000Z | Application/get_whitelist.py | soheyldaliraan/instagram_sub_bot_remover | 8ccf7134c79b8a9c9c09413321f526dd388c5609 | [
"MIT"
] | 5 | 2019-12-27T07:43:33.000Z | 2022-02-15T19:51:37.000Z | import os
import pandas as pd
import configuration
| 20.083333 | 61 | 0.717842 | import os
import pandas as pd
import configuration
def get_whitelist():
if os.path.exists(configuration.whitelist_path):
whitelist = pd.read_csv(configuration.whitelist_path)
return list(whitelist['pk'])
return []
| 165 | 0 | 23 |
8e57bc0091c782bab46c7958d378a4ddf117035a | 378 | py | Python | test.py | xiaoweiChen/OpenVINO_Model_Convert_Website | ce8b0d225d1e0228aace772e3017ad3154543688 | [
"Apache-2.0"
] | 1 | 2019-11-12T07:11:39.000Z | 2019-11-12T07:11:39.000Z | test.py | xiaoweiChen/OpenVINO_Model_Convert_Website | ce8b0d225d1e0228aace772e3017ad3154543688 | [
"Apache-2.0"
] | null | null | null | test.py | xiaoweiChen/OpenVINO_Model_Convert_Website | ce8b0d225d1e0228aace772e3017ad3154543688 | [
"Apache-2.0"
] | null | null | null |
import sys
from converter import processPreTrainModels
if __name__ == '__main__':
if len(sys.argv) < 4:
print("usage: {} proto caffemodel output_dir".format(sys.argv[0]))
exit(0)
proto = sys.argv[1]
model = sys.argv[2]
output = sys.argv[3]
file_path = processPreTrainModels(
proto,
... | 19.894737 | 70 | 0.648148 |
import sys
from converter import processPreTrainModels
if __name__ == '__main__':
if len(sys.argv) < 4:
print("usage: {} proto caffemodel output_dir".format(sys.argv[0]))
exit(0)
proto = sys.argv[1]
model = sys.argv[2]
output = sys.argv[3]
file_path = processPreTrainModels(
proto,
... | 0 | 0 | 0 |
25a83d4dda33b6f0fdf3262666cb597207aa5a6e | 4,990 | py | Python | package/tests/test_common/test_vm_details_provider.py | DYeag/AWS-Shell | b5318e72373b1a948ac6aced1c0bb4566d5ae46f | [
"0BSD"
] | 3 | 2016-08-22T07:14:56.000Z | 2018-03-16T07:31:44.000Z | package/tests/test_common/test_vm_details_provider.py | DYeag/AWS-Shell | b5318e72373b1a948ac6aced1c0bb4566d5ae46f | [
"0BSD"
] | 470 | 2016-03-24T13:38:08.000Z | 2022-02-05T01:14:05.000Z | package/tests/test_common/test_vm_details_provider.py | DYeag/AWS-Shell | b5318e72373b1a948ac6aced1c0bb4566d5ae46f | [
"0BSD"
] | 9 | 2016-06-20T11:41:54.000Z | 2020-11-21T00:42:45.000Z | from unittest import TestCase
from mock import Mock
from cloudshell.cp.aws.domain.common.vm_details_provider import VmDetailsProvider
| 40.901639 | 110 | 0.681964 | from unittest import TestCase
from mock import Mock
from cloudshell.cp.aws.domain.common.vm_details_provider import VmDetailsProvider
class TestVmDetailsProvider(TestCase):
def setUp(self):
self.vm_details_provider = VmDetailsProvider()
def test_prepare_vm_details(self):
instance = Mock()
... | 4,652 | 17 | 185 |
e837781e421b78fc059079fdefb0bdc32efc4414 | 3,229 | py | Python | scripts/eval.py | zsinsense/demosaicnet | bbe8151cab86dbe46b76806cf9ec353994b389ff | [
"MIT"
] | null | null | null | scripts/eval.py | zsinsense/demosaicnet | bbe8151cab86dbe46b76806cf9ec353994b389ff | [
"MIT"
] | null | null | null | scripts/eval.py | zsinsense/demosaicnet | bbe8151cab86dbe46b76806cf9ec353994b389ff | [
"MIT"
] | null | null | null | #!/bin/env python
"""Evaluate a demosaicking model."""
import argparse
import os
import time
import torch as th
from torch.utils.data import DataLoader
import numpy as np
import ttools
from ttools.modules.image_operators import crop_like
import demosaicnet
LOG = ttools.get_logger(__name__)
def main(args):
"""E... | 29.354545 | 87 | 0.569836 | #!/bin/env python
"""Evaluate a demosaicking model."""
import argparse
import os
import time
import torch as th
from torch.utils.data import DataLoader
import numpy as np
import ttools
from ttools.modules.image_operators import crop_like
import demosaicnet
LOG = ttools.get_logger(__name__)
class PSNR(th.nn.Module)... | 149 | 4 | 75 |
ace7c9af9eb249c27faf798e56fca31751c8a6ad | 1,030 | py | Python | lrp_toolbox/training_test.py | KushDen/deepimportance_code_release | 5d16f1f95568dc402be6dfed4ad993ec0dbaa356 | [
"MIT"
] | 18 | 2020-07-11T01:58:02.000Z | 2021-09-17T07:08:34.000Z | lrp_toolbox/training_test.py | KushDen/deepimportance_code_release | 5d16f1f95568dc402be6dfed4ad993ec0dbaa356 | [
"MIT"
] | 13 | 2021-01-13T14:41:26.000Z | 2021-12-29T02:15:10.000Z | lrp_toolbox/training_test.py | KushDen/deepimportance_code_release | 5d16f1f95568dc402be6dfed4ad993ec0dbaa356 | [
"MIT"
] | 8 | 2020-02-19T21:30:30.000Z | 2022-03-11T01:34:33.000Z | '''
@author: Sebastian Lapuschkin
@maintainer: Sebastian Lapuschkin
@contact: sebastian.lapuschkin@hhi.fraunhofer.de, wojciech.samek@hhi.fraunhofer.de
@date: 30.09.2015
@version: 1.0
@copyright: Copyright (c) 2015-2017, Sebastian Lapuschkin, Alexander Binder, Gregoire Montavon, Klaus-Robert Mueller, Wojciech Samek
@li... | 28.611111 | 216 | 0.703883 | '''
@author: Sebastian Lapuschkin
@maintainer: Sebastian Lapuschkin
@contact: sebastian.lapuschkin@hhi.fraunhofer.de, wojciech.samek@hhi.fraunhofer.de
@date: 30.09.2015
@version: 1.0
@copyright: Copyright (c) 2015-2017, Sebastian Lapuschkin, Alexander Binder, Gregoire Montavon, Klaus-Robert Mueller, Wojciech Samek
@li... | 0 | 0 | 0 |
c16cdfe67a57a720e41f4d1f6a82111d663200a5 | 149 | py | Python | tests/iac_integration/cdk/testdata/cdk_v2/python/app.py | zhuhaow/aws-sam-cli | 59d82ec6848b5a0cdd544d8ada838d4d34052971 | [
"Apache-2.0"
] | 2,959 | 2018-05-08T21:48:56.000Z | 2020-08-24T14:35:39.000Z | tests/iac_integration/cdk/testdata/cdk_v2/python/app.py | zhuhaow/aws-sam-cli | 59d82ec6848b5a0cdd544d8ada838d4d34052971 | [
"Apache-2.0"
] | 1,469 | 2018-05-08T22:44:28.000Z | 2020-08-24T20:19:24.000Z | tests/iac_integration/cdk/testdata/cdk_v2/python/app.py | zhuhaow/aws-sam-cli | 59d82ec6848b5a0cdd544d8ada838d4d34052971 | [
"Apache-2.0"
] | 642 | 2018-05-08T22:09:19.000Z | 2020-08-17T09:04:37.000Z | #!/usr/bin/env python3
from aws_cdk import App
from python.python_stack import PythonStack
app = App()
PythonStack(app, "TestStack")
app.synth()
| 13.545455 | 43 | 0.751678 | #!/usr/bin/env python3
from aws_cdk import App
from python.python_stack import PythonStack
app = App()
PythonStack(app, "TestStack")
app.synth()
| 0 | 0 | 0 |
294a2f7086d69271812482a18de2d6157e635b9d | 3,551 | py | Python | parsl/executors/base.py | Lnaden/parsl | f6ad3a272fa3d62e72ac3b7c402e25f079d4ab98 | [
"Apache-2.0"
] | null | null | null | parsl/executors/base.py | Lnaden/parsl | f6ad3a272fa3d62e72ac3b7c402e25f079d4ab98 | [
"Apache-2.0"
] | null | null | null | parsl/executors/base.py | Lnaden/parsl | f6ad3a272fa3d62e72ac3b7c402e25f079d4ab98 | [
"Apache-2.0"
] | null | null | null | from abc import ABCMeta, abstractmethod, abstractproperty
class ParslExecutor(metaclass=ABCMeta):
"""Define the strict interface for all Executor classes.
This is a metaclass that only enforces concrete implementations of
functionality by the child classes.
In addition to the listed methods, a Parsl... | 30.350427 | 93 | 0.639538 | from abc import ABCMeta, abstractmethod, abstractproperty
class ParslExecutor(metaclass=ABCMeta):
"""Define the strict interface for all Executor classes.
This is a metaclass that only enforces concrete implementations of
functionality by the child classes.
In addition to the listed methods, a Parsl... | 112 | 0 | 78 |
9eeb1c341a09b93233cbe624f89cddfd33fcd2f2 | 940 | py | Python | part4c.py | ddlatumalea/signal_analysis | 9e62e553f56e4c60c7e0963187e01c262d8d820e | [
"MIT"
] | null | null | null | part4c.py | ddlatumalea/signal_analysis | 9e62e553f56e4c60c7e0963187e01c262d8d820e | [
"MIT"
] | null | null | null | part4c.py | ddlatumalea/signal_analysis | 9e62e553f56e4c60c7e0963187e01c262d8d820e | [
"MIT"
] | 1 | 2022-03-03T13:31:23.000Z | 2022-03-03T13:31:23.000Z | def fourier_transform(yi):
"""a, b = fourier_transform(yi).
Real-valued Fourier transform that determines the
coefficients of the Fourier series for a given
signal y. The coefficients of the cosine terms are
returned in the array a; those of the sine terms
in the array b. Frequencies start at ze... | 39.166667 | 62 | 0.601064 | def fourier_transform(yi):
"""a, b = fourier_transform(yi).
Real-valued Fourier transform that determines the
coefficients of the Fourier series for a given
signal y. The coefficients of the cosine terms are
returned in the array a; those of the sine terms
in the array b. Frequencies start at ze... | 0 | 0 | 0 |
686add8ace25e333d96d69d7abbb938d46abc531 | 1,453 | py | Python | distance-betweeen-obj/main.py | CrispenGari/opencv-python | cfa862fbf3b8b2c8899b76cee2774d6fb72ba00e | [
"MIT"
] | 1 | 2021-11-08T07:37:05.000Z | 2021-11-08T07:37:05.000Z | distance-betweeen-obj/main.py | CrispenGari/opencv-python | cfa862fbf3b8b2c8899b76cee2774d6fb72ba00e | [
"MIT"
] | null | null | null | distance-betweeen-obj/main.py | CrispenGari/opencv-python | cfa862fbf3b8b2c8899b76cee2774d6fb72ba00e | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from math import pow, sqrt
points = []
letters = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
image = np.zeros((512, 512, 3), np.uint8)
while True:
cv2.putText(image, f'TO CLEAR THE POINTS PRESS (c)', (20, 20), cv2.FONT_HERSHEY_PLAIN, 1, (255, 255, 255), 1)
cv2.imshow("DISTANCE BETWEEN TWO... | 37.25641 | 126 | 0.604267 | import cv2
import numpy as np
from math import pow, sqrt
points = []
letters = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
image = np.zeros((512, 512, 3), np.uint8)
def mouseEvent(event, x, y, params, flags):
if event == cv2.EVENT_LBUTTONDOWN:
cv2.circle(image, (x, y), 5, (0, 0, 255), -1)
cv2.putText(image,... | 772 | 0 | 45 |
8e8c991f6293082c8cec862c8abc181e7ff19a46 | 1,948 | py | Python | Learning/python_data_analysis8.py | VictoriaGuXY/MCO-Menu-Checker-Online | 706e2e1bf7395cc344f382ea2ac53d964d459f86 | [
"MIT"
] | null | null | null | Learning/python_data_analysis8.py | VictoriaGuXY/MCO-Menu-Checker-Online | 706e2e1bf7395cc344f382ea2ac53d964d459f86 | [
"MIT"
] | null | null | null | Learning/python_data_analysis8.py | VictoriaGuXY/MCO-Menu-Checker-Online | 706e2e1bf7395cc344f382ea2ac53d964d459f86 | [
"MIT"
] | null | null | null | import json
import pandas as pd
import numpy as np
from pandas import DataFrame
"""
output
"""
# Note: some output is shortened to save spaces.
# This file introduces methods to group data.
# Data from https://github.com/mwaskom/seaborn-data
df = pd.read_csv('E:\\tips.csv')
"""
total_bill tip sex smoker ... | 32.466667 | 80 | 0.479466 | import json
import pandas as pd
import numpy as np
from pandas import DataFrame
"""
output
"""
# Note: some output is shortened to save spaces.
# This file introduces methods to group data.
# Data from https://github.com/mwaskom/seaborn-data
df = pd.read_csv('E:\\tips.csv')
"""
total_bill tip sex smoker ... | 0 | 0 | 0 |
948080e247360f7be9e2aa7cdc3fd4bb0c67bdac | 438 | py | Python | functions/reportIssue.py | chiluf/visvis.dev | 373846ea25044b7ca50f44c63dab4248e14deacd | [
"BSD-3-Clause"
] | null | null | null | functions/reportIssue.py | chiluf/visvis.dev | 373846ea25044b7ca50f44c63dab4248e14deacd | [
"BSD-3-Clause"
] | null | null | null | functions/reportIssue.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'.
def reportIssue():
""" help()
Open a webbrowser with the visvis website at the issue list.
"""
import webbro... | 23.052632 | 66 | 0.639269 | # -*- 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'.
def reportIssue():
""" help()
Open a webbrowser with the visvis website at the issue list.
"""
import webbro... | 0 | 0 | 0 |
405b1e05e30665caf1b56d799edb993551a9f5b1 | 217 | py | Python | thirdfile.py | 1frenchfrog1/testgithub | 7191e44d75ba50438d9c2fe8f0fcf9fcf3a2a991 | [
"MIT"
] | null | null | null | thirdfile.py | 1frenchfrog1/testgithub | 7191e44d75ba50438d9c2fe8f0fcf9fcf3a2a991 | [
"MIT"
] | null | null | null | thirdfile.py | 1frenchfrog1/testgithub | 7191e44d75ba50438d9c2fe8f0fcf9fcf3a2a991 | [
"MIT"
] | null | null | null | #!/usr/bin/python
def printme3( str ):
"This prints a passed string into this function"
print(str)
return
def printme3too( str ):
"This prints a passed string into this function"
print(str)
return
| 18.083333 | 51 | 0.686636 | #!/usr/bin/python
def printme3( str ):
"This prints a passed string into this function"
print(str)
return
def printme3too( str ):
"This prints a passed string into this function"
print(str)
return
| 0 | 0 | 0 |
52c36ddcbbbc1ea0125baf76215d709418864b64 | 642 | py | Python | lec7.py | uni-student234/ISAT252 | 4c0942919c432456fe26900c23f076161b4cc266 | [
"MIT"
] | null | null | null | lec7.py | uni-student234/ISAT252 | 4c0942919c432456fe26900c23f076161b4cc266 | [
"MIT"
] | null | null | null | lec7.py | uni-student234/ISAT252 | 4c0942919c432456fe26900c23f076161b4cc266 | [
"MIT"
] | null | null | null | """
Week 2, day 7, lec 7
"""
# i = 5
# while i >= 0:
# i = i - 1
# if i == 3:
# # break #breaks the smallest loop
# # continue #skips the current iteration and moves on
# # pass #does nothing, but is placehold if you need something for syntax
# print(i)
# for ... | 20.0625 | 90 | 0.489097 | """
Week 2, day 7, lec 7
"""
# i = 5
# while i >= 0:
# i = i - 1
# if i == 3:
# # break #breaks the smallest loop
# # continue #skips the current iteration and moves on
# # pass #does nothing, but is placehold if you need something for syntax
# print(i)
# for ... | 0 | 0 | 0 |
6446ebc359e3c3467ceb30fabeaa007c3100a7f7 | 11,447 | py | Python | scripts/survivor_analysis/utils/annotate.py | a-paxton/oss-community-health | 93ff4d266b5390b53d8ed59f71616de68bcfdda7 | [
"MIT"
] | null | null | null | scripts/survivor_analysis/utils/annotate.py | a-paxton/oss-community-health | 93ff4d266b5390b53d8ed59f71616de68bcfdda7 | [
"MIT"
] | 1 | 2022-03-22T19:32:27.000Z | 2022-03-23T12:43:08.000Z | scripts/survivor_analysis/utils/annotate.py | a-paxton/oss-community-health | 93ff4d266b5390b53d8ed59f71616de68bcfdda7 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from collections import Counter
from datetime import datetime
from nltk.tokenize import RegexpTokenizer
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
import re
def annotate_logs(comments, tickets):
"""
Annotates comments and tickets with additional... | 34.478916 | 101 | 0.638857 | import pandas as pd
import numpy as np
from collections import Counter
from datetime import datetime
from nltk.tokenize import RegexpTokenizer
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
import re
def annotate_logs(comments, tickets):
"""
Annotates comments and tickets with additional... | 0 | 0 | 0 |
46a90fe428c07ac7366934d1e4ee7724a8b4f434 | 352 | py | Python | packages/Python/lldbsuite/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py | nathawes/swift-lldb | 3cbf7470e0f9191ec1fc1c69ce8048c1dc64ec77 | [
"Apache-2.0"
] | 427 | 2018-05-29T14:21:02.000Z | 2022-03-16T03:17:54.000Z | packages/Python/lldbsuite/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py | DalavanCloud/lldb | e913eaf2468290fb94c767d474d611b41a84dd69 | [
"Apache-2.0"
] | 25 | 2018-07-23T08:34:15.000Z | 2021-11-05T07:13:36.000Z | packages/Python/lldbsuite/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py | DalavanCloud/lldb | e913eaf2468290fb94c767d474d611b41a84dd69 | [
"Apache-2.0"
] | 52 | 2018-07-19T19:57:32.000Z | 2022-03-11T16:05:38.000Z | from lldbsuite.test import decorators
from lldbsuite.test import lldbinline
lldbinline.MakeInlineTest(
__file__, globals(), [
decorators.skipIfFreeBSD, decorators.skipIfLinux,
decorators.skipIfWindows,
decorators.expectedFailureAll(
oslist=['macosx'], archs=['i386'],
... | 32 | 57 | 0.6875 | from lldbsuite.test import decorators
from lldbsuite.test import lldbinline
lldbinline.MakeInlineTest(
__file__, globals(), [
decorators.skipIfFreeBSD, decorators.skipIfLinux,
decorators.skipIfWindows,
decorators.expectedFailureAll(
oslist=['macosx'], archs=['i386'],
... | 0 | 0 | 0 |
af4dceb229fa3c43802c126ad350cbf15950b67e | 1,585 | bzl | Python | js/extensions.bzl | stoiky/rules_js | e61b61b98c2f5c733bf804f78db9f55b1fb2d599 | [
"Apache-2.0"
] | null | null | null | js/extensions.bzl | stoiky/rules_js | e61b61b98c2f5c733bf804f78db9f55b1fb2d599 | [
"Apache-2.0"
] | null | null | null | js/extensions.bzl | stoiky/rules_js | e61b61b98c2f5c733bf804f78db9f55b1fb2d599 | [
"Apache-2.0"
] | null | null | null | """Adapt repository rules in npm_import.bzl to be called from MODULE.bazel
See https://bazel.build/docs/bzlmod#extension-definition
"""
load("//js/private:pnpm_utils.bzl", "pnpm_utils")
load("//js/private:translate_pnpm_lock.bzl", translate_pnpm_lock_lib = "translate_pnpm_lock")
load("//js:npm_import.bzl", "npm_import... | 42.837838 | 113 | 0.637855 | """Adapt repository rules in npm_import.bzl to be called from MODULE.bazel
See https://bazel.build/docs/bzlmod#extension-definition
"""
load("//js/private:pnpm_utils.bzl", "pnpm_utils")
load("//js/private:translate_pnpm_lock.bzl", translate_pnpm_lock_lib = "translate_pnpm_lock")
load("//js:npm_import.bzl", "npm_import... | 787 | 0 | 23 |
c7b09eb689ac8f721c4645e55ec33f8b5d1f82bf | 32,780 | py | Python | paasta_tools/tron_tools.py | zhaoyanh1202/paasta | b0c148786f44476fe351fe410f0b81f0c941f3b6 | [
"Apache-2.0"
] | null | null | null | paasta_tools/tron_tools.py | zhaoyanh1202/paasta | b0c148786f44476fe351fe410f0b81f0c941f3b6 | [
"Apache-2.0"
] | null | null | null | paasta_tools/tron_tools.py | zhaoyanh1202/paasta | b0c148786f44476fe351fe410f0b81f0c941f3b6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015-2018 Yelp Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 35.864333 | 125 | 0.652013 | # Copyright 2015-2018 Yelp Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 18,261 | 2,480 | 1,114 |
6f6564a4b79638714786a730792e5cd34d3f9e05 | 1,755 | py | Python | invenio_records_presentation/workflows/presentation.py | CESNET/invenio-records-presentation | 547a2652a97feb1c6cd50e1ea917c2b5decb9286 | [
"MIT"
] | null | null | null | invenio_records_presentation/workflows/presentation.py | CESNET/invenio-records-presentation | 547a2652a97feb1c6cd50e1ea917c2b5decb9286 | [
"MIT"
] | 4 | 2019-03-19T16:18:22.000Z | 2021-06-28T12:33:14.000Z | invenio_records_presentation/workflows/presentation.py | CESNET/invenio-records-presentation | 547a2652a97feb1c6cd50e1ea917c2b5decb9286 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 CESNET.
#
# Invenio Records Presentation is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
""" Example Presentation workflow."""
from invenio_workflows import WorkflowEngine
from invenio_re... | 27 | 89 | 0.688889 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 CESNET.
#
# Invenio Records Presentation is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
""" Example Presentation workflow."""
from invenio_workflows import WorkflowEngine
from invenio_re... | 1,008 | 0 | 115 |
af18231ed684c46a269b36519eb707e9ab6b7d6a | 34,191 | py | Python | twit_analytics.py | nikb999/Twitter-analytics | 35074503be495e62fad282b9c723756df87119a7 | [
"MIT"
] | null | null | null | twit_analytics.py | nikb999/Twitter-analytics | 35074503be495e62fad282b9c723756df87119a7 | [
"MIT"
] | null | null | null | twit_analytics.py | nikb999/Twitter-analytics | 35074503be495e62fad282b9c723756df87119a7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#add the path of the twitter egg
import sys
egg_path = '/home/users/web/........./cgi-bin/PyPkg/twitter-1.14.3-py2.7.egg'
sys.path.append(egg_path)
# Import the CGI, string, sys, and md5crypt modules
import json, urllib2, re, time, datetime, sys, cgi, os
import sq... | 40.800716 | 197 | 0.534176 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#add the path of the twitter egg
import sys
egg_path = '/home/users/web/........./cgi-bin/PyPkg/twitter-1.14.3-py2.7.egg'
sys.path.append(egg_path)
# Import the CGI, string, sys, and md5crypt modules
import json, urllib2, re, time, datetime, sys, cgi, os
import sq... | 29,208 | 0 | 613 |
47aeba5f5a974bde56729cafe676435b3057e324 | 3,765 | py | Python | sonde/qaqc_viewer.py | wilsaj/pint | a2b2a6ea9ff480a168358af642cf36c7f3c5d0e4 | [
"BSD-3-Clause"
] | 1 | 2017-12-06T04:28:59.000Z | 2017-12-06T04:28:59.000Z | sonde/qaqc_viewer.py | wilsaj/pint | a2b2a6ea9ff480a168358af642cf36c7f3c5d0e4 | [
"BSD-3-Clause"
] | null | null | null | sonde/qaqc_viewer.py | wilsaj/pint | a2b2a6ea9ff480a168358af642cf36c7f3c5d0e4 | [
"BSD-3-Clause"
] | null | null | null | """
QAQC Viewer based on Chaco & Traits
"""
#from enthought.chaco.example_support import COLOR_PALETTE
#from enthought.enable.example_support import DemoFrame, demo_main
# Enthought library imports
from enthought.enable.api import Window, Component, ComponentEditor
from enthought.traits.api import HasTraits, Instance... | 41.833333 | 110 | 0.601594 | """
QAQC Viewer based on Chaco & Traits
"""
#from enthought.chaco.example_support import COLOR_PALETTE
#from enthought.enable.example_support import DemoFrame, demo_main
# Enthought library imports
from enthought.enable.api import Window, Component, ComponentEditor
from enthought.traits.api import HasTraits, Instance... | 2,200 | 450 | 23 |
86f12b2a5cc0b34fb6db729600f73e406c9d8539 | 1,514 | py | Python | src/tt_calendar/tt_calendar/logic.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 85 | 2017-11-21T12:22:02.000Z | 2022-03-27T23:07:17.000Z | src/tt_calendar/tt_calendar/logic.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 545 | 2017-11-04T14:15:04.000Z | 2022-03-27T14:19:27.000Z | src/tt_calendar/tt_calendar/logic.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 45 | 2017-11-11T12:36:30.000Z | 2022-02-25T06:10:44.000Z |
import datetime
from . import relations
| 22.597015 | 66 | 0.61889 |
import datetime
from . import relations
def actual_real_feasts(now=None):
if now is None:
now = datetime.datetime.utcnow()
now = now.replace(year=datetime.MINYEAR)
for feast in relations.REAL_FEAST.records:
for interval in feast.intervals:
if interval[0] <= now <= interval[... | 1,352 | 0 | 115 |
120fa0d15479ccd5b4653c3adf9354e51e55b55c | 573 | py | Python | ComicPub/comics/admin.py | Xonshiz/ComicPub | d332ee1b62d6c28347954280696c86898de6d125 | [
"MIT"
] | 8 | 2017-09-02T07:04:59.000Z | 2020-12-17T17:30:34.000Z | ComicPub/comics/admin.py | Xonshiz/ComicPub | d332ee1b62d6c28347954280696c86898de6d125 | [
"MIT"
] | 1 | 2017-10-24T12:49:57.000Z | 2017-10-24T15:04:44.000Z | ComicPub/comics/admin.py | Xonshiz/ComicPub | d332ee1b62d6c28347954280696c86898de6d125 | [
"MIT"
] | 4 | 2017-10-24T14:13:13.000Z | 2021-12-15T17:09:23.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from comics.models import Comic, ComicChapter
# class PageFileInline(admin.TabularInline):
# model = ComicChapter
#
#
# class PageAdmin(admin.ModelAdmin):
# inlines = [PageFileInline, ]
# class ChapterInline(adm... | 21.222222 | 47 | 0.724258 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from comics.models import Comic, ComicChapter
# class PageFileInline(admin.TabularInline):
# model = ComicChapter
#
#
# class PageAdmin(admin.ModelAdmin):
# inlines = [PageFileInline, ]
# class ChapterInline(adm... | 0 | 0 | 0 |
d7e5e4980b5718dcaa9192759e6b4c3e5d658b97 | 2,457 | py | Python | chpt6/Generate_random_characters.py | GDG-Buea/learn-python | 9dfe8caa4b57489cf4249bf7e64856062a0b93c2 | [
"Apache-2.0"
] | null | null | null | chpt6/Generate_random_characters.py | GDG-Buea/learn-python | 9dfe8caa4b57489cf4249bf7e64856062a0b93c2 | [
"Apache-2.0"
] | 2 | 2018-05-21T09:39:00.000Z | 2018-05-27T15:59:15.000Z | chpt6/Generate_random_characters.py | GDG-Buea/learn-python | 9dfe8caa4b57489cf4249bf7e64856062a0b93c2 | [
"Apache-2.0"
] | 2 | 2018-05-19T14:59:56.000Z | 2018-05-19T15:25:48.000Z | # This program displays 100 lowercase letters, fifteen per line
import turtle
from random import randint
main()
print()
# Draw a line from (x1, y1) to (x2, y2)
# def drawLine(x1, y1, x2, y2):
# turtle.penup()
# turtle.goto(x1, y1)
# turtle.pendown()
# turtle.goto(x2, y2)
# def writeText(s, x, y):
# turtle.pe... | 23.179245 | 66 | 0.659341 | # This program displays 100 lowercase letters, fifteen per line
import turtle
from random import randint
def get_random_lower_case_letter():
return get_random_character('a', 'z')
def get_random_character(ch1, ch2):
return chr(randint(ord(ch1), ord(ch2)))
def write_text(s, x, y):
turtle.penup()
... | 533 | 0 | 92 |
b4b58aa4d7d83f1298f775781fc1a78f79bf902f | 531 | py | Python | miniProject/miniApp/urls.py | cs-fullstack-2019-spring/django-mini-project5-gkg901 | 35af15000480a104f46adb62ba9ceebd4d0ad7a1 | [
"Apache-2.0"
] | null | null | null | miniProject/miniApp/urls.py | cs-fullstack-2019-spring/django-mini-project5-gkg901 | 35af15000480a104f46adb62ba9ceebd4d0ad7a1 | [
"Apache-2.0"
] | null | null | null | miniProject/miniApp/urls.py | cs-fullstack-2019-spring/django-mini-project5-gkg901 | 35af15000480a104f46adb62ba9ceebd4d0ad7a1 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('allrecipes/', views.allrecipes, name='allrecipes'),
path('newrecipe/', views.newrecipe, name='newrecipe'),
path('profile/', views.profile, name='profile'),
path('newuser/', views.newuser, na... | 37.928571 | 69 | 0.664783 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('allrecipes/', views.allrecipes, name='allrecipes'),
path('newrecipe/', views.newrecipe, name='newrecipe'),
path('profile/', views.profile, name='profile'),
path('newuser/', views.newuser, na... | 0 | 0 | 0 |
e63a707a6d1aecf82dd0e657d12e6dcba8e4283c | 3,996 | py | Python | hash_code.py | Arpan-206/EncryptoCLI | 26a7718ef387d46bfcf2d167e17a494de0165858 | [
"MIT"
] | 2 | 2021-10-20T13:38:45.000Z | 2022-01-11T12:36:49.000Z | hash_code.py | Arpan-206/EncryptoCLI | 26a7718ef387d46bfcf2d167e17a494de0165858 | [
"MIT"
] | null | null | null | hash_code.py | Arpan-206/EncryptoCLI | 26a7718ef387d46bfcf2d167e17a494de0165858 | [
"MIT"
] | null | null | null | # Importing the hashing library
import hashlib
# Importing the visual libraries
from PyInquirer import Separator, prompt
from termcolor import colored
# Defining the hash function.
| 27.75 | 129 | 0.508008 | # Importing the hashing library
import hashlib
# Importing the visual libraries
from PyInquirer import Separator, prompt
from termcolor import colored
# Defining the hash function.
def hash_func():
# Asking the user for further data regarding algoritms
hash_info = prompt([
{
'type': 'lis... | 3,741 | 0 | 69 |
e155cdbdf8a6a6a7a4d4cc1a43c09c3a16b32d5c | 3,800 | py | Python | examples/plugins/single_project/sample_project/data/plugin/ui_service.py | janvonrickenbach/Envisage_wxPhoenix_py3 | cf79e5b2a0c3b46898a60b5fe5a2fb580604808b | [
"BSD-3-Clause"
] | null | null | null | examples/plugins/single_project/sample_project/data/plugin/ui_service.py | janvonrickenbach/Envisage_wxPhoenix_py3 | cf79e5b2a0c3b46898a60b5fe5a2fb580604808b | [
"BSD-3-Clause"
] | 1 | 2017-05-22T21:15:22.000Z | 2017-05-22T21:15:22.000Z | examples/plugins/single_project/sample_project/data/plugin/ui_service.py | janvonrickenbach/Envisage_wxPhoenix_py3 | cf79e5b2a0c3b46898a60b5fe5a2fb580604808b | [
"BSD-3-Clause"
] | 1 | 2019-10-01T07:03:58.000Z | 2019-10-01T07:03:58.000Z | #-----------------------------------------------------------------------------
#
# Copyright (c) 2007 by Enthought, Inc.
# All rights reserved.
#
#-----------------------------------------------------------------------------
"""
The UI service for the Data plugin.
"""
# Standard library imports.
import logging
# E... | 29.007634 | 78 | 0.460789 | #-----------------------------------------------------------------------------
#
# Copyright (c) 2007 by Enthought, Inc.
# All rights reserved.
#
#-----------------------------------------------------------------------------
"""
The UI service for the Data plugin.
"""
# Standard library imports.
import logging
# E... | 0 | 0 | 0 |
20dc02eb654f867beadeef8c295396bcf7913d05 | 8,460 | py | Python | metecho/tests/consumers.py | almostolmos/Metecho | 7f58eca163faafea1ce07ffb6f4de2449fa0b8df | [
"BSD-3-Clause"
] | 21 | 2020-04-02T21:39:58.000Z | 2022-01-31T19:43:47.000Z | metecho/tests/consumers.py | almostolmos/Metecho | 7f58eca163faafea1ce07ffb6f4de2449fa0b8df | [
"BSD-3-Clause"
] | 1,613 | 2020-03-26T16:39:57.000Z | 2022-03-07T14:54:16.000Z | metecho/tests/consumers.py | almostolmos/Metecho | 7f58eca163faafea1ce07ffb6f4de2449fa0b8df | [
"BSD-3-Clause"
] | 21 | 2020-07-21T11:58:47.000Z | 2021-11-25T00:48:21.000Z | import pytest
from channels.db import database_sync_to_async
from channels.testing import WebsocketCommunicator
from ..api.model_mixins import Request
from ..api.push import push_message_about_instance, report_error
from ..api.serializers import (
EpicSerializer,
ProjectSerializer,
ScratchOrgSerializer,
... | 33.307087 | 88 | 0.711348 | import pytest
from channels.db import database_sync_to_async
from channels.testing import WebsocketCommunicator
from ..api.model_mixins import Request
from ..api.push import push_message_about_instance, report_error
from ..api.serializers import (
EpicSerializer,
ProjectSerializer,
ScratchOrgSerializer,
... | 7,456 | 0 | 220 |
f3976e2ec215dc1bd2bd45dd144b13e71688e6f1 | 6,227 | py | Python | cajitos_site/users/routes.py | OlgaKuratkina/cajitos | 0bc13f71281a1a67c8bcd1a3ae343ad0b14d9bad | [
"MIT"
] | null | null | null | cajitos_site/users/routes.py | OlgaKuratkina/cajitos | 0bc13f71281a1a67c8bcd1a3ae343ad0b14d9bad | [
"MIT"
] | 7 | 2020-05-08T19:51:22.000Z | 2022-03-11T23:37:57.000Z | cajitos_site/users/routes.py | OlgaKuratkina/cajitos | 0bc13f71281a1a67c8bcd1a3ae343ad0b14d9bad | [
"MIT"
] | null | null | null | import markdown
from flask import redirect, url_for, flash, render_template, session, request, current_app, abort
from flask_login import current_user, login_user, logout_user, login_required
from cajitos_site import bcrypt
from cajitos_site.users import users
from cajitos_site.users.forms import RegistrationForm, Log... | 40.967105 | 120 | 0.696965 | import markdown
from flask import redirect, url_for, flash, render_template, session, request, current_app, abort
from flask_login import current_user, login_user, logout_user, login_required
from cajitos_site import bcrypt
from cajitos_site.users import users
from cajitos_site.users.forms import RegistrationForm, Log... | 4,876 | 0 | 198 |
43fc4974ba1213885593d4b53ba973eb01e9d576 | 9,049 | py | Python | sdc/ysdc_dataset_api/dataset/dataset.py | sty61010/shifts | d3bb3086d8f2581f74644585701f4b1db4338483 | [
"Apache-2.0"
] | null | null | null | sdc/ysdc_dataset_api/dataset/dataset.py | sty61010/shifts | d3bb3086d8f2581f74644585701f4b1db4338483 | [
"Apache-2.0"
] | null | null | null | sdc/ysdc_dataset_api/dataset/dataset.py | sty61010/shifts | d3bb3086d8f2581f74644585701f4b1db4338483 | [
"Apache-2.0"
] | null | null | null | import json
import os
from typing import Callable, Union
from typing import Optional, List
import torch
from sdc.constants import SCENE_TAG_TYPE_TO_OPTIONS, VALID_TRAJECTORY_TAGS
from ..features import FeatureProducerBase
from ..proto import get_tags_from_request, proto_to_dict
from ..utils import (
get_file_path... | 42.088372 | 99 | 0.637971 | import json
import os
from typing import Callable, Union
from typing import Optional, List
import torch
from sdc.constants import SCENE_TAG_TYPE_TO_OPTIONS, VALID_TRAJECTORY_TAGS
from ..features import FeatureProducerBase
from ..proto import get_tags_from_request, proto_to_dict
from ..utils import (
get_file_path... | 4,714 | 3,746 | 69 |
351525ff3510e81241132c03602b819a2a740942 | 70 | py | Python | core/src/static_classes/__init__.py | azurlane-doujin/AzurLanePaintingExtract-v1.0 | ef4f25e70b3ca1b9df4304132cc7612c8f5efebb | [
"MIT"
] | 144 | 2019-06-13T06:43:43.000Z | 2022-03-29T15:07:57.000Z | core/src/static_classes/__init__.py | Shabi1213/AzurLanePaintingExtract-v1.0 | ef4f25e70b3ca1b9df4304132cc7612c8f5efebb | [
"MIT"
] | 2 | 2020-08-02T15:08:58.000Z | 2021-11-29T02:34:18.000Z | core/src/static_classes/__init__.py | Goodjooy/ArknightsPaintingExtract | e1e6ef339c6f76cab45a26df66497126c11a21a8 | [
"MIT"
] | 19 | 2020-03-01T10:06:52.000Z | 2022-02-06T13:49:26.000Z | __all__ = ["file_read", 'image_deal', 'search_order', 'static_data']
| 35 | 69 | 0.7 | __all__ = ["file_read", 'image_deal', 'search_order', 'static_data']
| 0 | 0 | 0 |
13e87111dffd55a11464ba7c203a6cc1cb2cb9ac | 412 | py | Python | Demo/wdt/example_wdt_file.py | quecpython/EC100Y-SDK | 712c7eb7b54a3971009d94f6d6b21a6011d56f68 | [
"MIT"
] | 4 | 2021-01-28T01:30:59.000Z | 2021-06-15T07:13:41.000Z | Demo/wdt/example_wdt_file.py | QuePython/EC100Y-SDK | 712c7eb7b54a3971009d94f6d6b21a6011d56f68 | [
"MIT"
] | null | null | null | Demo/wdt/example_wdt_file.py | QuePython/EC100Y-SDK | 712c7eb7b54a3971009d94f6d6b21a6011d56f68 | [
"MIT"
] | 3 | 2021-04-07T09:55:59.000Z | 2022-01-08T15:15:23.000Z | '''
@Author: Pawn
@Date: 2020-08-12
@LastEditTime: 2020-08-12 17:06:08
@Description: example for module timer
@FilePath: example_wdt.py
'''
from machine import WDT
from machine import Timer
timer1 = Timer(Timer.Timer1)
if __name__ == '__main__':
wdt = WDT(20) # 启动看门狗,间隔时长
timer1.start(period=15000, mode=ti... | 17.913043 | 78 | 0.682039 | '''
@Author: Pawn
@Date: 2020-08-12
@LastEditTime: 2020-08-12 17:06:08
@Description: example for module timer
@FilePath: example_wdt.py
'''
from machine import WDT
from machine import Timer
timer1 = Timer(Timer.Timer1)
def feed(t):
wdt.feed()
if __name__ == '__main__':
wdt = WDT(20) # 启动看门狗,间隔时长
timer... | 6 | 0 | 23 |
bcb5024cd6f5e64a630af32466bb1b12cbac2b4a | 2,752 | py | Python | users/tests/test_urls.py | jewells07/mumbleapi | beee0b50eefb3b1ff3e21073400c778323eece98 | [
"Apache-2.0"
] | 1 | 2021-05-18T11:37:44.000Z | 2021-05-18T11:37:44.000Z | users/tests/test_urls.py | TomNewton1/mumbleapi | 108d5a841b97d38285bede523f243624e05bc231 | [
"Apache-2.0"
] | null | null | null | users/tests/test_urls.py | TomNewton1/mumbleapi | 108d5a841b97d38285bede523f243624e05bc231 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from django.urls import reverse , resolve
from rest_framework import status
from rest_framework.test import APITestCase
from users.views import (
followUser , users , UserProfileUpdate ,
ProfilePictureUpdate , usersRecommended ,
user , userMumbles, userArticles, passwordCha... | 37.69863 | 87 | 0.703125 | from django.conf.urls import url
from django.urls import reverse , resolve
from rest_framework import status
from rest_framework.test import APITestCase
from users.views import (
followUser , users , UserProfileUpdate ,
ProfilePictureUpdate , usersRecommended ,
user , userMumbles, userArticles, passwordCha... | 1,987 | 11 | 347 |
6a95b14f3ec8c3f933b91466b0d3fff7d5b8dd2e | 520 | py | Python | common/connector.py | ex0hunt/redrat | 08ba8f088fcfb3ea246c56305420c2bc9e77517f | [
"BSD-2-Clause"
] | null | null | null | common/connector.py | ex0hunt/redrat | 08ba8f088fcfb3ea246c56305420c2bc9e77517f | [
"BSD-2-Clause"
] | null | null | null | common/connector.py | ex0hunt/redrat | 08ba8f088fcfb3ea246c56305420c2bc9e77517f | [
"BSD-2-Clause"
] | null | null | null | import configparser
import os
from redmine import Redmine
| 34.666667 | 76 | 0.713462 | import configparser
import os
from redmine import Redmine
def redmine():
rootdir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
config_path = os.path.join(rootdir, 'settings.conf')
config = configparser.ConfigParser()
config.read(config_path)
host = config.get('RedmineServer', 'h... | 439 | 0 | 23 |
73e1afd1d4cf91f0ff98fd1d78bfc8ce897e5c54 | 4,921 | py | Python | src/Testing/ZopeTestCase/utils.py | tseaver/Zope-RFA | 08634f39b0f8b56403a2a9daaa6ee4479ef0c625 | [
"ZPL-2.1"
] | 2 | 2015-12-21T10:34:56.000Z | 2017-09-24T11:07:58.000Z | src/Testing/ZopeTestCase/utils.py | MatthewWilkes/Zope | 740f934fc9409ae0062e8f0cd6dcfd8b2df00376 | [
"ZPL-2.1"
] | null | null | null | src/Testing/ZopeTestCase/utils.py | MatthewWilkes/Zope | 740f934fc9409ae0062e8f0cd6dcfd8b2df00376 | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 31.544872 | 83 | 0.636456 | ##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 0 | 0 | 0 |
c4ac1344ac12b2b41b5b5813289b0939cfb026e8 | 977 | py | Python | experiments/mcompress/set_options.py | paralab/EigenMM | 5c94233524ae2758ebf47c3b3fdb6570a6cc4e59 | [
"MIT"
] | null | null | null | experiments/mcompress/set_options.py | paralab/EigenMM | 5c94233524ae2758ebf47c3b3fdb6570a6cc4e59 | [
"MIT"
] | null | null | null | experiments/mcompress/set_options.py | paralab/EigenMM | 5c94233524ae2758ebf47c3b3fdb6570a6cc4e59 | [
"MIT"
] | null | null | null | emm_fmt = """<?xml version="1.0" encoding="utf-8" ?>
<EIGEN_MM>
<OPTIONS
_splitmaxiters="10"
_nodesperevaluator="1"
_subproblemsperevaluator="1"
_totalsubproblems="1"
_nevaluators="1"
_taskspernode="%d"
_nevals="-1"
_nk="10"
_nb="4"
_p="0"
_nv="10"
_raditers="20"
_splittol="0.9"
... | 20.354167 | 63 | 0.616172 | emm_fmt = """<?xml version="1.0" encoding="utf-8" ?>
<EIGEN_MM>
<OPTIONS
_splitmaxiters="10"
_nodesperevaluator="1"
_subproblemsperevaluator="1"
_totalsubproblems="1"
_nevaluators="1"
_taskspernode="%d"
_nevals="-1"
_nk="10"
_nb="4"
_p="0"
_nv="10"
_raditers="20"
_splittol="0.9"
... | 0 | 0 | 0 |
cb18427c6dda988b4a46b9e6269b431bec7b5ea3 | 5,758 | py | Python | qtpyvcp/widgets/display_widgets/atc_widget/atc.py | awigen/qtpyvcp | 5a23c4bca78accb159a76ac03652c74d5a07d14f | [
"BSD-3-Clause-LBNL",
"MIT"
] | null | null | null | qtpyvcp/widgets/display_widgets/atc_widget/atc.py | awigen/qtpyvcp | 5a23c4bca78accb159a76ac03652c74d5a07d14f | [
"BSD-3-Clause-LBNL",
"MIT"
] | null | null | null | qtpyvcp/widgets/display_widgets/atc_widget/atc.py | awigen/qtpyvcp | 5a23c4bca78accb159a76ac03652c74d5a07d14f | [
"BSD-3-Clause-LBNL",
"MIT"
] | null | null | null | import os
# Workarround for nvidia propietary drivers
import ctypes
import ctypes.util
ctypes.CDLL(ctypes.util.find_library("GL"), mode=ctypes.RTLD_GLOBAL)
# end of Workarround
from qtpy.QtCore import Signal, Slot, QUrl, QTimer
from qtpy.QtQuickWidgets import QQuickWidget
from qtpyvcp.plugins import getPlugin
fr... | 30.146597 | 83 | 0.633032 | import os
# Workarround for nvidia propietary drivers
import ctypes
import ctypes.util
ctypes.CDLL(ctypes.util.find_library("GL"), mode=ctypes.RTLD_GLOBAL)
# end of Workarround
from qtpy.QtCore import Signal, Slot, QUrl, QTimer
from qtpy.QtQuickWidgets import QQuickWidget
from qtpyvcp.plugins import getPlugin
fr... | 4,211 | 920 | 23 |
0515dfbce20f8b6db5af0d540ac7d973ccefba31 | 603 | py | Python | oreo_backend/memes/migrations/0003_auto_20211108_1250.py | TaipeiTechIAEWorkplace/Website | fc962d5f8163c08f901fe4d97af14b8e7b3cfc9c | [
"MIT"
] | 1 | 2022-02-06T07:08:13.000Z | 2022-02-06T07:08:13.000Z | oreo_backend/memes/migrations/0003_auto_20211108_1250.py | TaipeiTechIAEWorkplace/Website | fc962d5f8163c08f901fe4d97af14b8e7b3cfc9c | [
"MIT"
] | null | null | null | oreo_backend/memes/migrations/0003_auto_20211108_1250.py | TaipeiTechIAEWorkplace/Website | fc962d5f8163c08f901fe4d97af14b8e7b3cfc9c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-11-08 04:50
from django.db import migrations, models
| 22.333333 | 58 | 0.557214 | # Generated by Django 3.2.9 on 2021-11-08 04:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('memes', '0002_auto_20211108_1233'),
]
operations = [
migrations.RemoveField(
model_name='photo',
name='hashtag',
... | 0 | 489 | 23 |
2166ee9410003528b21dcef8b26807deef3d0e7b | 1,546 | py | Python | uav.py | Aniq55/DroneSim | 32cc5c40eefa542f1260e922567f854602ee66f4 | [
"MIT"
] | 5 | 2018-06-10T04:58:29.000Z | 2022-02-03T08:22:41.000Z | uav.py | Aniq55/DroneSim | 32cc5c40eefa542f1260e922567f854602ee66f4 | [
"MIT"
] | null | null | null | uav.py | Aniq55/DroneSim | 32cc5c40eefa542f1260e922567f854602ee66f4 | [
"MIT"
] | 2 | 2018-06-12T04:49:49.000Z | 2020-06-27T19:59:48.000Z | from constants import *
import time
import threading
from chaos import *
| 35.136364 | 87 | 0.498706 | from constants import *
import time
import threading
from chaos import *
class UAV():
def __init__(self, ID, x, y, velx, vely):
self.ID= ID
self.x= x
self.y= y
self.velx= velx
self.vely= vely
self.rescued = []
self._time_ = time.time()
self.init_time... | 1,378 | -9 | 104 |
fd2d2d27a90eb687cfa5ddaaf7a717a930d940df | 2,951 | py | Python | ldap_sync/__main__.py | JuKu/pycroft | 15595f9b4327da5c52c77174def73660226da7dc | [
"Apache-2.0"
] | null | null | null | ldap_sync/__main__.py | JuKu/pycroft | 15595f9b4327da5c52c77174def73660226da7dc | [
"Apache-2.0"
] | null | null | null | ldap_sync/__main__.py | JuKu/pycroft | 15595f9b4327da5c52c77174def73660226da7dc | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import os
from .exporter import add_stdout_logging, establish_and_return_ldap_connection, \
establish_and_return_session, fake_connection, fetch_current_ldap_users, \
fetch_users_to_sync, get_config_or_exit, logger, sync_all
logger = logging.getLogger('ldap_sync')
NAME_LE... | 30.42268 | 91 | 0.683497 | import argparse
import logging
import os
from .exporter import add_stdout_logging, establish_and_return_ldap_connection, \
establish_and_return_session, fake_connection, fetch_current_ldap_users, \
fetch_users_to_sync, get_config_or_exit, logger, sync_all
logger = logging.getLogger('ldap_sync')
def sync_... | 1,821 | 0 | 69 |
a20fcaf6ccf8820b917742d329e834e07689579f | 6,837 | py | Python | visdex/exploratory_graphs/__init__.py | mcraig-ibme/visdex | bbf8365e627f6d52fb201ae4ae6fef6775c4d716 | [
"Apache-2.0"
] | null | null | null | visdex/exploratory_graphs/__init__.py | mcraig-ibme/visdex | bbf8365e627f6d52fb201ae4ae6fef6775c4d716 | [
"Apache-2.0"
] | null | null | null | visdex/exploratory_graphs/__init__.py | mcraig-ibme/visdex | bbf8365e627f6d52fb201ae4ae6fef6775c4d716 | [
"Apache-2.0"
] | null | null | null | """
visdex: Exploratory graphs
The exploratory graphs section defines specialised data visualisations that
can be generated by the user on request
"""
import logging
from dash import html, dcc
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output, State, MATCH
import plotly.graph_objects... | 34.356784 | 91 | 0.511482 | """
visdex: Exploratory graphs
The exploratory graphs section defines specialised data visualisations that
can be generated by the user on request
"""
import logging
from dash import html, dcc
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output, State, MATCH
import plotly.graph_objects... | 4,786 | 0 | 23 |
eebf786325342f19a4237a7fea589022310860b1 | 4,982 | py | Python | intel_software/pkg_contents/micperf/CONTENTS/usr/share/micperf/micp/micp/kernels/mkl_conv.py | antoinecarme/xeon-phi-data | 883a6e2f31b2e729715303725f417b2990d923be | [
"BSD-3-Clause"
] | 1 | 2021-07-22T18:01:28.000Z | 2021-07-22T18:01:28.000Z | intel_software/pkg_contents/micperf/CONTENTS/usr/share/micperf/micp/micp/kernels/mkl_conv.py | antoinecarme/xeon-phi-data | 883a6e2f31b2e729715303725f417b2990d923be | [
"BSD-3-Clause"
] | null | null | null | intel_software/pkg_contents/micperf/CONTENTS/usr/share/micperf/micp/micp/kernels/mkl_conv.py | antoinecarme/xeon-phi-data | 883a6e2f31b2e729715303725f417b2990d923be | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2012-2017, Intel Corporation, All Rights Reserved.
#
# This software is supplied under the terms of a license
# agreement or nondisclosure agreement with Intel Corp.
# and may not be copied or disclosed except in accordance
# with the terms of that agreement.
import os
import re
import micp.kernel as mic... | 35.585714 | 119 | 0.609193 | # Copyright 2012-2017, Intel Corporation, All Rights Reserved.
#
# This software is supplied under the terms of a license
# agreement or nondisclosure agreement with Intel Corp.
# and may not be copied or disclosed except in accordance
# with the terms of that agreement.
import os
import re
import micp.kernel as mic... | 3,629 | 430 | 23 |
5499e89c9e89f497892f031f5a9cc83e7deaabf6 | 610 | py | Python | wfsim/utils.py | jmeyers314/wfsim | c2ad60c100ec1c4046368801a56a5211499f0c51 | [
"BSD-3-Clause"
] | null | null | null | wfsim/utils.py | jmeyers314/wfsim | c2ad60c100ec1c4046368801a56a5211499f0c51 | [
"BSD-3-Clause"
] | null | null | null | wfsim/utils.py | jmeyers314/wfsim | c2ad60c100ec1c4046368801a56a5211499f0c51 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import galsim
def BBSED(T):
"""(unnormalized) Blackbody SED for temperature T in Kelvin.
"""
waves_nm = np.arange(330.0, 1120.0, 10.0)
flambda = planck(T, waves_nm*1e-9)
return galsim.SED(
galsim.LookupTable(waves_nm, flambda),
wave_type='nm',
flux_type='... | 27.727273 | 64 | 0.57377 | import numpy as np
import galsim
def BBSED(T):
"""(unnormalized) Blackbody SED for temperature T in Kelvin.
"""
waves_nm = np.arange(330.0, 1120.0, 10.0)
def planck(t, w):
# t in K
# w in m
c = 2.99792458e8 # speed of light in m/s
kB = 1.3806488e-23 # Boltzmann's cons... | 249 | 0 | 26 |
a5f484ac8ab36970a0402fcb7d92a67abbe863f9 | 1,495 | py | Python | src/app/search.py | delgadofarid/my-first-search-engine | e8ea909030a599bb4bba739fe77747c98395dc29 | [
"Apache-2.0"
] | 1 | 2021-06-05T03:52:21.000Z | 2021-06-05T03:52:21.000Z | src/app/search.py | delgadofarid/my-first-search-engine | e8ea909030a599bb4bba739fe77747c98395dc29 | [
"Apache-2.0"
] | null | null | null | src/app/search.py | delgadofarid/my-first-search-engine | e8ea909030a599bb4bba739fe77747c98395dc29 | [
"Apache-2.0"
] | null | null | null | import re
from elasticsearch import Elasticsearch, helpers
from itertools import islice
# initialize Elasticsearch client
es = Elasticsearch()
| 30.510204 | 103 | 0.626756 | import re
from elasticsearch import Elasticsearch, helpers
from itertools import islice
# initialize Elasticsearch client
es = Elasticsearch()
def first_n(iterable, n):
return islice(iterable, 0, n)
def format_es_response(user_question, es_candidates):
results = list()
for c in es_candidates:
p... | 1,279 | 0 | 69 |
5786c329b92403e4f8b652789de8bbe26502cea4 | 24,221 | py | Python | tests/test_configfetch.py | openandclose/configfetch | fc0b329e6861cc73f0a108ddaea636e6956dd56f | [
"MIT"
] | null | null | null | tests/test_configfetch.py | openandclose/configfetch | fc0b329e6861cc73f0a108ddaea636e6956dd56f | [
"MIT"
] | null | null | null | tests/test_configfetch.py | openandclose/configfetch | fc0b329e6861cc73f0a108ddaea636e6956dd56f | [
"MIT"
] | null | null | null |
import argparse
import configparser
import functools
import textwrap
import pytest
import configfetch
fetch_ = configfetch.fetch
fetch = functools.partial(
configfetch.fetch, option_builder=configfetch.FiniOptionBuilder)
# blank string returns ``None``
# Just checking the standard library's behavi... | 24.842051 | 85 | 0.473886 |
import argparse
import configparser
import functools
import textwrap
import pytest
import configfetch
fetch_ = configfetch.fetch
fetch = functools.partial(
configfetch.fetch, option_builder=configfetch.FiniOptionBuilder)
def f(string):
return textwrap.dedent(string.strip('\n'))
def _get_action(conf, op... | 20,491 | 1,183 | 2,116 |
4b11f987288e4258a61dd4806f7718825b2bb273 | 2,254 | py | Python | portal_gun/commands/ssh.py | Coderik/portal-gun | 081020a46b16b649497bceb6c2435b1ba135b487 | [
"MIT"
] | 69 | 2018-05-03T18:25:43.000Z | 2021-02-10T11:37:28.000Z | portal_gun/commands/ssh.py | Coderik/portal-gun | 081020a46b16b649497bceb6c2435b1ba135b487 | [
"MIT"
] | 7 | 2018-09-19T06:39:11.000Z | 2022-03-29T21:55:08.000Z | portal_gun/commands/ssh.py | Coderik/portal-gun | 081020a46b16b649497bceb6c2435b1ba135b487 | [
"MIT"
] | 11 | 2018-07-30T18:09:12.000Z | 2019-10-03T15:36:13.000Z | import os
from portal_gun.commands.helpers import get_provider_config, get_portal_spec, get_portal_name, \
get_provider_from_portal
from portal_gun.context_managers.no_print import no_print
from .base_command import BaseCommand
from .handlers import create_handler
| 34.676923 | 107 | 0.726264 | import os
from portal_gun.commands.helpers import get_provider_config, get_portal_spec, get_portal_name, \
get_provider_from_portal
from portal_gun.context_managers.no_print import no_print
from .base_command import BaseCommand
from .handlers import create_handler
class SshCommand(BaseCommand):
DEFAULT_TMUX_SESSIO... | 1,796 | 167 | 23 |
a5bd7b16ae0ef9281e8935c406154bcc19d183b1 | 10,477 | py | Python | pt3/client.py | Aerun/pytyle3 | 86876fa7ad652fc99b77f5482559733c95490e84 | [
"WTFPL"
] | null | null | null | pt3/client.py | Aerun/pytyle3 | 86876fa7ad652fc99b77f5482559733c95490e84 | [
"WTFPL"
] | null | null | null | pt3/client.py | Aerun/pytyle3 | 86876fa7ad652fc99b77f5482559733c95490e84 | [
"WTFPL"
] | null | null | null | import time
import xcffib.xproto
import xpybutil
import xpybutil.event as event
import xpybutil.ewmh as ewmh
import xpybutil.motif as motif
import xpybutil.icccm as icccm
import xpybutil.rect as rect
import xpybutil.util as util
import xpybutil.window as window
from debug import debug
import config
import state
imp... | 34.127036 | 98 | 0.592345 | import time
import xcffib.xproto
import xpybutil
import xpybutil.event as event
import xpybutil.ewmh as ewmh
import xpybutil.motif as motif
import xpybutil.icccm as icccm
import xpybutil.rect as rect
import xpybutil.util as util
import xpybutil.window as window
from debug import debug
import config
import state
imp... | 9,523 | 0 | 488 |
aba168a92af45bb1cc54c1d9fa128f27dfac8b46 | 411 | py | Python | movies/details/models.py | tehran4e/workspace | 1a479458ae113c02e6597578f289e5f9283a69f2 | [
"MIT"
] | null | null | null | movies/details/models.py | tehran4e/workspace | 1a479458ae113c02e6597578f289e5f9283a69f2 | [
"MIT"
] | null | null | null | movies/details/models.py | tehran4e/workspace | 1a479458ae113c02e6597578f289e5f9283a69f2 | [
"MIT"
] | null | null | null | from django.db import models
| 27.4 | 61 | 0.693431 | from django.db import models
class Artist(models.Model):
name = models.CharField(max_length=200)
def __str__(self):
return self.name
class Movie(models.Model):
title = models.CharField(max_length=100)
year = models.IntegerField()
director = models.CharField(max_length=100)
s... | 23 | 307 | 49 |
1782765336d1c920b25f3e04b8d6dd09f0344112 | 905 | py | Python | index_cli/core/json_type.py | lishnih/index_cli | 57f23d5df5168bcc73e23e0eeabbb8317014585b | [
"MIT"
] | null | null | null | index_cli/core/json_type.py | lishnih/index_cli | 57f23d5df5168bcc73e23e0eeabbb8317014585b | [
"MIT"
] | null | null | null | index_cli/core/json_type.py | lishnih/index_cli | 57f23d5df5168bcc73e23e0eeabbb8317014585b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Stan 2018-09-27
from __future__ import (division, absolute_import,
print_function, unicode_literals)
import json
from sqlalchemy.types import UserDefinedType, TypeDecorator, Text
# class JsonType(UserDefinedType):
# def get_col_spec(self, **kw):
#... | 23.815789 | 73 | 0.653039 | #!/usr/bin/env python
# coding=utf-8
# Stan 2018-09-27
from __future__ import (division, absolute_import,
print_function, unicode_literals)
import json
from sqlalchemy.types import UserDefinedType, TypeDecorator, Text
class JsonType(TypeDecorator):
impl = Text
def process_bind_para... | 136 | 79 | 23 |
ed5e6c0f6c69ec6fdd90183710bf386418d25c66 | 1,563 | py | Python | tests/test_settings.py | sneJ-/chaostoolkit-lib | 07b00c8bffe8cda7494b049f9640cdbba3bad8bc | [
"Apache-2.0"
] | 1 | 2019-11-18T19:57:42.000Z | 2019-11-18T19:57:42.000Z | tests/test_settings.py | sneJ-/chaostoolkit-lib | 07b00c8bffe8cda7494b049f9640cdbba3bad8bc | [
"Apache-2.0"
] | null | null | null | tests/test_settings.py | sneJ-/chaostoolkit-lib | 07b00c8bffe8cda7494b049f9640cdbba3bad8bc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os.path
from chaoslib.settings import get_loaded_settings, load_settings, save_settings
settings_dir = os.path.join(os.path.dirname(__file__), "fixtures")
| 28.944444 | 79 | 0.715931 | # -*- coding: utf-8 -*-
import os.path
from chaoslib.settings import get_loaded_settings, load_settings, save_settings
settings_dir = os.path.join(os.path.dirname(__file__), "fixtures")
def test_do_not_fail_when_settings_do_not_exist():
assert load_settings(
os.path.join(settings_dir, "no_settings.yaml"... | 1,231 | 0 | 138 |
0da55faa65c939131e74dd60e3f512e40b9acbf0 | 49 | py | Python | instance/config.py | davideguidobene/cinema-web-app | 1a83576a1e37ea69bec2b2a80f584912cfc9b264 | [
"MIT"
] | null | null | null | instance/config.py | davideguidobene/cinema-web-app | 1a83576a1e37ea69bec2b2a80f584912cfc9b264 | [
"MIT"
] | null | null | null | instance/config.py | davideguidobene/cinema-web-app | 1a83576a1e37ea69bec2b2a80f584912cfc9b264 | [
"MIT"
] | null | null | null | import os
SECRET_KEY = os.getenv("SECRET_KEY")
| 9.8 | 36 | 0.734694 | import os
SECRET_KEY = os.getenv("SECRET_KEY")
| 0 | 0 | 0 |
7a777dd89c577420d917a03e50e383d90d26f239 | 652 | py | Python | cit_vipnet/inventory/migrations/0002_auto_20210906_1138.py | mr-Marshanskiy/cit-vipnet | 6a0e56a13cae57252957c82af3d4e98da5d9d6a4 | [
"BSD-3-Clause"
] | null | null | null | cit_vipnet/inventory/migrations/0002_auto_20210906_1138.py | mr-Marshanskiy/cit-vipnet | 6a0e56a13cae57252957c82af3d4e98da5d9d6a4 | [
"BSD-3-Clause"
] | null | null | null | cit_vipnet/inventory/migrations/0002_auto_20210906_1138.py | mr-Marshanskiy/cit-vipnet | 6a0e56a13cae57252957c82af3d4e98da5d9d6a4 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.2 on 2021-09-06 08:38
from django.db import migrations
| 29.636364 | 137 | 0.627301 | # Generated by Django 2.2 on 2021-09-06 08:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('inventory', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='hardwareplatform',
options={'ordering': ['-n... | 0 | 630 | 23 |
a218e268b041cea723c99b9e20c6c99c665876db | 88 | py | Python | main.py | hailleenvarela/data-2022-1 | 8f92e1325b6fcbf727b426c50ddf32d10e38db89 | [
"MIT"
] | null | null | null | main.py | hailleenvarela/data-2022-1 | 8f92e1325b6fcbf727b426c50ddf32d10e38db89 | [
"MIT"
] | 1 | 2022-02-27T23:23:50.000Z | 2022-02-27T23:23:50.000Z | main.py | hailleenvarela/data-2022-1 | 8f92e1325b6fcbf727b426c50ddf32d10e38db89 | [
"MIT"
] | 3 | 2022-02-27T23:14:24.000Z | 2022-03-02T00:47:12.000Z | from source.etl import ETL
x = ETL()
df = x.extract(True)
x.transform(df)
#x.load(df) | 11 | 26 | 0.670455 | from source.etl import ETL
x = ETL()
df = x.extract(True)
x.transform(df)
#x.load(df) | 0 | 0 | 0 |
97d4c4d8955d3f56c8e11f52c3ceebef2f337f77 | 2,533 | py | Python | 2021/advent2021_9.py | aatango/Advent-of-Code | f229abc7acaaa0a2316839bf11fa7e2fdf9caf2c | [
"MIT"
] | null | null | null | 2021/advent2021_9.py | aatango/Advent-of-Code | f229abc7acaaa0a2316839bf11fa7e2fdf9caf2c | [
"MIT"
] | null | null | null | 2021/advent2021_9.py | aatango/Advent-of-Code | f229abc7acaaa0a2316839bf11fa7e2fdf9caf2c | [
"MIT"
] | null | null | null | """Advent of Code 2021, day 9: Smoke Basin"""
def main(input_matrix: tuple[str]) -> int:
"""
Find all of the low points on your heightmap.
What is the sum of the risk levels of all low points on your heightmap?
"""
# It's a brute force approach that does not scale to part two,
# but it's what I could think of w... | 28.784091 | 83 | 0.684959 | """Advent of Code 2021, day 9: Smoke Basin"""
def main(input_matrix: tuple[str]) -> int:
"""
Find all of the low points on your heightmap.
What is the sum of the risk levels of all low points on your heightmap?
"""
# It's a brute force approach that does not scale to part two,
# but it's what I could think of w... | 430 | 0 | 24 |
8485ba5f72fd09655120694f54a0ea9e297a8fe8 | 545 | py | Python | pythondata_cpu_blackparrot/system_verilog/black-parrot/external/basejump_stl/testing/bsg_test/dramsim3_bandwidth2/const_random.py | litex-hub/pythondata-cpu-blackparrot | ba50883f12d33e1d834640640c84ddc9329bb68a | [
"BSD-3-Clause"
] | 3 | 2021-05-12T21:57:55.000Z | 2021-07-29T19:56:04.000Z | pythondata_cpu_blackparrot/system_verilog/black-parrot/external/basejump_stl/testing/bsg_test/dramsim3_bandwidth2/const_random.py | litex-hub/litex-data-cpu-blackparrot | ba50883f12d33e1d834640640c84ddc9329bb68a | [
"BSD-3-Clause"
] | 1 | 2020-05-02T02:41:24.000Z | 2020-05-02T02:44:25.000Z | pythondata_cpu_blackparrot/system_verilog/black-parrot/external/basejump_stl/testing/bsg_test/dramsim3_bandwidth2/const_random.py | litex-hub/litex-data-cpu-blackparrot | ba50883f12d33e1d834640640c84ddc9329bb68a | [
"BSD-3-Clause"
] | 2 | 2020-05-01T08:33:19.000Z | 2021-07-29T19:56:12.000Z | import sys
import random
from trace_gen import *
if __name__ == "__main__":
random.seed(0)
num_cache_p = int(sys.argv[1])
block_size_in_words_p = int(sys.argv[2])
tg = TraceGen(block_size_in_words_p)
tg.clear_tags()
#words = (2**18)/num_cache_p # 1MB
words = (2**18)/num_cache_p # 1MB
max_range = (2*... | 20.185185 | 47 | 0.66055 | import sys
import random
from trace_gen import *
if __name__ == "__main__":
random.seed(0)
num_cache_p = int(sys.argv[1])
block_size_in_words_p = int(sys.argv[2])
tg = TraceGen(block_size_in_words_p)
tg.clear_tags()
#words = (2**18)/num_cache_p # 1MB
words = (2**18)/num_cache_p # 1MB
max_range = (2*... | 0 | 0 | 0 |
74ee5adaad45c0809358f0e7260945651ef42945 | 5,699 | py | Python | touchdown/tests/test_aws_vpc_subnet.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 14 | 2015-01-05T18:18:04.000Z | 2022-02-07T19:35:12.000Z | touchdown/tests/test_aws_vpc_subnet.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 106 | 2015-01-06T00:17:13.000Z | 2019-09-07T00:35:32.000Z | touchdown/tests/test_aws_vpc_subnet.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 5 | 2015-01-30T10:18:24.000Z | 2022-02-07T19:35:13.000Z | # Copyright 2015 Isotoma Limited
#
# 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 writing... | 32.565714 | 87 | 0.589402 | # Copyright 2015 Isotoma Limited
#
# 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 writing... | 4,665 | 41 | 206 |
62b58d3a59f61b26ea27943ea666bc132820d76e | 8,597 | py | Python | pymbs/processing/loops/fourbar.py | brutzl/pymbs | fb7c91435f56b5c4d460f82f081d5d1960fea886 | [
"MIT"
] | null | null | null | pymbs/processing/loops/fourbar.py | brutzl/pymbs | fb7c91435f56b5c4d460f82f081d5d1960fea886 | [
"MIT"
] | null | null | null | pymbs/processing/loops/fourbar.py | brutzl/pymbs | fb7c91435f56b5c4d460f82f081d5d1960fea886 | [
"MIT"
] | null | null | null | from pymbs.processing.loops.loop import Loop
from pymbs.common.functions import sqrt
from pymbs.processing import Frame
from pymbs.processing.loads.constraint import Constraint
from numpy import pi
from pymbs.symbolics import Matrix, eye, cos, sin, atan, atan2, acos, zeros, transpose
AL = 'FB_%s_AL'
BE = 'FB_%s_BE'... | 35.378601 | 310 | 0.562289 | from pymbs.processing.loops.loop import Loop
from pymbs.common.functions import sqrt
from pymbs.processing import Frame
from pymbs.processing.loads.constraint import Constraint
from numpy import pi
from pymbs.symbolics import Matrix, eye, cos, sin, atan, atan2, acos, zeros, transpose
AL = 'FB_%s_AL'
BE = 'FB_%s_BE'... | 0 | 0 | 0 |
127d839e1bbc55e99f4f321f7c332ef610cb53d8 | 1,812 | py | Python | earth_enterprise/src/server/wsgi/wms/ogc/common/image_specs.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 2,661 | 2017-03-20T22:12:50.000Z | 2022-03-30T09:43:19.000Z | earth_enterprise/src/server/wsgi/wms/ogc/common/image_specs.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 1,531 | 2017-03-24T17:20:32.000Z | 2022-03-16T18:11:14.000Z | earth_enterprise/src/server/wsgi/wms/ogc/common/image_specs.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 990 | 2017-03-24T11:54:28.000Z | 2022-03-22T11:51:47.000Z | #!/usr/bin/env python2.7
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 22.65 | 74 | 0.679912 | #!/usr/bin/env python2.7
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 44 | 0 | 23 |
9b3205aefcc2508985db4f069099edf5e7dbfa1b | 662 | py | Python | ClassFromQueryGenerator/CRUDPyMacros/Update.py | UnstableMutex/ClassFromQueryGenerator | 5de03f61059d2c61783a9b66ab4e11060343e803 | [
"MIT"
] | null | null | null | ClassFromQueryGenerator/CRUDPyMacros/Update.py | UnstableMutex/ClassFromQueryGenerator | 5de03f61059d2c61783a9b66ab4e11060343e803 | [
"MIT"
] | null | null | null | ClassFromQueryGenerator/CRUDPyMacros/Update.py | UnstableMutex/ClassFromQueryGenerator | 5de03f61059d2c61783a9b66ab4e11060343e803 | [
"MIT"
] | null | null | null | comma=","
result="SET ANSI_NULLS ON\n"
result+="GO\n"
result+="SET QUOTED_IDENTIFIER ON\n"
result+="GO\n"
result+="CREATE PROCEDURE "+Model.TableName+"_Update\n"
result+=mapcols(pars)
result+="AS\n"
result+="BEGIN\n"
result+="SET NOCOUNT ON;\n"
result+="update [dbo].["+Model.TableName+"]\n"
result+=" set ("
result+=map... | 24.518519 | 55 | 0.669184 |
def sqf(col):
return "["+col.Name+"] = @"+col.Name
def pars(col):
return "@"+col.Name+" "+col.SQLType+"\n"
comma=","
def mapcols(f):
return comma.join(map(f,Model.Columns))
def mapusual(f):
return comma.join(map(f,Model.UsualColumns))
result="SET ANSI_NULLS ON\n"
result+="GO\n"
result+="SET QUOTED_IDENTIFIER ON\n"... | 141 | 0 | 89 |
e33365306faf8e05ad78b480b5ad8b2e0c36c04f | 6,338 | py | Python | tests/core/testRpg.py | rrpg/engine | 989f701b82aa7c73ea98003eed13077e5d6f15f9 | [
"MIT"
] | 2 | 2016-04-07T23:36:46.000Z | 2016-12-20T15:35:17.000Z | tests/core/testRpg.py | rrpg/engine | 989f701b82aa7c73ea98003eed13077e5d6f15f9 | [
"MIT"
] | 5 | 2016-02-04T16:28:33.000Z | 2016-03-18T17:02:07.000Z | tests/core/testRpg.py | rrpg/engine | 989f701b82aa7c73ea98003eed13077e5d6f15f9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
import tests.common
import core
from core.localisation import _
from core import Rpg
import models.player
from models.saved_game import saved_game
import json
import sqlite3
| 37.502959 | 297 | 0.736668 | # -*- coding: utf-8 -*-
import unittest
import tests.common
import core
from core.localisation import _
from core import Rpg
import models.player
from models.saved_game import saved_game
import json
import sqlite3
class rpgTests(tests.common.common):
idSavedGame = 1
idFaultySavedGame = 2
idEmptySavedGame = 3
in... | 5,562 | 536 | 23 |