hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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
"""
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 train, dev and test sets as... | 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... | 0 | 0 | 0 | 0 | 0 | 44,573 | 0 | -19 | 353 |
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 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 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!
| 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):
... | 0 | 0 | 0 | 9,040 | 0 | 0 | 0 | 21 | 50 |
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 | 0 | 0 | 0 | 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
try:
from django.template.exceptions import TemplateDoesNotExist, TemplateSyntaxError
except ImportError:
logger = logging.getLogger(__name__)
| 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... | 0 | 0 | 0 | 0 | 0 | 2,157 | 0 | 184 | 275 |
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 | 0 | 0 | 0 | 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 |
# 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('DogeCoin')
anagram_score = o... | 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... | 3 | 0 | 0 | 2,717 | 0 | 0 | 0 | 5 | 45 |
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"""
| 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... | 0 | 0 | 0 | 6,034 | 0 | 0 | 0 | -18 | 91 |
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)
| 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,
... | 0 | 0 | 0 | 6,131 | 0 | 0 | 0 | 184 | 180 |
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
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:
thread.start()
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):
... | 69 | 0 | 0 | 258 | 0 | 0 | 0 | -5 | 56 |
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
'''' Class containing the code that scrapes the stock ticker/information from various stock & crypto sites'''
| 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... | 0 | 0 | 0 | 1,364 | 0 | 0 | 0 | -7 | 110 |
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 = ... | 0 | 0 | 0 | 0 | 0 | 348 | 0 | 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... | 0 | 0 | 0 | 0 | 0 | 19,455 | 0 | -55 | 475 |
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 nmero 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}')
| 2 | 0 | 0 | 0 | 0 | 0 | 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
"""
# def test_preprocess_ckg_output():
# ckg_output_string_correct = "~Q92934;~Q15149"
# ckg_output_string_correct_2 = " ~Q92934; ~Q15149"
# ckg_output_string_wrong = "Q92934; Q15149"
#
# proteins_correct_inp... | 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(... | 0 | 0 | 0 | 0 | 0 | 2,870 | 0 | 11 | 137 |
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 |
# 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.dumps(unpack_pd... | 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... | 0 | 0 | 0 | 10,094 | 0 | 0 | 0 | -6 | 505 |
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 | 0 | 0 | 0 | 0 | 0 | 45 |
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 platform
if platform.system() == "Windows":
try:
from eunjeon import Mecab
except:
print("please install eunjeon module")
else: # Ubuntu
| 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... | 15 | 8,021 | 0 | 18,566 | 0 | 0 | 0 | -28 | 205 |
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 sys
from typing import Set
def filter_text(text: str) -> str:
"""remove unwanted character from the text which can disturb NER"""
filtered = text
for s in "\\\xa0\"'[]()\xad":
filtered = filtered.replace(s, "")
return filtered
def format_entities(entities: Set[str]) -> Set[str]:
... | 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... | 9 | 966 | 0 | 0 | 0 | 0 | 0 | 21 | 157 |
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 |
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... | 0 | 713 | 0 | 887 | 0 | 0 | 0 | 1 | 264 |
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 | 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 = "PASS"
FAIL = "FAIL"
e... | 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 | 0 | 0 | 0 | 0 | -3 | 22 |
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... | 0 | 0 | 0 | 1,045 | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 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
# Import Salt Testing Libs
# Import Salt Libs
import salt.modules.timezone as timezone
import salt.utils.platform
GET_ZONE_FILE = 'salt.modules.timezone._get_zone_file'
GET_LOCALTIME_PATH = 'salt.mo... | 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... | 0 | 19,303 | 0 | 0 | 0 | 0 | 0 | 211 | 222 |
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... | 0 | 0 | 0 | 0 | 0 | 74 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 |
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.nn as nn
| 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... | 0 | 0 | 0 | 3,559 | 0 | 0 | 0 | -3 | 67 |
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
if __name__ == '__main__':
... | 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 | 0 | 0 | 0 | 0 | -2 | 88 |
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 | import lxml.etree as etree | 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... | 0 | 0 | 0 | 5,299 | 0 | 0 | 0 | -8 | 110 |
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 |
# 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_t(3, 4))
# print (p_t2(5, 3))
# print (... | 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... | 0 | 0 | 0 | 0 | 0 | 2,308 | 0 | -24 | 847 |
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
from person_counting.utils.preprocessing import get_filtered_lengths
from person_counting.utils.scaler import FeatureScaler, LabelScaler
from person_counting.utils.preprocessing import apply_file_filters
def create_datagen(
top_path,
sample,
label_file,
augmentation_fact... | 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... | 0 | 0 | 0 | 755 | 0 | 0 | 0 | 164 | 201 |
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_to_cosd... | 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 | 0 | 0 | 0 | 0 | 6 | 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... | 0 | 0 | 0 | 0 | 0 | 29,337 | 0 | 16 | 781 |
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)
admin.site.register(QualificationGrant)
adm... | 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 | 0 | 0 | 0 | 0 | 39 | 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... | 0 | 0 | 0 | 14,693 | 0 | 515 | 0 | 5 | 180 |
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.uix.selectableview import SelectableView
from kivy.uix.listview import ListItemButton
from kivy.lang import Builder
from kivy.factory import Factory
# [TODO] Will SelectableView be in the kivy/factory_registers.py,
# as a result of setup.py? ListItemButton? others?
Factory.register('SelectableView', c... | 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... | 0 | 0 | 0 | 1,206 | 0 | 0 | 0 | 72 | 90 |
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 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 given tag list.
Par... | 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 | 0 | 0 | 0 | 0 | -22 | 44 |
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
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... | 96 | 0 | 0 | 0 | 0 | 1,497 | 0 | -25 | 181 |
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.
#
| 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... | 0 | 0 | 0 | 3,372 | 0 | 0 | 0 | 50 | 90 |
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.builder import ConfigBuilder
__all_... | 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 | 0 | 0 | 0 | 0 | 91 | 46 |
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 re
LANGUAGE = 'en'
NEWLINE_PATTERN = re.compile(r'(\r\n|\r|\n)')
OPENSUBTITLES_URL = 'http://api.opensubtitles.org/xml-rpc'
OPENSUBTITLES_UA = 'subvoc v1.0'
UNICODE_BOM = u'\N{ZERO WIDTH NO-BREAK SPACE}'
| 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-... | 0 | 502 | 0 | 3,000 | 0 | 0 | 0 | 14 | 201 |
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,... | 0 | 4,107 | 0 | 12,190 | 0 | 0 | 0 | 574 | 423 |
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 -*-
from .daoora import DaoOra
from .aes_decryptor import Prpcrypt
daoora = DaoOra()
prpCryptor = Prpcrypt()
cryColList = ['cert_no','qq','cell','card_no','database_password']
configMap = {
'oracle':ora_primary_config,
'mysql':'my_primary_config'}
daoMap = {
'oracle':daoora,
'mys... | 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... | 3,555 | 4,272 | 0 | 0 | 0 | 23,038 | 0 | 291 | 980 |
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 | 0 | 0 | 0 | 0 | 0 | 0 |
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 sys
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])... | 52 | 0 | 0 | 0 | 0 | 1,241 | 0 | -15 | 162 |
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 django.contrib.auth import get_user_model
User = get_user_model()
| 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... | 2 | 0 | 0 | 4,807 | 0 | 0 | 0 | 132 | 177 |
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 |
AGGREGATION_MODES = ["mean", "max", "min"]
| 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):... | 0 | 262 | 0 | 1,943 | 0 | 0 | 0 | -19 | 90 |
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"""
| 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
... | 0 | 0 | 0 | 0 | 0 | 394 | 0 | 40 | 68 |
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.
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: parameters defining the lorenz attractor
Returns:
x_dot, y_dot, z_... | 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 | 0 | 0 | 0 | 0 | 18 | 50 |
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
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_size, 2)).to(device) * 10
ds = ImageDataset("data/fox.j... | 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... | 0 | 0 | 0 | 725 | 0 | 2,300 | 0 | -6 | 204 |
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
| 35.213389 | 113 | 0.361157 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
# IMPORTS
# =============================================================================
from __future__ import unicode_literals
from unittest import TestCas... | 126 | 0 | 0 | 32,976 | 0 | 0 | 0 | 173 | 180 |
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... | 0 | 1,014 | 0 | 420 | 0 | 0 | 0 | 95 | 117 |
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 |
app = create_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 ... | 0 | 408 | 0 | 0 | 0 | 2,962 | 0 | 116 | 221 |
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 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 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... | 0 | 0 | 0 | 96 | 0 | 28 | 0 | 0 | 54 |
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
| 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 | 0 | 0 | 676 | 0 | 0 | 0 | 11 | 46 |
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 Entry
from PIL import 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 = tk.Tk()
window.geometry("1000x600... | 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... | 0 | 0 | 0 | 0 | 0 | 3,093 | 0 | 33 | 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
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:"),
dcc.Dropdown(
id='names',
... | 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:"),
... | 0 | 191 | 0 | 0 | 0 | 0 | 0 | 22 | 45 |
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
## Short Code Contest
# from .utils import login, clean, penalty
# from .models import CodeforcesContest, CodeforcesContestSubmissio... | 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 | 0 | 0 | 0 | 0 | 43 | 44 |
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."""
| 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 | 5,596 | 94 | 0 | 0 | 0 | 86 | 135 |
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... | 0 | 0 | 0 | 15,757 | 0 | 0 | 0 | 72 | 244 |
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 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.path.insert(0, pat... | 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... | 0 | 0 | 0 | 394 | 0 | 1,174 | 0 | 32 | 180 |
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 | 0 | 0 | 0 | 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 urllib.request
import os
import hashlib
test_img_url1 = 'https://camo.githubusercontent.com/810bdde0a88bc3f8ce70c5d85d8537c37f707abe/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f7468756d622f652f65632f4d6f6e615f4c6973612c5f62795f4c656f6e6172646f5f64615f56696e63692... | 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... | 0 | 865 | 0 | 0 | 0 | 1,762 | 0 | 92 | 330 |
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 | 0 | 0 | 0 | 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.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
:param file_path: The file p... | 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 | 0 | 0 | 0 | 0 | 2 | 22 |
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... | 2 | 0 | 0 | 513 | 0 | 0 | 0 | 8 | 23 |
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 datashader as ds
import rasterio as rio
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.bounds.left, src.bounds.right)
y_range =... | 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... | 0 | 0 | 0 | 0 | 0 | 1,615 | 0 | -1 | 207 |
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 | 0 | 0 | 0 | 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 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 optimizer state to file"... | 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
... | 0 | 0 | 0 | 544 | 0 | 99 | 0 | -21 | 95 |
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 | #from datetime import datetime, timezone
co_county_sf = '/Users/rl/scratch/covid-19/facebook/co_counties/co_counties.shp'
boulder_county_zone_sf = '/Users/rl/scratch/covid-19/facebook/boulder_county_zoning/Zoning__Zoning_Districts.shp'
| 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 ... | 0 | 0 | 0 | 0 | 0 | 2,011 | 0 | 12 | 314 |
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.Service.UserService import UserService
from saiqa.Service.QuestionService import QuestionService
service = UserService('test')
qser = QuestionService('test')
# List of tests:
# Good Register
# Password Mismatch
# Incorrect Username Format
# Incorrect Password Format 1
# Incorrect Password Format ... | 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... | 0 | 0 | 0 | 0 | 0 | 1,084 | 0 | 78 | 88 |
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.
# Ope... | 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... | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f88380005fdf72aec41b2332e31913dae1f756f6 | 7,742 | py | Python | src/operations/classification/svm.py | vmariiechko/python-image-processing | 5613440dc04140845600b8c37a2b28786d504815 | [
"MIT"
] | null | null | null | src/operations/classification/svm.py | vmariiechko/python-image-processing | 5613440dc04140845600b8c37a2b28786d504815 | [
"MIT"
] | null | null | null | src/operations/classification/svm.py | vmariiechko/python-image-processing | 5613440dc04140845600b8c37a2b28786d504815 | [
"MIT"
] | null | null | null | from matplotlib import use
use("Qt5Agg")
| 40.322917 | 111 | 0.652803 | import matplotlib.pyplot as plt
from cv2 import (ml, imread, threshold, findContours, moments, contourArea, arcLength,
boundingRect, drawContours, cvtColor,
IMREAD_GRAYSCALE, TERM_CRITERIA_MAX_ITER, COLOR_GRAY2RGB)
from numpy import (array, matrix, ones, empty, delete, sqrt, pi,
... | 0 | 0 | 0 | 6,920 | 0 | 0 | 0 | 532 | 247 |
104572a8ccb0d0755cba08b5cf533bc06da49b4a | 12,012 | py | Python | python/configPoster.py | crotwell/dragrace | 2fdb009e9ca7e868e1435d3a38ac81a0b3698433 | [
"MIT"
] | 12 | 2018-11-27T16:18:16.000Z | 2020-01-10T03:17:26.000Z | python/configPoster.py | crotwell/dragrace | 2fdb009e9ca7e868e1435d3a38ac81a0b3698433 | [
"MIT"
] | null | null | null | python/configPoster.py | crotwell/dragrace | 2fdb009e9ca7e868e1435d3a38ac81a0b3698433 | [
"MIT"
] | 1 | 2019-04-12T18:34:22.000Z | 2019-04-12T18:34:22.000Z | import argparse
import signal
#from netifaces import interfaces, ifaddresses, AF_INET
# #For Testing
# productionDirectory="./ConfigFiles"
# prepDir=productionDirectory + "/ConfigFileEdit"
# archiveDir=productionDirectory + "/ConfigFileArchive"
# deployDir=productionDirectory + "/Run/ConfigFile"
# For Production Run
... | 42 | 128 | 0.542791 | import argparse
import asyncio
import json
import math
import random
import signal
import time
from datetime import datetime, timedelta
#from netifaces import interfaces, ifaddresses, AF_INET
import socket
import traceback
import configChecker
import filecmp
import shutil
import sys
import simpleDali
# #For Testing
#... | 0 | 0 | 1,011 | 9,308 | 0 | 215 | 0 | -70 | 333 |
bb1f0421abd7c4f41cf11d86404f6403f7af7587 | 832 | py | Python | pie/util.py | andrearommal/PIe | 1502423b5377c1162fbe4fa953af9abea7f8e56b | [
"Apache-2.0"
] | null | null | null | pie/util.py | andrearommal/PIe | 1502423b5377c1162fbe4fa953af9abea7f8e56b | [
"Apache-2.0"
] | null | null | null | pie/util.py | andrearommal/PIe | 1502423b5377c1162fbe4fa953af9abea7f8e56b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
util.py
Created by Ronak Shah on April 12, 2018.
Copyright (c) 2018 Northwell Health. All rights reserved.
"""
import json
import logging
import os
import sys
RESOURCE_FILE = os.getenv('PIE_RESOURCE_CONFIG', "pie_resources.json")
JSON_CONFIG = json.load(open(RESOURCE_FILE))... | 26.83871 | 70 | 0.772837 | #!/usr/bin/env python
# encoding: utf-8
"""
util.py
Created by Ronak Shah on April 12, 2018.
Copyright (c) 2018 Northwell Health. All rights reserved.
"""
import json
import logging
import os
import sys
RESOURCE_FILE = os.getenv('PIE_RESOURCE_CONFIG', "pie_resources.json")
JSON_CONFIG = json.load(open(RESOURCE_FILE))... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2672c05fc5faec2576b9d7fe6a08752dbcc31a12 | 5,115 | py | Python | src/ventcat/app.py | rohe/verify_entcat | df6dc2be0abc4115273d0b20c14dc90f03cab98d | [
"Apache-2.0"
] | null | null | null | src/ventcat/app.py | rohe/verify_entcat | df6dc2be0abc4115273d0b20c14dc90f03cab98d | [
"Apache-2.0"
] | null | null | null | src/ventcat/app.py | rohe/verify_entcat | df6dc2be0abc4115273d0b20c14dc90f03cab98d | [
"Apache-2.0"
] | null | null | null | import logging
from saml2 import BINDING_HTTP_POST
from saml2 import BINDING_HTTP_REDIRECT
logger = logging.getLogger(__name__)
BINDING_MAP = {'post': BINDING_HTTP_POST, 'redirect': BINDING_HTTP_REDIRECT}
| 35.520833 | 82 | 0.516129 | import json
import cherrypy
import logging
from saml2 import BINDING_HTTP_POST
from saml2 import BINDING_HTTP_REDIRECT
from ventcat import conv_response, as_unicode
from ventcat import UnSupported
from ventcat.acs import ACS
from ventcat.response import Response, make_cookie
from ventcat.sso import SSO
logger = log... | 0 | 1,849 | 0 | 2,819 | 0 | 0 | 0 | 59 | 179 |
53b07645beb6a37bb39e8fb6d9e458b88789c6b6 | 770 | py | Python | gamemacros.py | GameTL/GameMacros | b573c0fbabc332873f2030728a5f9d52f64e0856 | [
"MIT"
] | null | null | null | gamemacros.py | GameTL/GameMacros | b573c0fbabc332873f2030728a5f9d52f64e0856 | [
"MIT"
] | null | null | null | gamemacros.py | GameTL/GameMacros | b573c0fbabc332873f2030728a5f9d52f64e0856 | [
"MIT"
] | null | null | null | # Version 3.0 - 2021 September 10
# work for both Mac, Windows, Linux
# use clear() for clearing terminal
# Method 1
# from clearterminal import * -----> clear()
# Method 2
# import clearterminal -----> clearterminal.clear()
import platform
platform = platform.system()
if platform == 'Darwin': # for Unix (MacOS, Linux... | 23.333333 | 59 | 0.68961 | # Version 3.0 - 2021 September 10
# work for both Mac, Windows, Linux
# use clear() for clearing terminal
# Method 1
# from clearterminal import * -----> clear()
# Method 2
# import clearterminal -----> clearterminal.clear()
import os
import platform
platform = platform.system()
if platform == 'Darwin': # for Unix (Ma... | 0 | 0 | 0 | 0 | 0 | 11 | 0 | -12 | 45 |
73c231f843e281f5793ac6d65c263fc1d0984a82 | 2,629 | py | Python | tovp/users/views.py | nrsimha/tovp | 311bc957c95c294811d737f5df30b0a218d35610 | [
"MIT"
] | null | null | null | tovp/users/views.py | nrsimha/tovp | 311bc957c95c294811d737f5df30b0a218d35610 | [
"MIT"
] | null | null | null | tovp/users/views.py | nrsimha/tovp | 311bc957c95c294811d737f5df30b0a218d35610 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Import the reverse lookup function
# view imports
# Will be used for logged in and logged out messages
from django.contrib.auth.signals import user_logged_in, user_logged_out
# Only authenticated users can access views using this.
# Import the form from users/forms.py
# Import the customi... | 31.674699 | 83 | 0.732218 | # -*- coding: utf-8 -*-
# Import the reverse lookup function
from django.core.urlresolvers import reverse
# view imports
from django.views.generic import DetailView
from django.views.generic import RedirectView
from django.views.generic import UpdateView
from django.views.generic import ListView
# Will be used for lo... | 0 | 0 | 0 | 1,371 | 0 | 331 | 0 | 162 | 336 |
5189a017d03f3a9e16de5ab89f9496ace97a2cf5 | 12,191 | py | Python | edge_scripts/robot_support.py | OSU-AIMS/tic-tac-toe | b213e2e16b95671f78a79fd9b8d6046c30cd0a54 | [
"Apache-2.0"
] | 2 | 2021-08-12T18:45:27.000Z | 2021-12-27T04:28:37.000Z | edge_scripts/robot_support.py | OSU-AIMS/tic-tac-toe | b213e2e16b95671f78a79fd9b8d6046c30cd0a54 | [
"Apache-2.0"
] | 11 | 2021-07-09T14:49:30.000Z | 2022-03-04T16:59:54.000Z | edge_scripts/robot_support.py | OSU-AIMS/tic-tac-toe | b213e2e16b95671f78a79fd9b8d6046c30cd0a54 | [
"Apache-2.0"
] | 1 | 2021-12-27T04:28:41.000Z | 2021-12-27T04:28:41.000Z | #!/usr/bin/env python
### IMPORTS
#
# `moveit_commander` namespace allows Python MoveIt interfaces.
# Includes a `MoveGroupCommander`_, `PlanningSceneInterface`_, and `RobotCommander`_ class
#
# Additional imports allow used for support, ROS messages, and etc.
import geometry_msgs.msg
from moveit_commander.conversion... | 36.71988 | 120 | 0.703634 | #!/usr/bin/env python
### IMPORTS
#
# `moveit_commander` namespace allows Python MoveIt interfaces.
# Includes a `MoveGroupCommander`_, `PlanningSceneInterface`_, and `RobotCommander`_ class
#
# Additional imports allow used for support, ROS messages, and etc.
import sys
import copy
import rospy
import moveit_comman... | 0 | 0 | 0 | 10,663 | 0 | 0 | 0 | 68 | 244 |
b4d0c4319db41b600e68c367ddf3793d8cf65162 | 1,222 | py | Python | client/test/test_packet.py | estcube/telemetry-forwarding-client | be659c8dd8e4bd26d1d1974d63f90acffd150e34 | [
"MIT"
] | 3 | 2020-06-11T12:34:25.000Z | 2020-09-16T12:06:32.000Z | client/test/test_packet.py | estcube/telemetry-forwarding-client | be659c8dd8e4bd26d1d1974d63f90acffd150e34 | [
"MIT"
] | 57 | 2020-09-16T09:11:04.000Z | 2022-02-28T01:32:13.000Z | client/test/test_packet.py | estcube/Telemetry-Forwarding-Client | be659c8dd8e4bd26d1d1974d63f90acffd150e34 | [
"MIT"
] | null | null | null |
hk_packet = generate_icp()
for byte in hk_packet:
print('{:02x}'.format(byte).upper(), end="")
print()
target = Main.from_bytes(hk_packet)
print({target.common_data.uptime})
print({target.spec_data.obc.fmc_mram_temp})
print({target.spec_data.aocs.sun_y_intensity_loc4})
| 21.438596 | 55 | 0.711948 | from random import random
from hk_common import *
from hk_sp import *
from test_code_common import *
from test_code_eps import *
from test_code_aocs import *
from test_code_obc import *
from test_code_st import *
from test_code_sp import *
from test_code_pcom import *
from test_code_scom import *
from client.kaitai.... | 0 | 0 | 0 | 0 | 0 | 556 | 0 | 74 | 313 |
f5f32bf9fc9897c7d19c064ce63795ce31ac13eb | 415 | py | Python | daysxtractor/daysselector.py | sebMathieu/daysxtractor | 744b535fbdd1e9186edc0f7562ce3bd920855c05 | [
"MIT"
] | 1 | 2020-09-15T07:29:18.000Z | 2020-09-15T07:29:18.000Z | daysxtractor/daysselector.py | sebMathieu/daysxtractor | 744b535fbdd1e9186edc0f7562ce3bd920855c05 | [
"MIT"
] | null | null | null | daysxtractor/daysselector.py | sebMathieu/daysxtractor | 744b535fbdd1e9186edc0f7562ce3bd920855c05 | [
"MIT"
] | null | null | null | ##@package daysselector
# @author Sebastien MATHIEU
## Abstract class of a day selector.
| 24.411765 | 64 | 0.722892 | ##@package daysselector
# @author Sebastien MATHIEU
from abc import ABCMeta, abstractmethod
## Abstract class of a day selector.
class DaysSelector:
__metaclass__ = ABCMeta
## Select representative days from time series.
# @param data Data with the time series.
# @return Dictionary with the select d... | 0 | 46 | 0 | 215 | 0 | 0 | 0 | 18 | 45 |
6a73b83c877297fb609627c070518c8f93ebfd7a | 38,276 | py | Python | deepinterpolation/generator_collection.py | sakuroki/deepinterpolation | 0b08cfbbdb02eec6d2bc2badfd007070fc020bc7 | [
"Unlicense"
] | null | null | null | deepinterpolation/generator_collection.py | sakuroki/deepinterpolation | 0b08cfbbdb02eec6d2bc2badfd007070fc020bc7 | [
"Unlicense"
] | null | null | null | deepinterpolation/generator_collection.py | sakuroki/deepinterpolation | 0b08cfbbdb02eec6d2bc2badfd007070fc020bc7 | [
"Unlicense"
] | null | null | null | # Class to generate data for training
import tensorflow.keras as keras
| 36.143532 | 131 | 0.604844 | # Class to generate data for training
import numpy as np
import json
import h5py
import os
import tensorflow.keras as keras
from deepinterpolation.generic import JsonLoader
import tifffile
import nibabel as nib
from scipy.io import wavfile
import s3fs
class MaxRetryException(Exception):
# This is helper class for ... | 0 | 0 | 0 | 37,810 | 0 | 0 | 0 | -17 | 405 |
31d15073f4299bffb88f36168fb8ffcab78c52c8 | 1,228 | py | Python | migrations/versions/b652b688d0ed_.py | firmitfeng/SurveysFlask | d25cdd68261088cfdf9596b291f70a1b0c32fd25 | [
"MIT"
] | null | null | null | migrations/versions/b652b688d0ed_.py | firmitfeng/SurveysFlask | d25cdd68261088cfdf9596b291f70a1b0c32fd25 | [
"MIT"
] | null | null | null | migrations/versions/b652b688d0ed_.py | firmitfeng/SurveysFlask | d25cdd68261088cfdf9596b291f70a1b0c32fd25 | [
"MIT"
] | null | null | null | """empty message
Revision ID: b652b688d0ed
Revises: c6170594b21e
Create Date: 2017-06-22 12:43:46.146126
"""
# revision identifiers, used by Alembic.
revision = 'b652b688d0ed'
down_revision = 'c6170594b21e'
| 30.7 | 80 | 0.673453 | """empty message
Revision ID: b652b688d0ed
Revises: c6170594b21e
Create Date: 2017-06-22 12:43:46.146126
"""
# revision identifiers, used by Alembic.
revision = 'b652b688d0ed'
down_revision = 'c6170594b21e'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | 0 | 0 | 0 | 0 | 0 | 922 | 0 | 3 | 91 |
29f40798e34ed8bade7a6e4e67fca54f24b3f2fb | 403 | py | Python | find_num.py | sanchagrins/Python | aad28edb8fd338a8da30f515e8239b403c6902b0 | [
"MIT"
] | null | null | null | find_num.py | sanchagrins/Python | aad28edb8fd338a8da30f515e8239b403c6902b0 | [
"MIT"
] | null | null | null | find_num.py | sanchagrins/Python | aad28edb8fd338a8da30f515e8239b403c6902b0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Purpose: Exercise for Coursera Class Using Python to Access Web Data.
# Reads through a file, extracts numbers using regex and sums them.
import re
fh = open("regex_sum_320787.txt", 'r')
numlist = list()
for line in fh:
line = line.rstrip()
x = re.findall('[0-9]+', line)
... | 25.1875 | 76 | 0.632754 | #!/usr/bin/env python
# Purpose: Exercise for Coursera Class Using Python to Access Web Data.
# Reads through a file, extracts numbers using regex and sums them.
import re
fh = open("regex_sum_320787.txt", 'r')
numlist = list()
for line in fh:
line = line.rstrip()
x = re.findall('[0-9]+', line)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a2725f355ef2b28067c0cff16fc47dcc673d222c | 7,418 | py | Python | Level3.py | MAXIORBOY/ReflexGame | 69d3c12f2a227cd948009f863fb5c16ce1c70256 | [
"MIT"
] | null | null | null | Level3.py | MAXIORBOY/ReflexGame | 69d3c12f2a227cd948009f863fb5c16ce1c70256 | [
"MIT"
] | null | null | null | Level3.py | MAXIORBOY/ReflexGame | 69d3c12f2a227cd948009f863fb5c16ce1c70256 | [
"MIT"
] | null | null | null |
pygame.init()
| 42.878613 | 263 | 0.630089 | import random
from Items import *
pygame.init()
class TerroristsAndCivilians:
def __init__(self, window_width, window_height):
self.targets = Sprites()
self.grid = Grid(window_width, window_height, self.targets.sprite_dimension)
self.terrorist, self.civilian = self.pick_fruit()
se... | 0 | 0 | 0 | 7,297 | 0 | 0 | 0 | -10 | 113 |
d745485ddfded67faabda3bdea895d1e8ceaa236 | 4,304 | py | Python | test_data/VoigtFit_example.py | jkrogager/VoigtFit | ca84ff4b9e6827e2ca64cd03c9437ab5d4097f1a | [
"MIT"
] | 21 | 2018-03-06T02:06:03.000Z | 2022-01-18T05:24:35.000Z | test_data/VoigtFit_example.py | jkrogager/VoigtFit | ca84ff4b9e6827e2ca64cd03c9437ab5d4097f1a | [
"MIT"
] | 21 | 2018-03-03T11:53:09.000Z | 2022-03-02T20:43:34.000Z | test_data/VoigtFit_example.py | jkrogager/VoigtFit | ca84ff4b9e6827e2ca64cd03c9437ab5d4097f1a | [
"MIT"
] | 9 | 2018-05-16T03:34:19.000Z | 2021-11-30T02:38:17.000Z | import numpy as np
import VoigtFit
### Fit DLA towards quasar Q1313+1441
### Observed in X-shooter P089.A-0068
z_DLA = 1.7941
logNHI = 21.3, 0.1 # value, uncertainty
# If log(NHI) is not known use:
#logNHI = None
#### Load UVB and VIS data:
UVB_fname = 'data/test_UVB_1d.spec'
res_UVB = 8000
VIS_fname = 'data/test_... | 36.168067 | 113 | 0.745818 | import numpy as np
import VoigtFit
### Fit DLA towards quasar Q1313+1441
### Observed in X-shooter P089.A-0068
z_DLA = 1.7941
logNHI = 21.3, 0.1 # value, uncertainty
# If log(NHI) is not known use:
#logNHI = None
#### Load UVB and VIS data:
UVB_fname = 'data/test_UVB_1d.spec'
res_UVB = 8000
VIS_fname = 'data/test_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f6f7df60b9e4598c503b7ba14cfaa26f0c4b5828 | 1,098 | py | Python | add_person.py | tomasrasymas/face-recognition-python | 52da6697fb775cfcd0a7e1511b356f6fd9908678 | [
"MIT"
] | null | null | null | add_person.py | tomasrasymas/face-recognition-python | 52da6697fb775cfcd0a7e1511b356f6fd9908678 | [
"MIT"
] | null | null | null | add_person.py | tomasrasymas/face-recognition-python | 52da6697fb775cfcd0a7e1511b356f6fd9908678 | [
"MIT"
] | null | null | null | import os
import cv2
import face_detector
import config
if __name__ == '__main__':
camera = cv2.VideoCapture(0)
cv2.namedWindow("preview")
person_name = input('Person name: ').lower()
person_folder = os.path.join(config.original_images_path, person_name)
if not os.path.exists(person_folder):
... | 24.954545 | 87 | 0.571949 | import os
import cv2
import face_detector
import config
if __name__ == '__main__':
camera = cv2.VideoCapture(0)
cv2.namedWindow("preview")
person_name = input('Person name: ').lower()
person_folder = os.path.join(config.original_images_path, person_name)
if not os.path.exists(person_folder):
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3e246085f72d7330f51f46130b2cc931e524e49e | 3,261 | py | Python | nlptoolkit/nlp.py | jeroyang/nlptoolkit | d788fa9011133dca86823b590d23070883e59918 | [
"MIT"
] | null | null | null | nlptoolkit/nlp.py | jeroyang/nlptoolkit | d788fa9011133dca86823b590d23070883e59918 | [
"MIT"
] | null | null | null | nlptoolkit/nlp.py | jeroyang/nlptoolkit | d788fa9011133dca86823b590d23070883e59918 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import re
from itertools import chain, combinations
def clause_tokenize(sentence):
"""Split on comma or parenthesis, if there are more then three words for each clause"""
clause_re = re.compile(r'((?:\S+\s){2,}\S+,|(?:\S+\s){3,}(?=\((?:\S+\s){2,... | 45.929577 | 134 | 0.59399 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import re
from itertools import chain, combinations
def sent_tokenize(context):
paired_symbols = [("(", ")"),
("[", "]"),
("{", "}")]
paired_patterns = ["%s.*?%s" % (re.escape(lt), re.escape(rt)) for lt, rt in... | 0 | 0 | 0 | 0 | 0 | 974 | 0 | 0 | 46 |
2bc64e80bf72ed0f849deeb18ccd8a8117379138 | 1,517 | py | Python | sols/111.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | sols/111.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | sols/111.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
| 32.276596 | 63 | 0.507581 | from collections import deque
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
# BFS (Accepted), O(n) time, O(n) space
def minDepth(self, root: TreeNo... | 0 | 0 | 0 | 1,270 | 0 | 0 | 0 | 8 | 45 |
c064039faf659c2d777c4940242feee054cd300d | 24 | py | Python | src/utils/__version__.py | kevin3/cwl-ica | cf706ea42993d563f364c0847ee4b882f8fe067c | [
"MIT"
] | 8 | 2021-12-08T05:33:58.000Z | 2022-03-07T00:40:48.000Z | src/utils/__version__.py | kevin3/cwl-ica | cf706ea42993d563f364c0847ee4b882f8fe067c | [
"MIT"
] | 34 | 2021-08-11T03:59:33.000Z | 2022-03-10T05:39:26.000Z | src/utils/__version__.py | kevin3/cwl-ica | cf706ea42993d563f364c0847ee4b882f8fe067c | [
"MIT"
] | 1 | 2022-01-08T07:34:55.000Z | 2022-01-08T07:34:55.000Z | version = "__VERSION__"
| 12 | 23 | 0.75 | version = "__VERSION__"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6e2107cf51e389f1a13fc9e21fc4ac6ecc14ba63 | 2,105 | py | Python | sherlock_scripts/pythonhops/sherlock_jacf.py | apoletayev/anomalous_ion_conduction | badb91e971e4a5263a433cfa9fcbf914d53ed2a1 | [
"MIT"
] | 2 | 2021-05-20T03:49:51.000Z | 2021-06-21T08:41:10.000Z | sherlock_scripts/pythonhops/sherlock_jacf.py | apoletayev/anomalous_ion_conduction | badb91e971e4a5263a433cfa9fcbf914d53ed2a1 | [
"MIT"
] | null | null | null | sherlock_scripts/pythonhops/sherlock_jacf.py | apoletayev/anomalous_ion_conduction | badb91e971e4a5263a433cfa9fcbf914d53ed2a1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 27 10:55:08 2020
@author: andreypoletaev
Assumptions made:
time is in picoseconds, timestep is 1 fs
"""
# =============================================================================
# %% Imports & constants
# ==========================... | 32.384615 | 122 | 0.55772 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 27 10:55:08 2020
@author: andreypoletaev
Assumptions made:
time is in picoseconds, timestep is 1 fs
"""
# =============================================================================
# %% Imports & constants
# ==========================... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b13e94b4438f73055adcddf25912666ad6090be7 | 456 | py | Python | symptoms/admin.py | sjsafranek/symptom_tracker | 2e7d9ff3ed946ebbf18b366bbe79deb3b3c94a5c | [
"MIT"
] | null | null | null | symptoms/admin.py | sjsafranek/symptom_tracker | 2e7d9ff3ed946ebbf18b366bbe79deb3b3c94a5c | [
"MIT"
] | null | null | null | symptoms/admin.py | sjsafranek/symptom_tracker | 2e7d9ff3ed946ebbf18b366bbe79deb3b3c94a5c | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import models
admin.site.register(models.Agency)
admin.site.register(models.Therapist)
admin.site.register(models.Client)
admin.site.register(models.ClientSymptom)
admin.site.register(models.Session)
admin.site.register(models.SymptomScore)
# from guardian.admin import Guard... | 24 | 61 | 0.811404 | from django.contrib import admin
from . import models
admin.site.register(models.Agency)
admin.site.register(models.Therapist)
admin.site.register(models.Client)
admin.site.register(models.ClientSymptom)
admin.site.register(models.Session)
admin.site.register(models.SymptomScore)
# from guardian.admin import Guard... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
40cd83ad44db70333ce38a5c61c142021c8a2fe6 | 6,037 | py | Python | models/algorithms/libfm_fastfm.py | ucds-sg/h2oai | 7042860767dc25d1a7d7122103bbd5016d02df53 | [
"Apache-2.0"
] | 194 | 2019-04-23T10:25:13.000Z | 2022-03-29T04:19:28.000Z | models/algorithms/libfm_fastfm.py | ucds-sg/h2oai | 7042860767dc25d1a7d7122103bbd5016d02df53 | [
"Apache-2.0"
] | 50 | 2019-06-24T20:17:51.000Z | 2022-03-16T20:05:37.000Z | models/algorithms/libfm_fastfm.py | ucds-sg/h2oai | 7042860767dc25d1a7d7122103bbd5016d02df53 | [
"Apache-2.0"
] | 85 | 2019-03-27T12:26:43.000Z | 2022-01-27T13:15:37.000Z | """LibFM implementation of fastFM """
# paper: https://arxiv.org/abs/1505.00641
| 39.980132 | 109 | 0.563525 | """LibFM implementation of fastFM """
import datatable as dt
import numpy as np
from sklearn.preprocessing import LabelEncoder
from h2oaicore.models import CustomModel
from sklearn.model_selection import StratifiedKFold
from sklearn.calibration import CalibratedClassifierCV
from sklearn.base import BaseEstimator, Class... | 0 | 283 | 0 | 5,270 | 0 | 0 | 0 | 180 | 221 |
87da8a733dcef29dd32be297bf9fda26b92a975c | 1,525 | py | Python | CursoIntensivoPython/alien_invasion/exercicio/star.py | SweydAbdul/estudos-python | b052708d0566a0afb9a1c04d035467d45f820879 | [
"MIT"
] | null | null | null | CursoIntensivoPython/alien_invasion/exercicio/star.py | SweydAbdul/estudos-python | b052708d0566a0afb9a1c04d035467d45f820879 | [
"MIT"
] | null | null | null | CursoIntensivoPython/alien_invasion/exercicio/star.py | SweydAbdul/estudos-python | b052708d0566a0afb9a1c04d035467d45f820879 | [
"MIT"
] | null | null | null |
inicia_jogo() | 26.754386 | 67 | 0.602623 | import pygame
from pygame.sprite import Sprite
import sys
class Estrela(Sprite):
"""Uma classe que representa uma unica estrela"""
def __init__(self, tela, janela):
"""Inicializa a estrela e define sua posicao inicial."""
super(Estrela, self).__init__()
self.janela = janela
sel... | 0 | 0 | 0 | 973 | 0 | 431 | 0 | -8 | 112 |
023de8aa7308628a653ef21d3dd78f164e3e9392 | 9,144 | py | Python | tools/tests/helperInclude.py | spockthegray/mantaflow | df72cf235e14ef4f3f8fac9141b5e0a8707406b3 | [
"Apache-2.0"
] | 158 | 2018-06-24T17:42:13.000Z | 2022-03-12T13:29:43.000Z | tools/tests/helperInclude.py | spockthegray/mantaflow | df72cf235e14ef4f3f8fac9141b5e0a8707406b3 | [
"Apache-2.0"
] | 5 | 2018-09-05T07:30:48.000Z | 2020-07-01T08:56:28.000Z | tools/tests/helperInclude.py | spockthegray/mantaflow | df72cf235e14ef4f3f8fac9141b5e0a8707406b3 | [
"Apache-2.0"
] | 35 | 2018-06-13T04:05:42.000Z | 2022-03-29T16:55:24.000Z | #
# Helper functions for test runs in mantaflow
#
# ------------------------------------------------------------------------------------------
# test result checking
# global var to print manta version once per test
printVersion = 1
# compare a grid, in generation mode (MANTA_GEN_TEST_DATA=1) it
# creates the d... | 36.722892 | 141 | 0.675962 | #
# Helper functions for test runs in mantaflow
#
from manta import *
import os
import shutil
import re
from helperGeneric import *
# ------------------------------------------------------------------------------------------
# test result checking
def checkResult( name, result, resultRel , thresh, threshStrict, i... | 0 | 0 | 0 | 0 | 0 | 7,720 | 0 | -28 | 244 |
0a20c06ff463c05d267ec94c8d6e0ff76393e309 | 152 | py | Python | gym_marl_reconnaissance/__init__.py | JacopoPan/gym-marl-reconnaissance | 85a4373f3ebee66b12c88a0bdd5e4e96f9606e5a | [
"MIT"
] | 4 | 2021-08-29T20:13:38.000Z | 2022-02-28T02:39:17.000Z | gym_marl_reconnaissance/__init__.py | JacopoPan/gym-marl-reconnaissance | 85a4373f3ebee66b12c88a0bdd5e4e96f9606e5a | [
"MIT"
] | 1 | 2022-02-28T02:26:04.000Z | 2022-03-22T15:30:58.000Z | gym_marl_reconnaissance/__init__.py | JacopoPan/gym-marl-reconnaissance | 85a4373f3ebee66b12c88a0bdd5e4e96f9606e5a | [
"MIT"
] | null | null | null | from gym.envs.registration import register
register(
id='recon-arena-v0',
entry_point='gym_marl_reconnaissance.envs.recon_arena:ReconArena',
)
| 21.714286 | 70 | 0.776316 | from gym.envs.registration import register
register(
id='recon-arena-v0',
entry_point='gym_marl_reconnaissance.envs.recon_arena:ReconArena',
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9c220a151084c5a15cafe9c0fb7e9461558a125f | 165 | py | Python | aliyun/dns/__init__.py | getlantern/python-aliyun | 524ccdc991f952433b2636a94266d31b00823f66 | [
"Apache-2.0"
] | 38 | 2015-05-21T05:59:14.000Z | 2018-11-28T09:14:07.000Z | aliyun/dns/__init__.py | getlantern/python-aliyun | 524ccdc991f952433b2636a94266d31b00823f66 | [
"Apache-2.0"
] | 16 | 2015-03-20T17:55:41.000Z | 2018-05-15T15:09:15.000Z | aliyun/dns/__init__.py | getlantern/python-aliyun | 524ccdc991f952433b2636a94266d31b00823f66 | [
"Apache-2.0"
] | 27 | 2015-03-16T18:32:16.000Z | 2020-11-30T05:28:06.000Z | """
Aliyun ECS
==========
The following DNS API actions are nearly fully supported:
* AddDomainRecord
* DeleteDomainRecord
* DescribeDomainRecords
"""
| 15 | 57 | 0.672727 | """
Aliyun ECS
==========
The following DNS API actions are nearly fully supported:
* AddDomainRecord
* DeleteDomainRecord
* DescribeDomainRecords
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |