hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2529dc53e5cd9ca70e79a3921134c3237fe3ea48 | 972 | py | Python | scripts/run_iqtree.py | fmalmeida/PopPIPE | 0012ff55c9959f1c7ac359412ca22d9c1948d00c | [
"Apache-2.0"
] | 7 | 2020-05-04T10:16:25.000Z | 2021-05-09T20:22:19.000Z | scripts/run_iqtree.py | fmalmeida/PopPIPE | 0012ff55c9959f1c7ac359412ca22d9c1948d00c | [
"Apache-2.0"
] | 4 | 2020-07-01T09:07:47.000Z | 2021-05-19T12:04:37.000Z | scripts/run_iqtree.py | fmalmeida/PopPIPE | 0012ff55c9959f1c7ac359412ca22d9c1948d00c | [
"Apache-2.0"
] | 2 | 2021-05-09T00:34:29.000Z | 2021-11-21T22:23:17.000Z | import subprocess
import dendropy
from shutil import copyfile
if snakemake.params.enabled:
iqtree_cmd = "iqtree --quiet -s " + snakemake.input.alignment + " -t " + snakemake.input.start_tree + \
" -T " + str(snakemake.threads) + " --prefix " + snakemake.params.prefix
if snakemake.params.mode =... | 42.26087 | 107 | 0.70679 | import subprocess
import dendropy
from shutil import copyfile
if snakemake.params.enabled:
iqtree_cmd = "iqtree --quiet -s " + snakemake.input.alignment + " -t " + snakemake.input.start_tree + \
" -T " + str(snakemake.threads) + " --prefix " + snakemake.params.prefix
if snakemake.params.mode =... | 0 | 0 | 0 |
daae40433f08ca14b1c202d237fcaef60659f854 | 1,411 | py | Python | example/toolbox/management/commands/analyzeuniquekeys.py | rkiddy/django-calaccess-raw-data | dab2bf103b713eee6d76295ffbd2d5d58c2796e4 | [
"MIT"
] | 48 | 2015-01-10T18:06:03.000Z | 2022-01-27T16:48:29.000Z | example/toolbox/management/commands/analyzeuniquekeys.py | rkiddy/django-calaccess-raw-data | dab2bf103b713eee6d76295ffbd2d5d58c2796e4 | [
"MIT"
] | 1,193 | 2015-01-07T06:35:20.000Z | 2021-06-19T11:43:20.000Z | example/toolbox/management/commands/analyzeuniquekeys.py | rkiddy/django-calaccess-raw-data | dab2bf103b713eee6d76295ffbd2d5d58c2796e4 | [
"MIT"
] | 163 | 2015-01-10T18:06:09.000Z | 2022-01-14T00:29:12.000Z | import os
import time
import calculate
from github import Github
from django.conf import settings
from calaccess_raw import get_model_list
from calaccess_raw.management.commands import CalAccessCommand
from django.contrib.humanize.templatetags.humanize import intcomma
| 31.355556 | 76 | 0.581857 | import os
import time
import calculate
from github import Github
from django.conf import settings
from calaccess_raw import get_model_list
from calaccess_raw.management.commands import CalAccessCommand
from django.contrib.humanize.templatetags.humanize import intcomma
class Command(CalAccessCommand):
help = 'Anal... | 0 | 1,118 | 23 |
e407015ffc89e6d1d5d878c1de0fb0517395640a | 213 | py | Python | Python/frequency_counter.py | Gaminee/Data_Structures_and_Algorithms.github.io | f25d368e17dfcbe81079f286012355281af8b390 | [
"Unlicense"
] | 77 | 2020-10-01T10:06:59.000Z | 2021-11-08T08:57:18.000Z | Python/frequency_counter.py | Gaminee/Data_Structures_and_Algorithms.github.io | f25d368e17dfcbe81079f286012355281af8b390 | [
"Unlicense"
] | 64 | 2020-10-01T09:27:58.000Z | 2020-12-02T10:47:01.000Z | Python/frequency_counter.py | Gaminee/Data_Structures_and_Algorithms.github.io | f25d368e17dfcbe81079f286012355281af8b390 | [
"Unlicense"
] | 327 | 2020-09-26T17:06:03.000Z | 2021-10-09T06:04:39.000Z | L = [11,22,66,22,11,44,55,66,88,77,22,11,44,22,33,77,55,44]
print('The given list is: ')
print(L)
D = {}
for item in L:
if item not in D:
D[item] = L.count(item)
print('Frequency of different items is:')
print(D)
| 21.3 | 59 | 0.647887 | L = [11,22,66,22,11,44,55,66,88,77,22,11,44,22,33,77,55,44]
print('The given list is: ')
print(L)
D = {}
for item in L:
if item not in D:
D[item] = L.count(item)
print('Frequency of different items is:')
print(D)
| 0 | 0 | 0 |
180fc1c1d07b42afefb6638e91e474bd5069892e | 5,407 | py | Python | server/datasource/models/candles.py | yizhang7210/Acre | c98cf8a4fdfb223a1958e8e61df759f889a1b13f | [
"MIT"
] | 2 | 2017-11-27T21:55:21.000Z | 2017-12-30T03:34:40.000Z | server/datasource/models/candles.py | yizhang7210/Acre | c98cf8a4fdfb223a1958e8e61df759f889a1b13f | [
"MIT"
] | 30 | 2017-09-06T12:00:08.000Z | 2018-06-20T22:47:46.000Z | server/datasource/models/candles.py | yizhang7210/Acre | c98cf8a4fdfb223a1958e8e61df759f889a1b13f | [
"MIT"
] | 1 | 2021-04-05T13:59:37.000Z | 2021-04-05T13:59:37.000Z | """ Data model and data access methods for Candles.
"""
import pytz
from core.models.instruments import Instrument
from django.db import models
class Candle(models.Model):
""" Candle data model.
"""
# pylint: disable=too-many-instance-attributes
instrument = models.ForeignKey(Instrument, on_delete=mo... | 31.994083 | 79 | 0.62567 | """ Data model and data access methods for Candles.
"""
import pytz
from core.models.instruments import Instrument
from django.db import models
class Candle(models.Model):
""" Candle data model.
"""
# pylint: disable=too-many-instance-attributes
instrument = models.ForeignKey(Instrument, on_delete=mo... | 0 | 64 | 27 |
40e01bc00a83ff41fbf3dca04cf9b0eb07326e3a | 14,663 | py | Python | models/Transformers/BertModel_backup.py | suhasgupta791/mids-w251-final-project | aa1ef80685c6d9b5fc8a444e438078150cc0d96c | [
"Apache-2.0"
] | null | null | null | models/Transformers/BertModel_backup.py | suhasgupta791/mids-w251-final-project | aa1ef80685c6d9b5fc8a444e438078150cc0d96c | [
"Apache-2.0"
] | null | null | null | models/Transformers/BertModel_backup.py | suhasgupta791/mids-w251-final-project | aa1ef80685c6d9b5fc8a444e438078150cc0d96c | [
"Apache-2.0"
] | 1 | 2020-02-14T01:10:43.000Z | 2020-02-14T01:10:43.000Z | #!/usr/bin/env python
# coding: utf-8
import itertools
import random
import numpy as np
import sys, os
import pandas as pd
import torch
from torchsummary import summary
from torchtext import data
import torch.nn as nn
import torch.utils.data
from torch.utils.data import Dataset, TensorDataset,DataLoader, RandomSample... | 47.14791 | 156 | 0.613994 | #!/usr/bin/env python
# coding: utf-8
import itertools
import random
import numpy as np
import sys, os
import pandas as pd
import torch
from torchsummary import summary
from torchtext import data
import torch.nn as nn
import torch.utils.data
from torch.utils.data import Dataset, TensorDataset,DataLoader, RandomSample... | 11,566 | 1,677 | 22 |
e0179e878f7eca8bff86090f5fe6aea6db8c2820 | 25,793 | py | Python | acoular/tbeamform.py | ndimubanzisenga/acoular | c7abace657d2602f9a4e9d2e4e1fabe44ec3927b | [
"BSD-3-Clause"
] | 1 | 2019-08-30T22:45:09.000Z | 2019-08-30T22:45:09.000Z | acoular/tbeamform.py | ndimubanzisenga/acoular | c7abace657d2602f9a4e9d2e4e1fabe44ec3927b | [
"BSD-3-Clause"
] | null | null | null | acoular/tbeamform.py | ndimubanzisenga/acoular | c7abace657d2602f9a4e9d2e4e1fabe44ec3927b | [
"BSD-3-Clause"
] | 1 | 2019-08-30T03:29:09.000Z | 2019-08-30T03:29:09.000Z | # -*- coding: utf-8 -*-
#pylint: disable-msg=E0611, E1101, C0103, R0901, R0902, R0903, R0904, W0232
#------------------------------------------------------------------------------
# Copyright (c) 2007-2014, Acoular Development Team.
#------------------------------------------------------------------------------
"""Impl... | 37.435414 | 91 | 0.541426 | # -*- coding: utf-8 -*-
#pylint: disable-msg=E0611, E1101, C0103, R0901, R0902, R0903, R0904, W0232
#------------------------------------------------------------------------------
# Copyright (c) 2007-2014, Acoular Development Team.
#------------------------------------------------------------------------------
"""Impl... | 317 | 0 | 208 |
2aec0d6638ad1f50011ab2d5daffdf486d01bf2e | 774 | py | Python | src/classifier/bin.py | Glavin001/IssueBot | 4dfb31bda009e254b38dc8394669f7debeac65a4 | [
"MIT"
] | 15 | 2016-06-08T02:21:19.000Z | 2019-10-16T19:14:41.000Z | src/classifier/bin.py | Glavin001/IssueBot | 4dfb31bda009e254b38dc8394669f7debeac65a4 | [
"MIT"
] | 23 | 2015-03-15T04:35:33.000Z | 2019-01-18T15:38:31.000Z | src/classifier/bin.py | Glavin001/IssueBot | 4dfb31bda009e254b38dc8394669f7debeac65a4 | [
"MIT"
] | 7 | 2015-06-16T19:35:21.000Z | 2021-08-09T06:13:16.000Z | # Dependencies
import sys, json
import classifier
ignore_labels = ['duplicate', 'in-progress', 'pending-publication', 'published', 'waiting-for-user-information', 'high priority']
# simple JSON echo script
for line in sys.stdin:
payload = json.loads(line)
( action, params ) = payload
results = {}
if a... | 33.652174 | 129 | 0.674419 | # Dependencies
import sys, json
import classifier
ignore_labels = ['duplicate', 'in-progress', 'pending-publication', 'published', 'waiting-for-user-information', 'high priority']
# simple JSON echo script
for line in sys.stdin:
payload = json.loads(line)
( action, params ) = payload
results = {}
if a... | 0 | 0 | 0 |
d8da40a9c00637fbb4cc02915ca28a22d0d1e041 | 462 | py | Python | tests/test_dash_compoment_utils.py | robpoll/webviz-config | 220a4ade8d2a8f5351a302080707e28e6d216cb5 | [
"MIT"
] | null | null | null | tests/test_dash_compoment_utils.py | robpoll/webviz-config | 220a4ade8d2a8f5351a302080707e28e6d216cb5 | [
"MIT"
] | null | null | null | tests/test_dash_compoment_utils.py | robpoll/webviz-config | 220a4ade8d2a8f5351a302080707e28e6d216cb5 | [
"MIT"
] | null | null | null | import pytest
from webviz_config.utils._dash_component_utils import calculate_slider_step
@pytest.mark.parametrize(
"min_value,max_value,steps,res",
[
(5, 10, 100, 0.01),
(-10, -5, 100, 0.01),
(-10, 10, 100, 0.1)
]
)
| 22 | 75 | 0.621212 | import pytest
from webviz_config.utils._dash_component_utils import calculate_slider_step
@pytest.mark.parametrize(
"min_value,max_value,steps,res",
[
(5, 10, 100, 0.01),
(-10, -5, 100, 0.01),
(-10, 10, 100, 0.1)
]
)
def test_calculate_slider_step(min_value, max_value, steps, res)... | 184 | 0 | 22 |
f48ac06ade6c3699af7d7457c6a52059497ed0d7 | 31,685 | py | Python | data/crud.py | delta-reporter/delta-core | e8fdcf01d3fd246c08fa30bbed84d66a85099167 | [
"Apache-2.0"
] | 1 | 2021-03-12T10:55:48.000Z | 2021-03-12T10:55:48.000Z | data/crud.py | delta-reporter/delta-core | e8fdcf01d3fd246c08fa30bbed84d66a85099167 | [
"Apache-2.0"
] | 29 | 2020-04-20T10:20:20.000Z | 2021-06-04T10:17:17.000Z | data/crud.py | delta-reporter/delta-core | e8fdcf01d3fd246c08fa30bbed84d66a85099167 | [
"Apache-2.0"
] | 3 | 2020-05-25T14:43:47.000Z | 2021-09-02T15:27:31.000Z | import models
import datetime
from app import db
from data import constants
from logzero import logger
from sqlalchemy import exc
from sqlalchemy.sql import func
from data.subqueries import TestCounts
import re
import os
import pytz
utc = pytz.UTC
| 33.108673 | 98 | 0.59716 | import models
import datetime
from app import db
from data import constants
from logzero import logger
from sqlalchemy import exc
from sqlalchemy.sql import func
from data.subqueries import TestCounts
import re
import os
import pytz
utc = pytz.UTC
def session_commit():
try:
db.session.commit()
except... | 28,834 | 2,482 | 115 |
746790b2f99b3eeda9ba31ceed4b0eb4232aa515 | 59 | py | Python | settings.py | joevgear/test_rail_util | fb5e6d24798025de47e12499921d533286e64cf8 | [
"MIT"
] | null | null | null | settings.py | joevgear/test_rail_util | fb5e6d24798025de47e12499921d533286e64cf8 | [
"MIT"
] | null | null | null | settings.py | joevgear/test_rail_util | fb5e6d24798025de47e12499921d533286e64cf8 | [
"MIT"
] | null | null | null | TESTRAIL_API_TOKEN = ""
TESTRAIL_URL = ""
TESTRAIL_PWD = "" | 19.666667 | 23 | 0.711864 | TESTRAIL_API_TOKEN = ""
TESTRAIL_URL = ""
TESTRAIL_PWD = "" | 0 | 0 | 0 |
dc0db130e806210874050218cce2f5ab9cc337fb | 45,500 | py | Python | experiment_setup.py | cambridgeltl/link-prediction_with_deep-learning | ff227fcc20ffa5e75ae456d1e8d533fd8204635d | [
"MIT"
] | 28 | 2017-11-17T16:36:23.000Z | 2022-01-06T12:30:47.000Z | experiment_setup.py | cambridgeltl/link-prediction_with_deep-learning | ff227fcc20ffa5e75ae456d1e8d533fd8204635d | [
"MIT"
] | 2 | 2019-12-30T18:22:41.000Z | 2020-04-15T07:40:35.000Z | experiment_setup.py | cambridgeltl/link-prediction_with_deep-learning | ff227fcc20ffa5e75ae456d1e8d533fd8204635d | [
"MIT"
] | 15 | 2018-06-07T13:09:53.000Z | 2021-03-07T07:27:33.000Z | import sys
import csv
import random
"""
Sets up the data for the Link Prediction experiment.
Given the raw data file, it: 1)removes a specified amount of edges for representation induction, 2) creates a specified amount of negative examples from the remaining edges,
3) splits the positive and negative examples into tr... | 46.571136 | 525 | 0.594396 | import sys
import csv
import random
"""
Sets up the data for the Link Prediction experiment.
Given the raw data file, it: 1)removes a specified amount of edges for representation induction, 2) creates a specified amount of negative examples from the remaining edges,
3) splits the positive and negative examples into tr... | 44,573 | 0 | 309 |
4605f51ceb7bfa7b5d4f7657c9b428121e83d39b | 784 | py | Python | tools/lines.py | mamaddeveloper/teleadmin | a5823a7d27f7304825757a1e3cc7a5f50b5534ec | [
"MIT"
] | null | null | null | tools/lines.py | mamaddeveloper/teleadmin | a5823a7d27f7304825757a1e3cc7a5f50b5534ec | [
"MIT"
] | null | null | null | tools/lines.py | mamaddeveloper/teleadmin | a5823a7d27f7304825757a1e3cc7a5f50b5534ec | [
"MIT"
] | null | null | null | import random
import codecs
| 26.133333 | 97 | 0.612245 | import random
import codecs
class LinesAbstract:
def __init__(self, path_or_list):
if isinstance(path_or_list, str):
self.lines = list([line.strip() for line in codecs.open(path_or_list, "r", "utf-8")])
else:
self.lines = list(path_or_list)
self.max = len(self.lines)... | 540 | 15 | 201 |
e57b119c7f3bb96c441604c0b54c53af20889096 | 526 | py | Python | intro_list.py | BeenashPervaiz/Command_Line_Task | a603fbdd06717ff157ecd72881d08329413fd82c | [
"MIT"
] | null | null | null | intro_list.py | BeenashPervaiz/Command_Line_Task | a603fbdd06717ff157ecd72881d08329413fd82c | [
"MIT"
] | null | null | null | intro_list.py | BeenashPervaiz/Command_Line_Task | a603fbdd06717ff157ecd72881d08329413fd82c | [
"MIT"
] | null | null | null | #list ----> we store int,float,string..
#ordered collection of item --->DAta structure
numbers = [1, 2, 3, 4, 5]
print(numbers)
print(numbers[2])#we can also access by indexing
words = ["Beenash", 'Pervaiz', "Hanan"]
print(words)
print(words[:2]) # by slicing
mixed = [1, 2, 3, 4, "five", "six",2.5, None]
print(mixed)... | 26.3 | 50 | 0.665399 | #list ----> we store int,float,string..
#ordered collection of item --->DAta structure
numbers = [1, 2, 3, 4, 5]
print(numbers)
print(numbers[2])#we can also access by indexing
words = ["Beenash", 'Pervaiz', "Hanan"]
print(words)
print(words[:2]) # by slicing
mixed = [1, 2, 3, 4, "five", "six",2.5, None]
print(mixed)... | 0 | 0 | 0 |
8967e76251d4e2585ac4bb6805bc0086542f758a | 136 | py | Python | lms_aadi_postgres/contacts/contacts_controllers/contacts_delete.py | hcmuleva/personal-profile | 051b5a2f36b927951691f48abe584beb8bc25440 | [
"MIT"
] | null | null | null | lms_aadi_postgres/contacts/contacts_controllers/contacts_delete.py | hcmuleva/personal-profile | 051b5a2f36b927951691f48abe584beb8bc25440 | [
"MIT"
] | 3 | 2020-07-13T17:46:32.000Z | 2020-07-26T10:30:59.000Z | lms_aadi_postgres/contacts/contacts_controllers/contacts_delete.py | hcmuleva/personal-profile | 051b5a2f36b927951691f48abe584beb8bc25440 | [
"MIT"
] | null | null | null | from contacts.contacts_modules import delete_contact
to_delete = delete_contact.DeleteContact()
delete = to_delete.delete_contact("1")
| 27.2 | 52 | 0.838235 | from contacts.contacts_modules import delete_contact
to_delete = delete_contact.DeleteContact()
delete = to_delete.delete_contact("1")
| 0 | 0 | 0 |
7a7177762b8c827b4e6e320a52cbf73bac71fbbc | 9,322 | py | Python | autolung/main_window.py | jcalendo/autolung | 9a3a10d2f4d5618e91d7c805b04211faa6f54300 | [
"MIT"
] | null | null | null | autolung/main_window.py | jcalendo/autolung | 9a3a10d2f4d5618e91d7c805b04211faa6f54300 | [
"MIT"
] | null | null | null | autolung/main_window.py | jcalendo/autolung | 9a3a10d2f4d5618e91d7c805b04211faa6f54300 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.12.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
| 56.49697 | 201 | 0.695559 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.12.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
... | 8,977 | 7 | 81 |
5ed2b6d22c8702f6b6e62de9b35b38767fb15a11 | 3,372 | py | Python | IoT_Web/iotweb/views/devices_view.py | ertis-research/reliable-iot | c7a1f6bb69099797e2136522dbdda94c2e6a4895 | [
"MIT"
] | 1 | 2019-04-26T10:28:57.000Z | 2019-04-26T10:28:57.000Z | IoT_Web/iotweb/views/devices_view.py | ertis-research/reliable-iot | c7a1f6bb69099797e2136522dbdda94c2e6a4895 | [
"MIT"
] | null | null | null | IoT_Web/iotweb/views/devices_view.py | ertis-research/reliable-iot | c7a1f6bb69099797e2136522dbdda94c2e6a4895 | [
"MIT"
] | 1 | 2019-04-26T10:29:35.000Z | 2019-04-26T10:29:35.000Z | from django.shortcuts import redirect
from django.http import HttpResponse
from django.template import loader
from http.server import HTTPStatus
from .User import User
import iotweb.views.urls_and_messages as UM
import requests
import json
def devices(request, shdw_id):
"""
GET request: renders the physical ... | 39.670588 | 93 | 0.577995 | from django.shortcuts import redirect
from django.http import HttpResponse
from django.template import loader
from http.server import HTTPStatus
from .User import User
import iotweb.views.urls_and_messages as UM
import requests
import json
def devices(request, shdw_id):
"""
GET request: renders the physical ... | 0 | 0 | 0 |
3ee833341127b144f309c6b92f9f4b2ca5b72308 | 2,786 | py | Python | mail_editor/helpers.py | maykinmedia/maykin-email-templates | 946538cf07e8fbb6df577fe5ea22b970bf54b4a2 | [
"BSD-3-Clause"
] | 4 | 2019-03-11T04:36:05.000Z | 2021-08-13T07:58:53.000Z | mail_editor/helpers.py | maykinmedia/maykin-email-templates | 946538cf07e8fbb6df577fe5ea22b970bf54b4a2 | [
"BSD-3-Clause"
] | 15 | 2017-03-02T12:16:20.000Z | 2022-01-21T15:03:44.000Z | mail_editor/helpers.py | maykinmedia/maykin-email-templates | 946538cf07e8fbb6df577fe5ea22b970bf54b4a2 | [
"BSD-3-Clause"
] | 3 | 2019-09-29T05:45:26.000Z | 2020-08-20T03:15:17.000Z | import logging
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.template import loader
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from .models import MailTemplate
try:
from django.template.exception... | 31.303371 | 122 | 0.714645 | import logging
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.template import loader
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from .models import MailTemplate
try:
from django.template.exception... | 2,157 | 0 | 115 |
9f358abb718b928d28ae4fa0e34eca5edd3395b9 | 2,547 | py | Python | Dell PowerVault MD32xxi/md32xx.py | tomaprzem/zabbix | 8eb46c72393636e919ac70e1c75f051d9ad04e3d | [
"MIT"
] | null | null | null | Dell PowerVault MD32xxi/md32xx.py | tomaprzem/zabbix | 8eb46c72393636e919ac70e1c75f051d9ad04e3d | [
"MIT"
] | null | null | null | Dell PowerVault MD32xxi/md32xx.py | tomaprzem/zabbix | 8eb46c72393636e919ac70e1c75f051d9ad04e3d | [
"MIT"
] | null | null | null | import subprocess
import sys
import getopt
import json
from pyzabbix import ZabbixMetric, ZabbixSender
ipa = ''
ipb = ''
host = ''
try:
opts, args = getopt.getopt(sys.argv[1:], "ha:b:n:")
except getopt.GetoptError:
print 'md32xx.py -a <IPControlerA> -b <IPControlerB> -n <HostNameInZabbix>'
sys.exit(2)
for o... | 41.754098 | 151 | 0.598351 | import subprocess
import sys
import getopt
import json
from pyzabbix import ZabbixMetric, ZabbixSender
ipa = ''
ipb = ''
host = ''
try:
opts, args = getopt.getopt(sys.argv[1:], "ha:b:n:")
except getopt.GetoptError:
print 'md32xx.py -a <IPControlerA> -b <IPControlerB> -n <HostNameInZabbix>'
sys.exit(2)
for o... | 0 | 0 | 0 |
97789f2d81d078c1154b5841a8595992e15aa21b | 3,331 | py | Python | spd-2.4/twitter_handle.py | Sukhrobjon/career-lab | 67bc38c0eb3b47248157f618cb34ed2bdd44fc78 | [
"MIT"
] | null | null | null | spd-2.4/twitter_handle.py | Sukhrobjon/career-lab | 67bc38c0eb3b47248157f618cb34ed2bdd44fc78 | [
"MIT"
] | null | null | null | spd-2.4/twitter_handle.py | Sukhrobjon/career-lab | 67bc38c0eb3b47248157f618cb34ed2bdd44fc78 | [
"MIT"
] | null | null | null | from heapq import nlargest
# NOTE: this solution assumes the handles are only english letters
handles = ['DogeCoin', 'YangGang', 'HodlForLife',
'fakeDonaldDrumpf', 'GodIsLove', 'BernieOrBust']
new_user = 'iLoveDogs'
obj = SimilarAccounts()
result1 = obj.make_anagram(new_user)
result2 = obj.make_anagram('D... | 32.339806 | 84 | 0.600721 | from heapq import nlargest
class SimilarAccounts():
def suggest(self, new_user: str, handles: list, k: int = 2):
"""
Returns the two most similar account handles associated with
new_user handle
Args:
new_user(str): New user's handle
handles(list... | 545 | 2,175 | 23 |
5eb550b12cff3701f85e02e56962cdab42e7a5cf | 6,175 | py | Python | rfsoc_qpsk/dict_widget.py | louisliuwei/rfsoc_qpsk | 53aaced242367b0ac5dd4f629f132f158095d83f | [
"BSD-3-Clause"
] | 1 | 2020-02-25T01:16:41.000Z | 2020-02-25T01:16:41.000Z | signal_gen/dict_widget.py | adriankaisinclair/signal_gen_proj | ecad285b367bca7e4dbc0fbf7059e1dcef6778e8 | [
"BSD-3-Clause"
] | null | null | null | signal_gen/dict_widget.py | adriankaisinclair/signal_gen_proj | ecad285b367bca7e4dbc0fbf7059e1dcef6778e8 | [
"BSD-3-Clause"
] | null | null | null | """Configuration data container with interactive ipywidgets GUI"""
import json
import ipywidgets
import jsonschema
class DictWidget():
"""Container class for configuration data
Constructed from a JSON Schema. Use like a dictionary to store and retrieve configuration data.
Will also create a ipywidget i... | 37.652439 | 120 | 0.594818 | """Configuration data container with interactive ipywidgets GUI"""
import json
import ipywidgets
import jsonschema
class DictWidget():
"""Container class for configuration data
Constructed from a JSON Schema. Use like a dictionary to store and retrieve configuration data.
Will also create a ipywidget i... | 78 | 0 | 27 |
68ec29b122262b30ff0938589a6d290ac5c9c5f2 | 83 | py | Python | nepali_company_registrar/__init__.py | girisagar46/nepal-company-registrar | 09e0bf2e5f5f2ed43482d7148ddfd22d84a8000f | [
"MIT"
] | null | null | null | nepali_company_registrar/__init__.py | girisagar46/nepal-company-registrar | 09e0bf2e5f5f2ed43482d7148ddfd22d84a8000f | [
"MIT"
] | 3 | 2020-05-02T16:04:17.000Z | 2021-12-13T20:39:06.000Z | nepali_company_registrar/__init__.py | girisagar46/nepal-company-registrar | 09e0bf2e5f5f2ed43482d7148ddfd22d84a8000f | [
"MIT"
] | 2 | 2020-05-02T15:47:13.000Z | 2020-05-04T15:19:47.000Z | from nepali_company_registrar.nepal_company_registrar import NepalCompanyRegistrar
| 41.5 | 82 | 0.939759 | from nepali_company_registrar.nepal_company_registrar import NepalCompanyRegistrar
| 0 | 0 | 0 |
e1dc6ae2165d37553a1c4ef3334ea49ec6b9f0af | 6,605 | py | Python | bt_ig/igdata.py | femtotrader/bt-ig-store | 3eb2716b0ee2bc427c5e7b49bfb2661e97e10e02 | [
"MIT"
] | 1 | 2017-11-07T12:07:45.000Z | 2017-11-07T12:07:45.000Z | bt_ig/igdata.py | femtotrader/bt-ig-store | 3eb2716b0ee2bc427c5e7b49bfb2661e97e10e02 | [
"MIT"
] | null | null | null | bt_ig/igdata.py | femtotrader/bt-ig-store | 3eb2716b0ee2bc427c5e7b49bfb2661e97e10e02 | [
"MIT"
] | 1 | 2021-06-14T15:37:05.000Z | 2021-06-14T15:37:05.000Z | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from datetime import datetime, timedelta
from backtrader.feed import DataBase
from backtrader import TimeFrame, date2num, num2date
from backtrader.utils.py3 import (integer_types, queue, string_types,
... | 31.303318 | 86 | 0.563967 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from datetime import datetime, timedelta
from backtrader.feed import DataBase
from backtrader import TimeFrame, date2num, num2date
from backtrader.utils.py3 import (integer_types, queue, string_types,
... | 1,874 | 277 | 158 |
58b7c6c0c929dbb5526611beacb304993639d923 | 3,750 | py | Python | modules/photons_products/lifx.py | Djelibeybi/photons | bc0aa91771d8e88fd3c691fb58f18cb876f292ec | [
"MIT"
] | 51 | 2020-07-03T08:34:48.000Z | 2022-03-16T10:56:08.000Z | modules/photons_products/lifx.py | delfick/photons | bc0aa91771d8e88fd3c691fb58f18cb876f292ec | [
"MIT"
] | 81 | 2020-07-03T08:13:59.000Z | 2022-03-31T23:02:54.000Z | modules/photons_products/lifx.py | Djelibeybi/photons | bc0aa91771d8e88fd3c691fb58f18cb876f292ec | [
"MIT"
] | 8 | 2020-07-24T23:48:20.000Z | 2021-05-24T17:20:16.000Z | from photons_products.base import Product, Capability, CapabilityValue
from photons_products.enums import VendorRegistry, Zones, Family
from photons_products import conditions as cond
class Capability(Capability):
"""
.. attribute:: is_light
Is this device a light
.. attribute:: zones
Th... | 27.985075 | 107 | 0.651467 | from photons_products.base import Product, Capability, CapabilityValue
from photons_products.enums import VendorRegistry, Zones, Family
from photons_products import conditions as cond
class Product(Product):
vendor = VendorRegistry.LIFX
class Capability(Capability):
"""
.. attribute:: is_light
I... | 576 | 313 | 73 |
06cd1a03dea8936803ea80d1da734e2a983cdfda | 676 | py | Python | creat_price_data_datebase.py | brucewong0516/bitfinex_data | f29a7073831c6dd63d5fcfc9d3ed0d2679268f9c | [
"MIT"
] | 2 | 2019-01-03T11:38:39.000Z | 2019-04-11T14:03:25.000Z | creat_price_data_datebase.py | brucewong0516/bitfinex_data | f29a7073831c6dd63d5fcfc9d3ed0d2679268f9c | [
"MIT"
] | null | null | null | creat_price_data_datebase.py | brucewong0516/bitfinex_data | f29a7073831c6dd63d5fcfc9d3ed0d2679268f9c | [
"MIT"
] | 1 | 2019-04-11T14:03:33.000Z | 2019-04-11T14:03:33.000Z | # 若中断了直接再次运行即可
# 爬取历史数据建立数据库
if __name__ == '__main__':
from crypto_1min import Bitfinex_api
import threading
initially_urls_queue = Bitfinex_api().create_initially_urls_queue()
# Bitfinex_api().get_all_symbol_detail()
threads = [thread() for i in range(50)]
for thread in threads:
... | 32.190476 | 94 | 0.656805 | # 若中断了直接再次运行即可
# 爬取历史数据建立数据库
if __name__ == '__main__':
from crypto_1min import Bitfinex_api
import threading
initially_urls_queue = Bitfinex_api().create_initially_urls_queue()
# Bitfinex_api().get_all_symbol_detail()
class thread(threading.Thread):
def __init__(self):
... | 184 | 10 | 93 |
89c49cc5089a630ef39091edc5eb321e74dc586b | 1,605 | py | Python | scraping/jobs/stock_scraper.py | nmccn/ddd | b4347c91c8776bca8dacc0d4372122b94e6ae4d5 | [
"MIT"
] | null | null | null | scraping/jobs/stock_scraper.py | nmccn/ddd | b4347c91c8776bca8dacc0d4372122b94e6ae4d5 | [
"MIT"
] | null | null | null | scraping/jobs/stock_scraper.py | nmccn/ddd | b4347c91c8776bca8dacc0d4372122b94e6ae4d5 | [
"MIT"
] | null | null | null | #! python3
import datetime as dt
import requests
import pandas as pd
import lxml.html as lh
'''' Class containing the code that scrapes the stock ticker/information from various stock & crypto sites'''
class StockScraper:
''' This is a function that scrapes a table from a provided web page.'''
| 23.602941 | 124 | 0.527103 | #! python3
import datetime as dt
import requests
import pandas as pd
import lxml.html as lh
'''' Class containing the code that scrapes the stock ticker/information from various stock & crypto sites'''
class StockScraper:
def __init__(self, source, stock_or_crypto):
self.source = source
self.s... | 1,231 | 0 | 57 |
aa46a81ce18f9b351c934d3837daf97bc528b371 | 4,307 | py | Python | 2-Python_Scripts/TrojControl.py | mdodici/trojan-WD-pollution | ec79a96f0d9517a53df4c82ca1be0d5d38f3346b | [
"MIT"
] | null | null | null | 2-Python_Scripts/TrojControl.py | mdodici/trojan-WD-pollution | ec79a96f0d9517a53df4c82ca1be0d5d38f3346b | [
"MIT"
] | null | null | null | 2-Python_Scripts/TrojControl.py | mdodici/trojan-WD-pollution | ec79a96f0d9517a53df4c82ca1be0d5d38f3346b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[8]:
import rebound
import numpy as np
###############
### IMPORTS ###
###############
params = np.load('sample_params.npy')
###################
### DEFINITIONS ###
###################
radeg = np.pi/180
############################
############################
####... | 23.664835 | 102 | 0.521941 | #!/usr/bin/env python
# coding: utf-8
# In[8]:
import rebound
import numpy as np
###############
### IMPORTS ###
###############
params = np.load('sample_params.npy')
###################
### DEFINITIONS ###
###################
radeg = np.pi/180
def add_tr(sim, pars):
a = pars[0]
e = pars[1]
c = ... | 348 | 0 | 23 |
db093beb53a7b6ad82a8e1539915f07c674c857e | 22,140 | py | Python | filter_unlabel.py | IMAGR-LTD/noisystudent | c5ae6524c6ba37d3cd133107c21250c4b8fb7a28 | [
"Apache-2.0"
] | 683 | 2020-02-14T20:50:53.000Z | 2022-03-30T06:02:54.000Z | filter_unlabel.py | IMAGR-LTD/noisystudent | c5ae6524c6ba37d3cd133107c21250c4b8fb7a28 | [
"Apache-2.0"
] | 11 | 2020-06-22T09:03:33.000Z | 2021-11-02T16:15:00.000Z | filter_unlabel.py | IMAGR-LTD/noisystudent | c5ae6524c6ba37d3cd133107c21250c4b8fb7a28 | [
"Apache-2.0"
] | 102 | 2020-02-17T10:30:41.000Z | 2022-03-25T05:38:51.000Z | # coding=utf-8
# Copyright 2019 The Google NoisyStudent Team 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... | 34.866142 | 145 | 0.652304 | # coding=utf-8
# Copyright 2019 The Google NoisyStudent Team 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... | 19,455 | 0 | 299 |
c7a57ea8bd5bf8926a8b9423d40481685fc17c8b | 193 | py | Python | PythonExercicios/ex060-calculo-do-fatorial-usando-for.py | ArthurAlbuquerquee/exercicios-python-cev | ba64d3a025731aae5e238c7cb469917420b7901e | [
"MIT"
] | null | null | null | PythonExercicios/ex060-calculo-do-fatorial-usando-for.py | ArthurAlbuquerquee/exercicios-python-cev | ba64d3a025731aae5e238c7cb469917420b7901e | [
"MIT"
] | null | null | null | PythonExercicios/ex060-calculo-do-fatorial-usando-for.py | ArthurAlbuquerquee/exercicios-python-cev | ba64d3a025731aae5e238c7cb469917420b7901e | [
"MIT"
] | null | null | null | n = int(input('Digite um número para calcular o fatorial: '))
f = 1
for c in range(n, 0, -1):
print(f'{c}', end='')
print(' x ' if c > 1 else ' = ', end='')
f = f * c
print(f'{f}')
| 24.125 | 61 | 0.502591 | n = int(input('Digite um número para calcular o fatorial: '))
f = 1
for c in range(n, 0, -1):
print(f'{c}', end='')
print(' x ' if c > 1 else ' = ', end='')
f = f * c
print(f'{f}')
| 0 | 0 | 0 |
d462a20b6ef7379120157d79baf14c2fc027f6cd | 3,966 | py | Python | tests/test_preprocessing.py | MannLabs/alphaviz | 5911f351cf5cd21e2a3fa2a455d1eeb0c43af9cc | [
"Apache-2.0"
] | 6 | 2022-01-27T12:47:31.000Z | 2022-03-10T11:18:03.000Z | tests/test_preprocessing.py | MannLabs/alphaviz | 5911f351cf5cd21e2a3fa2a455d1eeb0c43af9cc | [
"Apache-2.0"
] | 7 | 2022-01-27T14:34:15.000Z | 2022-03-15T12:16:58.000Z | tests/test_preprocessing.py | MannLabs/alphaviz | 5911f351cf5cd21e2a3fa2a455d1eeb0c43af9cc | [
"Apache-2.0"
] | null | null | null | #!python
"""
This module provides pytest tests for the functions from preprocessing.py file
"""
import pytest
import alphaviz.preprocessing as preproc
# def test_preprocess_ckg_output():
# ckg_output_string_correct = "~Q92934;~Q15149"
# ckg_output_string_correct_2 = " ~Q92934; ~Q15149"
# ckg_output_stri... | 47.783133 | 131 | 0.736258 | #!python
"""
This module provides pytest tests for the functions from preprocessing.py file
"""
import pytest
import alphaviz.preprocessing as preproc
def test_get_mq_unique_proteins():
mq_analysis_file = "../test_data/evidence.txt"
proteins = preproc.get_mq_unique_proteins(mq_analysis_file)
assert len(... | 2,870 | 0 | 92 |
4af483d9d5f2574d4667927db0ef0fd8d25f54f0 | 11,197 | py | Python | smpp/pdu_builder.py | komuW/smpp_server | 10ef5c2ebc09e2ef88bdd62c55a4280a187d1eb2 | [
"BSD-3-Clause"
] | 1 | 2016-05-18T16:57:20.000Z | 2016-05-18T16:57:20.000Z | smpp/pdu_builder.py | komuW/smpp_server | 10ef5c2ebc09e2ef88bdd62c55a4280a187d1eb2 | [
"BSD-3-Clause"
] | null | null | null | smpp/pdu_builder.py | komuW/smpp_server | 10ef5c2ebc09e2ef88bdd62c55a4280a187d1eb2 | [
"BSD-3-Clause"
] | null | null | null | from . import *
# bind = BindTransmitter(system_id='test_id', password='abc123')
# print bind.get_obj()
# print bind.get_hex()
# print bind.get_bin()
# #print json.dumps(bind.get_obj(), indent=4, sort_keys=True)
# #print json.dumps(decode_pdu(bind.get_hex()), indent=4, sort_keys=True)
# print json... | 45.149194 | 117 | 0.676163 | from . import *
class PDU(object):
def __init__(self, command_id, command_status, sequence_number, **kwargs):
super(PDU, self).__init__()
self.obj = {}
self.obj['header'] = {}
self.obj['header']['command_length'] = 0
self.obj['header']['command_id'] = command_id
self... | 9,200 | 51 | 1,326 |
67a6499830b7f74583e2c66c04f86175dac0b79b | 24,402 | py | Python | lib/catnip/preparation.py | MetOffice/CATNIP | 82a800d000513860077735eb115b060782a4815a | [
"BSD-3-Clause"
] | 2 | 2020-09-28T14:03:27.000Z | 2020-11-17T14:25:18.000Z | lib/catnip/preparation.py | MetOffice/CATNIP | 82a800d000513860077735eb115b060782a4815a | [
"BSD-3-Clause"
] | 26 | 2020-10-23T08:34:16.000Z | 2021-04-01T14:32:12.000Z | lib/catnip/preparation.py | MetOffice/CATNIP | 82a800d000513860077735eb115b060782a4815a | [
"BSD-3-Clause"
] | 2 | 2020-11-20T17:08:25.000Z | 2021-04-11T06:10:29.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2020 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 35.263006 | 87 | 0.651586 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2020 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 0 | 0 | 0 |
0dd32e9ca2c7ce0add00ea94a0758f176b038de9 | 27,038 | py | Python | src/summarization/metric/rouge_metric.py | youngerous/kobart-voice-summarization | bf48edea602c0661d638f0ed6f4a35c2ced4009f | [
"Apache-2.0"
] | 8 | 2021-05-16T05:40:29.000Z | 2022-03-14T08:32:54.000Z | src/summarization/metric/rouge_metric.py | youngerous/kobart-voice-summarization | bf48edea602c0661d638f0ed6f4a35c2ced4009f | [
"Apache-2.0"
] | null | null | null | src/summarization/metric/rouge_metric.py | youngerous/kobart-voice-summarization | bf48edea602c0661d638f0ed6f4a35c2ced4009f | [
"Apache-2.0"
] | 3 | 2021-08-09T08:06:24.000Z | 2021-11-29T05:04:56.000Z | """
Ref: https://dacon.io/competitions/official/235673/talkboard/401911?page=1&dtype=recent
"""
import os
import re
import platform
import itertools
import collections
import pkg_resources # pip install py-rouge
from io import open
if platform.system() == "Windows":
try:
from eunjeon import Mecab
exc... | 38.625714 | 97 | 0.492529 | """
Ref: https://dacon.io/competitions/official/235673/talkboard/401911?page=1&dtype=recent
"""
import os
import re
import platform
import itertools
import collections
import pkg_resources # pip install py-rouge
from io import open
if platform.system() == "Windows":
try:
from eunjeon import Mecab
exc... | 25,756 | 837 | 23 |
75f00237a492774445faf7cd823f0046fc10ff0e | 1,953 | py | Python | data_processing/find_entity.py | plista/news_knowledge_tree | 7b31a6faba1f1f9b267386a75766e435fc4e2674 | [
"MIT"
] | null | null | null | data_processing/find_entity.py | plista/news_knowledge_tree | 7b31a6faba1f1f9b267386a75766e435fc4e2674 | [
"MIT"
] | 1 | 2019-12-16T18:42:53.000Z | 2019-12-16T18:42:53.000Z | data_processing/find_entity.py | plista/news_knowledge_tree | 7b31a6faba1f1f9b267386a75766e435fc4e2674 | [
"MIT"
] | null | null | null | import functools
import sys
from typing import Set
import nltk
from flair.data import Sentence
from flair.models import SequenceTagger
from langdetect import detect
@functools.lru_cache(maxsize=1)
def get_tagger(language: str) -> SequenceTagger:
"""Return the tagger needed """
if language == "de":
re... | 26.391892 | 71 | 0.62724 | import functools
import sys
from typing import Set
import nltk
from flair.data import Sentence
from flair.models import SequenceTagger
from langdetect import detect
@functools.lru_cache(maxsize=1)
def get_tagger(language: str) -> SequenceTagger:
"""Return the tagger needed """
if language == "de":
re... | 0 | 0 | 0 |
61180cfa234edf359cd1eae6b1289e74c60f9294 | 1,928 | py | Python | datenguidepy/translation.py | EvgenyGorelov/datenguide-python | 9ff89665149b5cee31bab63b8a7e396b7233cc39 | [
"MIT"
] | 35 | 2019-10-10T17:42:21.000Z | 2021-04-10T08:56:51.000Z | datenguidepy/translation.py | EvgenyGorelov/datenguide-python | 9ff89665149b5cee31bab63b8a7e396b7233cc39 | [
"MIT"
] | 67 | 2019-06-30T08:30:20.000Z | 2021-06-21T12:59:18.000Z | datenguidepy/translation.py | EvgenyGorelov/datenguide-python | 9ff89665149b5cee31bab63b8a7e396b7233cc39 | [
"MIT"
] | 8 | 2019-10-10T21:00:50.000Z | 2021-06-22T11:58:32.000Z | from typing import Dict
from abc import abstractmethod, ABC
from pandas import DataFrame
import json
import os
DEFAULT_TRANSLATION_PROVIDER = SchemaTranslationProvider()
| 31.096774 | 81 | 0.732365 | from typing import Dict
from abc import abstractmethod, ABC
from pandas import DataFrame
import json
import os
class TranslationProvider(ABC):
@abstractmethod
def translate_data_frame_from_german(
self, data_frame: DataFrame, target_language: str
):
pass
@abstractmethod
def trans... | 1,299 | 408 | 46 |
2135004489baa792eeab5ba37016a6ad73478469 | 1,314 | py | Python | src/contexts/kms/computed_data/application/find_one/ComputedDataByKeyAndInputQueryHandler.py | parada3desu/foxy-key-broker | fc95de9e9bfd61c506a9a18aa64c5c9cbeac8a9c | [
"Apache-2.0"
] | null | null | null | src/contexts/kms/computed_data/application/find_one/ComputedDataByKeyAndInputQueryHandler.py | parada3desu/foxy-key-broker | fc95de9e9bfd61c506a9a18aa64c5c9cbeac8a9c | [
"Apache-2.0"
] | null | null | null | src/contexts/kms/computed_data/application/find_one/ComputedDataByKeyAndInputQueryHandler.py | parada3desu/foxy-key-broker | fc95de9e9bfd61c506a9a18aa64c5c9cbeac8a9c | [
"Apache-2.0"
] | null | null | null | from src.contexts.kms.computed_data.application.find_one.ComputedDataByKeyAndInputFinder import \
ComputedDataByKeyAndInputFinder
from src.contexts.kms.computed_data.application.find_one.ComputedDataByKeyAndInputQuery import \
ComputedDataByKeyAndInputQuery
from src.contexts.kms.computed_data.application.find_o... | 50.538462 | 111 | 0.822679 | from src.contexts.kms.computed_data.application.find_one.ComputedDataByKeyAndInputFinder import \
ComputedDataByKeyAndInputFinder
from src.contexts.kms.computed_data.application.find_one.ComputedDataByKeyAndInputQuery import \
ComputedDataByKeyAndInputQuery
from src.contexts.kms.computed_data.application.find_o... | 394 | 185 | 23 |
f7c7181676be11b5c14bd43d99798ed4f03ed80a | 3,952 | py | Python | tempest/tvaultconf.py | KiranPawar72/tempest | 1fef3dd92b083055793065dd0693454735ec2c01 | [
"Apache-2.0"
] | null | null | null | tempest/tvaultconf.py | KiranPawar72/tempest | 1fef3dd92b083055793065dd0693454735ec2c01 | [
"Apache-2.0"
] | null | null | null | tempest/tvaultconf.py | KiranPawar72/tempest | 1fef3dd92b083055793065dd0693454735ec2c01 | [
"Apache-2.0"
] | null | null | null | import apscheduler
from apscheduler.schedulers.blocking import BlockingScheduler
#If you want to cleanup all test resources like vms, volumes, workloads then set
# following cleanup parameter value to True otherwise False
cleanup = True
# pre requisite paramter
pre_req = True
#Test results for reporting
PASS = "PAS... | 34.973451 | 108 | 0.732287 | import apscheduler
from apscheduler.schedulers.blocking import BlockingScheduler
#If you want to cleanup all test resources like vms, volumes, workloads then set
# following cleanup parameter value to True otherwise False
cleanup = True
# pre requisite paramter
pre_req = True
#Test results for reporting
PASS = "PAS... | 0 | 0 | 0 |
ac8a05944dc625fce2bbd415e88698aa71441818 | 2,645 | py | Python | Sketches/MPS/Old/basicswarm.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/MPS/Old/basicswarm.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/MPS/Old/basicswarm.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ve... | 30.056818 | 88 | 0.659357 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ve... | 918 | 127 | 23 |
92e442443eaed77627b9c4c3c3bec21faca2a44c | 678 | py | Python | dart_fss/utils/dataframe.py | dveamer/dart-fss | 1ea6b937f363d604a7da9c03686fba7f66707efa | [
"MIT"
] | 243 | 2019-04-19T09:05:32.000Z | 2022-03-27T10:51:24.000Z | dart_fss/utils/dataframe.py | dveamer/dart-fss | 1ea6b937f363d604a7da9c03686fba7f66707efa | [
"MIT"
] | 80 | 2019-04-20T06:37:44.000Z | 2022-03-25T12:20:47.000Z | dart_fss/utils/dataframe.py | dveamer/dart-fss | 1ea6b937f363d604a7da9c03686fba7f66707efa | [
"MIT"
] | 92 | 2019-04-18T06:19:52.000Z | 2022-03-17T07:43:39.000Z | # -*- coding: utf-8 -*-
from pandas import DataFrame
from typing import List, Tuple
def dataframe_astype(df: DataFrame, columns: List[Tuple[str, type]]):
""" DataFrame Column Type converter
Parameters
----------
df: DataFrame
Pandas DataFrame
columns: list of tuple of str, type
co... | 25.111111 | 86 | 0.588496 | # -*- coding: utf-8 -*-
from pandas import DataFrame
from typing import List, Tuple
def dataframe_astype(df: DataFrame, columns: List[Tuple[str, type]]):
""" DataFrame Column Type converter
Parameters
----------
df: DataFrame
Pandas DataFrame
columns: list of tuple of str, type
co... | 0 | 0 | 0 |
37d19ff1083bb0281e5b6217c9468d8302d267d7 | 20,094 | py | Python | tests/unit/modules/test_timezone.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 5 | 2017-02-07T05:39:29.000Z | 2020-06-13T02:07:33.000Z | tests/unit/modules/test_timezone.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 86 | 2017-01-27T11:54:46.000Z | 2020-05-20T06:25:26.000Z | tests/unit/modules/test_timezone.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 11 | 2017-01-26T19:36:29.000Z | 2021-12-11T07:54:16.000Z | # -*- coding: utf-8 -*-
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
from tempfile import NamedTemporaryFile
import os
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase, skipIf
from tests.support.m... | 43.120172 | 116 | 0.62342 | # -*- coding: utf-8 -*-
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
from tempfile import NamedTemporaryFile
import os
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase, skipIf
from tests.support.m... | 2,046 | 35 | 265 |
60641ef4e63b02e80e53c98c3ee1677bdfba26a8 | 2,308 | py | Python | handwriting_classifier.py | ngp111/digit_classification_keras | 65d6b72d6d38bc257c5cde55d92d2210865f74d6 | [
"MIT"
] | null | null | null | handwriting_classifier.py | ngp111/digit_classification_keras | 65d6b72d6d38bc257c5cde55d92d2210865f74d6 | [
"MIT"
] | null | null | null | handwriting_classifier.py | ngp111/digit_classification_keras | 65d6b72d6d38bc257c5cde55d92d2210865f74d6 | [
"MIT"
] | null | null | null | import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Dropout, Dense, Flatten
import matplotlib.pyplot as plt
import numpy as np
import random
pixel_width = 28
pixel_height = 28
no_of_classes = 10
batch_size = 32
epochs = 10
(features_train, l... | 31.189189 | 94 | 0.737002 | import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Dropout, Dense, Flatten
import matplotlib.pyplot as plt
import numpy as np
import random
def get_label_color(val1, val2):
if val1 == val2:
return 'black'
else:
return 'red'
pixe... | 74 | 0 | 23 |
078a6fe226b1f79db248bb1c1845407854fdbc98 | 673 | py | Python | hw/hw10/tests/q2_1.py | ds-modules/Colab-demo | cccaff13633f8a5ec697cd4aeca9087f2feec2e4 | [
"BSD-3-Clause"
] | null | null | null | hw/hw10/tests/q2_1.py | ds-modules/Colab-demo | cccaff13633f8a5ec697cd4aeca9087f2feec2e4 | [
"BSD-3-Clause"
] | null | null | null | hw/hw10/tests/q2_1.py | ds-modules/Colab-demo | cccaff13633f8a5ec697cd4aeca9087f2feec2e4 | [
"BSD-3-Clause"
] | null | null | null | test = { 'name': 'q2_1',
'points': 1,
'suites': [ { 'cases': [ {'code': '>>> # Make sure you assigned `binary options` to an array;\n>>> type(binary_options) == np.ndarray\nTrue', 'hidden': False, 'locked': False},
{ 'code': '>>> # Should be a two element array of a ... | 61.181818 | 186 | 0.408618 | test = { 'name': 'q2_1',
'points': 1,
'suites': [ { 'cases': [ {'code': '>>> # Make sure you assigned `binary options` to an array;\n>>> type(binary_options) == np.ndarray\nTrue', 'hidden': False, 'locked': False},
{ 'code': '>>> # Should be a two element array of a ... | 0 | 0 | 0 |
9df1ec0fb4cc64dcc907cbc11b4596d5cfc19976 | 383 | py | Python | BFS_Iterative.py | FER-NASP/AdvancedAlgorithms | ce09c50b9d02fac53a09f6f0d0d099fe87aa7354 | [
"MIT"
] | 1 | 2021-12-24T19:30:13.000Z | 2021-12-24T19:30:13.000Z | BFS_Iterative.py | FER-NASP/AdvancedAlgorithms | ce09c50b9d02fac53a09f6f0d0d099fe87aa7354 | [
"MIT"
] | null | null | null | BFS_Iterative.py | FER-NASP/AdvancedAlgorithms | ce09c50b9d02fac53a09f6f0d0d099fe87aa7354 | [
"MIT"
] | null | null | null | import collections
| 20.157895 | 37 | 0.386423 | import collections
def BFS(G):
vis=[]
Q = collections.deque()
for u0 in G:
if u0 not in vis:
Q.append(u0)
vis.append(u0)
while Q:
u=Q.popleft()
for v in G[u]['adj']:
if v not in vis:
vis.... | 339 | 0 | 23 |
3319b793d86371d50aabd94af3fdcfc7754f0115 | 3,646 | py | Python | losses/LSGANLoss.py | NoelShin/LIT | ac08254c6ef2d29f5bb823d79f613b355f286953 | [
"MIT"
] | 1 | 2019-01-23T07:44:47.000Z | 2019-01-23T07:44:47.000Z | losses/LSGANLoss.py | NoelShin/LIT | ac08254c6ef2d29f5bb823d79f613b355f286953 | [
"MIT"
] | null | null | null | losses/LSGANLoss.py | NoelShin/LIT | ac08254c6ef2d29f5bb823d79f613b355f286953 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from .base_loss import Loss
| 40.065934 | 120 | 0.590236 | import torch
import torch.nn as nn
from .base_loss import Loss
class LSGANLoss(Loss):
def __init__(self, opt):
super(LSGANLoss, self).__init__(opt)
self.criterion = nn.MSELoss()
def get_grid(self, tensor, is_real=False):
grid = torch.FloatTensor(tensor.shape).fill_(1.0 if is_real else... | 3,478 | 1 | 103 |
a423a6f16d3d1cb1f60c93cd7d5e53d9405dd725 | 141 | py | Python | autoflow/opt/iterations/__init__.py | auto-flow/autoflow | f5903424ad8694d57741a0bd6dfeaba320ea6517 | [
"BSD-3-Clause"
] | 49 | 2020-04-16T11:17:28.000Z | 2020-05-06T01:32:44.000Z | autoflow/opt/iterations/__init__.py | auto-flow/autoflow | f5903424ad8694d57741a0bd6dfeaba320ea6517 | [
"BSD-3-Clause"
] | null | null | null | autoflow/opt/iterations/__init__.py | auto-flow/autoflow | f5903424ad8694d57741a0bd6dfeaba320ea6517 | [
"BSD-3-Clause"
] | 3 | 2020-04-17T00:53:24.000Z | 2020-04-23T03:04:26.000Z | from .successivehalving import SuccessiveHalving
from .base import WarmStartIteration
from .successiveresampling import SuccessiveResampling
| 35.25 | 54 | 0.893617 | from .successivehalving import SuccessiveHalving
from .base import WarmStartIteration
from .successiveresampling import SuccessiveResampling
| 0 | 0 | 0 |
2faadc4f2c2569527fcf4fe1bfa31ec9ba643355 | 2,278 | py | Python | biblio/mywebsites.py | lokal-profil/isfdb_site | 0ce20d6347849926d4eda961ea9249c31519eea5 | [
"BSD-3-Clause"
] | null | null | null | biblio/mywebsites.py | lokal-profil/isfdb_site | 0ce20d6347849926d4eda961ea9249c31519eea5 | [
"BSD-3-Clause"
] | null | null | null | biblio/mywebsites.py | lokal-profil/isfdb_site | 0ce20d6347849926d4eda961ea9249c31519eea5 | [
"BSD-3-Clause"
] | null | null | null | #!_PYTHONLOC
#
# (C) COPYRIGHT 2009-2019 Ahasuerus
# ALL RIGHTS RESERVED
#
# The copyright notice above does not evidence any actual or
# intended publication of such source code.
#
# Version: $Revision$
# Date: $Date$
import string
import sys
import MySQLdb
from isfdb import *
from comm... | 31.638889 | 155 | 0.610184 | #!_PYTHONLOC
#
# (C) COPYRIGHT 2009-2019 Ahasuerus
# ALL RIGHTS RESERVED
#
# The copyright notice above does not evidence any actual or
# intended publication of such source code.
#
# Version: $Revision$
# Date: $Date$
import string
import sys
import MySQLdb
from isfdb import *
from comm... | 0 | 0 | 0 |
abc1662bafe8b88242e1d6f85d310846facbde58 | 5,427 | py | Python | wpy/ArtifactGenerator.py | dulichan/wpython | 0e8319dd0d9e8d8cb362a6a373a07bc8c2ff5e81 | [
"WTFPL"
] | null | null | null | wpy/ArtifactGenerator.py | dulichan/wpython | 0e8319dd0d9e8d8cb362a6a373a07bc8c2ff5e81 | [
"WTFPL"
] | null | null | null | wpy/ArtifactGenerator.py | dulichan/wpython | 0e8319dd0d9e8d8cb362a6a373a07bc8c2ff5e81 | [
"WTFPL"
] | null | null | null | from pybars import Compiler
import lxml.etree as etree
import collections
from . import Artifact
import os
class ArtifactGenerator(object):
"""Class used to generate artifacts for WSO2"""
"""Generate the artifact based on the passed template location and data"""
def merge(self, a, b, path=None):
"deep merge di... | 36.918367 | 142 | 0.676617 | from pybars import Compiler
import lxml.etree as etree
import collections
from . import Artifact
import os
class ArtifactGenerator(object):
"""Class used to generate artifacts for WSO2"""
def __init__(self):
self.artifactList = []
pass
"""Generate the artifact based on the passed template location and data"""
d... | 1,518 | 0 | 196 |
a0cae71e1c74c50e189d22060e5db50461098c6f | 4,209 | py | Python | early_projects/defi.py | JSBCCA/pythoncode | b7f2af8b0efc2d01d3e4568265eb3a5038a8679f | [
"MIT"
] | null | null | null | early_projects/defi.py | JSBCCA/pythoncode | b7f2af8b0efc2d01d3e4568265eb3a5038a8679f | [
"MIT"
] | null | null | null | early_projects/defi.py | JSBCCA/pythoncode | b7f2af8b0efc2d01d3e4568265eb3a5038a8679f | [
"MIT"
] | null | null | null | from math import pi
import os
import time
# sum([n, n, n...]) adds any number of variables
# print (subtract(8, 3))
# print (multiply(5, 3))
# print (double(7))
# print (triple(5))
# print (divide(8, 4))
# print (half(4))
# print (celsius_conv(94))
c_c = celsius_conv
# print (fahrenheit_conv(49))
# print (p... | 19.307339 | 75 | 0.619625 | from math import pi
import os
import time
# sum([n, n, n...]) adds any number of variables
def add(a, b):
return a + b
def subtract(a, b): # subtracts one number from another
return a - b
# print (subtract(8, 3))
def multiply(a, b): # multiplies two numbers
return a * b
# print (multiply(5, 3))
de... | 2,308 | 0 | 781 |
1d857b0fad333456cb2cdb5bca71530476c6efd6 | 432 | py | Python | fc_passion/db.py | jinShine/fc-passion-page | 1e3af3595318a9ebf325e80869ac4d6c7194d0ff | [
"MIT"
] | 1 | 2020-04-19T02:12:28.000Z | 2020-04-19T02:12:28.000Z | fc_passion/db.py | jinShine/fc-passion-page | 1e3af3595318a9ebf325e80869ac4d6c7194d0ff | [
"MIT"
] | null | null | null | fc_passion/db.py | jinShine/fc-passion-page | 1e3af3595318a9ebf325e80869ac4d6c7194d0ff | [
"MIT"
] | null | null | null | import config
from pymongo import MongoClient
from instagram_api import insta_fetch_feed | 28.8 | 74 | 0.712963 | import config
from pymongo import MongoClient
from instagram_api import insta_fetch_feed
class DB():
def __init__(self, client=None):
self.client = MongoClient(config.MongoDB_URL, 27017)
def fcpassion_db(self):
return self.client.fcpassion
def get_insta_api(self):
instagram_colle... | 250 | -10 | 104 |
382240a294a5586fea04c96c0d1b774719fa869a | 5,495 | py | Python | data_generators/data_generator_cnn.py | Yannick947/person_counting | 4fbad4836369f89e238361498382824ddecf2eae | [
"MIT"
] | 3 | 2020-08-17T08:36:21.000Z | 2021-03-19T22:09:47.000Z | data_generators/data_generator_cnn.py | Yannick947/person_counting | 4fbad4836369f89e238361498382824ddecf2eae | [
"MIT"
] | 7 | 2021-02-02T23:05:11.000Z | 2022-03-12T00:50:33.000Z | data_generators/data_generator_cnn.py | Yannick947/person_counting | 4fbad4836369f89e238361498382824ddecf2eae | [
"MIT"
] | 1 | 2020-08-17T08:36:24.000Z | 2020-08-17T08:36:24.000Z | import os
import pandas as pd
import numpy as np
import math
from random import shuffle
from tensorflow import keras
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from person_counting.data_generators.data_generators import Generator_CSVS
from perso... | 34.130435 | 108 | 0.697543 | import os
import pandas as pd
import numpy as np
import math
from random import shuffle
from tensorflow import keras
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from person_counting.data_generators.data_generators import Generator_CSVS
from perso... | 81 | 0 | 27 |
d5b22ea34f0bbc299fab73839184251258eecd69 | 310 | py | Python | Losses/__init__.py | SimonTheVillain/ActiveStereoNet | 708bddce844998b366be1a1ec8a72a31ccd26f8c | [
"MIT"
] | 17 | 2019-08-23T04:00:32.000Z | 2022-02-06T13:37:02.000Z | Losses/__init__.py | SimonTheVillain/ActiveStereoNet | 708bddce844998b366be1a1ec8a72a31ccd26f8c | [
"MIT"
] | null | null | null | Losses/__init__.py | SimonTheVillain/ActiveStereoNet | 708bddce844998b366be1a1ec8a72a31ccd26f8c | [
"MIT"
] | 7 | 2019-12-20T07:46:41.000Z | 2021-11-01T04:18:19.000Z | from .supervise import *
| 22.142857 | 79 | 0.580645 | from .supervise import *
def get_losses(name, **kwargs):
name = name.lower()
if name == 'rhloss':
loss = RHLoss(**kwargs)
elif name == 'xtloss':
loss = XTLoss(**kwargs)
else:
raise NotImplementedError('Loss [{:s}] is not supported.'.format(name))
return loss
| 262 | 0 | 23 |
97cfb67e2c0a8d318cf1456a02cf8daf9b4214dc | 1,551 | py | Python | beaker/data_model/workspace.py | allenai/beaker-py | 99c8d7f6e9938807ca5405964ef35633a19e8d68 | [
"Apache-2.0"
] | null | null | null | beaker/data_model/workspace.py | allenai/beaker-py | 99c8d7f6e9938807ca5405964ef35633a19e8d68 | [
"Apache-2.0"
] | 20 | 2021-12-16T13:23:07.000Z | 2022-03-31T16:40:02.000Z | beaker/data_model/workspace.py | allenai/beaker-py | 99c8d7f6e9938807ca5405964ef35633a19e8d68 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from enum import Enum
from typing import Dict, List, Optional, Tuple
from .account import Account
from .base import BaseModel
class Permission(str, Enum):
"""
Workspace permission levels.
"""
no_permission = "none"
read = "read"
write = "write"
full_co... | 19.3875 | 58 | 0.68343 | from datetime import datetime
from enum import Enum
from typing import Dict, List, Optional, Tuple
from .account import Account
from .base import BaseModel
class WorkspaceSize(BaseModel):
datasets: int
experiments: int
groups: int
images: int
class Workspace(BaseModel):
id: str
name: str
... | 0 | 1,007 | 207 |
c79ee80443c8e28087163ee0ff092d7379886027 | 11,816 | py | Python | bot/modelv0/state_view.py | gillesdami/python-sc2-bot-manyminds | b44f83018ff287ab3417ed9f7444b55590b89a09 | [
"MIT"
] | 1 | 2019-09-11T08:04:08.000Z | 2019-09-11T08:04:08.000Z | bot/modelv0/state_view.py | gillesdami/python-sc2-bot-manyminds | b44f83018ff287ab3417ed9f7444b55590b89a09 | [
"MIT"
] | null | null | null | bot/modelv0/state_view.py | gillesdami/python-sc2-bot-manyminds | b44f83018ff287ab3417ed9f7444b55590b89a09 | [
"MIT"
] | null | null | null | import math
import numpy as np
from sc2.ids.unit_typeid import UnitTypeId
from sc2.helpers.control_group import ControlGroup
from . import constants as C | 39.651007 | 165 | 0.574898 | import math
import numpy as np
from sc2.ids.unit_typeid import UnitTypeId
from sc2.helpers.control_group import ControlGroup
from . import constants as C
class StateView():
def __init__(self):
self.map_size = [int(round(size)) for size in self.game_info.map_size]
self.map_size_sum = self.map_size... | 7,263 | 4,375 | 23 |
b94924887631dd799abe08a7574dbfa790332e61 | 752 | py | Python | scaf/utils/__init__.py | englhardt/scaf | 7ed7b424766ccb8910d28b55014604b5d98c276c | [
"MIT"
] | null | null | null | scaf/utils/__init__.py | englhardt/scaf | 7ed7b424766ccb8910d28b55014604b5d98c276c | [
"MIT"
] | null | null | null | scaf/utils/__init__.py | englhardt/scaf | 7ed7b424766ccb8910d28b55014604b5d98c276c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 Adrian Englhardt <adrian.englhardt@gmail.com>
# Licensed under the MIT License - https://opensource.org/licenses/MIT
from .change_detection_helpers import normalize, normalize_2d, normalize_2d_global, prepare_data, smooth_frequency, \
transform_t... | 53.714286 | 119 | 0.771277 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 Adrian Englhardt <adrian.englhardt@gmail.com>
# Licensed under the MIT License - https://opensource.org/licenses/MIT
from .change_detection_helpers import normalize, normalize_2d, normalize_2d_global, prepare_data, smooth_frequency, \
transform_t... | 0 | 0 | 0 |
6207d26ad838fe858b8f58d14ff8cb583d93b58b | 31,083 | py | Python | openrave/sandbox/debugplanning.py | jdsika/TUM_HOly | a2ac55fa1751a3a8038cf61d29b95005f36d6264 | [
"MIT"
] | 2 | 2015-11-13T16:40:57.000Z | 2017-09-15T15:37:19.000Z | openrave/sandbox/debugplanning.py | jdsika/holy | a2ac55fa1751a3a8038cf61d29b95005f36d6264 | [
"MIT"
] | 1 | 2016-06-13T01:29:51.000Z | 2016-06-14T00:38:27.000Z | openrave/sandbox/debugplanning.py | jdsika/holy | a2ac55fa1751a3a8038cf61d29b95005f36d6264 | [
"MIT"
] | 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 the... | 45.777614 | 629 | 0.698453 | # 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 the... | 29,337 | 0 | 671 |
77e4d9b317e4a31644728d015d912e3836a26295 | 1,009 | py | Python | python/package/model_2.py | pchtsp/ROADEF2018 | 442dfe919a41fa993155226b601625917e632577 | [
"MIT"
] | null | null | null | python/package/model_2.py | pchtsp/ROADEF2018 | 442dfe919a41fa993155226b601625917e632577 | [
"MIT"
] | null | null | null | python/package/model_2.py | pchtsp/ROADEF2018 | 442dfe919a41fa993155226b601625917e632577 | [
"MIT"
] | null | null | null | import package.tuplist as tl
import package.superdict as sd
import pulp as pl
import package.config as conf
import package.params as pm
import numpy as np
import pprint as pp
| 32.548387 | 82 | 0.65114 | import package.tuplist as tl
import package.superdict as sd
import pulp as pl
import package.config as conf
import package.params as pm
import numpy as np
import pprint as pp
def solve_model(self, options):
plates = self.trees
bins = range(len(self.trees))
plates_bins = [(p, b) for p in plates for b in b... | 811 | 0 | 23 |
452928815217ec89a44a47d3ef314ea32d20e384 | 611 | py | Python | ephios/core/admin.py | garinm90/ephios | 7d04d3287ae16ee332e31add1f25829b199f29a5 | [
"MIT"
] | null | null | null | ephios/core/admin.py | garinm90/ephios | 7d04d3287ae16ee332e31add1f25829b199f29a5 | [
"MIT"
] | null | null | null | ephios/core/admin.py | garinm90/ephios | 7d04d3287ae16ee332e31add1f25829b199f29a5 | [
"MIT"
] | null | null | null | from django.contrib import admin
from guardian.admin import GuardedModelAdmin
from ephios.core.models import (
Consequence,
Event,
EventType,
LocalParticipation,
Qualification,
QualificationCategory,
QualificationGrant,
Shift,
WorkingHours,
)
admin.site.register(Qualification)
admi... | 23.5 | 45 | 0.798691 | from django.contrib import admin
from guardian.admin import GuardedModelAdmin
from ephios.core.models import (
Consequence,
Event,
EventType,
LocalParticipation,
Qualification,
QualificationCategory,
QualificationGrant,
Shift,
WorkingHours,
)
admin.site.register(Qualification)
admi... | 0 | 0 | 0 |
ed8ed35373a497ad4d9a9c5d8b7259a588436899 | 20,933 | py | Python | front-end/testsuite-python-lib/Python-2.3/Lib/_strptime.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2020-11-26T18:53:46.000Z | 2020-11-26T18:53:46.000Z | front-end/testsuite-python-lib/Python-2.3/Lib/_strptime.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | null | null | null | front-end/testsuite-python-lib/Python-2.3/Lib/_strptime.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2019-04-11T11:27:01.000Z | 2019-04-11T11:27:01.000Z | """Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and/or stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information as is returned by time.strftime()
FUNCTIONS:
_getlang -- Figure out what la... | 40.024857 | 105 | 0.558878 | """Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and/or stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information as is returned by time.strftime()
FUNCTIONS:
_getlang -- Figure out what la... | 5,875 | 0 | 478 |
c7f02da4a17a76fc3ef4f8355db88715fe9fe33d | 2,231 | py | Python | examples/widgets/lists/list_kv.py | xinmingzhang/kivy | 86b6e19d8a02788fe8850b690bcecdff848f3c4e | [
"MIT"
] | 9 | 2016-09-03T07:20:01.000Z | 2020-05-21T14:44:48.000Z | examples/widgets/lists/list_kv.py | xinmingzhang/kivy | 86b6e19d8a02788fe8850b690bcecdff848f3c4e | [
"MIT"
] | 1 | 2017-05-30T20:45:15.000Z | 2017-05-30T20:45:15.000Z | examples/widgets/lists/list_kv.py | xinmingzhang/kivy | 86b6e19d8a02788fe8850b690bcecdff848f3c4e | [
"MIT"
] | 4 | 2016-09-10T15:27:54.000Z | 2020-03-27T22:05:31.000Z | from kivy.adapters.dictadapter import DictAdapter
from kivy.uix.selectableview import SelectableView
from kivy.uix.listview import ListView, ListItemButton
from kivy.uix.gridlayout import GridLayout
from kivy.lang import Builder
from kivy.factory import Factory
from fixtures import integers_dict
# [TODO] Will Selecta... | 36.57377 | 78 | 0.650829 | from kivy.adapters.dictadapter import DictAdapter
from kivy.uix.selectableview import SelectableView
from kivy.uix.listview import ListView, ListItemButton
from kivy.uix.gridlayout import GridLayout
from kivy.lang import Builder
from kivy.factory import Factory
from fixtures import integers_dict
# [TODO] Will Selecta... | 1,075 | 0 | 27 |
3d08429226f10159b4af20dd37f0a9c228fb7474 | 10,140 | py | Python | utils/evaluate.py | kyuyeonpooh/objects-that-sound | 962031567f7e5657637d5518dff4f9a44af1c7eb | [
"BSD-3-Clause"
] | 18 | 2020-05-11T06:38:14.000Z | 2022-03-08T02:01:08.000Z | utils/evaluate.py | kyuyeonpooh/objects-that-sound | 962031567f7e5657637d5518dff4f9a44af1c7eb | [
"BSD-3-Clause"
] | 6 | 2020-11-13T17:46:51.000Z | 2021-04-30T21:13:55.000Z | utils/evaluate.py | kyuyeonpooh/objects-that-sound | 962031567f7e5657637d5518dff4f9a44af1c7eb | [
"BSD-3-Clause"
] | 5 | 2020-05-27T07:36:45.000Z | 2022-03-08T02:01:09.000Z | import math
import os
import sys
import numpy as np
from util import load_result
from itertools import combinations
from itertools import product
from ontology import Ontology
def get_max_tree_distance(ontology, tags, debug=False):
"""
Description:
Return max tree distance which can be derived with g... | 32.190476 | 107 | 0.581953 | import math
import os
import sys
import numpy as np
from util import load_result
from itertools import combinations
from itertools import product
from ontology import Ontology
def get_max_tree_distance(ontology, tags, debug=False):
"""
Description:
Return max tree distance which can be derived with g... | 0 | 0 | 0 |
32c39be02178140946a124ae7744a66b50840fb3 | 1,711 | py | Python | task06/kadai3.py | hameji/PythonDjango | 35f3c41c03f17e23ed3a74bc6457e5d501a9650d | [
"MIT"
] | null | null | null | task06/kadai3.py | hameji/PythonDjango | 35f3c41c03f17e23ed3a74bc6457e5d501a9650d | [
"MIT"
] | null | null | null | task06/kadai3.py | hameji/PythonDjango | 35f3c41c03f17e23ed3a74bc6457e5d501a9650d | [
"MIT"
] | null | null | null | #coding:utf-8
import requests
import pprint
import csv
main() | 25.161765 | 78 | 0.566335 | #coding:utf-8
import requests
import pprint
import csv
def request_Url(url):
payload = {
'applicationId': 1094782773139302380,
'genreId': 100283, # 洋菓子
'carrier': 0, # 0:PC, 1:mobile
'page':1, #何ページ目か
}
r = requests.get(url, params=payload)
return r.json()
def check... | 1,593 | 0 | 115 |
974251c9784ccca2d7e09370ed045cd02bd561ef | 3,686 | py | Python | recognizer/pddl/pddl_planner.py | RukNdf/MA-Landmark | 4038ebe7edc9e353e1987479f5f9edc528a4bd2a | [
"Unlicense"
] | null | null | null | recognizer/pddl/pddl_planner.py | RukNdf/MA-Landmark | 4038ebe7edc9e353e1987479f5f9edc528a4bd2a | [
"Unlicense"
] | null | null | null | recognizer/pddl/pddl_planner.py | RukNdf/MA-Landmark | 4038ebe7edc9e353e1987479f5f9edc528a4bd2a | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
#
# pddl_planner.py
# ma-goal-recognition
#
# Created by Felipe Meneguzzi on 2020-03-12.
# Copyright 2020 Felipe Meneguzzi. All rights reserved.
#
from recognizer.pddl.pddl_parser import PDDL_Parser
from recognizer.pddl.state import applicable, apply
import time
| 35.786408 | 115 | 0.607976 | #!/usr/bin/env python
#
# pddl_planner.py
# ma-goal-recognition
#
# Created by Felipe Meneguzzi on 2020-03-12.
# Copyright 2020 Felipe Meneguzzi. All rights reserved.
#
from recognizer.pddl.pddl_parser import PDDL_Parser
from recognizer.pddl.state import applicable, apply
import time
class PDDL_Planner:
de... | 1,819 | 1,553 | 23 |
22109965bbbb582bac925c5777e6cc232e05234f | 1,332 | py | Python | qualang_tools/config/__init__.py | TheoLaudatQM/py-qua-tools | 60c005c651148bafee8f437ce1be69d2340a265b | [
"BSD-3-Clause"
] | null | null | null | qualang_tools/config/__init__.py | TheoLaudatQM/py-qua-tools | 60c005c651148bafee8f437ce1be69d2340a265b | [
"BSD-3-Clause"
] | null | null | null | qualang_tools/config/__init__.py | TheoLaudatQM/py-qua-tools | 60c005c651148bafee8f437ce1be69d2340a265b | [
"BSD-3-Clause"
] | null | null | null | from qualang_tools.config.integration_weights_tools import (
convert_integration_weights,
compress_integration_weights,
plot_integration_weights,
)
from qualang_tools.config.waveform_tools import (
drag_gaussian_pulse_waveforms,
drag_cosine_pulse_waveforms,
)
from qualang_tools.config.build... | 25.615385 | 61 | 0.688438 | from qualang_tools.config.integration_weights_tools import (
convert_integration_weights,
compress_integration_weights,
plot_integration_weights,
)
from qualang_tools.config.waveform_tools import (
drag_gaussian_pulse_waveforms,
drag_cosine_pulse_waveforms,
)
from qualang_tools.config.build... | 0 | 0 | 0 |
8debd24c7b2f10459219c2a5b93fdb2751a9e97a | 3,931 | py | Python | api/subtitle/opensubtitles.py | stephanos/subtitlevocabulary | f452d7f35468912fe3967cfcf81c8f65cab345ec | [
"MIT"
] | 19 | 2017-04-20T00:57:36.000Z | 2018-01-06T10:47:38.000Z | api/subtitle/opensubtitles.py | stephanos/subtitlevocabulary | f452d7f35468912fe3967cfcf81c8f65cab345ec | [
"MIT"
] | null | null | null | api/subtitle/opensubtitles.py | stephanos/subtitlevocabulary | f452d7f35468912fe3967cfcf81c8f65cab345ec | [
"MIT"
] | 3 | 2018-01-01T06:27:48.000Z | 2020-04-09T17:21:28.000Z | import base64
import json
import os
import re
import zlib
from retrying import retry
from xmlrpc.client import ServerProxy
from api.fixture import load_fixture
from api.subtitle.model import to_model
LANGUAGE = 'en'
NEWLINE_PATTERN = re.compile(r'(\r\n|\r|\n)')
OPENSUBTITLES_URL = 'http://api.opensubtitles.org/xml-... | 32.487603 | 84 | 0.640041 | import base64
import json
import os
import re
import zlib
from retrying import retry
from xmlrpc.client import ServerProxy
from api.fixture import load_fixture
from api.subtitle.model import to_model
LANGUAGE = 'en'
NEWLINE_PATTERN = re.compile(r'(\r\n|\r|\n)')
OPENSUBTITLES_URL = 'http://api.opensubtitles.org/xml-... | 749 | 0 | 133 |
8254adb03861f55618a48b8c21e079a5ff47bf47 | 19,391 | py | Python | TrainingExtensions/tensorflow/src/python/aimet_tensorflow/channel_pruning/channel_pruner.py | quic-sendilk/aimet | 85b183955f7cf17cdb5fba76a6d48cc7e57d878c | [
"BSD-3-Clause"
] | 3 | 2021-08-23T13:00:54.000Z | 2021-11-17T10:52:36.000Z | TrainingExtensions/tensorflow/src/python/aimet_tensorflow/channel_pruning/channel_pruner.py | 4ant00ra/aimet | c6ffd3c31c290fe0913b50831d58534f6df61d76 | [
"BSD-3-Clause"
] | null | null | null | TrainingExtensions/tensorflow/src/python/aimet_tensorflow/channel_pruning/channel_pruner.py | 4ant00ra/aimet | c6ffd3c31c290fe0913b50831d58534f6df61d76 | [
"BSD-3-Clause"
] | null | null | null | # /usr/bin/env python3.5
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2019, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification,... | 51.847594 | 120 | 0.657264 | # /usr/bin/env python3.5
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2019, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification,... | 3,532 | 0 | 81 |
34c77104cbf677459d426c7e0ff996874e4646da | 6,521 | py | Python | fitness_tracker/notes/workouts/create_workout_window.py | JuricaRT/fitness_tracker | 178ab7f20cc3cabcb5b2cad34cebfd4aa20c4fc6 | [
"MIT"
] | 1 | 2020-08-30T11:30:25.000Z | 2020-08-30T11:30:25.000Z | fitness_tracker/notes/workouts/create_workout_window.py | JuricaRT/fitness_tracker | 178ab7f20cc3cabcb5b2cad34cebfd4aa20c4fc6 | [
"MIT"
] | 21 | 2020-08-23T17:14:52.000Z | 2021-05-04T19:22:21.000Z | fitness_tracker/notes/workouts/create_workout_window.py | JuricaRT/fitness_tracker | 178ab7f20cc3cabcb5b2cad34cebfd4aa20c4fc6 | [
"MIT"
] | null | null | null | import json
from datetime import datetime
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QGridLayout, QHBoxLayout, QLabel, QLineEdit, QPushButton, QMessageBox
from PyQt5.QtGui import QIntValidator
from PyQt5.QtCore import Qt, pyqtSignal
from fitness_tracker.database_wrapper import DatabaseWrapper
| 40.75625 | 137 | 0.698973 | import json
from datetime import datetime
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QGridLayout, QHBoxLayout, QLabel, QLineEdit, QPushButton, QMessageBox
from PyQt5.QtGui import QIntValidator
from PyQt5.QtCore import Qt, pyqtSignal
from fitness_tracker.database_wrapper import DatabaseWrapper
class CreateWorkou... | 5,958 | 239 | 23 |
2d947a8901e26ca611324dba4e552212acbd3611 | 142 | py | Python | DataProfileViewer/__init__.py | remram44/DataProfileVis | ca8a02f462c2860ce874805e2f036bdc2c3035d1 | [
"BSD-3-Clause"
] | null | null | null | DataProfileViewer/__init__.py | remram44/DataProfileVis | ca8a02f462c2860ce874805e2f036bdc2c3035d1 | [
"BSD-3-Clause"
] | null | null | null | DataProfileViewer/__init__.py | remram44/DataProfileVis | ca8a02f462c2860ce874805e2f036bdc2c3035d1 | [
"BSD-3-Clause"
] | 1 | 2020-10-29T17:03:29.000Z | 2020-10-29T17:03:29.000Z | from ._plot_metadata_table import plot_data_summary, plot_edit_profiler, get_exported_metadata
from ._demodata import get_lifeexpectancy_data
| 47.333333 | 94 | 0.901408 | from ._plot_metadata_table import plot_data_summary, plot_edit_profiler, get_exported_metadata
from ._demodata import get_lifeexpectancy_data
| 0 | 0 | 0 |
8c79cfb53997f5073994566dbb00f69088c6de42 | 30,204 | py | Python | sql/views.py | a4221722/autops | d59aedd2b505cd0ecda5e7715a9eb887927b038b | [
"Apache-2.0"
] | 1 | 2019-04-20T06:08:09.000Z | 2019-04-20T06:08:09.000Z | sql/views.py | a4221722/autops | d59aedd2b505cd0ecda5e7715a9eb887927b038b | [
"Apache-2.0"
] | null | null | null | sql/views.py | a4221722/autops | d59aedd2b505cd0ecda5e7715a9eb887927b038b | [
"Apache-2.0"
] | 2 | 2019-01-18T03:55:37.000Z | 2020-05-15T03:32:01.000Z | # -*- coding: UTF-8 -*-
import re
import json
import multiprocessing
import math
from collections import OrderedDict
import pdb
from django.db.models import Q
from django.db import transaction
from django.conf import settings
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render, g... | 43.458993 | 463 | 0.683121 | # -*- coding: UTF-8 -*-
import re
import json
import multiprocessing
import math
from collections import OrderedDict
import pdb
from django.db.models import Q
from django.db import transaction
from django.conf import settings
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render, g... | 30,409 | 0 | 538 |
efe2db08314c57bd59ee078b29667d0527f4de9f | 844 | py | Python | NeuralNet/Oli/evaluateNN.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | 6 | 2017-04-12T14:05:19.000Z | 2021-01-29T11:23:50.000Z | NeuralNet/Oli/evaluateNN.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | NeuralNet/Oli/evaluateNN.py | alex-ta/Fontinator | 7ca9effe3b61ded032176557520127e1d4b7a5ef | [
"Apache-2.0"
] | null | null | null | from NeuralNet.Oli.libs.ProcessingPipeline import ProcessingPipeline
from NeuralNet.Oli.libs.Preprocessor import SimplePreprocessor, IPreprocessor
#__________Configuration__________#
# Path to folder which contains subfolders with the images
IMG_PATH = '../../images/Dataset_2'
# Name for model when saved
MODEL_LOAD_PA... | 30.142857 | 85 | 0.81872 | from NeuralNet.Oli.libs.ProcessingPipeline import ProcessingPipeline
from NeuralNet.Oli.libs.Preprocessor import SimplePreprocessor, IPreprocessor
#__________Configuration__________#
# Path to folder which contains subfolders with the images
IMG_PATH = '../../images/Dataset_2'
# Name for model when saved
MODEL_LOAD_PA... | 0 | 0 | 0 |
a25701cc6b6f43c6850d384533ce9653d157c2e6 | 3,530 | py | Python | examples/checkpointing/checkpoint.py | RajatRasal/devito | 162abb6b318e77eaa4e8f719047327c45782056f | [
"MIT"
] | null | null | null | examples/checkpointing/checkpoint.py | RajatRasal/devito | 162abb6b318e77eaa4e8f719047327c45782056f | [
"MIT"
] | null | null | null | examples/checkpointing/checkpoint.py | RajatRasal/devito | 162abb6b318e77eaa4e8f719047327c45782056f | [
"MIT"
] | null | null | null | from pyrevolve import Checkpoint, Operator
from devito import TimeFunction
class CheckpointOperator(Operator):
"""Devito's concrete implementation of the ABC pyrevolve.Operator. This class wraps
devito.Operator so it conforms to the pyRevolve API. pyRevolve will call apply
with arguments t_start and... | 42.02381 | 90 | 0.650142 | from pyrevolve import Checkpoint, Operator
from devito import TimeFunction
class CheckpointOperator(Operator):
"""Devito's concrete implementation of the ABC pyrevolve.Operator. This class wraps
devito.Operator so it conforms to the pyRevolve API. pyRevolve will call apply
with arguments t_start and... | 432 | 0 | 80 |
73e96d1b436844de47df13ec105b301ac7ba9065 | 1,543 | py | Python | demo_feature_descriptor.py | DVukalov/cvclasses18 | e9a1cab443d847e547fea98b55eecf248520122d | [
"MIT"
] | null | null | null | demo_feature_descriptor.py | DVukalov/cvclasses18 | e9a1cab443d847e547fea98b55eecf248520122d | [
"MIT"
] | null | null | null | demo_feature_descriptor.py | DVukalov/cvclasses18 | e9a1cab443d847e547fea98b55eecf248520122d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# DRAFT
import os
import sys
import json
import numpy as np
import matplotlib.pyplot as plt
if __name__ == "__main__":
if len(sys.argv) == 2:
compare_descriptors(sys.argv[1])
| 25.295082 | 130 | 0.610499 | #!/usr/bin/python3
# DRAFT
import os
import sys
import json
import numpy as np
import matplotlib.pyplot as plt
def get_hamming(a, b):
d = 0;
for i in range(len(a[0])):
d+=bin(a[0][i] ^ b[0][i]).count("1")
return d
def get_distances(values, cols, flag):
d = []
dist = (lambda i, j : values[i] ^ values[j])... | 1,293 | 0 | 72 |
0a6f6ccab95232541ad45f0a864c6c8f318c1343 | 5,198 | py | Python | bookorbooks/school/tests/class_tests.py | talhakoylu/SummerInternshipBackend | 4ecedf5c97f73e3d32d5a534769e86aac3e4b6d3 | [
"MIT"
] | 1 | 2021-08-10T22:24:17.000Z | 2021-08-10T22:24:17.000Z | bookorbooks/school/tests/class_tests.py | talhakoylu/SummerInternshipBackend | 4ecedf5c97f73e3d32d5a534769e86aac3e4b6d3 | [
"MIT"
] | null | null | null | bookorbooks/school/tests/class_tests.py | talhakoylu/SummerInternshipBackend | 4ecedf5c97f73e3d32d5a534769e86aac3e4b6d3 | [
"MIT"
] | null | null | null | from account.models.instructor_model import InstructorProfile
import json
from school.models.class_model import Class
from school.models.school_model import School
from django.urls.base import reverse
from rest_framework.test import APITestCase
from country.models import Country, City
from django.contrib.auth import ge... | 41.584 | 144 | 0.649865 | from account.models.instructor_model import InstructorProfile
import json
from school.models.class_model import Class
from school.models.school_model import School
from django.urls.base import reverse
from rest_framework.test import APITestCase
from country.models import Country, City
from django.contrib.auth import ge... | 1,567 | 3,242 | 23 |
4669eb8a1f882f9e79fab53b7a21494546fdaba9 | 2,321 | py | Python | frarch/modules/metrics/base.py | victorbadenas/frarch | e75e2a63aaf14cf797ffffc901ca382b3d88b7b0 | [
"Apache-2.0"
] | null | null | null | frarch/modules/metrics/base.py | victorbadenas/frarch | e75e2a63aaf14cf797ffffc901ca382b3d88b7b0 | [
"Apache-2.0"
] | 4 | 2022-02-16T20:53:24.000Z | 2022-02-16T21:39:26.000Z | frarch/modules/metrics/base.py | victorbadenas/frarch | e75e2a63aaf14cf797ffffc901ca382b3d88b7b0 | [
"Apache-2.0"
] | 1 | 2022-03-20T23:47:16.000Z | 2022-03-20T23:47:16.000Z | import abc
from typing import Any
import torch
AGGREGATION_MODES = ["mean", "max", "min"]
class Metric(metaclass=abc.ABCMeta):
"""abstract class for Metric objects.
Example:
Simple usage of the Metric class::
class MyMetric(Metric):
def _update(self, predictions, truth):... | 28.304878 | 82 | 0.560534 | import abc
from typing import Any
import torch
AGGREGATION_MODES = ["mean", "max", "min"]
class Metric(metaclass=abc.ABCMeta):
"""abstract class for Metric objects.
Example:
Simple usage of the Metric class::
class MyMetric(Metric):
def _update(self, predictions, truth):... | 64 | 0 | 54 |
bed916834bec6eedf516cff915c111227e3b0006 | 561 | py | Python | simple5ploit/utils/server.py | binexisHATT/simple5ploit | c3be89bbe67e413ee313da310d57a180243a758f | [
"MIT"
] | 1 | 2021-03-21T21:00:42.000Z | 2021-03-21T21:00:42.000Z | simple5ploit/utils/server.py | binexisHATT/simple5ploit | c3be89bbe67e413ee313da310d57a180243a758f | [
"MIT"
] | null | null | null | simple5ploit/utils/server.py | binexisHATT/simple5ploit | c3be89bbe67e413ee313da310d57a180243a758f | [
"MIT"
] | 1 | 2021-10-29T19:07:03.000Z | 2021-10-29T19:07:03.000Z | """Use this template for creating simple Python3 server"""
from http.server import SimpleHTTPRequestHandler
from socketserver import TCPServer
| 35.0625 | 65 | 0.647059 | """Use this template for creating simple Python3 server"""
from http.server import SimpleHTTPRequestHandler
from socketserver import TCPServer
def serve(port: int):
if port > 65535:
print(f"[X] port number, {port}, is not a valid port")
print("[*] will use port 8888 instead")
port = 8888
... | 394 | 0 | 23 |
0cf4c615a40fbaa98c794e4e41937f5390b1e17a | 1,323 | py | Python | src/plt-lorenz.py | nicola144/auxiliary-particle-filters | 61d72e9163abb73007c0fbd30f68d4cc6d7ab4e9 | [
"MIT"
] | 5 | 2020-11-26T15:56:15.000Z | 2022-02-06T12:48:21.000Z | src/plt-lorenz.py | nicola144/auxiliary-particle-filters | 61d72e9163abb73007c0fbd30f68d4cc6d7ab4e9 | [
"MIT"
] | null | null | null | src/plt-lorenz.py | nicola144/auxiliary-particle-filters | 61d72e9163abb73007c0fbd30f68d4cc6d7ab4e9 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
def lorenz(x, y, z, s=10, r=28, b=2.667):
'''
Given:
x, y, z: a point of interest in three dimensional space
s, r, b: par... | 25.442308 | 79 | 0.662887 | import numpy as np
import matplotlib.pyplot as plt
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
def lorenz(x, y, z, s=10, r=28, b=2.667):
'''
Given:
x, y, z: a point of interest in three dimensional space
s, r, b: par... | 0 | 0 | 0 |
08fc5cb1dced07419054a946bb8215665b291c68 | 3,908 | py | Python | demo.py | Ushk/fourier-feature-networks | af4947e137e31c5e3a887d800f1995485414297d | [
"MIT"
] | null | null | null | demo.py | Ushk/fourier-feature-networks | af4947e137e31c5e3a887d800f1995485414297d | [
"MIT"
] | null | null | null | demo.py | Ushk/fourier-feature-networks | af4947e137e31c5e3a887d800f1995485414297d | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torchvision
import numpy as np
from tqdm import tqdm
from dataset import ImageDataset
if __name__ == '__main__':
device = "cuda:0"
network_size = (4, 512, 256)
learning_rate = 1e-4
iters = 250
mapping_size = 256
B_gauss = torch.randn((mapping_... | 28.948148 | 92 | 0.591095 | import torch
import torch.nn as nn
import torchvision
import numpy as np
from tqdm import tqdm
from dataset import ImageDataset
class Swish(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return x * torch.sigmoid(x)
class SirenLayer(nn.Module):
def __init__(se... | 2,882 | 9 | 272 |
2507f30939de842954c4932ecd45b09333c6cfe5 | 33,664 | py | Python | tests/tree/aggs/test_aggs.py | alk-lbinet/pandagg | 542350f84ca4497ab4a5f01b054aff2385f6827e | [
"Apache-2.0"
] | null | null | null | tests/tree/aggs/test_aggs.py | alk-lbinet/pandagg | 542350f84ca4497ab4a5f01b054aff2385f6827e | [
"Apache-2.0"
] | null | null | null | tests/tree/aggs/test_aggs.py | alk-lbinet/pandagg | 542350f84ca4497ab4a5f01b054aff2385f6827e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
# IMPORTS
# =============================================================================
from __future__ import unicode_literals
from unittest import TestCas... | 35.213389 | 113 | 0.361157 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
# IMPORTS
# =============================================================================
from __future__ import unicode_literals
from unittest import TestCas... | 29,246 | 3,856 | 23 |
16a28ee4b62eb063602230dea021f902824e2ced | 2,785 | py | Python | airflow/providers/google/cloud/links/cloud_tasks.py | holly-evans/airflow | 865406cbab4defd35c95afbf0a8d5987ff7788b1 | [
"Apache-2.0"
] | 8,092 | 2016-04-27T20:32:29.000Z | 2019-01-05T07:39:33.000Z | airflow/providers/google/cloud/links/cloud_tasks.py | holly-evans/airflow | 865406cbab4defd35c95afbf0a8d5987ff7788b1 | [
"Apache-2.0"
] | 2,961 | 2016-05-05T07:16:16.000Z | 2019-01-05T08:47:59.000Z | airflow/providers/google/cloud/links/cloud_tasks.py | holly-evans/airflow | 865406cbab4defd35c95afbf0a8d5987ff7788b1 | [
"Apache-2.0"
] | 3,546 | 2016-05-04T20:33:16.000Z | 2019-01-05T05:14:26.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 33.963415 | 106 | 0.70018 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 640 | 0 | 52 |
90143376f671142320b39462852736a614776a02 | 3,729 | py | Python | app/create_app.py | communitiesuk/funding-service-design-assessment | 95ec0cbb97a42ef12d931658b90d3d91f1edee4c | [
"MIT"
] | null | null | null | app/create_app.py | communitiesuk/funding-service-design-assessment | 95ec0cbb97a42ef12d931658b90d3d91f1edee4c | [
"MIT"
] | null | null | null | app/create_app.py | communitiesuk/funding-service-design-assessment | 95ec0cbb97a42ef12d931658b90d3d91f1edee4c | [
"MIT"
] | null | null | null | from app.assets import compile_static_assets
from flask import Flask
from flask_assets import Environment
from flask_compress import Compress
from flask_talisman import Talisman
from flask_wtf.csrf import CSRFProtect
from jinja2 import ChoiceLoader
from jinja2 import PackageLoader
from jinja2 import PrefixLoader
app... | 28.684615 | 79 | 0.588898 | from app.assets import compile_static_assets
from flask import Flask
from flask_assets import Environment
from flask_compress import Compress
from flask_talisman import Talisman
from flask_wtf.csrf import CSRFProtect
from jinja2 import ChoiceLoader
from jinja2 import PackageLoader
from jinja2 import PrefixLoader
def ... | 3,370 | 0 | 23 |
5d4f8ce969782769c49f9bd860ae31820b06ab43 | 1,738 | py | Python | setup.py | msdslab/ASReview-vizualisation | 725cdfcc028a91225487fc6c63b15bd1cb3c6130 | [
"Apache-2.0"
] | 1 | 2020-01-31T07:13:34.000Z | 2020-01-31T07:13:34.000Z | setup.py | msdslab/ASReview-vizualisation | 725cdfcc028a91225487fc6c63b15bd1cb3c6130 | [
"Apache-2.0"
] | 1 | 2020-01-30T12:40:03.000Z | 2020-01-30T12:41:08.000Z | setup.py | msdslab/ASReview-vizualisation | 725cdfcc028a91225487fc6c63b15bd1cb3c6130 | [
"Apache-2.0"
] | 1 | 2020-01-29T15:18:43.000Z | 2020-01-29T15:18:43.000Z | # based on https://github.com/pypa/sampleproject
# MIT License
from io import open
from os import path
# Always prefer setuptools over distutils
from setuptools import find_namespace_packages
from setuptools import setup
import versioneer
here = path.abspath(path.dirname(__file__))
# Get the long description from ... | 31.6 | 78 | 0.677791 | # based on https://github.com/pypa/sampleproject
# MIT License
from io import open
from os import path
# Always prefer setuptools over distutils
from setuptools import find_namespace_packages
from setuptools import setup
import versioneer
here = path.abspath(path.dirname(__file__))
# Get the long description from ... | 0 | 0 | 0 |
07526d850b339b3e5cf2dc6b9dcb0479990f24ad | 819 | py | Python | distort_obj.py | aschier/mesh_scripts | 730e51abe04c8b0e189774ca7fcf9039c60f80cd | [
"BSD-3-Clause"
] | null | null | null | distort_obj.py | aschier/mesh_scripts | 730e51abe04c8b0e189774ca7fcf9039c60f80cd | [
"BSD-3-Clause"
] | null | null | null | distort_obj.py | aschier/mesh_scripts | 730e51abe04c8b0e189774ca7fcf9039c60f80cd | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import sys, random
vertices = []
faces = []
with open(sys.argv[1], "r") as file:
lines = file.read().split("\n")
outputobj = ""
for line in lines:
if line.startswith("v"):
parts = line.split(" ")
vertices.append([float(x) for x in parts[1:]])
i... | 32.76 | 81 | 0.521368 | #!/usr/bin/env python
import sys, random
vertices = []
faces = []
with open(sys.argv[1], "r") as file:
lines = file.read().split("\n")
outputobj = ""
for line in lines:
if line.startswith("v"):
parts = line.split(" ")
vertices.append([float(x) for x in parts[1:]])
i... | 0 | 0 | 0 |
b7fcc03c4d39ad34490d062cf734cf9b98afa16c | 3,933 | py | Python | metadata/scrape/hscic/ods.py | nhsengland/publish-o-matic | dc8f16cb83a2360989afa44d887e63b5cde6af29 | [
"MIT"
] | null | null | null | metadata/scrape/hscic/ods.py | nhsengland/publish-o-matic | dc8f16cb83a2360989afa44d887e63b5cde6af29 | [
"MIT"
] | 11 | 2015-03-02T16:30:20.000Z | 2016-11-29T12:16:15.000Z | metadata/scrape/hscic/ods.py | nhsengland/publish-o-matic | dc8f16cb83a2360989afa44d887e63b5cde6af29 | [
"MIT"
] | 2 | 2020-12-25T20:38:31.000Z | 2021-04-11T07:35:01.000Z | """
Scrape ODS data from the HSCIC
"""
import json
import sys
import ffs
sys.path.append(ffs.Path.here().parent)
import scrape
DATA_DIR = ffs.Path.here()/'../../data'
DOWNLOADS = 'http://systems.hscic.gov.uk/data/ods/datadownloads/index'
def check_sanity_of(metadata):
"""
We've just finished scraping, let'... | 31.214286 | 117 | 0.567251 | """
Scrape ODS data from the HSCIC
"""
import json
import sys
import ffs
sys.path.append(ffs.Path.here().parent)
import scrape
DATA_DIR = ffs.Path.here()/'../../data'
DOWNLOADS = 'http://systems.hscic.gov.uk/data/ods/datadownloads/index'
class Error(Exception):
def __init__(self, msg):
Exception.__ini... | 95 | 2 | 81 |
f176663e74b963d6d7e6336560c123d0572a7cad | 847 | py | Python | nanitosbaby/store/migrations/0007_auto_20170722_1945.py | Hector-hedb12/nanitosbaby | 86eff05157dab02a7daca61e1f70ec76bbf6cbdf | [
"MIT"
] | null | null | null | nanitosbaby/store/migrations/0007_auto_20170722_1945.py | Hector-hedb12/nanitosbaby | 86eff05157dab02a7daca61e1f70ec76bbf6cbdf | [
"MIT"
] | null | null | null | nanitosbaby/store/migrations/0007_auto_20170722_1945.py | Hector-hedb12/nanitosbaby | 86eff05157dab02a7daca61e1f70ec76bbf6cbdf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-07-22 19:45
from __future__ import unicode_literals
from django.db import migrations
| 26.46875 | 87 | 0.582054 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-07-22 19:45
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('store', '0006_auto_20170227_0204'),
]
operations = [
migrations.AlterModelOptions(
... | 0 | 676 | 23 |
6e0b8d667aadec326f62af823df8872b61b53d0e | 5,659 | py | Python | SpriteTool.py | LV-6502/Sprite-Layer-Compiler | 9d37dbf1473e5d4015758dcc60a5fb1965d2a9e3 | [
"MIT"
] | 3 | 2021-05-06T06:40:08.000Z | 2021-09-12T14:28:38.000Z | SpriteTool.py | LV-6502/Sprite-Layer-Compiler | 9d37dbf1473e5d4015758dcc60a5fb1965d2a9e3 | [
"MIT"
] | null | null | null | SpriteTool.py | LV-6502/Sprite-Layer-Compiler | 9d37dbf1473e5d4015758dcc60a5fb1965d2a9e3 | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import filedialog, Entry, messagebox
from PIL import ImageTk, Image
filenames = []
all_labels = []
base_labels = []
Layer_0 = Image.new(mode = "RGB", size = (1, 1))
left_img_out = Image.new(mode = "RGB", size = (1, 1))
right_img_out = Image.new(mode = "RGB", size = (1, 1))
window = ... | 34.717791 | 123 | 0.641103 | import tkinter as tk
from tkinter import filedialog, Entry, messagebox
from PIL import ImageTk, Image
filenames = []
all_labels = []
base_labels = []
Layer_0 = Image.new(mode = "RGB", size = (1, 1))
left_img_out = Image.new(mode = "RGB", size = (1, 1))
right_img_out = Image.new(mode = "RGB", size = (1, 1))
def openfi... | 3,093 | 0 | 254 |
362ad954b7ae66d4982bdce7facb466b9ccb8cc8 | 1,188 | py | Python | app/app.py | valuebaseai/docker_viz_test | a873238436a273936374b9ba2c1eae364eaa65ca | [
"MIT"
] | null | null | null | app/app.py | valuebaseai/docker_viz_test | a873238436a273936374b9ba2c1eae364eaa65ca | [
"MIT"
] | null | null | null | app/app.py | valuebaseai/docker_viz_test | a873238436a273936374b9ba2c1eae364eaa65ca | [
"MIT"
] | null | null | null | import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.express as px
# This dataframe has 244 lines, but 4 distinct values for `day`
df = px.data.tips()
app = dash.Dash(__name__)
app.layout = html.Div([
html.P("Selector:"),
... | 25.276596 | 71 | 0.59596 | import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.express as px
# This dataframe has 244 lines, but 4 distinct values for `day`
df = px.data.tips()
app = dash.Dash(__name__)
app.layout = html.Div([
html.P("Selector:"),
... | 77 | 0 | 22 |
2100a825b81abf1ae8d76c45a765eb6393aee0f6 | 3,392 | py | Python | codedigger/contest/cron.py | jyothiprakashpanaik/Backend | 9ab1b57436a0a1a6197777c0b36c842e71121d3a | [
"Apache-2.0"
] | 17 | 2020-10-07T22:40:37.000Z | 2022-01-20T07:19:09.000Z | codedigger/contest/cron.py | jyothiprakashpanaik/Backend | 9ab1b57436a0a1a6197777c0b36c842e71121d3a | [
"Apache-2.0"
] | 42 | 2021-06-03T01:58:04.000Z | 2022-01-31T14:49:22.000Z | codedigger/contest/cron.py | jyothiprakashpanaik/Backend | 9ab1b57436a0a1a6197777c0b36c842e71121d3a | [
"Apache-2.0"
] | 25 | 2020-10-06T17:55:19.000Z | 2021-12-09T07:56:50.000Z | # Cron Job -
# Problem Assign -- Contest with isProblem False -- Assign Problem
# Result Assign -- Contest with isResult False
# contest end -- (startTime + duration) <= time.now
#Email
from django.core.mail import send_mail
from codedigger.settings import EMAIL_HOST_USER
## Short Code Contest
# from .utils import lo... | 34.612245 | 106 | 0.661557 | # Cron Job -
# Problem Assign -- Contest with isProblem False -- Assign Problem
# Result Assign -- Contest with isResult False
# contest end -- (startTime + duration) <= time.now
#Email
from django.core.mail import send_mail
from codedigger.settings import EMAIL_HOST_USER
## Short Code Contest
# from .utils import lo... | 0 | 0 | 0 |
d954154e7b9daa5cdea8c4b4390e0576c8ac5293 | 5,948 | py | Python | ocr/form_recognizer.py | PrynsTag/oneBarangay | 6a8d56003d85b8385e91f5c5d81208619023c1ee | [
"Apache-2.0"
] | null | null | null | ocr/form_recognizer.py | PrynsTag/oneBarangay | 6a8d56003d85b8385e91f5c5d81208619023c1ee | [
"Apache-2.0"
] | 96 | 2021-08-28T12:37:02.000Z | 2022-03-23T04:25:12.000Z | ocr/form_recognizer.py | PrynsTag/oneBarangay | 6a8d56003d85b8385e91f5c5d81208619023c1ee | [
"Apache-2.0"
] | null | null | null | """Recognize and extract forms."""
import os
from statistics import fmean
from azure.ai.formrecognizer.aio import FormRecognizerClient, FormTrainingClient
from azure.core.credentials import AzureKeyCredential
class RecognizeCustomFormsSampleAsync:
"""Class to recognize forms in async mode."""
async def reco... | 43.416058 | 96 | 0.408036 | """Recognize and extract forms."""
import os
from statistics import fmean
from azure.ai.formrecognizer.aio import FormRecognizerClient, FormTrainingClient
from azure.core.credentials import AzureKeyCredential
class RecognizeCustomFormsSampleAsync:
"""Class to recognize forms in async mode."""
async def reco... | 0 | 0 | 0 |
6847eac22fa6fe907df819c4635e45eba818a864 | 17,227 | py | Python | SSTransits.py | keatonb/SolarSystemTransits | c11966972d0f407892c4aeb046fd4aaea3f2d76d | [
"MIT"
] | null | null | null | SSTransits.py | keatonb/SolarSystemTransits | c11966972d0f407892c4aeb046fd4aaea3f2d76d | [
"MIT"
] | null | null | null | SSTransits.py | keatonb/SolarSystemTransits | c11966972d0f407892c4aeb046fd4aaea3f2d76d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 24 15:39:33 2021
Calculate and plot details of inner Solar System transits as seen from outer
Solar System objects.
Requires package solarsystem (https://pypi.org/project/solarsystem/)
Animation requires imagemagick (imagemagick.org)
@author: keat... | 41.311751 | 105 | 0.573925 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 24 15:39:33 2021
Calculate and plot details of inner Solar System transits as seen from outer
Solar System objects.
Requires package solarsystem (https://pypi.org/project/solarsystem/)
Animation requires imagemagick (imagemagick.org)
@author: keat... | 228 | 0 | 61 |
eabe8c69163f71157cd2ba1f49bb642b4bbb49cc | 4,751 | py | Python | pose_estimation/my_train.py | RoboBachelor/vehicle_pose_estimation | 53f1ff4a70d69256ba10fd2ecee024cf19801b22 | [
"MIT"
] | 1 | 2021-11-01T15:12:39.000Z | 2021-11-01T15:12:39.000Z | pose_estimation/my_train.py | RoboBachelor/vehicle_pose_estimation | 53f1ff4a70d69256ba10fd2ecee024cf19801b22 | [
"MIT"
] | 1 | 2021-11-01T15:11:14.000Z | 2021-11-06T07:02:13.000Z | pose_estimation/my_train.py | RoboBachelor/vehicle_pose_estimation | 53f1ff4a70d69256ba10fd2ecee024cf19801b22 | [
"MIT"
] | 1 | 2021-12-15T22:19:08.000Z | 2021-12-15T22:19:08.000Z | import os.path as osp
import sys
import argparse
import time
import torch
from torchvision import transforms
this_dir = osp.dirname(__file__)
paths = []
paths.append(osp.join(this_dir, '..', 'lib'))
paths.append(osp.join(this_dir, '..', 'lib', 'dataset'))
for path in paths:
if path not in sys.path:
sys.pa... | 26.841808 | 75 | 0.595875 | import os.path as osp
import sys
import argparse
import time
import torch
from torchvision import transforms
this_dir = osp.dirname(__file__)
paths = []
paths.append(osp.join(this_dir, '..', 'lib'))
paths.append(osp.join(this_dir, '..', 'lib', 'dataset'))
for path in paths:
if path not in sys.path:
sys.pa... | 1,422 | 0 | 126 |
ac8a36d1877984ef81576c267c469097f46c2c4e | 1,898 | py | Python | setup.py | qctrl/python-cirq | 72f2e412bcef2d92a53dee71ad50dca4153bb192 | [
"Apache-2.0"
] | null | null | null | setup.py | qctrl/python-cirq | 72f2e412bcef2d92a53dee71ad50dca4153bb192 | [
"Apache-2.0"
] | 6 | 2020-01-16T03:10:34.000Z | 2022-03-13T22:57:46.000Z | setup.py | qctrl/python-cirq | 72f2e412bcef2d92a53dee71ad50dca4153bb192 | [
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
# DO NOT EDIT THIS FILE!
# This file has been autogenerated by dephell <3
# https://github.com/dephell/dephell
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import os.path
readme = ''
here = os.path.abspath(os.path.dirname(__file__))
readme_... | 45.190476 | 620 | 0.652266 |
# -*- coding: utf-8 -*-
# DO NOT EDIT THIS FILE!
# This file has been autogenerated by dephell <3
# https://github.com/dephell/dephell
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import os.path
readme = ''
here = os.path.abspath(os.path.dirname(__file__))
readme_... | 0 | 0 | 0 |
c8628f4105fa9dc4a1e175f4c7f8e662791f1969 | 4,341 | py | Python | tests/test_elasticsearch_driver_metadata_as_nested.py | James-QiuHaoran/scalable-image-matching | a96fe5132d2c39f32680a97e216b438c87280a24 | [
"MIT"
] | 22 | 2018-11-24T12:30:47.000Z | 2021-09-08T12:22:18.000Z | tests/test_elasticsearch_driver_metadata_as_nested.py | James-QiuHaoran/scalable-image-matching | a96fe5132d2c39f32680a97e216b438c87280a24 | [
"MIT"
] | null | null | null | tests/test_elasticsearch_driver_metadata_as_nested.py | James-QiuHaoran/scalable-image-matching | a96fe5132d2c39f32680a97e216b438c87280a24 | [
"MIT"
] | 6 | 2019-01-18T12:18:36.000Z | 2021-05-07T08:47:34.000Z | import pytest
import urllib.request
import os
import hashlib
from elasticsearch import Elasticsearch, ConnectionError, RequestError, NotFoundError
from time import sleep
from image_match.elasticsearch_driver import SignatureES
from PIL import Image
test_img_url1 = 'https://camo.githubusercontent.com/810bdde0a88bc3f8c... | 32.395522 | 452 | 0.652384 | import pytest
import urllib.request
import os
import hashlib
from elasticsearch import Elasticsearch, ConnectionError, RequestError, NotFoundError
from time import sleep
from image_match.elasticsearch_driver import SignatureES
from PIL import Image
test_img_url1 = 'https://camo.githubusercontent.com/810bdde0a88bc3f8c... | 2,453 | 0 | 214 |
4cbf11419437fed2cf010cf45d94dd5dea8c505a | 41 | py | Python | tru/global_vars.py | TroyRetter/TRU | c9989d09021b0e1483487c99c5a2e73b0310aae6 | [
"MIT"
] | null | null | null | tru/global_vars.py | TroyRetter/TRU | c9989d09021b0e1483487c99c5a2e73b0310aae6 | [
"MIT"
] | null | null | null | tru/global_vars.py | TroyRetter/TRU | c9989d09021b0e1483487c99c5a2e73b0310aae6 | [
"MIT"
] | null | null | null | BASE_DIRECTORY = None
CACHE = "/tmp/tru"
| 13.666667 | 21 | 0.707317 | BASE_DIRECTORY = None
CACHE = "/tmp/tru"
| 0 | 0 | 0 |
a2008ac42ab43f59dd987f910382bf756d67c855 | 1,670 | py | Python | src/BandC/ParserUtil.py | pywash/pywash | f105752f67ad5c4648117a2bebd875f8c88caeb2 | [
"MIT"
] | 7 | 2019-02-26T10:45:18.000Z | 2019-08-13T18:08:58.000Z | src/BandC/ParserUtil.py | pywash/pywash | f105752f67ad5c4648117a2bebd875f8c88caeb2 | [
"MIT"
] | null | null | null | src/BandC/ParserUtil.py | pywash/pywash | f105752f67ad5c4648117a2bebd875f8c88caeb2 | [
"MIT"
] | 1 | 2021-06-11T14:56:52.000Z | 2021-06-11T14:56:52.000Z | from src.BandC import *
from src.Exceptions import FileFormatNotFound
__parsers__ = {'.csv': CSV, '.arff': Arff}
__url_parsers__ = {'.csv': URLCSV, '.arff': URLARFF}
def assign_parser(file_path: str, contents: str = None, verbose: bool = False) -> callable:
""" Allocate a specific parser to a file_path
:par... | 35.531915 | 91 | 0.619162 | from src.BandC import *
from src.Exceptions import FileFormatNotFound
__parsers__ = {'.csv': CSV, '.arff': Arff}
__url_parsers__ = {'.csv': URLCSV, '.arff': URLARFF}
def assign_parser(file_path: str, contents: str = None, verbose: bool = False) -> callable:
""" Allocate a specific parser to a file_path
:par... | 0 | 0 | 0 |
1c749ee797e17400b3ddbf7ac439a88ffca0a93e | 2,955 | py | Python | tests/test_xsd_union.py | imanashoorii/zibal-zeep | 9ff7b229b0759597823da41d1dbf48c6e7b5b383 | [
"MIT"
] | null | null | null | tests/test_xsd_union.py | imanashoorii/zibal-zeep | 9ff7b229b0759597823da41d1dbf48c6e7b5b383 | [
"MIT"
] | null | null | null | tests/test_xsd_union.py | imanashoorii/zibal-zeep | 9ff7b229b0759597823da41d1dbf48c6e7b5b383 | [
"MIT"
] | null | null | null | from tests.utils import assert_nodes_equal, load_xml, render_node
from zibalzeep import xsd
| 30.78125 | 92 | 0.551946 | from tests.utils import assert_nodes_equal, load_xml, render_node
from zibalzeep import xsd
def test_union_same_types():
schema = xsd.Schema(
load_xml(
"""
<?xml version="1.0"?>
<xsd:schema
xmlns="http://tests.python-zeep.org/"
xmlns:xsd="http://www.w3.o... | 2,815 | 0 | 46 |
14b8846f714d76e5b90a4f207ecf7721fe8b3e01 | 3,334 | py | Python | docs/mail-merge/docs_mail_merge_test.py | kvij/python-samples | 1f3341c37bacf5239210ea0cbe957a373c095a0a | [
"Apache-2.0"
] | 1 | 2021-06-12T22:39:57.000Z | 2021-06-12T22:39:57.000Z | docs/mail-merge/docs_mail_merge_test.py | kvij/python-samples | 1f3341c37bacf5239210ea0cbe957a373c095a0a | [
"Apache-2.0"
] | null | null | null | docs/mail-merge/docs_mail_merge_test.py | kvij/python-samples | 1f3341c37bacf5239210ea0cbe957a373c095a0a | [
"Apache-2.0"
] | 8 | 2021-11-25T04:26:15.000Z | 2021-11-30T17:06:49.000Z | # -*- coding: utf-8 -*-
#
# Copyright ©2018-2019 Google 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 apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to... | 35.849462 | 79 | 0.709058 | # -*- coding: utf-8 -*-
#
# Copyright ©2018-2019 Google 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 apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to... | 296 | 0 | 156 |
2644da3c7c17205a4c4c3e561f05108d119f037f | 2,323 | py | Python | datashader/tests/test_raster.py | nside/datashader | 7d1af5a63c51430731e728a627d5e2304c56da8a | [
"BSD-3-Clause"
] | null | null | null | datashader/tests/test_raster.py | nside/datashader | 7d1af5a63c51430731e728a627d5e2304c56da8a | [
"BSD-3-Clause"
] | 1 | 2021-07-30T18:24:08.000Z | 2021-07-30T18:24:08.000Z | datashader/tests/test_raster.py | nside/datashader | 7d1af5a63c51430731e728a627d5e2304c56da8a | [
"BSD-3-Clause"
] | null | null | null | from os import path
import pytest
import datashader as ds
import rasterio as rio
from pytest import set_trace
BASE_PATH = path.split(__file__)[0]
DATA_PATH = path.abspath(path.join(BASE_PATH, 'data'))
TEST_RASTER_PATH = path.join(DATA_PATH, 'world.rgb.tif')
with rio.open(TEST_RASTER_PATH) as src:
x_range = (src... | 33.666667 | 95 | 0.641412 | from os import path
import pytest
import datashader as ds
import rasterio as rio
from pytest import set_trace
BASE_PATH = path.split(__file__)[0]
DATA_PATH = path.abspath(path.join(BASE_PATH, 'data'))
TEST_RASTER_PATH = path.join(DATA_PATH, 'world.rgb.tif')
with rio.open(TEST_RASTER_PATH) as src:
x_range = (src... | 1,615 | 0 | 161 |
f2dedbfad2292cca8b53e6df8edb30d71cc8f25c | 298 | py | Python | pybpodgui_plugin_session_history/settings.py | pybpod/pybpod-gui-plugin-session-history | 6767c5a6590001a8f0420cfdb5327f924b98dc5a | [
"MIT"
] | null | null | null | pybpodgui_plugin_session_history/settings.py | pybpod/pybpod-gui-plugin-session-history | 6767c5a6590001a8f0420cfdb5327f924b98dc5a | [
"MIT"
] | null | null | null | pybpodgui_plugin_session_history/settings.py | pybpod/pybpod-gui-plugin-session-history | 6767c5a6590001a8f0420cfdb5327f924b98dc5a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
SETTINGS_PRIORITY = 80
# THESE SETTINGS ARE NEEDED FOR PYSETTINGS
SESSIONLOG_PLUGIN_ICON = os.path.join(os.path.dirname(__file__), 'resources', 'history.png')
SESSIONLOG_PLUGIN_WINDOW_SIZE = 700, 600
SESSIONLOG_PLUGIN_REFRESH_RATE = 1000
| 21.285714 | 92 | 0.758389 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
SETTINGS_PRIORITY = 80
# THESE SETTINGS ARE NEEDED FOR PYSETTINGS
SESSIONLOG_PLUGIN_ICON = os.path.join(os.path.dirname(__file__), 'resources', 'history.png')
SESSIONLOG_PLUGIN_WINDOW_SIZE = 700, 600
SESSIONLOG_PLUGIN_REFRESH_RATE = 1000
| 0 | 0 | 0 |
ffe35272f8ce7acb0b3fa5d432b36ab020bfbd5f | 1,795 | py | Python | utils/utils.py | likesum/bpn | bf4cc2b78c461f99cdc7ac91453b1c4cd3aad9b6 | [
"MIT"
] | 17 | 2021-04-14T13:57:59.000Z | 2022-02-09T04:28:13.000Z | utils/utils.py | likesum/bpn | bf4cc2b78c461f99cdc7ac91453b1c4cd3aad9b6 | [
"MIT"
] | 4 | 2021-04-29T03:41:59.000Z | 2022-01-06T02:33:39.000Z | utils/utils.py | likesum/bpn | bf4cc2b78c461f99cdc7ac91453b1c4cd3aad9b6 | [
"MIT"
] | 6 | 2021-05-19T08:04:19.000Z | 2021-12-28T12:32:40.000Z | """Various utility functions."""
import sys
import time
import signal
import numpy as np
def getstop():
"""Returns stop so that stop[0] is True if ctrl+c was hit."""
stop = [False]
_orig = [None]
_orig[0] = signal.signal(signal.SIGINT, handler)
return stop
def saveopt(fname, opt):
"""Save ... | 27.19697 | 75 | 0.579387 | """Various utility functions."""
import sys
import time
import signal
import numpy as np
class LogWriter:
def __init__(self, filename):
self._log = open(filename, 'a')
def log(self, data, numit=None):
"""Log output in standard format."""
if numit is None:
lstr = data
... | 147 | 496 | 50 |
153f0948bdb59700318ba30f9815f029f9d0d05f | 2,579 | py | Python | src/fb.py | webgisdeveloper/COvid19 | 45d80109109ee03ca4b7ea463f63830b6f411cf0 | [
"MIT"
] | null | null | null | src/fb.py | webgisdeveloper/COvid19 | 45d80109109ee03ca4b7ea463f63830b6f411cf0 | [
"MIT"
] | null | null | null | src/fb.py | webgisdeveloper/COvid19 | 45d80109109ee03ca4b7ea463f63830b6f411cf0 | [
"MIT"
] | null | null | null | import geopandas as gpd
import pandas as pd
from shapely.geometry import Point
from geopandas.tools import sjoin
import sqlite3
#from datetime import datetime, timezone
import datetime
co_county_sf = '/Users/rl/scratch/covid-19/facebook/co_counties/co_counties.shp'
boulder_county_zone_sf = '/Users/rl/scratch/covi... | 27.43617 | 113 | 0.618457 | import geopandas as gpd
import pandas as pd
from shapely.geometry import Point
from geopandas.tools import sjoin
import sqlite3
#from datetime import datetime, timezone
import datetime
def day_of_week(date):
year,month,day = date.split('-')
ans = datetime.date(int(year), int(month), int(day))
day_of_week ... | 2,011 | 0 | 182 |
7095a2abb5c57ba434cd9edb10719738604c0238 | 1,607 | py | Python | django-saiqa/saiqa/Test/RegisterTest.py | mark-mo/saiqa | a12482931aa0830de915ace4a25b039db951cd34 | [
"Apache-2.0"
] | null | null | null | django-saiqa/saiqa/Test/RegisterTest.py | mark-mo/saiqa | a12482931aa0830de915ace4a25b039db951cd34 | [
"Apache-2.0"
] | 21 | 2019-12-26T17:09:47.000Z | 2022-03-21T22:16:46.000Z | saidj/saidj/test/RegisterTest.py | mark-mo/saiqa | a12482931aa0830de915ace4a25b039db951cd34 | [
"Apache-2.0"
] | null | null | null | from saiqa.Model.UserModel import User
from saiqa.Service.UserService import UserService
from saiqa.Service.QuestionService import QuestionService
from saiqa.Exception.CustomException import FormatError, PasswordMismatchError, EmptyFormError
import re
service = UserService('test')
qser = QuestionService('test')
# Lis... | 34.934783 | 94 | 0.671437 | from saiqa.Model.UserModel import User
from saiqa.Service.UserService import UserService
from saiqa.Service.QuestionService import QuestionService
from saiqa.Exception.CustomException import FormatError, PasswordMismatchError, EmptyFormError
import re
service = UserService('test')
qser = QuestionService('test')
# Lis... | 1,084 | 0 | 22 |
8bd670a796ae7575f3e1ae3f850652a36e145686 | 1,400 | py | Python | Official Notes/Exercises/Chapter 7/ex_0617.py | rafay99-epic/Ssmsunng-Innovation-Campus-Notes | 19a2dfd125957d5a3d3458636d91747b48267689 | [
"MIT"
] | 1 | 2022-01-14T15:20:43.000Z | 2022-01-14T15:20:43.000Z | Official Notes/Exercises/Chapter 7/ex_0617.py | rafay99-epic/Ssmsunng-Innovation-Campus-Notes | 19a2dfd125957d5a3d3458636d91747b48267689 | [
"MIT"
] | null | null | null | Official Notes/Exercises/Chapter 7/ex_0617.py | rafay99-epic/Ssmsunng-Innovation-Campus-Notes | 19a2dfd125957d5a3d3458636d91747b48267689 | [
"MIT"
] | null | null | null | # Coding Practice #0617
#----------------------------------------------------------------------------------
import numpy as np
import cv2
# Go to the directory where the data file is located.
# os.chdir(r'~~') # Please, replace the path with your own.
# 1. Morphological filtering.
# Op... | 43.75 | 118 | 0.506429 | # Coding Practice #0617
#----------------------------------------------------------------------------------
import numpy as np
import cv2
# Go to the directory where the data file is located.
# os.chdir(r'~~') # Please, replace the path with your own.
# 1. Morphological filtering.
# Op... | 0 | 0 | 0 |