hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
70e1a5af6d40bdc29f7254bd80b4720e3fb4fe89 | 308 | py | Python | binance_f/model/positionmode.py | molibdenium/autostopmarket | deb63c83ea480b417affd29d360e12befaae8dad | [
"MIT"
] | 4 | 2020-09-07T15:04:43.000Z | 2022-01-19T04:52:06.000Z | binance_f/model/positionmode.py | molibdenium/autostopmarket | deb63c83ea480b417affd29d360e12befaae8dad | [
"MIT"
] | null | null | null | binance_f/model/positionmode.py | molibdenium/autostopmarket | deb63c83ea480b417affd29d360e12befaae8dad | [
"MIT"
] | 1 | 2021-05-15T13:22:12.000Z | 2021-05-15T13:22:12.000Z | #createdbyme
| 22 | 45 | 0.681818 | #createdbyme
class PositionMode:
def __init__(self):
self.code = ""
self.msg = ""
@staticmethod
def json_parse(json_data):
print("parsing position data")
result = PositionMode()
result.code = json_data.get_string("code")
result.msg = json_data.get_string("msg")
return result | 0 | 191 | 0 | 82 | 0 | 0 | 0 | 0 | 22 |
3077d0b2b6c4dc7425d60cb05b484e9c238ff4e3 | 1,616 | py | Python | seq2seq/select_influence_score.py | GT-SALT/CODA | 7d3ae5d79288813c66f49701a1f019e8f61d18d6 | [
"Apache-2.0"
] | 11 | 2022-02-28T10:07:04.000Z | 2022-03-28T06:45:44.000Z | seq2seq/.ipynb_checkpoints/select_influence_score-checkpoint.py | GT-SALT/CODA | 7d3ae5d79288813c66f49701a1f019e8f61d18d6 | [
"Apache-2.0"
] | 3 | 2022-03-28T12:49:24.000Z | 2022-03-30T02:17:52.000Z | seq2seq/.ipynb_checkpoints/select_influence_score-checkpoint.py | GT-SALT/CODA | 7d3ae5d79288813c66f49701a1f019e8f61d18d6 | [
"Apache-2.0"
] | 1 | 2022-02-28T10:07:10.000Z | 2022-02-28T10:07:10.000Z | import argparse
parser = argparse.ArgumentParser(description='Unlabeled')
parser.add_argument('--data_path', type=str, default='./tmp/tst-summarization-baseline-predict/test_generations.txt',
help='path to data files')
parser.add_argument('--output_data_path', type=str, default='./data/ulbl_predi... | 27.862069 | 117 | 0.64047 | import pandas as pd
import argparse
import pickle
import numpy as np
from bert_score import BERTScorer
parser = argparse.ArgumentParser(description='Unlabeled')
parser.add_argument('--data_path', type=str, default='./tmp/tst-summarization-baseline-predict/test_generations.txt',
help='path to data... | 0 | 0 | 0 | 0 | 0 | 956 | 0 | -1 | 112 |
d9719701296d49b8008d6d90c05c1882975c627d | 283 | py | Python | bcf-announcements/urls.py | BioComputing/django-bcf-announcements | 693e3cd9f58d497832ccd458a80eaa94fd45823f | [
"BSD-3-Clause"
] | null | null | null | bcf-announcements/urls.py | BioComputing/django-bcf-announcements | 693e3cd9f58d497832ccd458a80eaa94fd45823f | [
"BSD-3-Clause"
] | null | null | null | bcf-announcements/urls.py | BioComputing/django-bcf-announcements | 693e3cd9f58d497832ccd458a80eaa94fd45823f | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import patterns
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
(r'^api/announcement/(?P<pk>\d+)/dismiss$', AnnouncementDismiss.as_view()),
(r'^api/announcements$', AnnouncementList.as_view()),
)
| 23.583333 | 79 | 0.724382 | from django.conf.urls import url, patterns
from django.contrib import admin
from .api import *
admin.autodiscover()
urlpatterns = patterns(
(r'^api/announcement/(?P<pk>\d+)/dismiss$', AnnouncementDismiss.as_view()),
(r'^api/announcements$', AnnouncementList.as_view()),
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 22 |
3ac5dc8054ab1ad788fff41588e746ddd4a6b1bc | 5,373 | py | Python | main.py | tfreundo/TensorFlow_BasicImageClassification | c0526134bbaf9fd50f95a7ee69c3eecd434ae3af | [
"MIT"
] | null | null | null | main.py | tfreundo/TensorFlow_BasicImageClassification | c0526134bbaf9fd50f95a7ee69c3eecd434ae3af | [
"MIT"
] | null | null | null | main.py | tfreundo/TensorFlow_BasicImageClassification | c0526134bbaf9fd50f95a7ee69c3eecd434ae3af | [
"MIT"
] | null | null | null | # Implementation of the TensforFlow Tutorial for Basic Classification: https://www.tensorflow.org/tutorials/keras/basic_classification
# author: tfreundo
import tensorflow as tf
# High Level TF-API
from tensorflow import keras
import numpy as np
# Parameters for Debugging and tweaking the Learning
debug_plot_exampleI... | 38.934783 | 221 | 0.687512 | # Implementation of the TensforFlow Tutorial for Basic Classification: https://www.tensorflow.org/tutorials/keras/basic_classification
# author: tfreundo
import tensorflow as tf
# High Level TF-API
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plot
# Parameters for Debugging and tweaking... | 0 | 0 | 0 | 0 | 0 | 1,212 | 0 | 11 | 113 |
39a4ad7ac65bfb5b8a327c7d390102a859ca8556 | 31,179 | py | Python | CTFd/panSky.py | RealityAbb/panSky | fadf7063094f809f679d0bcaafbd161054b6b63b | [
"Apache-2.0"
] | null | null | null | CTFd/panSky.py | RealityAbb/panSky | fadf7063094f809f679d0bcaafbd161054b6b63b | [
"Apache-2.0"
] | null | null | null | CTFd/panSky.py | RealityAbb/panSky | fadf7063094f809f679d0bcaafbd161054b6b63b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
from flask import current_app as app
import sys
authority = app.config['MYSQL_USER']
password = app.config['MYSQL_PASSWORD']
name = app.config['DATEBASE_NAME']
reload(sys)
sys.setdefaultencoding('utf-8')
PER_PAGE_COUNT = 20
PDD_COOKIES = ""
| 50.046549 | 166 | 0.596972 | # coding=utf-8
import csv
from flask import render_template, request, redirect, abort, jsonify, url_for, session, flash, send_from_directory
from CTFd.utils import authed, judge_result, allowed_file, get_file_suffix
from CTFd.models import db, GoodBaseInfo, GoodSkuInfo, SkuProxyInfo, get_id, DisplayGoodInfo, getPlatfo... | 162 | 27,207 | 0 | 0 | 0 | 2,442 | 0 | 374 | 839 |
0b4a57552c45af163e7d3c26f3f4f9242ef6ae01 | 1,686 | py | Python | jdcloud_sdk/services/asset/models/OperatingStatement.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | jdcloud_sdk/services/asset/models/OperatingStatement.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | jdcloud_sdk/services/asset/models/OperatingStatement.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | 40.142857 | 159 | 0.705813 | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | 357 | 0 | 0 | 875 | 0 | 0 | 0 | 0 | 23 |
b43840c4a6881b7a59cc381c4a30820b94ba3c43 | 287 | py | Python | ACME/visdom/create_session.py | mauriziokovacic/ACME | 2615b66dd4addfd5c03d9d91a24c7da414294308 | [
"MIT"
] | 3 | 2019-10-23T23:10:55.000Z | 2021-09-01T07:30:14.000Z | ACME/visdom/create_session.py | mauriziokovacic/ACME-Python | 2615b66dd4addfd5c03d9d91a24c7da414294308 | [
"MIT"
] | null | null | null | ACME/visdom/create_session.py | mauriziokovacic/ACME-Python | 2615b66dd4addfd5c03d9d91a24c7da414294308 | [
"MIT"
] | 1 | 2020-07-11T11:35:43.000Z | 2020-07-11T11:35:43.000Z | from visdom import Visdom
def create_session(**kwargs):
"""
Creates a visdom session
Parameters
----------
kwargs : ...
Returns
-------
object
a visdom session
"""
session = Visdom(**kwargs)
session.close(None)
return session
| 13.666667 | 30 | 0.547038 | from visdom import Visdom
def create_session(**kwargs):
"""
Creates a visdom session
Parameters
----------
kwargs : ...
Returns
-------
object
a visdom session
"""
session = Visdom(**kwargs)
session.close(None)
return session
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
add9bcd2370ae2572ca4ce5d88a51d08eee165cf | 15,626 | py | Python | geomloss/examples/sinkhorn_multiscale/plot_kernel_truncation.py | KingaS03/geomloss | 0f6dfa2ddde306337c85167543304bc3fe3e298d | [
"MIT"
] | null | null | null | geomloss/examples/sinkhorn_multiscale/plot_kernel_truncation.py | KingaS03/geomloss | 0f6dfa2ddde306337c85167543304bc3fe3e298d | [
"MIT"
] | 1 | 2021-07-15T12:43:21.000Z | 2021-07-15T12:43:21.000Z | geomloss/examples/sinkhorn_multiscale/plot_kernel_truncation.py | KingaS03/geomloss | 0f6dfa2ddde306337c85167543304bc3fe3e298d | [
"MIT"
] | null | null | null | """
2) Kernel truncation, log-linear runtimes
=====================================================
In the previous notebook, we've seen that **simulated annealing**
could be used to define efficient coarse-to-fine solvers
of the entropic :math:`\\text{OT}_\\varepsilon` problem.
Adapting ideas from `(Schmitzer, 2016) ... | 41.892761 | 131 | 0.656022 | """
2) Kernel truncation, log-linear runtimes
=====================================================
In the previous notebook, we've seen that **simulated annealing**
could be used to define efficient coarse-to-fine solvers
of the entropic :math:`\\text{OT}_\\varepsilon` problem.
Adapting ideas from `(Schmitzer, 2016) ... | 6 | 0 | 0 | 0 | 0 | 1,492 | 0 | -20 | 182 |
139ed1381680f6361644b12685a16d1038452c58 | 13,216 | py | Python | Impansible/Impansible3.py | AdamPrzybyla/Impansible | f34f190abce71de01a36a21dae0914cbd20ff51a | [
"MIT"
] | 2 | 2020-05-15T23:09:05.000Z | 2021-01-24T14:39:28.000Z | Impansible/Impansible3.py | AdamPrzybyla/Impansible | f34f190abce71de01a36a21dae0914cbd20ff51a | [
"MIT"
] | null | null | null | Impansible/Impansible3.py | AdamPrzybyla/Impansible | f34f190abce71de01a36a21dae0914cbd20ff51a | [
"MIT"
] | null | null | null | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
import os
from ansible import modules
ansible_password=False
ansible_become_password=False
ansible_user=False
amodules_map={}
r=os.path.dirname(modules.__file__)
rr=len(r)-15
del modules
results={}
resultser={}
for i in os.walk(r):
mo=[... | 34.327273 | 139 | 0.617206 | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
import importlib,os,re,sys
from robot.libraries.BuiltIn import BuiltIn,RobotNotRunningError
from robot.api import logger
from ansible import modules
from .picker2 import picker2
from ansible.cli.adhoc import AdHocCLI as mycli
from ansibl... | 0 | 0 | 0 | 12,390 | 0 | 0 | 0 | 144 | 246 |
c646aa1ca48a5bb4215bc89581b1b1a6564c1162 | 165 | py | Python | narcy/nlp/tenses.py | sztal/narcy | 18bfdcfb691c3505384f452479dee5fb6c93321e | [
"MIT"
] | 13 | 2019-04-17T13:44:33.000Z | 2021-03-17T23:23:15.000Z | narcy/nlp/tenses.py | sztal/narcy | 18bfdcfb691c3505384f452479dee5fb6c93321e | [
"MIT"
] | 1 | 2019-03-17T16:29:14.000Z | 2019-03-17T16:29:14.000Z | narcy/nlp/tenses.py | sztal/narcy | 18bfdcfb691c3505384f452479dee5fb6c93321e | [
"MIT"
] | 1 | 2020-01-08T11:35:03.000Z | 2020-01-08T11:35:03.000Z | """Tense analysis and detection related utilities."""
# pylint: disable=E0611
PRESENT = 'PRESENT'
PAST = 'PAST'
FUTURE = 'FUTURE'
MODAL = 'MODAL'
NORMAL = 'NORMAL'
| 18.333333 | 53 | 0.69697 | """Tense analysis and detection related utilities."""
# pylint: disable=E0611
PRESENT = 'PRESENT'
PAST = 'PAST'
FUTURE = 'FUTURE'
MODAL = 'MODAL'
NORMAL = 'NORMAL'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
616ba45a89e198aa88a7dfdeabbeb7d806c09f29 | 839 | py | Python | finrl/exchange/__init__.py | JuohmaruSanshiro/FinRL-Library | d62fd577a0be37e1daffdc5ba10862e42b38e04b | [
"MIT"
] | 2 | 2021-03-16T02:33:57.000Z | 2021-04-01T02:09:49.000Z | finrl/exchange/__init__.py | JuohmaruSanshiro/FinRL-Library | d62fd577a0be37e1daffdc5ba10862e42b38e04b | [
"MIT"
] | null | null | null | finrl/exchange/__init__.py | JuohmaruSanshiro/FinRL-Library | d62fd577a0be37e1daffdc5ba10862e42b38e04b | [
"MIT"
] | 2 | 2021-03-16T07:04:33.000Z | 2021-12-19T09:12:10.000Z | # flake8: noqa: F401
# isort: off
# isort: on
| 49.352941 | 96 | 0.673421 | # flake8: noqa: F401
# isort: off
from finrl.exchange.common import MAP_EXCHANGE_CHILDCLASS
from finrl.exchange.exchange import Exchange
# isort: on
from finrl.exchange.bibox import Bibox
from finrl.exchange.binance import Binance
from finrl.exchange.bittrex import Bittrex
from finrl.exchange.exchange import (available... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 617 | 176 |
536b4d6a4a6666359b90e191a3d593250b44e863 | 1,253 | py | Python | data_utils/augmentor/impulse_response.py | limpidezza/DeepSpeech | b3c728d46ff4eee68c45f20b0abb76e968008bcb | [
"Apache-2.0"
] | 45 | 2020-02-24T14:34:44.000Z | 2022-03-08T08:33:56.000Z | data_utils/augmentor/impulse_response.py | limpidezza/DeepSpeech | b3c728d46ff4eee68c45f20b0abb76e968008bcb | [
"Apache-2.0"
] | 2 | 2019-03-20T07:17:27.000Z | 2020-11-27T08:33:30.000Z | data_utils/augmentor/impulse_response.py | limpidezza/DeepSpeech | b3c728d46ff4eee68c45f20b0abb76e968008bcb | [
"Apache-2.0"
] | 12 | 2020-03-09T13:23:47.000Z | 2022-01-24T05:45:25.000Z | """Contains the impulse response augmentation model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
| 35.8 | 80 | 0.75419 | """Contains the impulse response augmentation model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from data_utils.augmentor.base import AugmentorBase
from data_utils.utility import read_manifest
from data_utils.audio import AudioSegment
class Impulse... | 0 | 0 | 0 | 924 | 0 | 0 | 0 | 73 | 90 |
fe96e0e1fcc166d5bddd8fd1c46d81292e038d07 | 1,471 | py | Python | knnimpute/common.py | DeoLeung/knnimpute | 0c5ba220cb0e21940a22d903987334e4022661de | [
"Apache-2.0"
] | null | null | null | knnimpute/common.py | DeoLeung/knnimpute | 0c5ba220cb0e21940a22d903987334e4022661de | [
"Apache-2.0"
] | null | null | null | knnimpute/common.py | DeoLeung/knnimpute | 0c5ba220cb0e21940a22d903987334e4022661de | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 39.756757 | 76 | 0.74915 | # 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, software
# distributed under th... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -4 | 45 |
78b15bfa61c9f0a0ac60ea17100b87dc3a38c869 | 2,641 | py | Python | object_database/web/cells_demo/sized.py | APrioriInvestments/object_database | d44b8432490b36b1ace67de0e23fb59f7ce9b529 | [
"Apache-2.0"
] | 2 | 2021-02-23T18:28:40.000Z | 2021-04-18T03:00:53.000Z | object_database/web/cells_demo/sized.py | APrioriInvestments/object_database | d44b8432490b36b1ace67de0e23fb59f7ce9b529 | [
"Apache-2.0"
] | 115 | 2019-10-08T18:32:58.000Z | 2021-02-12T20:16:14.000Z | object_database/web/cells_demo/sized.py | APrioriInvestments/object_database | d44b8432490b36b1ace67de0e23fb59f7ce9b529 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2020 object_database Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 34.75 | 93 | 0.664142 | # Copyright 2017-2020 object_database Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 0 | 0 | 0 | 1,801 | 0 | 0 | 0 | 38 | 137 |
61fe9e6e1b690bbecc7f6cef0de9cc43d76cfcaf | 1,079 | py | Python | signin.py | panzihan/signin | e0014207c12890230df69730498ad83128d22617 | [
"Apache-2.0"
] | null | null | null | signin.py | panzihan/signin | e0014207c12890230df69730498ad83128d22617 | [
"Apache-2.0"
] | null | null | null | signin.py | panzihan/signin | e0014207c12890230df69730498ad83128d22617 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# coding=utf-8
| 29.162162 | 75 | 0.508804 | #!/usr/bin/python
# coding=utf-8
from urllib import request
import json
def signin(dict, cookie):
host = dict["host"]
if host:
print(host)
url = "http://" + dict["host"] + dict["url"]
print(url)
req = request.Request(url, method="POST")
headers = dict["headers"]
... | 0 | 0 | 0 | 0 | 0 | 959 | 0 | -5 | 91 |
4185180f87bd862a3f91bec6052890ae83da020e | 2,398 | py | Python | spectre/utils.py | Bit03/django-spectre | 5f64cc82415458ca62cb86060f2476061b853639 | [
"MIT"
] | null | null | null | spectre/utils.py | Bit03/django-spectre | 5f64cc82415458ca62cb86060f2476061b853639 | [
"MIT"
] | null | null | null | spectre/utils.py | Bit03/django-spectre | 5f64cc82415458ca62cb86060f2476061b853639 | [
"MIT"
] | null | null | null | from django.forms.utils import flatatt
from django.utils import six
from django.utils.encoding import force_text, force_str
from django.utils.html import format_html
from django.utils.http import urlencode
from django.utils.safestring import mark_safe
try:
from urlparse import urlparse, parse_qs, urlunparse
except... | 28.211765 | 89 | 0.649291 | from django.forms.utils import flatatt
from django.utils import six
from django.utils.encoding import force_text, force_str
from django.utils.html import format_html
from django.utils.http import urlencode
from django.utils.safestring import mark_safe
try:
from urlparse import urlparse, parse_qs, urlunparse
except... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a2b9821d4307e2037bcd7b3dc9aea06b6aaf7265 | 1,392 | py | Python | RQ3/ncs_baseline/test.py | BuiltOntheRock/FSE22_BuiltOntheRock | 84e1ccefa01e5de610924ca8619999f93bcf80c2 | [
"BSD-Source-Code"
] | null | null | null | RQ3/ncs_baseline/test.py | BuiltOntheRock/FSE22_BuiltOntheRock | 84e1ccefa01e5de610924ca8619999f93bcf80c2 | [
"BSD-Source-Code"
] | null | null | null | RQ3/ncs_baseline/test.py | BuiltOntheRock/FSE22_BuiltOntheRock | 84e1ccefa01e5de610924ca8619999f93bcf80c2 | [
"BSD-Source-Code"
] | null | null | null | import javalang
import json
# def concatParentheses(code_list):
# temp_code = ''
# new_code_list = []
# for code in code_list:
# code = code.strip()
# if temp_code == '' and code != '{' and code != '}':
with open(f'./../../../../Downloads/code2comment_dataset/dataset/TLcodesum_dataset/t... | 29 | 110 | 0.586925 | import javalang
import json
from tqdm import tqdm
import re
# def concatParentheses(code_list):
# temp_code = ''
# new_code_list = []
# for code in code_list:
# code = code.strip()
# if temp_code == '' and code != '{' and code != '}':
def tokenize_with_camel_case(token):
matches = re.... | 0 | 0 | 0 | 0 | 0 | 189 | 0 | -12 | 90 |
4e641f13cbc9f066fc0946b737e6b0dc8cf79344 | 4,984 | py | Python | src/lib/Bcfg2/Server/Hostbase/settings.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | src/lib/Bcfg2/Server/Hostbase/settings.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | src/lib/Bcfg2/Server/Hostbase/settings.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | import os.path
# Compatibility import
from Bcfg2.Bcfg2Py3k import ConfigParser
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
c = ConfigParser.ConfigParser()
#This needs to be configurable one day somehow
c.read(['./bcfg2.conf'])
defaults = {'database_engine':'sqlite3',
'database_name':'./dev.... | 34.611111 | 83 | 0.7189 | import os.path
# Compatibility import
from Bcfg2.Bcfg2Py3k import ConfigParser
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
c = ConfigParser.ConfigParser()
#This needs to be configurable one day somehow
c.read(['./bcfg2.conf'])
defaults = {'database_engine':'sqlite3',
'database_name':'./dev.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6a04b1894020002b5955cd936f00948a5c560f3b | 2,894 | py | Python | server/tests/tests_login.py | franchais3226/coral | 82ff6290658741fc77464b7641b482075a78a925 | [
"MIT"
] | 2 | 2016-04-16T23:57:50.000Z | 2016-12-14T21:55:32.000Z | server/tests/tests_login.py | franchais3226/coral | 82ff6290658741fc77464b7641b482075a78a925 | [
"MIT"
] | 1 | 2016-03-31T23:44:05.000Z | 2016-03-31T23:44:05.000Z | server/tests/tests_login.py | franchais3226/coral | 82ff6290658741fc77464b7641b482075a78a925 | [
"MIT"
] | 9 | 2016-02-01T23:00:24.000Z | 2020-07-30T14:39:01.000Z | """This script handles test cases for the login module"""
import unittest
if __name__ == '__main__':
unittest.main() | 37.584416 | 74 | 0.577402 | """This script handles test cases for the login module"""
import unittest
from flask import request, session
from app.views import create_app
class LoginTestCase(unittest.TestCase):
"""Login Feature specific Test Cases will go here"""
def setUp(self):
"""Setup test app"""
self.app = create_a... | 0 | 0 | 0 | 2,680 | 0 | 0 | 0 | 24 | 67 |
055179ce006c04c78590d60ba0fc939fa3401518 | 286 | py | Python | pages/urls.py | mp5maker/heroku-django | 533cc6a7378e60b082d73f91b5c76780736a21b1 | [
"MIT"
] | null | null | null | pages/urls.py | mp5maker/heroku-django | 533cc6a7378e60b082d73f91b5c76780736a21b1 | [
"MIT"
] | 13 | 2020-02-12T00:14:20.000Z | 2022-02-10T08:46:42.000Z | simpleapp/pages/urls.py | mp5maker/django | a2d38e2e9973e755afce1bd0ccb17e58f3db7e33 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import (testPageView, HomePageView, AboutPageView)
app_name = "pages"
urlpatterns = [
path('', HomePageView.as_view(), name="home"),
path('about/', AboutPageView.as_view(), name="about"),
path('test/', testPageView, name="test")
] | 26 | 62 | 0.688811 | from django.urls import path
from .views import (testPageView, HomePageView, AboutPageView)
app_name = "pages"
urlpatterns = [
path('', HomePageView.as_view(), name="home"),
path('about/', AboutPageView.as_view(), name="about"),
path('test/', testPageView, name="test")
] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
530963ad389edbdbf2ad6639468262c976a8bf0d | 344 | py | Python | airflow/plugins/operators/__init__.py | abelkartwii/warehouse | 0ca37b49cea2ae9dfd5c65afa77ac187f9dc01e5 | [
"MIT"
] | null | null | null | airflow/plugins/operators/__init__.py | abelkartwii/warehouse | 0ca37b49cea2ae9dfd5c65afa77ac187f9dc01e5 | [
"MIT"
] | null | null | null | airflow/plugins/operators/__init__.py | abelkartwii/warehouse | 0ca37b49cea2ae9dfd5c65afa77ac187f9dc01e5 | [
"MIT"
] | null | null | null | from operators.sourcetoredshift import SourceToRedshiftOperator
__all__ = [
'SourceToRedshiftOperator',
'CreateTablesOperator'
'LoadFactOperator',
'LoadDimensionOperator',
] | 31.272727 | 63 | 0.831395 | from operators.sourcetoredshift import SourceToRedshiftOperator
from operators.createtables import CreateTablesOperator
from operators.loadfact import FactOperator
from operators.loaddimension import DimensionOperator
__all__ = [
'SourceToRedshiftOperator',
'CreateTablesOperator'
'LoadFactOperator',
'L... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 88 | 66 |
436e7f357b002f725491263a49a0e8103f9752d9 | 538 | py | Python | 2019/06/1/process.py | andrewelkins/advent-of-code | 2c04f53f86a919b1dee0d95971f6502a03d25d74 | [
"MIT"
] | null | null | null | 2019/06/1/process.py | andrewelkins/advent-of-code | 2c04f53f86a919b1dee0d95971f6502a03d25d74 | [
"MIT"
] | null | null | null | 2019/06/1/process.py | andrewelkins/advent-of-code | 2c04f53f86a919b1dee0d95971f6502a03d25d74 | [
"MIT"
] | null | null | null | # https://adventofcode.com/2019/day/6
import os
orbit_data = {}
with open(os.path.join(os.path.dirname(__file__), "../data.txt"), "r") as f:
for line in f:
# child > parent
relation = line.strip().split(")")
orbit_data[relation[1]] = relation[0]
print(process(orbit_data))
| 20.692308 | 76 | 0.581784 | # https://adventofcode.com/2019/day/6
import os
def process(data):
count = 0
for planet in data.keys():
num_orbits = 1
while data[planet] in data:
num_orbits += 1
planet = data[planet]
count += num_orbits
return count
orbit_data = {}
with open(os.path.joi... | 0 | 0 | 0 | 0 | 0 | 208 | 0 | 0 | 23 |
96a8cc8ff06cd4fb2028dfb0c9831e3e3a456176 | 5,895 | py | Python | tests/unit/test_config.py | oglok/CPU-Manager-for-Kubernetes | 503f37dcb20452699ce789b6628fa3ebeb9ffb54 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_config.py | oglok/CPU-Manager-for-Kubernetes | 503f37dcb20452699ce789b6628fa3ebeb9ffb54 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_config.py | oglok/CPU-Manager-for-Kubernetes | 503f37dcb20452699ce789b6628fa3ebeb9ffb54 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 29.183168 | 74 | 0.546904 | # Copyright (c) 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 0 | 0 | 0 | 0 | 0 | 4,920 | 0 | -33 | 386 |
5ab36515e6bca44c0b06c9c083f6fc7d38fa3ff3 | 6,471 | py | Python | stereo3d/stereo3d/stereocapture/pyloncapture.py | bknight-i3drobotics/Stereo3D | 3f7fa5902590397d5ff67f2ab1efdcced08f8501 | [
"MIT"
] | 3 | 2020-11-29T21:48:52.000Z | 2021-04-17T02:59:58.000Z | stereo3d/stereo3d/stereocapture/pyloncapture.py | bknight-i3drobotics/Stereo3D | 3f7fa5902590397d5ff67f2ab1efdcced08f8501 | [
"MIT"
] | 6 | 2020-02-07T09:52:00.000Z | 2020-04-29T14:51:03.000Z | stereo3d/stereo3d/stereocapture/pyloncapture.py | bknight-i3drobotics/Stereo3D | 3f7fa5902590397d5ff67f2ab1efdcced08f8501 | [
"MIT"
] | 2 | 2020-06-24T05:52:31.000Z | 2020-10-29T05:16:25.000Z | import cv2
# Image event handler.
if __name__ == '__main__':
CAMERA_SERIAL = "23517286"
cam = PylonCapture(CAMERA_SERIAL)
cam.connect()
while True:
res, image = cam.grab()
if res:
image_resized = cv2.resize(image, (640, 480))
cv2.imshow('Image', image_resized)
... | 38.748503 | 124 | 0.620306 | import cv2
import numpy as np
from pypylon import pylon
from threading import Lock
# Image event handler.
class PylonImageEventHandler(pylon.ImageEventHandler):
def __init__(self):
super().__init__()
self.image_mutex = Lock()
with self.image_mutex:
self.image = np.array([])
... | 0 | 0 | 0 | 5,936 | 0 | 0 | 0 | 6 | 111 |
ac3a67f89fca54b0db033102b8bddf46933e98bc | 1,589 | py | Python | P1-test02/gaussianBlur.py | 1924zjy0835/OpenCV | 15d0407b12e825949a7e0fa2a1c775aa24edb943 | [
"bzip2-1.0.6"
] | null | null | null | P1-test02/gaussianBlur.py | 1924zjy0835/OpenCV | 15d0407b12e825949a7e0fa2a1c775aa24edb943 | [
"bzip2-1.0.6"
] | null | null | null | P1-test02/gaussianBlur.py | 1924zjy0835/OpenCV | 15d0407b12e825949a7e0fa2a1c775aa24edb943 | [
"bzip2-1.0.6"
] | null | null | null | # @Description: gaussianBlur.py
# @Author: zjy
# @Date: 2020/4/23 9:21
# @SoftWare: PyCharm
# @CSDN: https://blog.csdn.net/zjy123078_zjy
# @: https://www.cnblogs.com/guyan-2020/
import cv2 as cv
src = cv.imread("./images/raindropGirl.jpg")
#
# getTickCount()
t1 = cv.getTickCount()
Gaussian_noise(src)
t2 = cv.g... | 24.828125 | 80 | 0.631844 | # @Description: gaussianBlur.py
# @Author: 孤烟逐云zjy
# @Date: 2020/4/23 9:21
# @SoftWare: PyCharm
# @CSDN: https://blog.csdn.net/zjy123078_zjy
# @博客园: https://www.cnblogs.com/guyan-2020/
import cv2 as cv
import numpy as np
def Gaussian_demo(image):
dst = cv.GaussianBlur(image, (0, 0), 3)
cv.imshow("Gaussian im... | 366 | 0 | 0 | 0 | 0 | 737 | 0 | -3 | 91 |
b928ad824c590f5b8f3b04c8ca60bc99681e0e7f | 8,614 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/community/general/tests/unit/plugins/modules/web_infrastructure/test_jenkins_plugin.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/general/tests/unit/plugins/modules/web_infrastructure/test_jenkins_plugin.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/general/tests/unit/plugins/modules/web_infrastructure/test_jenkins_plugin.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from io import BytesIO
from ansible_collections.community.general.plugins.modules.web_infrastructure.jenkins_plugin import JenkinsPlugin... | 45.099476 | 131 | 0.702461 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from io import BytesIO
from ansible_collections.community.general.plugins.modules.web_infrastructure.jenkins_plugin import JenkinsPlugin... | 0 | 0 | 0 | 0 | 0 | 146 | 0 | 0 | 46 |
5680a8a2bbadc0d1d81ff0c91c94c9f6abdd131c | 15,845 | py | Python | keystone-moon/keystone/identity/backends/sql.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | keystone-moon/keystone/identity/backends/sql.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | keystone-moon/keystone/identity/backends/sql.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# 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... | 39.317618 | 78 | 0.607195 | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 0 | 3,648 | 0 | 11,151 | 0 | 0 | 0 | 93 | 361 |
7115e70e58becc7427f1eb25d9e80689128d74b6 | 1,348 | py | Python | kernel_tuner/strategies/brute_force.py | mfkiwl/kernel_tuner | 7f2bdc85a9c355d38b04dba1ce518fba1d65ffb7 | [
"Apache-2.0"
] | null | null | null | kernel_tuner/strategies/brute_force.py | mfkiwl/kernel_tuner | 7f2bdc85a9c355d38b04dba1ce518fba1d65ffb7 | [
"Apache-2.0"
] | null | null | null | kernel_tuner/strategies/brute_force.py | mfkiwl/kernel_tuner | 7f2bdc85a9c355d38b04dba1ce518fba1d65ffb7 | [
"Apache-2.0"
] | null | null | null | """ The default strategy that iterates through the whole parameter space """
from __future__ import print_function
from kernel_tuner.searchspace import Searchspace
def tune(runner, kernel_options, device_options, tuning_options):
""" Tune all instances in the parameter space
:params runner: A runner from ke... | 35.473684 | 81 | 0.751484 | """ The default strategy that iterates through the whole parameter space """
from __future__ import print_function
from kernel_tuner.searchspace import Searchspace
def tune(runner, kernel_options, device_options, tuning_options):
""" Tune all instances in the parameter space
:params runner: A runner from ke... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e0e831709862b42cb5206e8e6dec527ea59fa850 | 2,065 | py | Python | Insert a node at the head of a linked list.py | ganeshbs17/PythonAndCPP-Programs | 7a00c3fad84dc2e721e29732f998e151bd122213 | [
"MIT"
] | null | null | null | Insert a node at the head of a linked list.py | ganeshbs17/PythonAndCPP-Programs | 7a00c3fad84dc2e721e29732f998e151bd122213 | [
"MIT"
] | null | null | null | Insert a node at the head of a linked list.py | ganeshbs17/PythonAndCPP-Programs | 7a00c3fad84dc2e721e29732f998e151bd122213 | [
"MIT"
] | 3 | 2019-10-23T05:23:20.000Z | 2020-10-04T16:47:45.000Z | #include <bits/stdc++.h>
using namespace std;
};
class SinglyLinkedList {
public:
SinglyLinkedListNode *head;
SinglyLinkedListNode *tail;
SinglyLinkedList() {
this->head = nullptr;
this->tail = nullptr;
}
};
void print_singly_linked_list(SinglyLinkedListN... | 19.481132 | 91 | 0.605327 | #include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
this->data = node_data;
this->next = nullptr;
}
};
class SinglyLinkedList {
public:
S... | 0 | 0 | 0 | 200 | 0 | 0 | 0 | 0 | 23 |
4f73efb041d7c76dd96a6426250a9aef186f29ce | 7,513 | py | Python | compss/programming_model/bindings/python/src/pycompss/util/logger/helpers.py | alexbarcelo/compss | d619faa70ac5a933543c6f8ef65e8acd18ae37a0 | [
"Apache-2.0"
] | 31 | 2018-03-06T09:30:03.000Z | 2022-03-23T09:51:05.000Z | compss/programming_model/bindings/python/src/pycompss/util/logger/helpers.py | alexbarcelo/compss | d619faa70ac5a933543c6f8ef65e8acd18ae37a0 | [
"Apache-2.0"
] | 3 | 2020-08-28T17:16:50.000Z | 2021-11-11T21:58:02.000Z | compss/programming_model/bindings/python/src/pycompss/util/logger/helpers.py | alexbarcelo/compss | d619faa70ac5a933543c6f8ef65e8acd18ae37a0 | [
"Apache-2.0"
] | 15 | 2018-06-07T10:03:27.000Z | 2022-02-23T14:59:42.000Z | #!/usr/bin/python
#
# Copyright 2002-2021 Barcelona Supercomputing Center (www.bsc.es)
#
# 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
... | 33.842342 | 86 | 0.639957 | #!/usr/bin/python
#
# Copyright 2002-2021 Barcelona Supercomputing Center (www.bsc.es)
#
# 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
... | 0 | 543 | 0 | 0 | 0 | 0 | 0 | 16 | 68 |
4608bc73b70fb733f1ae3c3c23c3493edaa536d9 | 336 | py | Python | algorithms/recursion/double.py | Nyior/algorithms-and-datastructures-python | f970e9955e6305cf92c317e60acfbf391af04a96 | [
"MIT"
] | 1 | 2022-01-07T18:04:26.000Z | 2022-01-07T18:04:26.000Z | algorithms/recursion/double.py | Nyior/algorithms-and-datastructures-python | f970e9955e6305cf92c317e60acfbf391af04a96 | [
"MIT"
] | null | null | null | algorithms/recursion/double.py | Nyior/algorithms-and-datastructures-python | f970e9955e6305cf92c317e60acfbf391af04a96 | [
"MIT"
] | null | null | null | """
double each entry in a given array recursively
E.g [1, 2, 3, 4, 5]
"""
if __name__ == '__main__':
a = [1,2,3,4,5]
print(double_entries(a))
| 17.684211 | 50 | 0.559524 | """
double each entry in a given array recursively
E.g [1, 2, 3, 4, 5]
"""
def double_entries(arr, index=0):
if index >= len(arr):
return arr
else:
arr[index] = arr[index]*2
return(double_entries(arr, index+1))
if __name__ == '__main__':
a = [1,2,3,4,5]
print(double_... | 0 | 0 | 0 | 0 | 0 | 147 | 0 | 0 | 23 |
6edb38a0c548bba69e006641892021a624d7a0c7 | 4,747 | py | Python | src/rlext/record.py | kngwyu/rlext | b7e74ba4b440d2c6f98ea79dcd0aab15053fa96a | [
"Apache-2.0"
] | null | null | null | src/rlext/record.py | kngwyu/rlext | b7e74ba4b440d2c6f98ea79dcd0aab15053fa96a | [
"Apache-2.0"
] | null | null | null | src/rlext/record.py | kngwyu/rlext | b7e74ba4b440d2c6f98ea79dcd0aab15053fa96a | [
"Apache-2.0"
] | null | null | null | """ Record class that stores {Key: List[Value]} dict
"""
import typing as t
from pathlib import Path
import pandas as pd
_SAVE_FN = t.Callable[[pd.DataFrame, Path], None]
| 31.646667 | 85 | 0.579524 | """ Record class that stores {Key: List[Value]} dict
"""
import atexit
import typing as t
from collections import defaultdict
from pathlib import Path
import click
import pandas as pd
_SAVE_FN = t.Callable[[pd.DataFrame, Path], None]
class _StdoutConfig(t.NamedTuple):
interval: int
indices: t.List[str]
... | 0 | 0 | 0 | 3,928 | 0 | 463 | 0 | -3 | 182 |
7110f56604c978bbb9d0ce3e1ac9f0e064c6b0f2 | 880 | py | Python | cadee/dyn/mpi.py | kamerlinlab/cadee | 8fa34fc4f7fc496c8843e9380075ae11fca7aaa7 | [
"MIT"
] | 10 | 2017-01-11T09:21:27.000Z | 2021-06-27T03:56:15.000Z | cadee/dyn/mpi.py | kamerlinlab/cadee | 8fa34fc4f7fc496c8843e9380075ae11fca7aaa7 | [
"MIT"
] | 2 | 2017-07-18T06:54:17.000Z | 2020-08-25T14:03:14.000Z | cadee/dyn/mpi.py | kamerlinlab/cadee | 8fa34fc4f7fc496c8843e9380075ae11fca7aaa7 | [
"MIT"
] | 3 | 2017-03-15T12:18:13.000Z | 2021-02-28T05:09:36.000Z | #!/usr/bin/env python
"""
Module for coordinating mpi
Author: {0} ({1})
This program is part of CADEE, the framework for
Computer-Aided Directed Evolution of Enzymes.
"""
__author__ = "Beat Amrein"
__email__ = "beat.amrein@gmail.com"
try:
from mpi4py import MPI
except ImportError:
print('mpi4py not found'... | 16.296296 | 48 | 0.585227 | #!/usr/bin/env python
"""
Module for coordinating mpi
Author: {0} ({1})
This program is part of CADEE, the framework for
Computer-Aided Directed Evolution of Enzymes.
"""
__author__ = "Beat Amrein"
__email__ = "beat.amrein@gmail.com"
try:
from mpi4py import MPI
except ImportError:
print('mpi4py not found'... | 0 | 0 | 0 | 149 | 0 | 135 | 0 | 0 | 46 |
c5d3fa903abb0c65b709cbe5d59268fb4a50a6b8 | 1,992 | py | Python | demo_autolog.py | arjunKumbakkara/AiOPs_MLFlow_02 | 617bbcf2fa6089f8b32b7d55eacd3a699d83b7c5 | [
"MIT"
] | null | null | null | demo_autolog.py | arjunKumbakkara/AiOPs_MLFlow_02 | 617bbcf2fa6089f8b32b7d55eacd3a699d83b7c5 | [
"MIT"
] | null | null | null | demo_autolog.py | arjunKumbakkara/AiOPs_MLFlow_02 | 617bbcf2fa6089f8b32b7d55eacd3a699d83b7c5 | [
"MIT"
] | null | null | null | import mlflow
import argparse
if __name__ == "__main__":
args = argparse.ArgumentParser()
args.add_argument("--alpha","-a", type=float, default=0.5)
args.add_argument("--l1_ratio","-l1", type=float, default=0.5)
parsed_args = args.parse_args()
main(alpha=parsed_args.alpha , l1_ratio=pa... | 31.619048 | 108 | 0.697289 | from email.policy import default
from email.utils import parsedate
import os
import mlflow
import mlflow.sklearn
import argparse
import time
import numpy as np
import pandas as pd
from sklearn.metrics import mean_absolute_percentage_error, mean_squared_error, mean_absolute_error,r2_score
from sklearn.model_selection i... | 0 | 0 | 0 | 0 | 0 | 1,216 | 0 | 136 | 290 |
dbe977caaa121b5054f9b31918994075c6e0496e | 1,328 | py | Python | cis385_week8_testing/test/test_calendar.py | bendalgaard/cis385_2021Winter | db80e65ad26899daaeddb3c262f881ed1f967f58 | [
"Apache-2.0"
] | null | null | null | cis385_week8_testing/test/test_calendar.py | bendalgaard/cis385_2021Winter | db80e65ad26899daaeddb3c262f881ed1f967f58 | [
"Apache-2.0"
] | null | null | null | cis385_week8_testing/test/test_calendar.py | bendalgaard/cis385_2021Winter | db80e65ad26899daaeddb3c262f881ed1f967f58 | [
"Apache-2.0"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 34.051282 | 123 | 0.731928 | import unittest
from datetime import datetime
from unittest.mock import MagicMock
from app.main import calendar
from app.main.holiday import Holiday
class TestCalendar(unittest.TestCase):
def setUp(self):
holiday = Holiday()
holiday.is_new_year_observed = MagicMock(return_value=False)
def t... | 0 | 0 | 0 | 1,105 | 0 | 0 | 0 | 45 | 112 |
bc29b8cf03567460e6712946090a077ce1db7618 | 73,609 | py | Python | zeitcoinamp.py | mmgrant73/zeitcoin | ae04d37e66c2f278c9c83525eb0d0d1c6ecf9fe0 | [
"MIT"
] | 1 | 2017-07-03T17:00:16.000Z | 2017-07-03T17:00:16.000Z | zeitcoinamp.py | mmgrant73/zeitcoin | ae04d37e66c2f278c9c83525eb0d0d1c6ecf9fe0 | [
"MIT"
] | null | null | null | zeitcoinamp.py | mmgrant73/zeitcoin | ae04d37e66c2f278c9c83525eb0d0d1c6ecf9fe0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#########################################
# Zeitcoin AMP Class
#########################################
ALIVE=1
FNAME='zeitcoin'
ADDRESS='127.0.0.1'
PORT=1234
GUID='1'
TXCOINHASH=''
TXADDRESS=''
TXMESSAGE=''
##########################################################################
# move to an... | 36.458148 | 223 | 0.712318 | #!/usr/bin/env python
#########################################
# Zeitcoin AMP Class
#########################################
import sys, os, time, threading, hashlib, random
from zeitcoindb import hashtable
from zeitcoinutility import utility,encyption
from zeitcointrans import transactions
from twisted.protocols im... | 0 | 14,399 | 0 | 55,506 | 0 | 1,750 | 0 | 337 | 1,116 |
6cd330f60a8b08f48db45ee75488aa436167703b | 763 | py | Python | tests/test_loader.py | zenaix/ICSuit | 792b498df7f0e700b77f147e4f888b950f3ba296 | [
"Apache-2.0"
] | 1 | 2021-02-21T11:19:23.000Z | 2021-02-21T11:19:23.000Z | tests/test_loader.py | zenaix/ICSuit | 792b498df7f0e700b77f147e4f888b950f3ba296 | [
"Apache-2.0"
] | null | null | null | tests/test_loader.py | zenaix/ICSuit | 792b498df7f0e700b77f147e4f888b950f3ba296 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
if __name__ == '__main__':
unittest.main()
| 21.8 | 57 | 0.598952 | # -*- coding: utf-8 -*-
import os
import unittest
from context import icsuit
from icsuit.cli.loader import findmod, importmod, listmod
class TestLoader(unittest.TestCase):
"""Unit test cases for cli.loader."""
def test_listmod(self):
os.chdir('..')
print
print listmod()
os.c... | 0 | 0 | 0 | 554 | 0 | 0 | 0 | 29 | 92 |
ee7591a7a27b660226c1d87c48390f3c8a0aca56 | 7,299 | py | Python | backend/eth_app/views/api.py | CUBigDataClass/eth_track | a3475e61fdc6f519ab6c670dc005f9e96939c947 | [
"MIT"
] | null | null | null | backend/eth_app/views/api.py | CUBigDataClass/eth_track | a3475e61fdc6f519ab6c670dc005f9e96939c947 | [
"MIT"
] | null | null | null | backend/eth_app/views/api.py | CUBigDataClass/eth_track | a3475e61fdc6f519ab6c670dc005f9e96939c947 | [
"MIT"
] | null | null | null | from flask import Blueprint
import os
API_KEY = os.getenv("API_KEY")
bp = Blueprint('api', __name__)
| 37.050761 | 121 | 0.598849 | from flask import Blueprint
from flask import current_app
from flask import jsonify
from flask import g
from flask import request
from eth_app.db import get_connection, get_data, add_data
from eth_app.API import Api
import os
import pandas as pd
import numpy as np
API_KEY = os.getenv("API_KEY")
bp = Blueprint('api'... | 0 | 3,624 | 0 | 0 | 0 | 3,202 | 0 | 51 | 315 |
eadf108001a65bab32722477eba41bfa9ef4d893 | 79 | py | Python | confab/helper.py | confab-services/confab | 4f90cee9c8a7f07f3cfffbe05a015c1119c3a654 | [
"MIT"
] | null | null | null | confab/helper.py | confab-services/confab | 4f90cee9c8a7f07f3cfffbe05a015c1119c3a654 | [
"MIT"
] | null | null | null | confab/helper.py | confab-services/confab | 4f90cee9c8a7f07f3cfffbe05a015c1119c3a654 | [
"MIT"
] | null | null | null | """Helper module"""
| 13.166667 | 43 | 0.658228 | """Helper module"""
def username_exists(username: str) -> bool:
return 0
| 0 | 0 | 0 | 0 | 0 | 35 | 0 | 0 | 23 |
ce3e5e8bde3e8e1224f5664f65d80ab12dec646c | 3,295 | py | Python | pypugjs/ext/tornado/__init__.py | Dryja/pypugjs | 11cb230f632ffa9ba07e16c5bfcc17ca924d46dc | [
"MIT"
] | null | null | null | pypugjs/ext/tornado/__init__.py | Dryja/pypugjs | 11cb230f632ffa9ba07e16c5bfcc17ca924d46dc | [
"MIT"
] | null | null | null | pypugjs/ext/tornado/__init__.py | Dryja/pypugjs | 11cb230f632ffa9ba07e16c5bfcc17ca924d46dc | [
"MIT"
] | null | null | null |
ATTRS_FUNC = '__pypugjs_attrs'
ESCAPE_FUNC = '__pypugjs_escape'
ITER_FUNC = '__pypugjs_iter'
# Patch tornado template engine for preprocess PugJS templates
| 34.322917 | 115 | 0.564795 | import tornado.template
from pypugjs import Compiler as _Compiler
from pypugjs.exceptions import CurrentlyNotSupported
from pypugjs.runtime import attrs, escape, iteration
from pypugjs.utils import process
ATTRS_FUNC = '__pypugjs_attrs'
ESCAPE_FUNC = '__pypugjs_escape'
ITER_FUNC = '__pypugjs_iter'
class Compiler(_C... | 0 | 0 | 0 | 2,819 | 0 | 40 | 0 | 96 | 179 |
a712ee3c3c6bf51b9b642ed0a4ec873c99ad333b | 368 | py | Python | sdk/apis/packs_service.py | CLG0125/elemesdk | 344466398bad7cf026e082e47c77d3ca98621ef3 | [
"MIT"
] | 1 | 2021-04-03T05:11:29.000Z | 2021-04-03T05:11:29.000Z | sdk/apis/packs_service.py | CLG0125/elemesdk | 344466398bad7cf026e082e47c77d3ca98621ef3 | [
"MIT"
] | null | null | null | sdk/apis/packs_service.py | CLG0125/elemesdk | 344466398bad7cf026e082e47c77d3ca98621ef3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
| 19.368421 | 98 | 0.619565 | # -*- coding: utf-8 -*-
# 签约服务
class PacksService:
__client = None
def __init__(self, client):
self.__client = client
def get_effect_service_pack_contract(self, shop_id):
"""
查询店铺当前生效合同类型
:param shopId:店铺id
"""
return self.__client.call("eleme.packs.getEf... | 54 | 0 | 0 | 298 | 0 | 0 | 0 | 0 | 22 |
6f6fd09ea6eb2d2cb4c683cec5fc4e9b35909eda | 1,219 | py | Python | parsl/tests/test_python_apps/test_worker_fail.py | khurtado/parsl | 6ea461ccd7be83b51bf5384bf50b522e56fc46f1 | [
"Apache-2.0"
] | null | null | null | parsl/tests/test_python_apps/test_worker_fail.py | khurtado/parsl | 6ea461ccd7be83b51bf5384bf50b522e56fc46f1 | [
"Apache-2.0"
] | null | null | null | parsl/tests/test_python_apps/test_worker_fail.py | khurtado/parsl | 6ea461ccd7be83b51bf5384bf50b522e56fc46f1 | [
"Apache-2.0"
] | null | null | null | import argparse
import parsl
from parsl.tests.configs.local_threads import config
parsl.clear()
parsl.load(config)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--count", default="10",
help="Count of apps to launch")
parser.add_argume... | 23 | 76 | 0.603774 | import argparse
import time
import parsl
from parsl.app.app import App
from parsl.tests.configs.local_threads import config
parsl.clear()
parsl.load(config)
@App('python')
def import_echo(x, string, sleep=0, stdout=None):
import time
time.sleep(sleep)
print(string)
return x * 5
def test_parallel_f... | 0 | 116 | 0 | 0 | 0 | 393 | 0 | -2 | 90 |
f5671bcd389e5d84b88c8b8d43a2893798e4bfb5 | 6,276 | py | Python | Attendance Marker 0.0.0/Attendance Marker.py | VallishaM/Google-Meet-Attendance | 9210d91173378a73b48879c9a36770a4cc4a8f24 | [
"RSA-MD"
] | null | null | null | Attendance Marker 0.0.0/Attendance Marker.py | VallishaM/Google-Meet-Attendance | 9210d91173378a73b48879c9a36770a4cc4a8f24 | [
"RSA-MD"
] | null | null | null | Attendance Marker 0.0.0/Attendance Marker.py | VallishaM/Google-Meet-Attendance | 9210d91173378a73b48879c9a36770a4cc4a8f24 | [
"RSA-MD"
] | null | null | null | #attendance_file is the source file and list_file is the destination file
__author__ = "Vallisha M"
__version__ = '0.0.0'
threshold = 20 #Minimum time of attendance to be marked present
root=Tk()
# creating a label for
# name using widget Label
root.wm_title("Attendance Marker")
canvas=Canvas(root,w... | 45.478261 | 169 | 0.637986 | #attendance_file is the source file and list_file is the destination file
__author__ = "Vallisha M"
__version__ = '0.0.0'
from os import listdir
from os.path import isfile, join
import tkinter as tk
import pandas as pd
import re
from tkinter import *
from tkinter import filedialog
from tkinter.filedialog ... | 0 | 0 | 0 | 0 | 0 | 4,622 | 0 | 27 | 263 |
d1a3c2589f4cc63b9fb4392973cf7bc466b883bc | 886 | py | Python | antioch/test/__init__.py | philchristensen/antioch | 7fe27c961ae81b7655c6428038c85eefad27e980 | [
"MIT"
] | 15 | 2015-10-07T06:30:22.000Z | 2022-03-07T19:44:55.000Z | antioch/test/__init__.py | philchristensen/antioch | 7fe27c961ae81b7655c6428038c85eefad27e980 | [
"MIT"
] | 2 | 2016-10-17T05:04:58.000Z | 2018-09-10T02:36:15.000Z | antioch/test/__init__.py | philchristensen/antioch | 7fe27c961ae81b7655c6428038c85eefad27e980 | [
"MIT"
] | 2 | 2018-07-30T12:58:33.000Z | 2018-11-26T03:17:34.000Z | # antioch
# Copyright (c) 1999-2019 Phil Christensen
#
# See LICENSE for details
"""
Provide testing for the codebase
""" | 23.945946 | 87 | 0.700903 | # antioch
# Copyright (c) 1999-2019 Phil Christensen
#
# See LICENSE for details
"""
Provide testing for the codebase
"""
import pkg_resources as pkg
from antioch.core import bootstrap
from django.conf import settings
from django.db import connection
def init_database(dbid, dataset='minimal', autocommit=False):
... | 0 | 0 | 0 | 303 | 0 | 261 | 0 | 41 | 159 |
cce7e125523d7008c2959b1d34ee3b20907e6caf | 3,112 | py | Python | ceilometer/storage/sqlalchemy/alembic/versions/b6ae66d05e3_remove_extra_indexes.py | rackerlabs/instrumented-ceilometer | 6ac5215ac0476120d9c99adcabc9cad0d32963da | [
"Apache-2.0"
] | 3 | 2021-04-18T00:37:48.000Z | 2021-07-21T10:20:11.000Z | ceilometer/storage/sqlalchemy/alembic/versions/b6ae66d05e3_remove_extra_indexes.py | lexxito/monitoring | bec8dfb8d3610331c7ae5ec543e0b8da0948c164 | [
"Apache-2.0"
] | null | null | null | ceilometer/storage/sqlalchemy/alembic/versions/b6ae66d05e3_remove_extra_indexes.py | lexxito/monitoring | bec8dfb8d3610331c7ae5ec543e0b8da0948c164 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp. #
#
# Authors: Svetlana Shturm <sshturm@mirantis.com>
#
# 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 t... | 32.757895 | 75 | 0.595758 | # -*- encoding: utf-8 -*-
#
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp. #
#
# Authors: Svetlana Shturm <sshturm@mirantis.com>
#
# 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 t... | 0 | 0 | 0 | 0 | 0 | 1,755 | 0 | 3 | 114 |
f9078f3d7cc023c72737c4a6fbf03f3686054dcb | 3,878 | py | Python | declry/templatetags/sorting_tag.py | jAlpedrinha/DeclRY | f6f1f18a0cc38d0b502945a6f8baec64c3b9a6fa | [
"BSD-3-Clause"
] | 1 | 2015-08-12T12:02:54.000Z | 2015-08-12T12:02:54.000Z | declry/templatetags/sorting_tag.py | jAlpedrinha/DeclRY | f6f1f18a0cc38d0b502945a6f8baec64c3b9a6fa | [
"BSD-3-Clause"
] | null | null | null | declry/templatetags/sorting_tag.py | jAlpedrinha/DeclRY | f6f1f18a0cc38d0b502945a6f8baec64c3b9a6fa | [
"BSD-3-Clause"
] | null | null | null | from django import template
from django.http import Http404
from django.conf import settings
from copy import copy
register = template.Library()
REMOVE_ORDER = '<a href="{}"><i class="icon-remove"></i></a>'
sort_directions = {
'asc': {'icon':'icon-arrow-up', 'inverse': 'desc'},
'desc': {'icon':'icon-arrow-do... | 32.588235 | 122 | 0.546158 | from django import template
from django.http import Http404
from django.conf import settings
from copy import copy
register = template.Library()
REMOVE_ORDER = '<a href="{}"><i class="icon-remove"></i></a>'
sort_directions = {
'asc': {'icon':'icon-arrow-up', 'inverse': 'desc'},
'desc': {'icon':'icon-arrow-do... | 0 | 0 | 0 | 2,731 | 0 | 163 | 0 | 0 | 69 |
9c211c6729326ede5ee80e3259d9678112140ecc | 2,144 | py | Python | parser_logic.py | avizmarlon/eml_email_parsing | 4ddbe0614f08ac857c46e4d56509e63eada91726 | [
"MIT"
] | null | null | null | parser_logic.py | avizmarlon/eml_email_parsing | 4ddbe0614f08ac857c46e4d56509e63eada91726 | [
"MIT"
] | null | null | null | parser_logic.py | avizmarlon/eml_email_parsing | 4ddbe0614f08ac857c46e4d56509e63eada91726 | [
"MIT"
] | null | null | null | import re
import os
from tkinter import Tk
from tkinter.filedialog import askdirectory
# todo:
# make renaming temporary, file names go back to their original after the parsing computation is done
# or find a way to parse without needing to rename (probably using regex).
rootWindow = Tk().withdraw()
folder = askdirec... | 28.586667 | 101 | 0.702425 | import re
import os
from tkinter import *
from tkinter import Tk
from tkinter.filedialog import askdirectory
import time
# todo:
# make renaming temporary, file names go back to their original after the parsing computation is done
# or find a way to parse without needing to rename (probably using regex).
rootWindow =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 44 |
7a6c5469b216ea20136d38d73bd509c00a600e0f | 2,603 | py | Python | rotv_apps/urls.py | ivellios/django-rotv-apps | 95aad945debd0e60d210057c0605928483e213a8 | [
"MIT"
] | 1 | 2017-12-05T13:24:23.000Z | 2017-12-05T13:24:23.000Z | rotv_apps/urls.py | ivellios/django-rotv-apps | 95aad945debd0e60d210057c0605928483e213a8 | [
"MIT"
] | 9 | 2017-11-22T23:29:48.000Z | 2022-03-11T23:11:34.000Z | rotv_apps/urls.py | ivellios/django-rotv-apps | 95aad945debd0e60d210057c0605928483e213a8 | [
"MIT"
] | null | null | null | from django.conf.urls import url, include
from .program.views import (EpisodeView, EpisodeProgramView, EpisodePlaylistView, ProgramListView, IndexView, EpisodesByTagView, SearchEpisodeByTagsView, EpisodesBySearchedTagsView, ProgramDetailView)
from .blog.views import (EntryView, ArchiveView, EntriesByTagView, SearchEnt... | 60.534884 | 119 | 0.659239 | from django.conf.urls import url, include
from .program.views import (EpisodeView, EpisodeProgramView, EpisodePlaylistView,
ProgramListView, IndexView, EpisodesByTagView,
SearchEpisodeByTagsView, EpisodesBySearchedTagsView,
ProgramDeta... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 109 | 0 |
d0451a234a954e085464f45b92baca32dd294c02 | 536 | py | Python | transformers/data/__init__.py | DaDaMrX/ReaLiSe | 25843e0c2c32b3a364cee857b2e4f5ba8b2764e9 | [
"MIT"
] | 72 | 2021-05-27T06:32:20.000Z | 2022-03-31T03:04:58.000Z | transformers/data/__init__.py | DaDaMrX/ReaLiSe | 25843e0c2c32b3a364cee857b2e4f5ba8b2764e9 | [
"MIT"
] | 10 | 2021-05-27T05:13:50.000Z | 2022-03-27T09:10:47.000Z | transformers/data/__init__.py | DaDaMrX/ReaLiSe | 25843e0c2c32b3a364cee857b2e4f5ba8b2764e9 | [
"MIT"
] | 13 | 2021-06-24T04:44:14.000Z | 2022-03-03T12:57:23.000Z |
from .metrics import is_sklearn_available
if is_sklearn_available():
| 59.555556 | 117 | 0.865672 | from .processors import InputExample, InputFeatures, DataProcessor, SquadFeatures
from .processors import glue_output_modes, glue_processors, glue_tasks_num_labels, glue_convert_examples_to_features
from .processors import squad_convert_examples_to_features, SquadExample, SquadV1Processor, SquadV2Processor
from .pro... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 344 | 119 |
bfe42630b4533801c2cdd39124dc7ed463196739 | 1,202 | py | Python | tekis/flatpages/migrations/0002_auto_20160221_0006.py | TKOaly/tkoaly-new-service | 5a6ab1e44ea842923b3d7c6a86f07a0e155d4cef | [
"BSD-3-Clause"
] | null | null | null | tekis/flatpages/migrations/0002_auto_20160221_0006.py | TKOaly/tkoaly-new-service | 5a6ab1e44ea842923b3d7c6a86f07a0e155d4cef | [
"BSD-3-Clause"
] | 8 | 2017-11-27T11:41:57.000Z | 2021-09-07T23:51:11.000Z | tekis/flatpages/migrations/0002_auto_20160221_0006.py | hylje/tekis | 5dfb965dd6f199b37abf759248bc7d3e730ce241 | [
"BSD-3-Clause"
] | 1 | 2020-02-15T10:51:55.000Z | 2020-02-15T10:51:55.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-20 22:06
from __future__ import unicode_literals
| 33.388889 | 174 | 0.587354 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-20 22:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('flatpages', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 0 | 0 | 0 | 1,024 | 0 | 0 | 0 | 19 | 46 |
ef8d0e14231dadb0fe3e9cc24e64fd5456f99c21 | 109 | py | Python | scanner/settings/__init__.py | samber/celery_demonstration | 8e0bcc2bf02af6af40955bf2e58d7222dc759df5 | [
"Beerware"
] | 2 | 2016-09-17T05:44:24.000Z | 2017-05-27T17:34:30.000Z | scanner/settings/__init__.py | samber/celery_demonstration | 8e0bcc2bf02af6af40955bf2e58d7222dc759df5 | [
"Beerware"
] | null | null | null | scanner/settings/__init__.py | samber/celery_demonstration | 8e0bcc2bf02af6af40955bf2e58d7222dc759df5 | [
"Beerware"
] | null | null | null |
from __future__ import absolute_import
| 13.625 | 38 | 0.770642 |
from __future__ import absolute_import
from .scanner import *
from .django import *
from .celery import *
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 67 |
f95c1278c793eb2bad8b2d8bfd0c394e47bee6b3 | 2,448 | py | Python | app/func/slack.py | JoonyoungYi/kaist-bus | 9db2cd7cc7d418533eccec54396e9d351f4ab5c2 | [
"Apache-2.0"
] | 2 | 2022-01-13T10:39:26.000Z | 2022-03-16T11:12:28.000Z | app/func/slack.py | JoonyoungYi/kaist-bus | 9db2cd7cc7d418533eccec54396e9d351f4ab5c2 | [
"Apache-2.0"
] | null | null | null | app/func/slack.py | JoonyoungYi/kaist-bus | 9db2cd7cc7d418533eccec54396e9d351f4ab5c2 | [
"Apache-2.0"
] | 1 | 2021-07-15T12:50:28.000Z | 2021-07-15T12:50:28.000Z | import requests
from ..core import server
URL_JOONYOUNG = 'https://hooks.slack.com/services/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'
# https://api.slack.com/docs/messages/builder
def _send_slack_message(url, text, attachments=[]):
"""
"""
if not url:
return False
if not te... | 24.727273 | 95 | 0.524918 | import requests
from flask import request, url_for
from ..core import server
URL_JOONYOUNG = 'https://hooks.slack.com/services/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'
class Field():
title = ''
value = ''
short = False
def __init__(self, title='', value='', short=False):
self.title = ... | 30 | 0 | 0 | 1,606 | 0 | 134 | 0 | 13 | 91 |
8aba186cae8f1b7e9e7c08f6c019bee20682c24e | 10,916 | py | Python | playground/Non_DAG_with_Energy_rllib/launch_scripts.py | kangyifei/CloudSimPy | 45912e7ea35086b67941624102e400cb22e549ab | [
"MIT"
] | null | null | null | playground/Non_DAG_with_Energy_rllib/launch_scripts.py | kangyifei/CloudSimPy | 45912e7ea35086b67941624102e400cb22e549ab | [
"MIT"
] | null | null | null | playground/Non_DAG_with_Energy_rllib/launch_scripts.py | kangyifei/CloudSimPy | 45912e7ea35086b67941624102e400cb22e549ab | [
"MIT"
] | null | null | null | import time
import numpy as np
import tensorflow as tf
from multiprocessing import freeze_support
import sys
import matplotlib.pyplot as plt
sys.path.append('..')
import torch
from core.config import MachineConfig
from playground.Non_DAG_with_Energy.algorithm.random_algorithm import RandomTaskalgorithm
from playground.... | 42.310078 | 133 | 0.701081 | import os
import time
import numpy as np
import tensorflow as tf
from multiprocessing import Process, Manager,freeze_support
import sys
import matplotlib.pyplot as plt
import math
sys.path.append('..')
import torch
from core.config import MachineConfig
from playground.Non_DAG_with_Energy.algorithm.random_algorithm impo... | 15 | 0 | 0 | 0 | 0 | 0 | 0 | 120 | 66 |
9d06e340596312da18cfc25af5dc8753a72f0496 | 1,370 | py | Python | samples/inheritance.py | cor-kalis/Net2Scripting | 97938ccde154661c0c598ea82ad3a6b23e06d205 | [
"MIT"
] | 6 | 2018-06-21T15:17:34.000Z | 2021-12-19T16:31:53.000Z | samples/inheritance.py | marcelcorso/Net2Scripting | 65c4e77a7c88c3d4b88f901225b71710df415ba5 | [
"MIT"
] | null | null | null | samples/inheritance.py | marcelcorso/Net2Scripting | 65c4e77a7c88c3d4b88f901225b71710df415ba5 | [
"MIT"
] | 1 | 2019-12-13T08:56:33.000Z | 2019-12-13T08:56:33.000Z | """
Sample script to demonstrate inheritance
"""
from Net2Scripting import init_logging
# Operator id 0 is System Engineer
OPERATOR_ID = 0
# Default Net2 password
OPERATOR_PWD = "net2"
# When running on the machine where Net2 is installed
NET2_SERVER = "localhost"
if __name__ == "__main__":
# Init log4net
... | 26.346154 | 72 | 0.656934 | """
Sample script to demonstrate inheritance
"""
from Net2Scripting import init_logging
from Net2Scripting.net2xs import Net2XS
# Operator id 0 is System Engineer
OPERATOR_ID = 0
# Default Net2 password
OPERATOR_PWD = "net2"
# When running on the machine where Net2 is installed
NET2_SERVER = "localhost"
class MyNet... | 0 | 0 | 0 | 669 | 0 | 0 | 0 | 18 | 45 |
7589b449cd0bd544684955865ad8bd2ec54247c1 | 21,718 | py | Python | src/main.py | funkyk/CSLAIER | 341e2fe6c0b9a2e0d57eca4667125e99ddb2a3f8 | [
"BSD-3-Clause",
"MIT"
] | 41 | 2016-10-19T01:01:46.000Z | 2022-03-16T18:29:25.000Z | src/main.py | funkyk/CSLAIER | 341e2fe6c0b9a2e0d57eca4667125e99ddb2a3f8 | [
"BSD-3-Clause",
"MIT"
] | 3 | 2016-12-14T10:02:07.000Z | 2017-05-11T05:43:41.000Z | src/main.py | funkyk/CSLAIER | 341e2fe6c0b9a2e0d57eca4667125e99ddb2a3f8 | [
"BSD-3-Clause",
"MIT"
] | 9 | 2016-12-08T12:53:48.000Z | 2019-04-17T08:10:54.000Z | # -*- coding: utf-8 -*-
import json
import os
import re
import logging
from logging.handlers import RotatingFileHandler
from logging import getLogger
from time import sleep
from flask import Flask, url_for, render_template, request, redirect, jsonify, send_from_directory, send_file, Response
import gevent
from gevent.... | 34.309637 | 101 | 0.636937 | # -*- coding: utf-8 -*-
import json
import os
import re
import logging
from logging.handlers import RotatingFileHandler
from logging import getLogger
from time import sleep
from flask import Flask, url_for, render_template, request, redirect, \
jsonify, send_from_directory, send_file, Response
import gevent
from g... | 234 | 16,721 | 0 | 468 | 0 | 346 | 0 | 6 | 919 |
7dd4c7c735b371b15711743d290a7c3b9dc5df38 | 5,023 | py | Python | gem/utils/plot_stats.py | vinnamkim/GEM-Benchmark | 8420c565531098b5b36abec340f1c5e330c4dbcc | [
"BSD-3-Clause"
] | 44 | 2019-08-20T02:37:12.000Z | 2022-03-16T14:09:08.000Z | gem/utils/plot_stats.py | vinnamkim/GEM-Benchmark | 8420c565531098b5b36abec340f1c5e330c4dbcc | [
"BSD-3-Clause"
] | 3 | 2019-09-29T05:34:38.000Z | 2020-12-07T20:45:44.000Z | gem/utils/plot_stats.py | vinnamkim/GEM-Benchmark | 8420c565531098b5b36abec340f1c5e330c4dbcc | [
"BSD-3-Clause"
] | 13 | 2019-08-20T05:59:04.000Z | 2021-05-10T14:51:06.000Z | try: import cPickle as pickle
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib import rc
import seaborn as sns
font = {'family': 'serif', 'serif': ['computer modern roman']}
rc('text', usetex=False)
rc('font', weight='bold')
rc('font', size=2)
rc('lines', markersize=2.5)
rc('line... | 32.198718 | 144 | 0.570177 | try: import cPickle as pickle
except: import pickle
from os import environ
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import itertools
from matplotlib import rc
import numpy as np
import pandas as pd
import seaborn as sns
import pickle as pkl
import functools
font = {'family': 'serif', 'se... | 0 | 0 | 0 | 0 | 0 | 3,934 | 0 | -34 | 299 |
48cd52d56a8d2a8c874d136a3855a2d94d2a3f80 | 1,555 | py | Python | tests/test_colours.py | jmacgrillen/mac_lib | 67c7e6f35fbe27809e60fbb88a10d841656969f0 | [
"Apache-2.0"
] | null | null | null | tests/test_colours.py | jmacgrillen/mac_lib | 67c7e6f35fbe27809e60fbb88a10d841656969f0 | [
"Apache-2.0"
] | null | null | null | tests/test_colours.py | jmacgrillen/mac_lib | 67c7e6f35fbe27809e60fbb88a10d841656969f0 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python -*- coding: utf-8 -*-
"""
Name:
test_colours.py
Desscription:
Unit tests for mac_colours.
Version:
1 - Inital release
Author:
J.MacGrillen <macgrillen@gmail.com>
Copyright:
Copyright (c) John MacGrillen. All rights reserved.
"""
import ... | 22.867647 | 74 | 0.653376 | #! /usr/bin/env python -*- coding: utf-8 -*-
"""
Name:
test_colours.py
Desscription:
Unit tests for mac_colours.
Version:
1 - Inital release
Author:
J.MacGrillen <macgrillen@gmail.com>
Copyright:
Copyright (c) John MacGrillen. All rights reserved.
"""
import ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6ffaf0a0c605ce373fd4c50ad6cf35852424e3a3 | 583 | py | Python | nornir_test/netmiko_examples/case1_netmiko_simple/netmiko_simple.py | ktbyers/nornir_test | 66244356c436bb47f51270bc6358336ad37976d4 | [
"Apache-2.0"
] | 4 | 2018-08-28T16:49:27.000Z | 2021-10-03T21:10:06.000Z | nornir_test/netmiko_examples/case1_netmiko_simple/netmiko_simple.py | ktbyers/nornir_test | 66244356c436bb47f51270bc6358336ad37976d4 | [
"Apache-2.0"
] | 1 | 2021-09-14T12:38:45.000Z | 2021-09-14T18:40:57.000Z | nornir_test/netmiko_examples/case1_netmiko_simple/netmiko_simple.py | ktbyers/nornir_test | 66244356c436bb47f51270bc6358336ad37976d4 | [
"Apache-2.0"
] | 6 | 2019-05-15T18:18:29.000Z | 2021-11-24T08:02:47.000Z |
if __name__ == "__main__":
main()
| 23.32 | 64 | 0.725557 | from nornir import InitNornir
from nornir.plugins.tasks.networking import netmiko_send_command
from nornir.plugins.functions.text import print_result
from nornir_test.nornir_utilities import nornir_set_creds
def main():
# Initialize Nornir object using hosts.yaml and groups.yaml
norn = InitNornir(config_fil... | 0 | 0 | 0 | 0 | 0 | 310 | 0 | 120 | 112 |
b4e41eb5d6a741a344b7921964486e92ffc0926c | 1,664 | py | Python | scripts/libs/core.py | skodapetr/lbvs-environment | 0c468b9b87392ffe69e0e7726cf02cc6e2fec5e2 | [
"MIT"
] | null | null | null | scripts/libs/core.py | skodapetr/lbvs-environment | 0c468b9b87392ffe69e0e7726cf02cc6e2fec5e2 | [
"MIT"
] | null | null | null | scripts/libs/core.py | skodapetr/lbvs-environment | 0c468b9b87392ffe69e0e7726cf02cc6e2fec5e2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
__license__ = "X11"
def read_csv_as_object(path):
"""
Read CSV lines as objects.
"""
results = []
with open(path) as stream:
reader = csv.reader(stream, delimiter=",", quotechar='"')
header = next(reader)
for r... | 24.115942 | 75 | 0.611779 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import csv
import os
import logging
import gzip
__license__ = "X11"
def init_logging():
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s [%(levelname)s] - %(message)s',
datefmt='%H:%M:%S')
def create_directory(path... | 0 | 0 | 0 | 0 | 0 | 884 | 0 | -39 | 204 |
6fcaa03949e98b757d446db2228a3cf91ca70346 | 7,294 | py | Python | Project_1/optimus.py | Chertushkin/AI_Projects | 9a7221094fb48773a2e0d77e2a1078d06236bce7 | [
"MIT"
] | null | null | null | Project_1/optimus.py | Chertushkin/AI_Projects | 9a7221094fb48773a2e0d77e2a1078d06236bce7 | [
"MIT"
] | null | null | null | Project_1/optimus.py | Chertushkin/AI_Projects | 9a7221094fb48773a2e0d77e2a1078d06236bce7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Optimus.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1E2Wmkz43H4FgDefXwK8kyLjgGGC7y_4w
"""
import random
import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.metrics... | 39.427027 | 177 | 0.649027 | # -*- coding: utf-8 -*-
"""Optimus.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1E2Wmkz43H4FgDefXwK8kyLjgGGC7y_4w
"""
import random
import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.metrics... | 0 | 0 | 0 | 4,876 | 0 | 0 | 0 | 0 | 46 |
9699891f2e555e3eccb74844a70bd9ea64c39bab | 2,162 | py | Python | avanzapy/instrument_factory.py | alrevuelta/avanzapy | 5a723607a3e1b5028172239372bb51ad6ac9978e | [
"MIT"
] | 2 | 2021-04-15T13:34:52.000Z | 2021-08-24T17:32:26.000Z | avanzapy/instrument_factory.py | alrevuelta/avanzapy | 5a723607a3e1b5028172239372bb51ad6ac9978e | [
"MIT"
] | null | null | null | avanzapy/instrument_factory.py | alrevuelta/avanzapy | 5a723607a3e1b5028172239372bb51ad6ac9978e | [
"MIT"
] | 1 | 2022-02-03T08:30:44.000Z | 2022-02-03T08:30:44.000Z |
"""
Instrument factory, creates a particular instrument
with some given data.
TODO: Ugly
""" | 42.392157 | 70 | 0.785384 | from avanzapy.constants import InstrumentType
from avanzapy.stock import Stock
from avanzapy.fund import Fund
from avanzapy.bond import Bond
from avanzapy.option import Option
from avanzapy.futureforward import FutureForward
from avanzapy.certificate import Certificate
from avanzapy.warrant import Warrant
from avanzap... | 0 | 0 | 0 | 0 | 0 | 1,472 | 0 | 265 | 331 |
3a3880a7ef4ad4f1a3eb56ad71e039c017c5d7a3 | 1,837 | py | Python | util/blender/io_scene_qor/__init__.py | flipcoder/qor | 7a2ebf667be4c913fbc7daf5e0b07a4c1723389d | [
"MIT"
] | 84 | 2015-03-30T14:29:29.000Z | 2022-01-28T12:29:25.000Z | util/blender/io_scene_qor/__init__.py | flipcoder/qor | 7a2ebf667be4c913fbc7daf5e0b07a4c1723389d | [
"MIT"
] | 5 | 2016-01-22T18:54:35.000Z | 2021-07-24T10:21:12.000Z | util/blender/io_scene_qor/__init__.py | flipcoder/qor | 7a2ebf667be4c913fbc7daf5e0b07a4c1723389d | [
"MIT"
] | 22 | 2015-08-06T05:32:29.000Z | 2022-03-05T13:20:46.000Z | bl_info = {
"name": "Qor JSON Scene Export",
"author": "Grady O'Connell",
"blender": (2,7,6),
"version": (0,0,1),
"location": "File > Import-Export",
"description": "Import-Export Qor JSON data format (export only)",
"category": "Import-Export",
"wiki_url... | 31.135593 | 94 | 0.669026 | bl_info = {
"name": "Qor JSON Scene Export",
"author": "Grady O'Connell",
"blender": (2,7,6),
"version": (0,0,1),
"location": "File > Import-Export",
"description": "Import-Export Qor JSON data format (export only)",
"category": "Import-Export",
"wiki_url... | 0 | 64 | 0 | 526 | 0 | 484 | 0 | 28 | 159 |
fc8e278f41ccfd8e183393f7f6bebd6db7c1f9ab | 11,963 | py | Python | QueryDB.py | Nik0l/UTemPr | cc8c64dd01910194d1f18530a687595dceff30df | [
"MIT"
] | 2 | 2016-02-24T19:36:12.000Z | 2017-08-04T07:46:06.000Z | QueryDB.py | Nik0l/UTemPr | cc8c64dd01910194d1f18530a687595dceff30df | [
"MIT"
] | 1 | 2016-03-03T09:18:07.000Z | 2016-03-03T09:18:07.000Z | QueryDB.py | Nik0l/UTemPr | cc8c64dd01910194d1f18530a687595dceff30df | [
"MIT"
] | 2 | 2017-04-18T09:56:30.000Z | 2019-11-22T01:40:10.000Z | __author__ = 'nb254'
import sys
sys.path.append("/mnt/nb254_data/src/utils/")
#import pandas as pd
DIR = '/mnt/nb254_data/db/'
| 64.664865 | 458 | 0.718382 | __author__ = 'nb254'
import sqlite3
import numpy
import csv
import sys
sys.path.append("/mnt/nb254_data/src/utils/")
#import pandas as pd
from once import once, oncecleardb, onceprintdb, onceinit
DIR = '/mnt/nb254_data/db/'
def runquery(c,query,parameters=()):
c.execute(query,parameters)
return c.fetchall()
... | 0 | 0 | 0 | 0 | 0 | 10,979 | 0 | 9 | 847 |
2a92d9d63bfc8456150317545c815e97c7cd9b1e | 3,812 | py | Python | clitools/id3v1toid3v2.py | infothrill/python-clitools | f513c3d66bdfee926212ee8ee1c92d1555393d1e | [
"MIT"
] | 4 | 2017-12-18T16:33:50.000Z | 2022-03-24T09:48:24.000Z | clitools/id3v1toid3v2.py | infothrill/python-clitools | f513c3d66bdfee926212ee8ee1c92d1555393d1e | [
"MIT"
] | 1 | 2021-08-25T04:55:26.000Z | 2021-09-13T09:05:14.000Z | clitools/id3v1toid3v2.py | infothrill/python-clitools | f513c3d66bdfee926212ee8ee1c92d1555393d1e | [
"MIT"
] | 1 | 2018-06-02T00:27:06.000Z | 2018-06-02T00:27:06.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Script to convert id3 v1 tags in a mp3 file to id3 v2."""
import sys
import os
import subprocess # noqa: S404, B404 nosec
# requires tool "id3v2"
# id3v2 -l Prince/Unknown\ Album/When\ Doves\ Cry.mp3
# id3v1 tag info for Prince/Unknown Album/When Doves Cry.mp3:
# T... | 38.12 | 101 | 0.597849 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Script to convert id3 v1 tags in a mp3 file to id3 v2."""
import sys
import os
import subprocess # noqa: S404, B404 nosec
# requires tool "id3v2"
# id3v2 -l Prince/Unknown\ Album/When\ Doves\ Cry.mp3
# id3v1 tag info for Prince/Unknown Album/When Doves Cry.mp3:
# T... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d7178d383817f71eafa70004b34da61f709bd9e9 | 20,284 | py | Python | experiments/federated.py | czlee/jadeite | dfd3f6ea22e14ad3e7961361b0f247752558ad00 | [
"MIT"
] | 2 | 2022-02-16T09:12:36.000Z | 2022-03-27T15:00:50.000Z | experiments/federated.py | czlee/jadeite | dfd3f6ea22e14ad3e7961361b0f247752558ad00 | [
"MIT"
] | null | null | null | experiments/federated.py | czlee/jadeite | dfd3f6ea22e14ad3e7961361b0f247752558ad00 | [
"MIT"
] | null | null | null | """Classes for federated experiments.
Experiment classes are supposed to be, as far as possible, agnostic to models,
loss functions and optimizers. They take care of training, testing and logging.
Note on parameter/`state_dict` distinction: Currently, this implementation
treats all members of the `state_dict` as para... | 44.678414 | 102 | 0.663725 | """Classes for federated experiments.
Experiment classes are supposed to be, as far as possible, agnostic to models,
loss functions and optimizers. They take care of training, testing and logging.
Note on parameter/`state_dict` distinction: Currently, this implementation
treats all members of the `state_dict` as para... | 0 | 6,084 | 0 | 13,059 | 0 | 0 | 0 | 21 | 182 |
5998238c184af1feb9c75b285f1289f5b3c7cc33 | 3,421 | py | Python | problem/breadcrumb/explore.py | jhanley634/testing-tools | 3f3f8a34df53015347e1e1cc37d20c8d03652cad | [
"MIT"
] | null | null | null | problem/breadcrumb/explore.py | jhanley634/testing-tools | 3f3f8a34df53015347e1e1cc37d20c8d03652cad | [
"MIT"
] | 3 | 2020-09-07T17:24:36.000Z | 2020-09-08T17:37:33.000Z | problem/breadcrumb/explore.py | jhanley634/testing-tools | 3f3f8a34df53015347e1e1cc37d20c8d03652cad | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# Copyright 2017 John Hanley.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, m... | 37.593407 | 79 | 0.657702 | #! /usr/bin/env python3
# Copyright 2017 John Hanley.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, m... | 0 | 0 | 0 | 1,361 | 0 | 387 | 0 | -5 | 91 |
dcd5b25920453b5755e87df370f6ba5cff3e79df | 740 | py | Python | omniforms/migrations/0010_auto_20160614_1740.py | vixdigital/omni-forms | 1a21c4b7428e08ee148fc97662ed6b15c21cbe1c | [
"MIT"
] | 6 | 2016-09-02T22:07:32.000Z | 2019-12-16T08:52:37.000Z | omniforms/migrations/0010_auto_20160614_1740.py | vixdigital/omni-forms | 1a21c4b7428e08ee148fc97662ed6b15c21cbe1c | [
"MIT"
] | 32 | 2016-06-09T14:06:13.000Z | 2018-04-24T11:45:44.000Z | omniforms/migrations/0010_auto_20160614_1740.py | vixdigital/omni-forms | 1a21c4b7428e08ee148fc97662ed6b15c21cbe1c | [
"MIT"
] | 4 | 2016-08-08T17:49:38.000Z | 2019-11-19T15:32:03.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-14 17:40
from __future__ import unicode_literals
| 28.461538 | 141 | 0.609459 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-14 17:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('omniforms', '0009_auto_20160614_1723'),
]
operations = [
migrations.AddField... | 0 | 0 | 0 | 562 | 0 | 0 | 0 | 19 | 46 |
c8ff067ce3db7d18af3284b32db0970a4b8cf0ef | 2,968 | py | Python | account/views.py | joshuariveramnltech/projectIE | 9f707f6f1a30ca728580ba738877c77785155ae5 | [
"MIT"
] | null | null | null | account/views.py | joshuariveramnltech/projectIE | 9f707f6f1a30ca728580ba738877c77785155ae5 | [
"MIT"
] | 5 | 2021-02-08T20:32:43.000Z | 2021-09-08T01:13:03.000Z | account/views.py | joshuariveramnltech/projectIE | 9f707f6f1a30ca728580ba738877c77785155ae5 | [
"MIT"
] | null | null | null |
# Create your views here.
| 43.647059 | 96 | 0.709906 | from django.shortcuts import render, reverse
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import PasswordChangeForm
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.contrib.auth import update_session_auth_hash
from .forms import Per... | 0 | 2,474 | 0 | 0 | 0 | 0 | 0 | 241 | 223 |
0a65d09a0e5e971bd56113cdb87b92c737c49c7a | 699 | py | Python | checkers/constants.py | Kuu44/Checkers-AI | 279479e43df58bc5bca6a24503f05c6cde87b482 | [
"MIT"
] | null | null | null | checkers/constants.py | Kuu44/Checkers-AI | 279479e43df58bc5bca6a24503f05c6cde87b482 | [
"MIT"
] | null | null | null | checkers/constants.py | Kuu44/Checkers-AI | 279479e43df58bc5bca6a24503f05c6cde87b482 | [
"MIT"
] | null | null | null | import pygame
OFFSET = 80
WIDTH, HEIGHT = 640, 640
ROWS, COLS = 8, 8
#size of each square on the board
SQUARE_SIZE = WIDTH//COLS
# rgb
RED = (255, 0, 0)
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
BLUE = (0, 0, 255)
GREY = (128, 128, 128)
BROWN = (139, 69, 19)
PIECE_SIZE = 60
WHITE_PIECE = pygame.transform.scale(
... | 25.888889 | 73 | 0.686695 | import pygame
OFFSET = 80
WIDTH, HEIGHT = 640, 640
ROWS, COLS = 8, 8
#size of each square on the board
SQUARE_SIZE = WIDTH//COLS
# rgb
RED = (255, 0, 0)
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
BLUE = (0, 0, 255)
GREY = (128, 128, 128)
BROWN = (139, 69, 19)
PIECE_SIZE = 60
WHITE_PIECE = pygame.transform.scale(
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
38cb69d65c4cafc55740bb822e1a8f003e3dc197 | 109 | py | Python | vmaig_blog/uwsgi-2.0.14/tests/werkzeug.py | StanYaha/Blog | 3cb38918e14ebe6ce2e2952ef272de116849910d | [
"BSD-3-Clause"
] | 1 | 2019-01-14T10:58:43.000Z | 2019-01-14T10:58:43.000Z | vmaig_blog/uwsgi-2.0.14/tests/werkzeug.py | StanYaha/Blog | 3cb38918e14ebe6ce2e2952ef272de116849910d | [
"BSD-3-Clause"
] | null | null | null | vmaig_blog/uwsgi-2.0.14/tests/werkzeug.py | StanYaha/Blog | 3cb38918e14ebe6ce2e2952ef272de116849910d | [
"BSD-3-Clause"
] | null | null | null | import uwsgi
print(uwsgi.opt)
print(uwsgi.magic_table)
| 18.166667 | 52 | 0.834862 | import uwsgi
print(uwsgi.opt)
print(uwsgi.magic_table)
from werkzeug.testapp import test_app as application
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 31 | 22 |
439a3ecfe6918af29888899b777dcdee5ad3ed9f | 114 | py | Python | back/bookclub/db/queries/genres.py | wonesy/bookclub | 0b0368974ca5c9f25666efd556e5b514db44180f | [
"MIT"
] | null | null | null | back/bookclub/db/queries/genres.py | wonesy/bookclub | 0b0368974ca5c9f25666efd556e5b514db44180f | [
"MIT"
] | null | null | null | back/bookclub/db/queries/genres.py | wonesy/bookclub | 0b0368974ca5c9f25666efd556e5b514db44180f | [
"MIT"
] | null | null | null | GET_ALL_GENRES = """
SELECT name
FROM genres
"""
INSERT_GENRE = """
INSERT INTO genres (name) VALUES (:name)
"""
| 12.666667 | 40 | 0.666667 | GET_ALL_GENRES = """
SELECT name
FROM genres
"""
INSERT_GENRE = """
INSERT INTO genres (name) VALUES (:name)
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
67d4b634f864f103a38fe9e4c50c37671ec9aac5 | 4,224 | py | Python | image_face_trimming/image_face_trim.py | scpepper69/ml-tools | 807d396c057be7c5038968226d82454888da2f11 | [
"MIT"
] | 2 | 2020-08-24T01:15:13.000Z | 2020-09-10T11:50:53.000Z | image_face_trimming/image_face_trim.py | scpepper69/ml-tools | 807d396c057be7c5038968226d82454888da2f11 | [
"MIT"
] | null | null | null | image_face_trimming/image_face_trim.py | scpepper69/ml-tools | 807d396c057be7c5038968226d82454888da2f11 | [
"MIT"
] | 1 | 2021-03-09T13:15:39.000Z | 2021-03-09T13:15:39.000Z | #------------------------------------------------------------------------------
# Image Face Triming Tool
# Copyright (c) 2019, scpepper All rights reserved.
#------------------------------------------------------------------------------
import numpy as np
import sys
import tensorflow as tf
#import os.path as osp
m... | 36.413793 | 151 | 0.541903 | #------------------------------------------------------------------------------
# Image Face Triming Tool
# Copyright (c) 2019, scpepper All rights reserved.
#------------------------------------------------------------------------------
import numpy as np
import os
import sys
import cv2
import tensorflow as tf
import... | 0 | 0 | 0 | 0 | 0 | 3,339 | 0 | -39 | 178 |
6dff00eda6e7e13b33088c5ae46ed97a3a4cc3ce | 1,464 | py | Python | setup.py | hiradyazdan/nginx-amplify-agent-health-check | 7aa0fa2aba082491b1b47c2b6189a9266245f647 | [
"MIT"
] | 2 | 2018-05-23T17:34:28.000Z | 2018-07-09T21:55:53.000Z | setup.py | hiradyazdan/nginx-amplify-agent-health-check | 7aa0fa2aba082491b1b47c2b6189a9266245f647 | [
"MIT"
] | null | null | null | setup.py | hiradyazdan/nginx-amplify-agent-health-check | 7aa0fa2aba082491b1b47c2b6189a9266245f647 | [
"MIT"
] | null | null | null | from setuptools import setup
classifiers = [
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX'
] + [
('Programming Language :: Python :: %s' % x)
for x in '2.7'.split()
]
test_requirements = [
'pytest',
'pytest-cov',
'coveralls',
... | 24 | 84 | 0.623634 | from setuptools import setup
classifiers = [
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX'
] + [
('Programming Language :: Python :: %s' % x)
for x in '2.7'.split()
]
test_requirements = [
'pytest',
'pytest-cov',
'coveralls',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
06f8e0e30d4b9d99479c64991f6a1e545a136c87 | 1,744 | py | Python | GeneratorInterface/GenFilters/python/ModelpMSSMFilter_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | GeneratorInterface/GenFilters/python/ModelpMSSMFilter_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | GeneratorInterface/GenFilters/python/ModelpMSSMFilter_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | #Configuration file fragment used for ModelpMSSMFilter module (GeneratorInterface/GenFilters/plugins/ModelpMSSMFilter.cc) initalisation
#ModelpMSSMFilter_cfi GeneratorInterface/GenFilters/python/ModelpMSSMFilter_cfi.py
import FWCore.ParameterSet.Config as cms
ModelpMSSMFilter = cms.EDFilter("ModelpMSSMFilter",
gpss... | 67.076923 | 135 | 0.659404 | #Configuration file fragment used for ModelpMSSMFilter module (GeneratorInterface/GenFilters/plugins/ModelpMSSMFilter.cc) initalisation
#ModelpMSSMFilter_cfi GeneratorInterface/GenFilters/python/ModelpMSSMFilter_cfi.py
import FWCore.ParameterSet.Config as cms
ModelpMSSMFilter = cms.EDFilter("ModelpMSSMFilter",
gpss... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
988e12b122ee5149b2c649d40b2f82e674b1cf8f | 158 | py | Python | tomako/tests/util.py | rcmachado/tomako | 1288e84d81e5bff7ce8040363b2a6891afd0c955 | [
"MIT"
] | 4 | 2015-04-19T15:14:44.000Z | 2018-11-26T13:07:12.000Z | tomako/tests/util.py | rcmachado/tomako | 1288e84d81e5bff7ce8040363b2a6891afd0c955 | [
"MIT"
] | 1 | 2016-06-30T07:38:51.000Z | 2016-06-30T17:24:52.000Z | tomako/tests/util.py | rcmachado/tomako | 1288e84d81e5bff7ce8040363b2a6891afd0c955 | [
"MIT"
] | 3 | 2016-02-01T03:49:21.000Z | 2018-11-26T13:07:14.000Z | # coding: utf-8
| 19.75 | 47 | 0.651899 | # coding: utf-8
from tornado.web import UIModule
class DummyUI(UIModule):
def render(self, arg1, arg2):
return 'arg1=%s|arg2=%s' % (arg1, arg2)
| 0 | 0 | 0 | 85 | 0 | 0 | 0 | 11 | 45 |
dc8461d642c05d4fcb8b721fc9917328c6136203 | 1,281 | py | Python | src/python/pants/backend/native/targets/native_artifact.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/native/targets/native_artifact.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/native/targets/native_artifact.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
| 36.6 | 100 | 0.741608 | # coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from hashlib import sha1
from future.utils import PY3
from pants.base.payload_field imp... | 0 | 38 | 0 | 842 | 0 | 0 | 0 | 56 | 114 |
33f65d7c6ad32c8c9a596a0e59b774467c7e5294 | 2,625 | py | Python | backend/data/jimm/models/layers/mixed_conv2d.py | MikeOwino/JittorVis | d9568b72d684d167045121ea8ed22d694b2f9192 | [
"Apache-2.0"
] | 139 | 2021-06-24T10:32:02.000Z | 2021-06-26T10:22:07.000Z | backend/data/jimm/models/layers/mixed_conv2d.py | MikeOwino/JittorVis | d9568b72d684d167045121ea8ed22d694b2f9192 | [
"Apache-2.0"
] | 8 | 2021-06-29T07:29:06.000Z | 2022-02-28T02:16:48.000Z | backend/data/jimm/models/layers/mixed_conv2d.py | MikeOwino/JittorVis | d9568b72d684d167045121ea8ed22d694b2f9192 | [
"Apache-2.0"
] | 5 | 2021-06-27T21:04:03.000Z | 2021-08-14T03:26:17.000Z | """
Copyright VIP Group
Licensed under the Apache License, Version 2.0.
Modify from https://github.com/rwightman/pytorch-image-models
Original copyright of Ross Wightman below, modifications by VIP Group
Hacked together by / copyright Ross Wightman
"""
| 32.8125 | 100 | 0.63581 | """
Copyright VIP Group
Licensed under the Apache License, Version 2.0.
Modify from https://github.com/rwightman/pytorch-image-models
Original copyright of Ross Wightman below, modifications by VIP Group
Hacked together by / copyright Ross Wightman
"""
from typing import Optional
from collections import Order... | 0 | 0 | 0 | 1,983 | 0 | 143 | 0 | 39 | 192 |
e6ae9fba447c7fc3341acd19538d1a66ef6a315a | 6,653 | py | Python | heat/engine/stack_lock.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 265 | 2015-01-02T09:33:22.000Z | 2022-03-26T23:19:54.000Z | heat/engine/stack_lock.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 8 | 2015-09-01T15:43:19.000Z | 2021-12-14T05:18:23.000Z | heat/engine/stack_lock.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 295 | 2015-01-06T07:00:40.000Z | 2021-09-06T08:05:06.000Z | #
# 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, software
# ... | 39.838323 | 78 | 0.530588 | #
# 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, software
# ... | 0 | 1,099 | 0 | 4,655 | 0 | 0 | 0 | 94 | 157 |
4a74ca0034e4212a3b0464c80ee0c203d48b99cc | 11,540 | py | Python | assistive_gym/learn.py | chstetco/assistive-gym | cc797c86051ed4d09688d60ce9f378b884547264 | [
"MIT"
] | 216 | 2019-10-11T01:33:50.000Z | 2022-03-28T23:24:58.000Z | assistive_gym/learn.py | chstetco/assistive-gym | cc797c86051ed4d09688d60ce9f378b884547264 | [
"MIT"
] | 19 | 2019-12-18T03:28:56.000Z | 2021-11-10T22:02:01.000Z | assistive_gym/learn.py | chstetco/assistive-gym | cc797c86051ed4d09688d60ce9f378b884547264 | [
"MIT"
] | 62 | 2019-10-12T00:42:43.000Z | 2022-03-28T01:26:05.000Z | import argparse
# from ray.rllib.agents.ppo import PPOTrainer, DEFAULT_CONFIG
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='RL for Assistive Gym')
parser.add_argument('--env', default='ScratchItchJaco-v0',
help='Environment to train on (default: ScratchItchJ... | 50.837004 | 345 | 0.640901 | import os, sys, multiprocessing, gym, ray, shutil, argparse, importlib, glob
import numpy as np
# from ray.rllib.agents.ppo import PPOTrainer, DEFAULT_CONFIG
from ray.rllib.agents import ppo, sac
from ray.tune.logger import pretty_print
from numpngw import write_apng
def setup_config(env, algo, coop=False, seed=0, ex... | 0 | 0 | 0 | 0 | 0 | 8,261 | 0 | 102 | 226 |
08d19efa2b2ad9268ec60a966f96b4b19dad289d | 1,554 | py | Python | src/inference/dnam.py | AaronBlare/dnam | 4d97c879cb24447eee0852eaf48fc5b3ef8e159b | [
"MIT"
] | null | null | null | src/inference/dnam.py | AaronBlare/dnam | 4d97c879cb24447eee0852eaf48fc5b3ef8e159b | [
"MIT"
] | null | null | null | src/inference/dnam.py | AaronBlare/dnam | 4d97c879cb24447eee0852eaf48fc5b3ef8e159b | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
inference()
| 24.666667 | 133 | 0.66538 | from src.models.fcmlp_model import FCMLPModel
import pickle
from src.datamodules.to_delete.datasets.dnam_dataset import DNAmDataset
from torch.utils.data import DataLoader
from tqdm import tqdm
import pandas as pd
def inference():
model_type = "FCMLPModel"
model_path = "E:/YandexDisk/Work/dnamvae/models/fcm... | 0 | 0 | 0 | 0 | 0 | 1,271 | 0 | 82 | 155 |
59ece2a31140b7933f756ccfc395dff570d80296 | 4,346 | py | Python | Collection/data2spreadsheet.py | Big-Data-Analytics-Lab-USF/test | 8dbcc1bdf326ff0dc042fee54bc6f7975127cbd2 | [
"MIT"
] | null | null | null | Collection/data2spreadsheet.py | Big-Data-Analytics-Lab-USF/test | 8dbcc1bdf326ff0dc042fee54bc6f7975127cbd2 | [
"MIT"
] | null | null | null | Collection/data2spreadsheet.py | Big-Data-Analytics-Lab-USF/test | 8dbcc1bdf326ff0dc042fee54bc6f7975127cbd2 | [
"MIT"
] | null | null | null | try:
import json
except ImportError:
import simplejson as json
import codecs
import time
import os
import time
import sys
# Just used to highlight matches in tweets. This file does not query anything from Twitter!
queries = ["term1", "term2"]
outputDir = "output/" # Output directory
os.system("mkdir -p %s" %... | 27.333333 | 113 | 0.553843 | try:
import json
except ImportError:
import simplejson as json
import codecs
import time
import datetime
import os
import random
import time
import sys
# Just used to highlight matches in tweets. This file does not query anything from Twitter!
queries = ["term1", "term2"]
outputDir = "output/" # Output direc... | 0 | 356 | 0 | 2,388 | 0 | 299 | 0 | -14 | 113 |
d9af9935e3199666e5da11fc7dc05184147b03cf | 10,359 | py | Python | iscc_bench/algos/cdc_fast_text.py | coblo/isccbench | daf22cdd740fa99c62c4a56233593159e398596b | [
"BSD-2-Clause"
] | 3 | 2019-07-07T19:30:26.000Z | 2020-09-17T10:17:36.000Z | iscc_bench/algos/cdc_fast_text.py | coblo/isccbench | daf22cdd740fa99c62c4a56233593159e398596b | [
"BSD-2-Clause"
] | 3 | 2019-04-15T13:00:48.000Z | 2021-12-13T19:44:12.000Z | iscc_bench/algos/cdc_fast_text.py | coblo/isccbench | daf22cdd740fa99c62c4a56233593159e398596b | [
"BSD-2-Clause"
] | 1 | 2021-02-25T16:13:14.000Z | 2021-02-25T16:13:14.000Z | # -*- coding: utf-8 -*-
"""Fast-CDC on Unicode Code Points"""
import logging
logr = logging.getLogger(__name__)
MAX_INT64 = 2 ** 64 - 1
GEAR2_NORM = 1024
GEAR2_MIN = 64
GEAR2_MAX = 4096
GEAR2_MASK1 = 0b1101100110110100010000
GEAR2_MASK2 = 0b11100101010110000000
CHUNKING_GEAR = [
9584138480181866666,
4739450... | 26.093199 | 88 | 0.713775 | # -*- coding: utf-8 -*-
"""Fast-CDC on Unicode Code Points"""
import logging
from io import StringIO
from os.path import basename
from statistics import mean
from typing import TextIO
from iscc_bench.algos.metrics import jaccard
from iscc_bench.algos.slide import sliding_window
from iscc_bench.readers.mltext import mlt... | 0 | 0 | 0 | 0 | 389 | 2,494 | 0 | 158 | 289 |
810a30af53923464d3f05031b3d9a710c2d1b016 | 25,303 | py | Python | src/external/coremltools_wrap/coremltools/coremltools/test/pipeline/test_model_updatable.py | cookingcodewithme/turicreate | a89e203d60529d2d72547c03ec9753ea979ee342 | [
"BSD-3-Clause"
] | 11,356 | 2017-12-08T19:42:32.000Z | 2022-03-31T16:55:25.000Z | src/external/coremltools_wrap/coremltools/coremltools/test/pipeline/test_model_updatable.py | cookingcodewithme/turicreate | a89e203d60529d2d72547c03ec9753ea979ee342 | [
"BSD-3-Clause"
] | 2,402 | 2017-12-08T22:31:01.000Z | 2022-03-28T19:25:52.000Z | src/external/coremltools_wrap/coremltools/coremltools/test/pipeline/test_model_updatable.py | cookingcodewithme/turicreate | a89e203d60529d2d72547c03ec9753ea979ee342 | [
"BSD-3-Clause"
] | 1,343 | 2017-12-08T19:47:19.000Z | 2022-03-26T11:31:36.000Z | # Copyright (c) 2017, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import coremltools.models.datatypes as datatypes
| 34.804677 | 99 | 0.616844 | # Copyright (c) 2017, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import os, shutil
import numpy as _np
import coremltools.models.datatypes as datatypes
import unittest
im... | 0 | 166 | 0 | 24,494 | 0 | 0 | 0 | 157 | 221 |
129ea823e2f3de932651c0d6d38d4b285ac49b1d | 443 | py | Python | django_geosource/migrations/0006_auto_20190612_1020.py | Terralego/django-geosource | 013afde33cfeb8a3f91b809a8f6df3ab3e4089bd | [
"MIT"
] | 3 | 2019-08-08T15:19:19.000Z | 2022-03-04T14:37:00.000Z | django_geosource/migrations/0006_auto_20190612_1020.py | Terralego/django-geosource | 013afde33cfeb8a3f91b809a8f6df3ab3e4089bd | [
"MIT"
] | 39 | 2019-05-22T12:03:06.000Z | 2022-03-04T15:09:56.000Z | django_geosource/migrations/0006_auto_20190612_1020.py | Terralego/django-geosource | 013afde33cfeb8a3f91b809a8f6df3ab3e4089bd | [
"MIT"
] | null | null | null | # Generated by Django 2.1.9 on 2019-06-12 08:20
| 24.611111 | 79 | 0.668172 | # Generated by Django 2.1.9 on 2019-06-12 08:20
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("django_geosource", "0005_auto_20190603_1506")]
operations = [
migrations.AlterField(
model_name="field",
... | 0 | 0 | 0 | 293 | 0 | 0 | 0 | 33 | 68 |
236dd6f1c285719c335790c7a9a93fb33ba46dc4 | 27,792 | py | Python | metrics.py | kotikkonstantin/convasr | 3d4d7f3627269372ae1eb7ff7423b29838f47ac0 | [
"MIT"
] | 17 | 2019-08-01T07:45:46.000Z | 2022-03-25T05:15:13.000Z | metrics.py | kotikkonstantin/convasr | 3d4d7f3627269372ae1eb7ff7423b29838f47ac0 | [
"MIT"
] | 14 | 2020-05-30T16:18:28.000Z | 2021-06-24T08:08:19.000Z | metrics.py | kotikkonstantin/convasr | 3d4d7f3627269372ae1eb7ff7423b29838f47ac0 | [
"MIT"
] | 6 | 2020-07-10T14:43:02.000Z | 2021-04-08T19:28:53.000Z |
placeholder = '|'
space = ' '
silence = placeholder + space
replace_placeholder = lambda s, rep = '': s.replace(placeholder, rep)
def levenshtein(a, b):
"""Calculates the Levenshtein distance between a and b.
The code was copied from: http://hetland.org/coding/python/levenshtein.py
"""
n, m = len(a), le... | 36.713342 | 247 | 0.684478 | import os
import math
import collections
import json
import functools
import typing
import text_processing
import Levenshtein
placeholder = '|'
space = ' '
silence = placeholder + space
replace_placeholder = lambda s, rep = '': s.replace(placeholder, rep)
class ErrorTagger:
typo_easy = 'typo_easy'
typo_hard = 'ty... | 0 | 0 | 0 | 15,476 | 0 | 9,455 | 0 | -50 | 498 |
2ed0a7c54dbb318029e1a6cba75e30cf6af85207 | 895 | py | Python | field_calculator/string_defs.py | Dan-Patterson/Tools_for_ArcGIS_Pro | b5c253d59d57bd1abe7e2433a77aed7d3ea22567 | [
"Info-ZIP"
] | 23 | 2020-05-15T18:40:25.000Z | 2022-03-31T08:44:39.000Z | field_calculator/string_defs.py | Dan-Patterson/Tools_for_ArcGIS_Pro | b5c253d59d57bd1abe7e2433a77aed7d3ea22567 | [
"Info-ZIP"
] | 1 | 2021-12-14T16:47:00.000Z | 2021-12-15T03:06:26.000Z | field_calculator/string_defs.py | Dan-Patterson/Tools_for_ArcGIS_Pro | b5c253d59d57bd1abe7e2433a77aed7d3ea22567 | [
"Info-ZIP"
] | 3 | 2021-08-09T05:42:19.000Z | 2022-03-31T08:44:59.000Z | # -*- coding: UTF-8 -*-
"""
:Script: string_defs.py
:Author: Dan.Patterson@carleton.ca
:Modified: 2017-06-17
:Purpose: tools for working strings
:Useage:
: These are mini-onliners or so
:---------------------------------------------------------------------:
"""
# ---- imports, formats, constants ----
... | 25.571429 | 72 | 0.512849 | # -*- coding: UTF-8 -*-
"""
:Script: string_defs.py
:Author: Dan.Patterson@carleton.ca
:Modified: 2017-06-17
:Purpose: tools for working strings
:Useage:
: These are mini-onliners or so
:---------------------------------------------------------------------:
"""
# ---- imports, formats, constants ----
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
057b7c55ac3f9c847ff7a8cdf2dff1038ce4617d | 4,092 | py | Python | volatility/volatility/plugins/linux/route_cache.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | 2 | 2018-07-16T13:30:40.000Z | 2018-07-17T12:02:05.000Z | volatility/volatility/plugins/linux/route_cache.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | null | null | null | volatility/volatility/plugins/linux/route_cache.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | null | null | null | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation. You may not use, modify or
# distribu... | 37.2 | 236 | 0.572092 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation. You may not use, modify or
# distribu... | 0 | 0 | 0 | 3,025 | 0 | 0 | 0 | 25 | 67 |
d45e6ec7c9526c6baab4ebeb0694999f61392a2e | 1,632 | py | Python | tests/test_cli.py | Vauxoo/cookiecutter | 422f7d75da11bcaa7f933959b62d0cda2de09545 | [
"BSD-3-Clause"
] | null | null | null | tests/test_cli.py | Vauxoo/cookiecutter | 422f7d75da11bcaa7f933959b62d0cda2de09545 | [
"BSD-3-Clause"
] | 1 | 2021-02-24T05:31:46.000Z | 2021-02-24T05:31:46.000Z | tests/test_cli.py | Vauxoo/cookiecutter | 422f7d75da11bcaa7f933959b62d0cda2de09545 | [
"BSD-3-Clause"
] | 1 | 2021-01-29T10:04:27.000Z | 2021-01-29T10:04:27.000Z |
from click.testing import CliRunner
runner = CliRunner()
| 28.137931 | 78 | 0.714461 | import os
import pytest
from click.testing import CliRunner
from cookiecutter.cli import main
from cookiecutter import utils
runner = CliRunner()
@pytest.fixture
def remove_fake_project_dir(request):
"""
Remove the fake project directory created during the tests.
"""
def fin_remove_fake_project_dir... | 0 | 1,211 | 0 | 0 | 0 | 128 | 0 | 1 | 227 |
252d36ca311bb1dc4d719065663f4df283089676 | 54,079 | py | Python | py3/utils/mbatch_generation.py | gulamungon/SEQUENS | 48321f437f637d6d31c0beb70e03477952ad7340 | [
"Apache-1.1"
] | 4 | 2019-07-26T09:11:28.000Z | 2020-09-27T13:31:40.000Z | py3/utils/mbatch_generation.py | gulamungon/SEQUENS | 48321f437f637d6d31c0beb70e03477952ad7340 | [
"Apache-1.1"
] | null | null | null | py3/utils/mbatch_generation.py | gulamungon/SEQUENS | 48321f437f637d6d31c0beb70e03477952ad7340 | [
"Apache-1.1"
] | 2 | 2019-07-27T06:34:37.000Z | 2019-07-29T09:21:52.000Z |
# Code for generating mini-batches. The outout can be any
# combination of:
# features/0-stats/1-stats/i-vectors/labels/scp-indices
#
# scp-indices means which position in the data had. This
# can for example be used for looking up a trial weight
# from a list or for accessing data that is already
# loaded to the... | 44.436319 | 232 | 0.534292 |
# Code for generating mini-batches. The outout can be any
# combination of:
# features/0-stats/1-stats/i-vectors/labels/scp-indices
#
# scp-indices means which position in the data had. This
# can for example be used for looking up a trial weight
# from a list or for accessing data that is already
# loaded to the... | 0 | 0 | 0 | 19,448 | 20,883 | 9,023 | 0 | -5 | 426 |
16c88947474dea348ddab218c67f9264f81814c7 | 5,661 | py | Python | gridpath/auxiliary/auxiliary.py | souissim/gridpath | 4eeca2be24b485edc56026e38cfda83f4a6b27ea | [
"Apache-2.0"
] | null | null | null | gridpath/auxiliary/auxiliary.py | souissim/gridpath | 4eeca2be24b485edc56026e38cfda83f4a6b27ea | [
"Apache-2.0"
] | null | null | null | gridpath/auxiliary/auxiliary.py | souissim/gridpath | 4eeca2be24b485edc56026e38cfda83f4a6b27ea | [
"Apache-2.0"
] | 1 | 2021-12-21T20:44:21.000Z | 2021-12-21T20:44:21.000Z | # Copyright 2016-2020 Blue Marble Analytics LLC.
#
# 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 ag... | 27.75 | 87 | 0.63222 | # Copyright 2016-2020 Blue Marble Analytics LLC.
#
# 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 ag... | 0 | 0 | 0 | 0 | 0 | 188 | 0 | 0 | 46 |
45d85f89246414723d2c62817da4e63306d9f59c | 9,067 | py | Python | idem_azurerm/exec/azurerm/web/app_service_plan.py | eitrtechnologies/idem_provider_azurerm | 7922ea1dbe3ca411754cdbf12cd9fda397be6681 | [
"Apache-2.0"
] | 6 | 2019-10-31T16:01:39.000Z | 2020-01-30T01:13:45.000Z | idem_azurerm/exec/azurerm/web/app_service_plan.py | tompscanlan/idem-azurerm | 7922ea1dbe3ca411754cdbf12cd9fda397be6681 | [
"Apache-2.0"
] | 69 | 2020-05-05T02:49:25.000Z | 2021-09-20T01:21:34.000Z | idem_azurerm/exec/azurerm/web/app_service_plan.py | tompscanlan/idem-azurerm | 7922ea1dbe3ca411754cdbf12cd9fda397be6681 | [
"Apache-2.0"
] | 3 | 2020-06-01T19:35:15.000Z | 2021-04-21T19:37:57.000Z | # -*- coding: utf-8 -*-
"""
Azure Resource Manager (ARM) Web App Service Plan Operations Execution Module
.. versionadded:: 3.0.0
:maintainer: <devops@eitr.tech>
:configuration: This module requires Azure Resource Manager credentials to be passed as keyword arguments
to every function or via acct in order to work... | 28.071207 | 115 | 0.644094 | # -*- coding: utf-8 -*-
"""
Azure Resource Manager (ARM) Web App Service Plan Operations Execution Module
.. versionadded:: 3.0.0
:maintainer: <devops@eitr.tech>
:configuration: This module requires Azure Resource Manager credentials to be passed as keyword arguments
to every function or via acct in order to work... | 0 | 0 | 7,500 | 0 | 0 | 0 | 0 | 138 | 297 |
9ef0754ae8a218f693c013d4ea0e1da0690436c9 | 645 | py | Python | documentation_multiprocessing/08_reference/02_pipes_and_queues/pipe_01.py | software-foundations/learning-distributed-systems | b09f60742a88acf466fcf724e1368b95363682fa | [
"MIT"
] | null | null | null | documentation_multiprocessing/08_reference/02_pipes_and_queues/pipe_01.py | software-foundations/learning-distributed-systems | b09f60742a88acf466fcf724e1368b95363682fa | [
"MIT"
] | null | null | null | documentation_multiprocessing/08_reference/02_pipes_and_queues/pipe_01.py | software-foundations/learning-distributed-systems | b09f60742a88acf466fcf724e1368b95363682fa | [
"MIT"
] | null | null | null | """
For passing messages one can use Pipe() (for a connection between two processes)
or a queue (which allows multiple producers and consumers).
Returns a pair (conn1, conn2) of Connection objects representing the ends of a
pipe.
If duplex is True (the default) then the pipe is bidirectional. If duplex is
False th... | 26.875 | 81 | 0.775194 | """
For passing messages one can use Pipe() (for a connection between two processes)
or a queue (which allows multiple producers and consumers).
Returns a pair (conn1, conn2) of Connection objects representing the ends of a
pipe.
If duplex is True (the default) then the pipe is bidirectional. If duplex is
False th... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3db78c4dc327334895df0bdb9f6c1cb9faf77998 | 15,016 | py | Python | webinars/covid/scripts/text_encoder.py | jacobtomlinson/Welcome_to_BlazingSQL_Notebooks | 3f9eebff8a2d8edbc64b0da020340d287623a2c3 | [
"Apache-2.0"
] | 18 | 2020-03-17T21:15:35.000Z | 2021-09-27T11:15:17.000Z | webinars/covid/scripts/text_encoder.py | jacobtomlinson/Welcome_to_BlazingSQL_Notebooks | 3f9eebff8a2d8edbc64b0da020340d287623a2c3 | [
"Apache-2.0"
] | 9 | 2020-05-21T19:26:22.000Z | 2021-08-29T19:23:06.000Z | webinars/covid/scripts/text_encoder.py | jacobtomlinson/Welcome_to_BlazingSQL_Notebooks | 3f9eebff8a2d8edbc64b0da020340d287623a2c3 | [
"Apache-2.0"
] | 10 | 2020-04-21T10:01:24.000Z | 2021-12-04T09:00:09.000Z | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 37.353234 | 105 | 0.687467 | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 0 | 191 | 0 | 11,215 | 0 | 817 | 0 | -1 | 286 |
e21b70d5b678b3d6506f2dce9b08435278c76eb9 | 7,636 | py | Python | app/pru.py | HudsonWerks/visualpru | 5bbb44ebb0798a493ad33f4881fa7845e8aeff74 | [
"MIT"
] | 1 | 2020-07-15T18:55:07.000Z | 2020-07-15T18:55:07.000Z | app/pru.py | HudsonWerks/visualpru | 5bbb44ebb0798a493ad33f4881fa7845e8aeff74 | [
"MIT"
] | null | null | null | app/pru.py | HudsonWerks/visualpru | 5bbb44ebb0798a493ad33f4881fa7845e8aeff74 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import division | 43.634286 | 144 | 0.675223 | from __future__ import print_function
from __future__ import division
import os
import mmap
import struct
import re
import pasm
class PRU:
def __init__(self, id, constants, shared_constants):
self.id = id
self.constants = constants
self.shared_constants = shared_constants
self.f ... | 0 | 0 | 0 | 7,484 | 0 | 0 | 0 | -52 | 135 |
90630a605b94b7b536cbc862348704d41df4cd63 | 23,438 | py | Python | Kanalhaltungen-anpassen.py | loudar/SubVision-py | 22c94076289adf519b73f1f691901f865637f913 | [
"MIT"
] | null | null | null | Kanalhaltungen-anpassen.py | loudar/SubVision-py | 22c94076289adf519b73f1f691901f865637f913 | [
"MIT"
] | null | null | null | Kanalhaltungen-anpassen.py | loudar/SubVision-py | 22c94076289adf519b73f1f691901f865637f913 | [
"MIT"
] | null | null | null | # ArcGIS Skript
#
# Zweck:
# Anpassen von Haltungs- und Hausanschlussdaten mithilfe von Schachtsohlen
#
# Anmerkungen:
# Kommentare sind in Englisch verfasst, nur die ausgegebenen Nachrichten sind auf Deutsch.
# Damit wird mglichst viel Arbeit vermieden, falls das Skript mal bei Bedarf auf Englisch ausgefhrt werden sol... | 43.646182 | 155 | 0.620403 | # ArcGIS Skript
#
# Zweck:
# Anpassen von Haltungs- und Hausanschlussdaten mithilfe von Schachtsohlen
#
# Anmerkungen:
# Kommentare sind in Englisch verfasst, nur die ausgegebenen Nachrichten sind auf Deutsch.
# Damit wird möglichst viel Arbeit vermieden, falls das Skript mal bei Bedarf auf Englisch ausgeführt werden s... | 26 | 0 | 0 | 311 | 0 | 0 | 0 | -10 | 45 |
fabbcb3b32aaa9da3e428a4db06e84d39be17638 | 372 | py | Python | chatbots_training_eval/generative/evaluation/finetuned_empathy_cc.py | shashankvmaiya/Task-Oriented-Chatbot-With-Empathy | 7306349ade3c9a0b9e04f870178c3949ff1f1aa7 | [
"MIT"
] | 1 | 2021-01-18T05:19:07.000Z | 2021-01-18T05:19:07.000Z | chatbots_training_eval/generative/evaluation/finetuned_empathy_cc.py | shashankvmaiya/Task-Oriented-Chatbot-With-Empathy | 7306349ade3c9a0b9e04f870178c3949ff1f1aa7 | [
"MIT"
] | null | null | null | chatbots_training_eval/generative/evaluation/finetuned_empathy_cc.py | shashankvmaiya/Task-Oriented-Chatbot-With-Empathy | 7306349ade3c9a0b9e04f870178c3949ff1f1aa7 | [
"MIT"
] | 1 | 2021-02-02T12:57:14.000Z | 2021-02-02T12:57:14.000Z | from parlai.scripts.eval_model import EvalModel
EvalModel.main(
task='customer_Care',
model_file='/home/xcs224u/project/Task-Oriented-Chatbot-With-Empathy/data/test_models/pretrained_transformer__ed_cc/model',
metrics = ['ppl','f1','accuracy','hits@1'],
# model_file='zoo:bert/model',
# fp16 = False,... | 33.818182 | 127 | 0.706989 | from parlai.scripts.eval_model import EvalModel
EvalModel.main(
task='customer_Care',
model_file='/home/xcs224u/project/Task-Oriented-Chatbot-With-Empathy/data/test_models/pretrained_transformer__ed_cc/model',
metrics = ['ppl','f1','accuracy','hits@1'],
# model_file='zoo:bert/model',
# fp16 = False,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
520ce8b18d66cbd77fd15c412a98f5ceeca74557 | 2,444 | py | Python | toneAnalyzer.py | czyoung/Emotion-Sentiment-Analysis | d39452f418efd30ce0ca20253aa7d64cbdfae73d | [
"MIT"
] | null | null | null | toneAnalyzer.py | czyoung/Emotion-Sentiment-Analysis | d39452f418efd30ce0ca20253aa7d64cbdfae73d | [
"MIT"
] | null | null | null | toneAnalyzer.py | czyoung/Emotion-Sentiment-Analysis | d39452f418efd30ce0ca20253aa7d64cbdfae73d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 17 13:34:41 2018
"""
| 31.74026 | 252 | 0.592062 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 17 13:34:41 2018
"""
import requests
import json
def analyze_tone(text):
username = 'ENTER USERNAME HERE'
password = 'ENTER PASSWORD HERE'
watsonUrl = 'https://gateway.watsonplatform.net/tone-analyzer/api/v3/tone?version=2016-05-19'
... | 0 | 0 | 0 | 0 | 0 | 2,195 | 0 | -16 | 172 |
04e925dca9b16182561bb1f9663e551ae587cbb6 | 1,092 | py | Python | count_calls/count_calls_extension.py | chimicus/addons | 0fa1110df999fc9a8622a12e00453fc67b62fce1 | [
"BSD-3-Clause"
] | null | null | null | count_calls/count_calls_extension.py | chimicus/addons | 0fa1110df999fc9a8622a12e00453fc67b62fce1 | [
"BSD-3-Clause"
] | 6 | 2019-08-23T15:53:05.000Z | 2021-07-14T08:24:06.000Z | count_calls/count_calls_extension.py | chimicus/addons | 0fa1110df999fc9a8622a12e00453fc67b62fce1 | [
"BSD-3-Clause"
] | 3 | 2019-11-04T12:02:11.000Z | 2020-03-05T13:57:11.000Z | import gdb
from undodb.debugger_extensions import udb
def count_calls(func_name):
"""
Counts how many times func_name is hit during the replay of the currently
loaded recording and returns the hit count.
"""
# Set a breakpoint for the specified function.
bp = gdb.Breakpoint(func_name)
# ... | 31.2 | 80 | 0.72619 | import gdb
from undodb.debugger_extensions import udb
def count_calls(func_name):
"""
Counts how many times func_name is hit during the replay of the currently
loaded recording and returns the hit count.
"""
# Set a breakpoint for the specified function.
bp = gdb.Breakpoint(func_name)
# ... | 0 | 0 | 0 | 0 | 0 | 300 | 0 | 0 | 22 |
df311f41c9d37eb013e3bb4b9f029f1b1de96c37 | 509 | py | Python | nicos_mlz/pgaa/testscripts/scan.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_mlz/pgaa/testscripts/scan.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_mlz/pgaa/testscripts/scan.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | # pylint: skip-file
# test: subdirs = frm2
# test: setups = pgaa
# test: setupcode = SetDetectors(det)
# typical PGAA application
from nicos import session
loaded_setups = session.loaded_setups
if 'pgaa' in loaded_setups:
printwarning('Execute PGAA specific tests')
sample_motor.status(0)
samplepos.stat... | 22.130435 | 51 | 0.675835 | # pylint: skip-file
# test: subdirs = frm2
# test: setups = pgaa
# test: setupcode = SetDetectors(det)
# typical PGAA application
from nicos import session
loaded_setups = session.loaded_setups
if 'pgaa' in loaded_setups:
printwarning('Execute PGAA specific tests')
sample_motor.status(0)
samplepos.stat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
17e27f365b4a412a168334d5e75d332ee1dd3bb4 | 372 | py | Python | minikube/drivers/hyperkit.py | j-boivie/fiaas-deploy-daemon | 3bba04b3b329f4c9c1418d80a9a007e8ed22f804 | [
"Apache-2.0"
] | null | null | null | minikube/drivers/hyperkit.py | j-boivie/fiaas-deploy-daemon | 3bba04b3b329f4c9c1418d80a9a007e8ed22f804 | [
"Apache-2.0"
] | null | null | null | minikube/drivers/hyperkit.py | j-boivie/fiaas-deploy-daemon | 3bba04b3b329f4c9c1418d80a9a007e8ed22f804 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8
| 24.8 | 60 | 0.704301 | #!/usr/bin/env python
# -*- coding: utf-8
from distutils.version import StrictVersion
from .common import has_utility, MacDriver
class HyperKitDriver(MacDriver):
name = "hyperkit"
def supported(self, minikube_version):
if minikube_version < StrictVersion("0.22.0"):
return False
r... | 0 | 0 | 0 | 218 | 0 | 0 | 0 | 43 | 68 |