hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4c2f7f010bb36a1b149b6ed4a2993bec6ebd5275 | 454 | py | Python | traffic/urls.py | zyayoung/lab-item-tracking | 6d0ee000114300d6693ec078f974b9a6ef4dfe40 | [
"MIT"
] | 4 | 2019-01-14T15:44:22.000Z | 2019-01-16T16:07:19.000Z | traffic/urls.py | zyayoung/lab-item-tracking | 6d0ee000114300d6693ec078f974b9a6ef4dfe40 | [
"MIT"
] | 2 | 2019-02-01T00:50:20.000Z | 2019-02-22T15:15:54.000Z | traffic/urls.py | zyayoung/lab-item-tracking | 6d0ee000114300d6693ec078f974b9a6ef4dfe40 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from traffic import views
app_name = 'traffic'
urlpatterns = [
# url(r'^$', views.index),
# url(r'^index/', views.index),
url(r'^traffic/pages/$', views.page_view, name='performance'),
url(r'^traffic/calender/$', views.calender_view, name='calender'),
url(r'^traff... | 30.266667 | 79 | 0.674009 | from django.conf.urls import url
from traffic import views
app_name = 'traffic'
urlpatterns = [
# url(r'^$', views.index),
# url(r'^index/', views.index),
url(r'^traffic/pages/$', views.page_view, name='performance'),
url(r'^traffic/calender/$', views.calender_view, name='calender'),
url(r'^traff... | 0 | 0 | 0 |
505aa41c67cd2ed4b63a6e36f75de2f82d28a41f | 1,337 | py | Python | accounts/urls.py | Alwin1847207/Hackathon | 473adea12822cbe2be9a7525ac29391659f0ab6b | [
"bzip2-1.0.6"
] | null | null | null | accounts/urls.py | Alwin1847207/Hackathon | 473adea12822cbe2be9a7525ac29391659f0ab6b | [
"bzip2-1.0.6"
] | null | null | null | accounts/urls.py | Alwin1847207/Hackathon | 473adea12822cbe2be9a7525ac29391659f0ab6b | [
"bzip2-1.0.6"
] | null | null | null | from django.urls import path, include
from accounts import views
urlpatterns = [
path('', views.indx, name='accounts'),
<<<<<<< HEAD
path('/signup', views.signup, name='signup'),
path('logout', views.logout, name='logout'),
path('/login', views.loginn, name='login'),
path('/usertpe/<int:pk>/', vie... | 46.103448 | 80 | 0.670157 | from django.urls import path, include
from accounts import views
urlpatterns = [
path('', views.indx, name='accounts'),
<<<<<<< HEAD
path('/signup', views.signup, name='signup'),
path('logout', views.logout, name='logout'),
path('/login', views.loginn, name='login'),
path('/usertpe/<int:pk>/', vie... | 0 | 0 | 0 |
3ab8da9645179c73a62da6edd4b18e895e3c8ecc | 61 | py | Python | applications/silverlance/__init__.py | triflesoft/django-application-silverlance | 5bfa0d1d5dfb29eb784e43f36797ed8063d9e125 | [
"BSD-3-Clause"
] | null | null | null | applications/silverlance/__init__.py | triflesoft/django-application-silverlance | 5bfa0d1d5dfb29eb784e43f36797ed8063d9e125 | [
"BSD-3-Clause"
] | null | null | null | applications/silverlance/__init__.py | triflesoft/django-application-silverlance | 5bfa0d1d5dfb29eb784e43f36797ed8063d9e125 | [
"BSD-3-Clause"
] | null | null | null | default_app_config = 'silverlance.apps.SilverlanceAppConfig'
| 30.5 | 60 | 0.868852 | default_app_config = 'silverlance.apps.SilverlanceAppConfig'
| 0 | 0 | 0 |
b704428032a68287a446ffa22b449eed0c4d3477 | 7,778 | py | Python | scratch_wiki.py | tjvr/scratch-wiki-client | 04d935781ea2961470b37029b8c4d5e20158954e | [
"MIT"
] | 1 | 2016-03-17T18:25:26.000Z | 2016-03-17T18:25:26.000Z | scratch_wiki.py | tjvr/scratch-wiki-client | 04d935781ea2961470b37029b8c4d5e20158954e | [
"MIT"
] | 1 | 2018-07-14T18:52:29.000Z | 2018-07-14T18:52:29.000Z | scratch_wiki.py | tjvr/scratch-wiki-client | 04d935781ea2961470b37029b8c4d5e20158954e | [
"MIT"
] | null | null | null | """
A really simple MediaWiki API client for the Scratch Wiki.
Can:
* read pages
* edit pages
* list pages in category
* list page backlinks ("what links here")
* list page transclusions
Requires the `requests` library.
http://wiki.scratch.mit.edu/
Example Usage
=============
Get a page::
wiki = S... | 25.669967 | 92 | 0.525714 | """
A really simple MediaWiki API client for the Scratch Wiki.
Can:
* read pages
* edit pages
* list pages in category
* list page backlinks ("what links here")
* list page transclusions
Requires the `requests` library.
http://wiki.scratch.mit.edu/
Example Usage
=============
Get a page::
wiki = S... | 5,171 | 1,198 | 149 |
ed200ee83fd84d259f3a041dc2b65b14639e5e1c | 371 | py | Python | runehistory_api/app/events/account.py | RuneHistory/runehistory-api | 4e857c7fdbdf585d57cf4c7fe6214b565ac37a22 | [
"MIT"
] | null | null | null | runehistory_api/app/events/account.py | RuneHistory/runehistory-api | 4e857c7fdbdf585d57cf4c7fe6214b565ac37a22 | [
"MIT"
] | 6 | 2018-06-14T13:58:43.000Z | 2018-07-16T14:02:24.000Z | runehistory_api/app/events/account.py | RuneHistory/runehistory-api | 4e857c7fdbdf585d57cf4c7fe6214b565ac37a22 | [
"MIT"
] | null | null | null | from evntbus import Event
| 15.458333 | 40 | 0.725067 | from evntbus import Event
class AccountEvent(Event):
def __init__(self, account):
self.account = account
class AccountCreatedEvent(AccountEvent):
pass
class AccountUpdatedEvent(AccountEvent):
pass
class GotAccountEvent(AccountEvent):
pass
class GotAccountsEvent(Event):
def __init__... | 79 | 94 | 167 |
5e74d36026bb02646328df8a81b51f1a25db5f72 | 6,955 | py | Python | plugins/modules/panos_commit_panorama.py | Nothing4You/pan-os-ansible | 50078a71eef0c5e9a4263020135df6a0e05961bf | [
"Apache-2.0"
] | null | null | null | plugins/modules/panos_commit_panorama.py | Nothing4You/pan-os-ansible | 50078a71eef0c5e9a4263020135df6a0e05961bf | [
"Apache-2.0"
] | null | null | null | plugins/modules/panos_commit_panorama.py | Nothing4You/pan-os-ansible | 50078a71eef0c5e9a4263020135df6a0e05961bf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2020 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 31.613636 | 96 | 0.661251 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2020 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 2,683 | 0 | 23 |
74b88e79ca0426b717b4dde41f28f6fd54f1636a | 75 | py | Python | src/backend/door_api/database/__init__.py | xinkecf35/Door_Unlock_Web_GUI | 3aa2b00c51db525bd0c6fbdc1f3ad3d6fafcdc13 | [
"MIT"
] | 1 | 2021-09-22T18:08:53.000Z | 2021-09-22T18:08:53.000Z | src/backend/door_api/database/__init__.py | xinkecf35/Door_Unlock_Web_GUI | 3aa2b00c51db525bd0c6fbdc1f3ad3d6fafcdc13 | [
"MIT"
] | 10 | 2021-03-09T16:03:35.000Z | 2022-02-18T08:40:39.000Z | src/backend/door_api/database/__init__.py | Pitt-RAS/Door_Unlock_Web_GUI | 3aa2b00c51db525bd0c6fbdc1f3ad3d6fafcdc13 | [
"MIT"
] | null | null | null | from .Person import Person
from .Role import Role
from .Event import Event
| 18.75 | 26 | 0.8 | from .Person import Person
from .Role import Role
from .Event import Event
| 0 | 0 | 0 |
a860cef0e934467f7c1597b0b8fe5e6449065aef | 3,682 | py | Python | algorithm/kmax.py | wangyongjie-ntu/GUM | 09691059d3f0bbe9788ed08aa1fe68c88966a968 | [
"MIT"
] | null | null | null | algorithm/kmax.py | wangyongjie-ntu/GUM | 09691059d3f0bbe9788ed08aa1fe68c88966a968 | [
"MIT"
] | null | null | null | algorithm/kmax.py | wangyongjie-ntu/GUM | 09691059d3f0bbe9788ed08aa1fe68c88966a968 | [
"MIT"
] | 1 | 2021-09-06T06:18:02.000Z | 2021-09-06T06:18:02.000Z | import numpy as np
import random
import time
import copy
def kmax(data, init_centriod, L = 2, K = 3, max_iterations = 50):
'''
data: a collection of records
init_centriod: the inital centriod
L: top K attributes
K: cluster numbers
max_iterations: the max iteration before stop
'''
star... | 34.411215 | 111 | 0.599131 | import numpy as np
import random
import time
import copy
def kmax(data, init_centriod, L = 2, K = 3, max_iterations = 50):
'''
data: a collection of records
init_centriod: the inital centriod
L: top K attributes
K: cluster numbers
max_iterations: the max iteration before stop
'''
star... | 0 | 0 | 0 |
e025f5a766dade21ee38467fd1d7c3fb826fc616 | 16,581 | py | Python | RQ1_RQ2/Vehicle_case_study/Pymoo_GA/road_gen.py | dgumenyuk/Environment_generation | 092fbecdc208f84aa58f2ccd3522262984e79cda | [
"MIT"
] | null | null | null | RQ1_RQ2/Vehicle_case_study/Pymoo_GA/road_gen.py | dgumenyuk/Environment_generation | 092fbecdc208f84aa58f2ccd3522262984e79cda | [
"MIT"
] | null | null | null | RQ1_RQ2/Vehicle_case_study/Pymoo_GA/road_gen.py | dgumenyuk/Environment_generation | 092fbecdc208f84aa58f2ccd3522262984e79cda | [
"MIT"
] | null | null | null | '''
Module to generate the TC with the given probability to "go straight", "turn left" or "turn right"
'''
import numpy as np
from car_road import Map
import os
import config as cf
import json
class RoadGen:
"""Class for generating roads"""
def test_case_generate(self):
"""Function that produces a... | 38.470998 | 98 | 0.37742 | '''
Module to generate the TC with the given probability to "go straight", "turn left" or "turn right"
'''
import numpy as np
from car_road import Map
import os
import config as cf
import json
class RoadGen:
"""Class for generating roads"""
def __init__(
self,
map_size,
min_len, #... | 1,361 | 0 | 27 |
4b32f82ea884446c3a0243b93ffc476b9356d61c | 3,175 | py | Python | barry/datasets/dummy.py | AaronGlanville/Barry | f181448b2ed10a8c08195e7e34819ceb8abfe532 | [
"MIT"
] | null | null | null | barry/datasets/dummy.py | AaronGlanville/Barry | f181448b2ed10a8c08195e7e34819ceb8abfe532 | [
"MIT"
] | null | null | null | barry/datasets/dummy.py | AaronGlanville/Barry | f181448b2ed10a8c08195e7e34819ceb8abfe532 | [
"MIT"
] | null | null | null | import logging
from scipy.interpolate import splev, splrep
import numpy as np
from barry.cosmology import pk2xi
from barry.cosmology.camb_generator import getCambGenerator
from barry.datasets import PowerSpectrum_SDSS_DR12_Z061_NGC, CorrelationFunction_SDSS_DR12_Z061_NGC
class DummyPowerSpectrum_SDSS_DR12_Z061_NGC(P... | 36.918605 | 125 | 0.668031 | import logging
from scipy.interpolate import splev, splrep
import numpy as np
from barry.cosmology import pk2xi
from barry.cosmology.camb_generator import getCambGenerator
from barry.datasets import PowerSpectrum_SDSS_DR12_Z061_NGC, CorrelationFunction_SDSS_DR12_Z061_NGC
class DummyPowerSpectrum_SDSS_DR12_Z061_NGC(P... | 1,895 | 0 | 54 |
f847e50b19a49843e449cfa5833f7f5953c0356a | 1,529 | py | Python | website_monitor/utils/scheduler.py | KappaLambda/website-monitor | 2823e36d8089723fb3cca4ba9284f4754dd3d2cf | [
"MIT"
] | null | null | null | website_monitor/utils/scheduler.py | KappaLambda/website-monitor | 2823e36d8089723fb3cca4ba9284f4754dd3d2cf | [
"MIT"
] | null | null | null | website_monitor/utils/scheduler.py | KappaLambda/website-monitor | 2823e36d8089723fb3cca4ba9284f4754dd3d2cf | [
"MIT"
] | null | null | null | import logging
from datetime import datetime
import django_rq
from api.models import CheckTaskJob
from utils.check_url import check_url
logger = logging.getLogger(__name__)
| 31.854167 | 77 | 0.679529 | import logging
from datetime import datetime
import django_rq
from api.models import CheckTaskJob
from utils.check_url import check_url
logger = logging.getLogger(__name__)
def schedule(check_task):
scheduler = django_rq.get_scheduler('default', interval=10)
try:
job = scheduler.schedule(
... | 1,305 | 0 | 46 |
6a5979e35ae35b16b232f164213c0ce01d7bdc57 | 1,727 | py | Python | MuonGun/resources/scripts/fitting/fit_rdist.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | 1 | 2020-12-24T22:00:01.000Z | 2020-12-24T22:00:01.000Z | MuonGun/resources/scripts/fitting/fit_rdist.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | null | null | null | MuonGun/resources/scripts/fitting/fit_rdist.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | 3 | 2020-07-17T09:20:29.000Z | 2021-03-30T16:44:18.000Z | #!/usr/bin/env python
from optparse import OptionParser
parser = OptionParser(usage="%prog infile outfile")
opts, args = parser.parse_args()
try:
infile, outfile = args
except ValueError:
infile = "/data/uwa/jvansanten/projects/2012/muongun/corsika/SIBYLL/Hoerandel5/atmod_12.hdf5"
outfile = "Hoerandel5_atmod12_SIB... | 37.543478 | 133 | 0.738854 | #!/usr/bin/env python
from optparse import OptionParser
parser = OptionParser(usage="%prog infile outfile")
opts, args = parser.parse_args()
try:
infile, outfile = args
except ValueError:
infile = "/data/uwa/jvansanten/projects/2012/muongun/corsika/SIBYLL/Hoerandel5/atmod_12.hdf5"
outfile = "Hoerandel5_atmod12_SIB... | 0 | 0 | 0 |
282ba9d7a05ae894ba9605dbaa2a601f0198fc9b | 3,431 | py | Python | executiveorder/processors/wikisource.py | chrisengelsma/executive_orders | 5f0c7102b9abce3d44b54e5dd4c57bd0bb404037 | [
"MIT"
] | 2 | 2017-03-23T02:26:05.000Z | 2017-08-24T02:07:17.000Z | executiveorder/processors/wikisource.py | chrisengelsma/executive_orders | 5f0c7102b9abce3d44b54e5dd4c57bd0bb404037 | [
"MIT"
] | null | null | null | executiveorder/processors/wikisource.py | chrisengelsma/executive_orders | 5f0c7102b9abce3d44b54e5dd4c57bd0bb404037 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from executiveorder.util import *
from executiveorder.executiveorder import ExecutiveOrder
base_url = "https://en.wikisource.org"
url = "/wiki/Category:United_States_executive_orders"
eos = []
def get_all_pages(url):
'''
Gets all the pages in the base site.
'''
... | 23.340136 | 75 | 0.645001 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from executiveorder.util import *
from executiveorder.executiveorder import ExecutiveOrder
base_url = "https://en.wikisource.org"
url = "/wiki/Category:United_States_executive_orders"
eos = []
def run():
pages = get_all_pages(url)
for page in pages:
print page,'..... | 130 | 0 | 23 |
d7133c4a92f3ff0cce7398bb4696d9c8aa2a540b | 815 | py | Python | tests/issues/test_issue_459.py | XiangyiZhao/heterocl | fe69d532e7f64ee8b76419f4ff05b0cc27c77e8a | [
"Apache-2.0"
] | null | null | null | tests/issues/test_issue_459.py | XiangyiZhao/heterocl | fe69d532e7f64ee8b76419f4ff05b0cc27c77e8a | [
"Apache-2.0"
] | 1 | 2020-06-01T01:41:29.000Z | 2020-06-01T01:41:29.000Z | tests/issues/test_issue_459.py | XiangyiZhao/heterocl | fe69d532e7f64ee8b76419f4ff05b0cc27c77e8a | [
"Apache-2.0"
] | null | null | null | import heterocl as hcl
if __name__ == "__main__":
test() | 23.285714 | 54 | 0.509202 | import heterocl as hcl
def reduce(b, w, q):
bw = hcl.get_bitwidth(q.dtype)
bwh = bw // 2
mask = (1 << bwh) - 1
b = hcl.scalar(b, "b", dtype=hcl.UInt(bw))
w = hcl.scalar(w, "w", dtype=hcl.UInt(bw))
q = hcl.scalar(q, "q", dtype=hcl.UInt(bw))
a = w * b
for i in range(2):
t = (-a... | 707 | 0 | 46 |
b56dae7549336a201f155c6bf722542d1df8bb93 | 1,383 | py | Python | Python/Problem#7.py | Wolfy7/DailyCodingProblem | dcca0da51bf42413c2eeff122dbb653e73ab5d83 | [
"MIT"
] | null | null | null | Python/Problem#7.py | Wolfy7/DailyCodingProblem | dcca0da51bf42413c2eeff122dbb653e73ab5d83 | [
"MIT"
] | null | null | null | Python/Problem#7.py | Wolfy7/DailyCodingProblem | dcca0da51bf42413c2eeff122dbb653e73ab5d83 | [
"MIT"
] | null | null | null | """
Given the mapping a = 1, b = 2, ... z = 26, and an encoded message, count the number of ways it can be decoded.
For example, the message '111' would give 3, since it could be decoded as 'aaa', 'ka', and 'ak'.
You can assume that the messages are decodable. For example, '001' is not allowed.
"""
import ti... | 22.672131 | 112 | 0.616775 | """
Given the mapping a = 1, b = 2, ... z = 26, and an encoded message, count the number of ways it can be decoded.
For example, the message '111' would give 3, since it could be decoded as 'aaa', 'ka', and 'ak'.
You can assume that the messages are decodable. For example, '001' is not allowed.
"""
import ti... | 664 | 0 | 100 |
4584fc5ed9194906f974bdb397f201c7c7eb28f6 | 433 | py | Python | hanchi/sandbox2.py | simazhi/ideophones | c986ee60bb1d61b27cbda8a9054a40d77ee50c41 | [
"MIT"
] | 1 | 2018-04-10T06:55:38.000Z | 2018-04-10T06:55:38.000Z | hanchi/sandbox2.py | simazhi/ideophones | c986ee60bb1d61b27cbda8a9054a40d77ee50c41 | [
"MIT"
] | null | null | null | hanchi/sandbox2.py | simazhi/ideophones | c986ee60bb1d61b27cbda8a9054a40d77ee50c41 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import os
import time
#"./chromedriver"
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
DRIVER_BIN = os.path.join(PROJECT_ROOT, "chromedriver.exe")
browser = webdriver.Chrome(executable_path = DRIVER_BIN)
browser.get("https://... | 22.789474 | 66 | 0.787529 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import os
import time
#"./chromedriver"
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
DRIVER_BIN = os.path.join(PROJECT_ROOT, "chromedriver.exe")
browser = webdriver.Chrome(executable_path = DRIVER_BIN)
browser.get("https://... | 0 | 0 | 0 |
ec68870145227da5b083e92934e00d5cf1c9830c | 5,383 | py | Python | test_classes/generic_test_class.py | Pelmen323/Kaiserreich_Jenkins_PyTests | 8d2c01f61b4c3820fcb86fd43be6b91538bf19f4 | [
"MIT"
] | null | null | null | test_classes/generic_test_class.py | Pelmen323/Kaiserreich_Jenkins_PyTests | 8d2c01f61b4c3820fcb86fd43be6b91538bf19f4 | [
"MIT"
] | null | null | null | test_classes/generic_test_class.py | Pelmen323/Kaiserreich_Jenkins_PyTests | 8d2c01f61b4c3820fcb86fd43be6b91538bf19f4 | [
"MIT"
] | null | null | null | import logging
import re
import os
import glob
class FileOpener:
'''
Test class that hosts common file functions like opening text files
'''
@classmethod
def open_text_file(cls, filename: str, lowercase: bool = True) -> str:
"""Opens and returns text file in utf-8-sig encoding
Arg... | 37.124138 | 138 | 0.574587 | import logging
import re
import os
import glob
class FileOpener:
'''
Test class that hosts common file functions like opening text files
'''
@classmethod
def open_text_file(cls, filename: str, lowercase: bool = True) -> str:
"""Opens and returns text file in utf-8-sig encoding
Arg... | 0 | 3,181 | 69 |
cae2f694a8963adda63826c93c9f8f02e7f333ab | 15,040 | py | Python | koku/koku/configurator.py | Vasyka/koku | b5aa9ec41c3b0821e74afe9ff3a5ffaedb910614 | [
"Apache-2.0"
] | 2 | 2022-01-12T03:42:39.000Z | 2022-01-12T03:42:40.000Z | koku/koku/configurator.py | Vasyka/koku | b5aa9ec41c3b0821e74afe9ff3a5ffaedb910614 | [
"Apache-2.0"
] | null | null | null | koku/koku/configurator.py | Vasyka/koku | b5aa9ec41c3b0821e74afe9ff3a5ffaedb910614 | [
"Apache-2.0"
] | 1 | 2021-07-21T09:33:59.000Z | 2021-07-21T09:33:59.000Z | #
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""
Handler module for gathering configuration data.
"""
from .env import ENVIRONMENT
CLOWDER_ENABLED = ENVIRONMENT.bool("CLOWDER_ENABLED", default=False)
if CLOWDER_ENABLED:
from app_common_python import ObjectBuckets, LoadedConfig, KafkaTop... | 30.08 | 107 | 0.646277 | #
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""
Handler module for gathering configuration data.
"""
from .env import ENVIRONMENT
CLOWDER_ENABLED = ENVIRONMENT.bool("CLOWDER_ENABLED", default=False)
if CLOWDER_ENABLED:
from app_common_python import ObjectBuckets, LoadedConfig, KafkaTop... | 0 | 0 | 0 |
9e9034a39725d9c1d69a8ef7a1292191ae9d6cbb | 393 | py | Python | thefuck/rules/git_stash.py | John-Appleseed/fix | 6d8ee9a3cbeee70593f0f8f570a50869dfc7552b | [
"MIT"
] | 1 | 2015-12-09T02:25:20.000Z | 2015-12-09T02:25:20.000Z | thefuck/rules/git_stash.py | John-Appleseed/fix | 6d8ee9a3cbeee70593f0f8f570a50869dfc7552b | [
"MIT"
] | null | null | null | thefuck/rules/git_stash.py | John-Appleseed/fix | 6d8ee9a3cbeee70593f0f8f570a50869dfc7552b | [
"MIT"
] | null | null | null | from thefuck import shells
| 30.230769 | 79 | 0.722646 | from thefuck import shells
def match(command, settings):
# catches "Please commit or stash them" and "Please, commit your changes or
# stash them before you can switch branches."
return 'git' in command.script and 'or stash them' in command.stderr
def get_new_command(command, settings):
formatme = s... | 318 | 0 | 46 |
9ff629efe7ef8faf47e8740362ba5080ddfa8975 | 4,218 | py | Python | game.py | odenge/jaken | 4b3048b5acd6dd0ce967bcd8227add5f5c468d98 | [
"MIT"
] | null | null | null | game.py | odenge/jaken | 4b3048b5acd6dd0ce967bcd8227add5f5c468d98 | [
"MIT"
] | null | null | null | game.py | odenge/jaken | 4b3048b5acd6dd0ce967bcd8227add5f5c468d98 | [
"MIT"
] | null | null | null | from random import randint
from time import sleep
from player import Player
| 34.859504 | 113 | 0.541252 | from random import randint
from time import sleep
from player import Player
class Game:
def __init__(self):
#ゲーム回数を設定
self.max_game_count = 3
self.print_message("邪権 開始({}回勝負)".format(self.max_game_count), 1)
#自分を設定
name1 = input("プレーヤー1 名前: ")
self.p1 = Player(name1)... | 4,491 | -10 | 211 |
42a221214e1330a592de45c4a1a76295348a08fe | 737 | py | Python | py2/Problem067.py | DanielGarrett/ProjectEuler | ca23f4dbfb2a47ea663fb0858630d3e2fb3b9764 | [
"MIT"
] | null | null | null | py2/Problem067.py | DanielGarrett/ProjectEuler | ca23f4dbfb2a47ea663fb0858630d3e2fb3b9764 | [
"MIT"
] | null | null | null | py2/Problem067.py | DanielGarrett/ProjectEuler | ca23f4dbfb2a47ea663fb0858630d3e2fb3b9764 | [
"MIT"
] | null | null | null | import EulerRunner
numFile = open('../data/Problem067_numbers.txt', 'r')
nums = [[int(num) for num in line.split(' ')] for line in numFile.readlines()]
print len(nums)
print len(nums[-1])
EulerRunner.solve_problem(problem67_dp)
| 26.321429 | 78 | 0.572592 | import EulerRunner
numFile = open('../data/Problem067_numbers.txt', 'r')
nums = [[int(num) for num in line.split(' ')] for line in numFile.readlines()]
print len(nums)
print len(nums[-1])
def problem67_dp():
totals = []
for x in range(len(nums)):
totals.append([])
for y in range(len(nums[x])):... | 484 | 0 | 23 |
698146b46b7075c1458a16bc4122497ee5798c02 | 8,352 | py | Python | tfsnippet/scaffold/model.py | haowen-xu/tfsnippet-pre-alpha | 31eb2cf692ac25b95cc815aaca53754d6db42d9f | [
"MIT"
] | null | null | null | tfsnippet/scaffold/model.py | haowen-xu/tfsnippet-pre-alpha | 31eb2cf692ac25b95cc815aaca53754d6db42d9f | [
"MIT"
] | null | null | null | tfsnippet/scaffold/model.py | haowen-xu/tfsnippet-pre-alpha | 31eb2cf692ac25b95cc815aaca53754d6db42d9f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import shutil
import numpy as np
import six
import tensorflow as tf
from tfsnippet.utils import (ensure_variables_initialized,
VarScopeObject,
get_variables_as_dict,
reopen_variable_scope,
... | 34.945607 | 80 | 0.59818 | # -*- coding: utf-8 -*-
import os
import shutil
import numpy as np
import six
import tensorflow as tf
from tfsnippet.utils import (ensure_variables_initialized,
VarScopeObject,
get_variables_as_dict,
reopen_variable_scope,
... | 298 | 0 | 26 |
9078e5c3f0833a45386708e9e11f8a773ced1cbe | 620 | py | Python | src/make_data_set/src/test.py | diddytpq/Predict-Tennisball-LandingPoint | 0ae4a9ff45fd4dd82b4b4e3cc2533e7fd5d1506a | [
"MIT"
] | null | null | null | src/make_data_set/src/test.py | diddytpq/Predict-Tennisball-LandingPoint | 0ae4a9ff45fd4dd82b4b4e3cc2533e7fd5d1506a | [
"MIT"
] | null | null | null | src/make_data_set/src/test.py | diddytpq/Predict-Tennisball-LandingPoint | 0ae4a9ff45fd4dd82b4b4e3cc2533e7fd5d1506a | [
"MIT"
] | null | null | null | import rospy
import sys, select, os
import roslib
import time
from tool.test_utils import *
roslib.load_manifest('mecanum_robot_gazebo')
if __name__ == '__main__' :
rospy.init_node('pingpong')
mecanum_0 = Make_mecanum_left('mecanum_0')
#mecanum_0.torque = [0, -2000000, 0]
#mecanum_0.torque = ... | 16.756757 | 46 | 0.645161 | import rospy
import sys, select, os
import roslib
import time
from tool.test_utils import *
roslib.load_manifest('mecanum_robot_gazebo')
if __name__ == '__main__' :
rospy.init_node('pingpong')
mecanum_0 = Make_mecanum_left('mecanum_0')
#mecanum_0.torque = [0, -2000000, 0]
#mecanum_0.torque = ... | 0 | 0 | 0 |
5863984ebe31a84c0b664f96e59e0fcfea843fa5 | 1,323 | py | Python | get_lyrics.py | ShaylanDias/MusicalMessage | 16d3b7bdde4fdfe19e82d21f3aa63a7c2ae4a9a5 | [
"MIT"
] | null | null | null | get_lyrics.py | ShaylanDias/MusicalMessage | 16d3b7bdde4fdfe19e82d21f3aa63a7c2ae4a9a5 | [
"MIT"
] | null | null | null | get_lyrics.py | ShaylanDias/MusicalMessage | 16d3b7bdde4fdfe19e82d21f3aa63a7c2ae4a9a5 | [
"MIT"
] | null | null | null | import azapi
api = azapi.AZlyrics()
def get_lyrics(artist, title, dir='./', save=False):
"""artist=name of artist, title=name of song, dir=directory to save (if saving), save=save the lyrics in a text file (boolean input)"""
attempts = 0
val = None
title_lower = title.lower()
if ' feat' in title_l... | 41.34375 | 139 | 0.598639 | import azapi
api = azapi.AZlyrics()
def get_lyrics(artist, title, dir='./', save=False):
"""artist=name of artist, title=name of song, dir=directory to save (if saving), save=save the lyrics in a text file (boolean input)"""
attempts = 0
val = None
title_lower = title.lower()
if ' feat' in title_l... | 0 | 0 | 0 |
7b894340af50b8faa94449a69811b8e548990c61 | 225 | py | Python | Twper/__init__.py | fergusch/Twper | 01a536453a2b38400e1006063e3bd65b7c224f4a | [
"MIT"
] | 8 | 2018-12-17T20:12:53.000Z | 2022-01-06T19:52:59.000Z | Twper/__init__.py | fergusch/Twper | 01a536453a2b38400e1006063e3bd65b7c224f4a | [
"MIT"
] | 3 | 2019-12-04T04:14:16.000Z | 2021-05-05T10:43:00.000Z | Twper/__init__.py | fergusch/Twper | 01a536453a2b38400e1006063e3bd65b7c224f4a | [
"MIT"
] | 3 | 2019-01-15T15:34:27.000Z | 2020-02-29T18:23:21.000Z | # Twper - Async Twitter Scraper
# Copyright Sacha Jungerman
# See LICENSE for details.
__version__ = '0.1.1'
__author__ = 'Sacha Jungerman'
__license__ = 'MIT'
from Twper.Twper import Tweet, TwitterAccount, Query, Queries
| 20.454545 | 61 | 0.755556 | # Twper - Async Twitter Scraper
# Copyright Sacha Jungerman
# See LICENSE for details.
__version__ = '0.1.1'
__author__ = 'Sacha Jungerman'
__license__ = 'MIT'
from Twper.Twper import Tweet, TwitterAccount, Query, Queries
| 0 | 0 | 0 |
a8f19d9c8f7c0b2ba72c4f98f2d753de57803390 | 771 | py | Python | fcm.py | stevexiaofei/Worm_seg_net | 99114bb3f221baa4df4c93d6e282ae288aa63cfc | [
"MIT"
] | null | null | null | fcm.py | stevexiaofei/Worm_seg_net | 99114bb3f221baa4df4c93d6e282ae288aa63cfc | [
"MIT"
] | null | null | null | fcm.py | stevexiaofei/Worm_seg_net | 99114bb3f221baa4df4c93d6e282ae288aa63cfc | [
"MIT"
] | null | null | null | import numpy as np
import PIL.Image as image
from sklearn.cluster import KMeans
from skfuzzy.cluster import cmeans
imgData,row,col = loadData('11.jpg')
imgData = imgData.T
center, u, u0, d, jm, p, fpc = cmeans(imgData, m=2, c=2, error=0.0001, maxiter=1000)
for i in u:
label = np.argmax(u, axis=0)
label = label.reshap... | 29.653846 | 84 | 0.645914 | import numpy as np
import PIL.Image as image
from sklearn.cluster import KMeans
from skfuzzy.cluster import cmeans
def loadData(filePath):
f = open(filePath,'rb')
data = []
img = image.open(f)
m,n = img.size
for i in range(m):
for j in range(n):
x,y,z = img.getpixel((i,j))
data.append([x/256.0,... | 241 | 0 | 22 |
04b2959d17659eb1b0417a4fd0929232a6e8350a | 3,042 | py | Python | conary/build/buildinfo.py | sassoftware/conary | d418968acd5e11ee17ed6d91ca395ea10a040222 | [
"Apache-2.0"
] | 43 | 2015-03-31T01:37:10.000Z | 2021-11-14T16:26:48.000Z | conary/build/buildinfo.py | sassoftware/conary | d418968acd5e11ee17ed6d91ca395ea10a040222 | [
"Apache-2.0"
] | 9 | 2015-06-10T16:39:41.000Z | 2020-01-27T16:35:01.000Z | conary/build/buildinfo.py | sassoftware/conary | d418968acd5e11ee17ed6d91ca395ea10a040222 | [
"Apache-2.0"
] | 9 | 2015-04-07T08:12:37.000Z | 2020-01-26T09:54:18.000Z | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 31.360825 | 76 | 0.530901 | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 2,069 | 1 | 239 |
d28c21cf43e61441d58d58e638b41107d6deb65a | 3,904 | py | Python | jass_player/deep_learning_player.py | tschibu/hslu-dl4g | 20cd5b09817a72b7aa4568964345bd89fb5dd9ed | [
"MIT"
] | null | null | null | jass_player/deep_learning_player.py | tschibu/hslu-dl4g | 20cd5b09817a72b7aa4568964345bd89fb5dd9ed | [
"MIT"
] | null | null | null | jass_player/deep_learning_player.py | tschibu/hslu-dl4g | 20cd5b09817a72b7aa4568964345bd89fb5dd9ed | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from jass.base.const import color_masks
from jass.base.player_round import PlayerRound
from jass.player.player import Player
from tensorflow.keras.models import load_model
class DeepLearningPlayer(Player):
"""
Deep learning implementation of a player to play Jass.
... | 34.857143 | 142 | 0.604252 | import numpy as np
import tensorflow as tf
from jass.base.const import color_masks
from jass.base.player_round import PlayerRound
from jass.player.player import Player
from tensorflow.keras.models import load_model
class DeepLearningPlayer(Player):
"""
Deep learning implementation of a player to play Jass.
... | 921 | 0 | 81 |
c4ce33a8f78d5a5a31f73757124a1f2cb356730e | 505 | py | Python | 一、工程基础/软件工程/算法与数据结构/力扣题目/leetcode_027.py | ethan-sui/AI-algorithm-engineer-knowledge | 24795b23a4cbeb6e6839e0cae65f7745be666da6 | [
"Apache-2.0"
] | 209 | 2020-10-06T08:34:45.000Z | 2022-03-08T08:35:15.000Z | 一、工程基础/软件工程/算法与数据结构/力扣题目/leetcode_027.py | ethan-sui/AI-algorithm-engineer-knowledge | 24795b23a4cbeb6e6839e0cae65f7745be666da6 | [
"Apache-2.0"
] | null | null | null | 一、工程基础/软件工程/算法与数据结构/力扣题目/leetcode_027.py | ethan-sui/AI-algorithm-engineer-knowledge | 24795b23a4cbeb6e6839e0cae65f7745be666da6 | [
"Apache-2.0"
] | 8 | 2020-10-09T09:07:18.000Z | 2021-05-18T10:30:46.000Z | # 27、移除元素
# 一、双指针法,设置快慢指针,当快指针指向元素等于删除元素时,快指针快走一步,
# 慢指针不走;否则,快慢指针同时走一步,并把快指针的元素值赋给慢指针,这样
# 慢指针走过的元素就是删除掉指定元素的数组,时间复杂度O(n),空间复杂度O(1)
nums = [0, 1, 2, 2, 3, 0, 4, 2]
val = 2
print(removeElement0(nums, val)) | 24.047619 | 45 | 0.550495 | # 27、移除元素
# 一、双指针法,设置快慢指针,当快指针指向元素等于删除元素时,快指针快走一步,
# 慢指针不走;否则,快慢指针同时走一步,并把快指针的元素值赋给慢指针,这样
# 慢指针走过的元素就是删除掉指定元素的数组,时间复杂度O(n),空间复杂度O(1)
def removeElement0(nums, val):
if len(nums) == 0:
return 0
left = 0
right = 0
while right < len(nums):
if nums[right] != val:
nums[left] ... | 271 | 0 | 22 |
3eb7864ba54178cf1398b977f0c387b59e14a7c2 | 2,949 | py | Python | tests/test_pgroup.py | xonsh/slug | b4a229f930eb4bf7b508c0a454aceafb7e0fb8b9 | [
"BSD-3-Clause"
] | 17 | 2017-04-30T17:58:49.000Z | 2022-01-24T20:25:01.000Z | tests/test_pgroup.py | xonsh/slug | b4a229f930eb4bf7b508c0a454aceafb7e0fb8b9 | [
"BSD-3-Clause"
] | 25 | 2017-02-05T23:17:16.000Z | 2017-12-12T21:46:19.000Z | tests/test_pgroup.py | xonsh/slug | b4a229f930eb4bf7b508c0a454aceafb7e0fb8b9 | [
"BSD-3-Clause"
] | 1 | 2019-03-20T11:53:36.000Z | 2019-03-20T11:53:36.000Z | import pytest
import os
import slug
from slug import ProcessGroup, Process, Pipe
from conftest import runpy, not_in_path
@pytest.mark.skipif(not hasattr(ProcessGroup, 'pgid'),
reason="No Process Group IDs")
@pytest.mark.skipif(ProcessGroup is slug.base.ProcessGroup,
reason... | 25.205128 | 70 | 0.58664 | import pytest
import os
import slug
from slug import ProcessGroup, Process, Pipe
from conftest import runpy, not_in_path
def test_group():
with ProcessGroup() as pg:
p1 = Pipe()
pg.add(Process(runpy("print('spam')"), stdout=p1.side_in))
p2 = Pipe()
pg.add(Process(runpy("print('eggs... | 2,019 | 0 | 113 |
ada6f6bc8f31f3064b8d889f66103c621edb2090 | 2,019 | py | Python | tests/addons/criterions/test_ts_triplet_loss.py | khirotaka/enchanter | 71faa51f998da5c8d9185a979a4f5849c9b5f9e6 | [
"Apache-2.0"
] | 8 | 2020-04-18T03:09:19.000Z | 2021-05-05T17:57:27.000Z | tests/addons/criterions/test_ts_triplet_loss.py | khirotaka/enchanter | 71faa51f998da5c8d9185a979a4f5849c9b5f9e6 | [
"Apache-2.0"
] | 107 | 2020-02-12T11:35:06.000Z | 2022-03-24T20:49:43.000Z | tests/addons/criterions/test_ts_triplet_loss.py | khirotaka/enchanter | 71faa51f998da5c8d9185a979a4f5849c9b5f9e6 | [
"Apache-2.0"
] | 2 | 2020-02-12T12:23:51.000Z | 2021-07-19T11:41:04.000Z | import torch
import enchanter.addons.criterions as C
import enchanter
| 24.035714 | 103 | 0.67162 | import torch
import enchanter.addons.criterions as C
import enchanter
def test_generate_sample_indices_1():
n_rand_samples: int = 10
batch_size: int = 32
length: int = 100
begin_batches, len_anchor, end_pos, len_pos_neg, begin_neg_samples = C.generate_sample_indices(
n_rand_samples, batch_siz... | 1,829 | 0 | 115 |
b72c1e7ed93592b637ce1f8cbcd881bc56c9db22 | 2,772 | py | Python | migration/src/plots/plots/eta_tau_sfh.py | rcooke-ast/VICE | 762911eb4192c7206ce2ae36b645d120ed889cb7 | [
"MIT"
] | 22 | 2018-09-26T21:02:51.000Z | 2022-03-24T18:07:03.000Z | migration/src/plots/plots/eta_tau_sfh.py | rcooke-ast/VICE | 762911eb4192c7206ce2ae36b645d120ed889cb7 | [
"MIT"
] | 2 | 2019-05-03T13:08:27.000Z | 2021-02-17T20:11:37.000Z | migration/src/plots/plots/eta_tau_sfh.py | rcooke-ast/VICE | 762911eb4192c7206ce2ae36b645d120ed889cb7 | [
"MIT"
] | 3 | 2019-05-10T19:26:31.000Z | 2021-11-10T08:13:42.000Z | r"""
This script creates a plot of the mass-loading factor eta and the star
formation e-folding timescale as functions of Galactocentric radius in the
forms adopted by Johnson et al. (2021).
"""
from .. import env
from ...simulations.models.insideout import insideout
from .utils import named_colors
import matplotlib.p... | 29.489362 | 77 | 0.672439 | r"""
This script creates a plot of the mass-loading factor eta and the star
formation e-folding timescale as functions of Galactocentric radius in the
forms adopted by Johnson et al. (2021).
"""
from .. import env
from ...simulations.models.insideout import insideout
from .utils import named_colors
import matplotlib.p... | 0 | 0 | 0 |
e00f288d0375b73a08aef40a686f363fd5cc8285 | 3,757 | py | Python | grodddroid/BranchExplorer/branchexp/grodd_cmd.py | demirdagemir/thesis | 4a48bddf815c91729e27484548bb7bbf7ddeda64 | [
"MIT"
] | null | null | null | grodddroid/BranchExplorer/branchexp/grodd_cmd.py | demirdagemir/thesis | 4a48bddf815c91729e27484548bb7bbf7ddeda64 | [
"MIT"
] | null | null | null | grodddroid/BranchExplorer/branchexp/grodd_cmd.py | demirdagemir/thesis | 4a48bddf815c91729e27484548bb7bbf7ddeda64 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
""" BranchExplorer is the high-level tool that tries to explore specific parts
of code rather than maximizing coverage like regular automatic testing. """
import argparse
import logging
import os
import sys
import time
import datetime
import branchexp.imports
import branchexp.config
from branch... | 33.247788 | 80 | 0.640405 | #!/usr/bin/env python3
""" BranchExplorer is the high-level tool that tries to explore specific parts
of code rather than maximizing coverage like regular automatic testing. """
import argparse
import logging
import os
import sys
import time
import datetime
import branchexp.imports
import branchexp.config
from branch... | 2,884 | 0 | 69 |
8601e4823b3e141dfce88dfecc7ba7a12da3b018 | 252 | py | Python | frekenbok/settings/test_sqlite.py | frekenbok/frekenbok | 296e6cffba5a58c1c8d61ff6eb4d0aed3f3b4247 | [
"MIT"
] | null | null | null | frekenbok/settings/test_sqlite.py | frekenbok/frekenbok | 296e6cffba5a58c1c8d61ff6eb4d0aed3f3b4247 | [
"MIT"
] | null | null | null | frekenbok/settings/test_sqlite.py | frekenbok/frekenbok | 296e6cffba5a58c1c8d61ff6eb4d0aed3f3b4247 | [
"MIT"
] | null | null | null | import tempfile
from frekenbok.settings import *
from frekenbok.settings.dev import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': tempfile.mkstemp(suffix='.sqlite3', prefix='frekenbok_')[1],
}
}
| 21 | 76 | 0.654762 | import tempfile
from frekenbok.settings import *
from frekenbok.settings.dev import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': tempfile.mkstemp(suffix='.sqlite3', prefix='frekenbok_')[1],
}
}
| 0 | 0 | 0 |
e0c70e3b3415e57515bd901ff801d9bbb258a66c | 10,506 | py | Python | pl_bolts/models/autoencoders/components.py | btwardow/pytorch-lightning-bolts | 4a7b6ffe0fcbeee37f8bac6af1e926469b2052bf | [
"Apache-2.0"
] | 1 | 2021-06-28T03:24:11.000Z | 2021-06-28T03:24:11.000Z | pl_bolts/models/autoencoders/components.py | btwardow/pytorch-lightning-bolts | 4a7b6ffe0fcbeee37f8bac6af1e926469b2052bf | [
"Apache-2.0"
] | null | null | null | pl_bolts/models/autoencoders/components.py | btwardow/pytorch-lightning-bolts | 4a7b6ffe0fcbeee37f8bac6af1e926469b2052bf | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn.functional as F
from torch import nn
class Interpolate(nn.Module):
"""nn.Module wrapper for F.interpolate"""
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias... | 30.189655 | 105 | 0.616314 | import torch
import torch.nn.functional as F
from torch import nn
class Interpolate(nn.Module):
"""nn.Module wrapper for F.interpolate"""
def __init__(self, size=None, scale_factor=None):
super().__init__()
self.size, self.scale_factor = size, scale_factor
def forward(self, x):
r... | 8,087 | 10 | 547 |
ea67ca0d9bc4bc63a271bc2aef8c4f13fd22a99c | 3,694 | py | Python | lib/utils.py | Chaffelson/cml_curvefitting | 6173021fd60a02b0a3a31b4c969ae58fb5adaa06 | [
"MIT"
] | 2 | 2021-01-31T05:57:40.000Z | 2021-02-02T17:37:05.000Z | lib/utils.py | Chaffelson/cml_curvefitting | 6173021fd60a02b0a3a31b4c969ae58fb5adaa06 | [
"MIT"
] | null | null | null | lib/utils.py | Chaffelson/cml_curvefitting | 6173021fd60a02b0a3a31b4c969ae58fb5adaa06 | [
"MIT"
] | 1 | 2021-04-29T10:20:55.000Z | 2021-04-29T10:20:55.000Z | # ###########################################################################
#
# CLOUDERA APPLIED MACHINE LEARNING PROTOTYPE (AMP)
# (C) Cloudera, Inc. 2020
# All rights reserved.
#
# Applicable Open Source License: Apache 2.0
#
# NOTE: Cloudera open source products are modular software products
# made up of hun... | 33.581818 | 77 | 0.690309 | # ###########################################################################
#
# CLOUDERA APPLIED MACHINE LEARNING PROTOTYPE (AMP)
# (C) Cloudera, Inc. 2020
# All rights reserved.
#
# Applicable Open Source License: Apache 2.0
#
# NOTE: Cloudera open source products are modular software products
# made up of hun... | 785 | 0 | 161 |
7ca28bd7ed1737db978d8839238913c0212c4ba4 | 2,340 | py | Python | databuilder/extractor/db_api_extractor.py | sauravsrijan/amundsendatabuilder | 3e78a5dff61b8e214157b5fc4f78cb397e4845b3 | [
"Apache-2.0"
] | null | null | null | databuilder/extractor/db_api_extractor.py | sauravsrijan/amundsendatabuilder | 3e78a5dff61b8e214157b5fc4f78cb397e4845b3 | [
"Apache-2.0"
] | null | null | null | databuilder/extractor/db_api_extractor.py | sauravsrijan/amundsendatabuilder | 3e78a5dff61b8e214157b5fc4f78cb397e4845b3 | [
"Apache-2.0"
] | null | null | null | import importlib
import logging
from typing import Iterable, Any # noqa: F401
from pyhocon import ConfigTree # noqa: F401
from databuilder.extractor.base_extractor import Extractor
LOGGER = logging.getLogger(__name__)
class DBAPIExtractor(Extractor):
"""
Generic DB API extractor.
"""
CONNECTION_... | 27.209302 | 90 | 0.585043 | import importlib
import logging
from typing import Iterable, Any # noqa: F401
from pyhocon import ConfigTree # noqa: F401
from databuilder.extractor.base_extractor import Extractor
LOGGER = logging.getLogger(__name__)
class DBAPIExtractor(Extractor):
"""
Generic DB API extractor.
"""
CONNECTION_... | 58 | 0 | 27 |
40b08a1e29765b08e0bd1beaf989e491652080d9 | 5,959 | py | Python | pmap/small_ising_scoring.py | vicariousinc/perturb_and_max_product | 5d781e5ab33ceda621d1f014fdfe8d50e68016c1 | [
"MIT"
] | 3 | 2021-11-09T06:54:01.000Z | 2022-03-14T13:06:32.000Z | pmap/small_ising_scoring.py | vicariousinc/perturb_and_max_product | 5d781e5ab33ceda621d1f014fdfe8d50e68016c1 | [
"MIT"
] | null | null | null | pmap/small_ising_scoring.py | vicariousinc/perturb_and_max_product | 5d781e5ab33ceda621d1f014fdfe8d50e68016c1 | [
"MIT"
] | 2 | 2022-03-12T11:35:10.000Z | 2022-03-19T10:43:22.000Z | # Utils for small Ising models
from itertools import product
import numpy as np
from jax import jit
from jax import random
from jax.config import config
from jax.scipy.special import logsumexp
from tqdm import tqdm
config.update("jax_disable_jit", False)
"""
Note: in our experiments we consider two classes of Ising ... | 32.922652 | 104 | 0.603793 | # Utils for small Ising models
from itertools import product
import numpy as np
from jax import jit
from jax import random
from jax.config import config
from jax.scipy.special import logsumexp
from tqdm import tqdm
config.update("jax_disable_jit", False)
"""
Note: in our experiments we consider two classes of Ising ... | 4,816 | 0 | 182 |
8f557c9c6d3dfd66d747b2dc5dfac26c83084f0a | 693 | py | Python | remcall/schema/base.py | luphord/remcall | 31419ff0f5c21ea2d90f9cabdaec85b6eebcaa12 | [
"MIT"
] | null | null | null | remcall/schema/base.py | luphord/remcall | 31419ff0f5c21ea2d90f9cabdaec85b6eebcaa12 | [
"MIT"
] | null | null | null | remcall/schema/base.py | luphord/remcall | 31419ff0f5c21ea2d90f9cabdaec85b6eebcaa12 | [
"MIT"
] | null | null | null | NAME_CHARS = set('ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
'abcdefghijklmnopqrstuvwxyz0123456789')
NAME_FIRST_CHARS = set('ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
'abcdefghijklmnopqrstuvwxyz')
| 43.3125 | 77 | 0.621934 | NAME_CHARS = set('ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
'abcdefghijklmnopqrstuvwxyz0123456789')
NAME_FIRST_CHARS = set('ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
'abcdefghijklmnopqrstuvwxyz')
def assert_name(name: str):
assert len(name) > 0, ('A name has to contain at least one character, ' +
... | 457 | 0 | 23 |
a8a5bca9249bed381200aa37264b3bcd0d65434a | 1,677 | py | Python | src/setup.py | antonsmislevics/safe-env | 8727bda0b3a0010f0653dbfe824910ac69e27007 | [
"MIT"
] | null | null | null | src/setup.py | antonsmislevics/safe-env | 8727bda0b3a0010f0653dbfe824910ac69e27007 | [
"MIT"
] | null | null | null | src/setup.py | antonsmislevics/safe-env | 8727bda0b3a0010f0653dbfe824910ac69e27007 | [
"MIT"
] | null | null | null | import setuptools
import re
long_description = ""
# with open("README.md", "r") as fh:
# long_description = fh.read()
version = re.search(
r"^__version__\s*?=\s*?'(.*)'",
open('safe_env/version.py').read(),
re.M
).group(1)
requires_base = load_requirements_from_file("requirements-base.txt")
requi... | 30.490909 | 79 | 0.645796 | import setuptools
import re
def load_requirements_from_file(file_name):
# get the dependencies and installs
requires = []
with open(file_name, "r", encoding="utf-8") as f:
# Make sure we strip all comments and options (e.g "--extra-index-url")
for line in f:
req = line.split("#"... | 391 | 0 | 23 |
265de00e591a9bd468fdb61184d5fc5df5b88691 | 4,049 | py | Python | tests/unit_tests/test_responsebot.py | openjusticebaltimore/ResponseBot | e224fe5251190f2f4a8901afbd622c411601e86e | [
"Apache-2.0"
] | 16 | 2016-05-11T00:04:18.000Z | 2020-07-21T20:32:11.000Z | tests/unit_tests/test_responsebot.py | openjusticebaltimore/ResponseBot | e224fe5251190f2f4a8901afbd622c411601e86e | [
"Apache-2.0"
] | 6 | 2016-05-10T03:34:17.000Z | 2016-06-14T02:42:45.000Z | tests/unit_tests/test_responsebot.py | openjusticebaltimore/ResponseBot | e224fe5251190f2f4a8901afbd622c411601e86e | [
"Apache-2.0"
] | 6 | 2016-05-09T20:17:43.000Z | 2020-08-15T04:43:45.000Z | from unittest.case import TestCase
from tweepy.error import TweepError
from responsebot.common.exceptions import MissingConfigError, APIQuotaError, AuthenticationError
try:
from mock import patch, MagicMock
except ImportError:
from unittest.mock import patch, MagicMock
from responsebot.responsebot import Re... | 49.987654 | 113 | 0.674241 | from unittest.case import TestCase
from tweepy.error import TweepError
from responsebot.common.exceptions import MissingConfigError, APIQuotaError, AuthenticationError
try:
from mock import patch, MagicMock
except ImportError:
from unittest.mock import patch, MagicMock
from responsebot.responsebot import Re... | 3,424 | 271 | 23 |
289059a368c618c03bdc37e2a9f2a8891b92b9d9 | 19,901 | py | Python | packages/w3af/w3af/core/ui/gui/profiles.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | 3 | 2019-04-09T22:59:33.000Z | 2019-06-14T09:23:24.000Z | tools/w3af/w3af/core/ui/gui/profiles.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | null | null | null | tools/w3af/w3af/core/ui/gui/profiles.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | null | null | null | """
profiles.py
Copyright 2007 Andres Riancho
This file is part of w3af, http://w3af.org/ .
w3af is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
w3af is distributed in the hope that it... | 36.785582 | 94 | 0.581076 | """
profiles.py
Copyright 2007 Andres Riancho
This file is part of w3af, http://w3af.org/ .
w3af is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
w3af is distributed in the hope that it... | 1,151 | 0 | 26 |
b21b40eeb46b85198637ae6c755f4556a994813a | 1,586 | py | Python | src/app/models.py | aminul91/linktutor_restapi | 2077119f9771b31e2aa49f914ebd76451fe3b53c | [
"MIT"
] | null | null | null | src/app/models.py | aminul91/linktutor_restapi | 2077119f9771b31e2aa49f914ebd76451fe3b53c | [
"MIT"
] | null | null | null | src/app/models.py | aminul91/linktutor_restapi | 2077119f9771b31e2aa49f914ebd76451fe3b53c | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
| 38.682927 | 80 | 0.747793 | from django.db import models
# Create your models here.
class user_infos(models.Model):
user_name = models.CharField(max_length=50,default="")
pass_user = models.CharField(max_length=50,default="")
user_email = models.EmailField()
def __str__(self):
return self.user_name
class tutorial_types(m... | 147 | 1,267 | 114 |
d08715c0ef4c3ec409e4da9558407c2e6e2f25ee | 503 | py | Python | EasyGit/controllers/navigation.py | andreyragimov/EasyGit | 96d92eeeffab21222887846c77e78eb804223e5d | [
"MIT"
] | null | null | null | EasyGit/controllers/navigation.py | andreyragimov/EasyGit | 96d92eeeffab21222887846c77e78eb804223e5d | [
"MIT"
] | null | null | null | EasyGit/controllers/navigation.py | andreyragimov/EasyGit | 96d92eeeffab21222887846c77e78eb804223e5d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from PyQt5.QtCore import QObject, pyqtSlot, QUrl
from PyQt5.QtWebKitWidgets import QWebView
view = QWebView()
frame = view.page().mainFrame() # todo check is it changing
| 20.958333 | 60 | 0.630219 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from PyQt5.QtCore import QObject, pyqtSlot, QUrl
from PyQt5.QtWebKitWidgets import QWebView
view = QWebView()
frame = view.page().mainFrame() # todo check is it changing
class Loader(QObject):
def __init__(self):
QObject.__init__(self)
@pyqtSlot(str)
... | 131 | 131 | 23 |
c108fd3d6022fdbe9c9fd301bea4c7bc30dc146e | 619 | py | Python | csv/jython/read/csv_read.py | ekzemplaro/data_base_language | e77030367ffc595f1fac8583f03f9a3ce5eb1611 | [
"MIT",
"Unlicense"
] | 3 | 2015-05-12T16:44:27.000Z | 2021-02-09T00:39:24.000Z | csv/jython/read/csv_read.py | ekzemplaro/data_base_language | e77030367ffc595f1fac8583f03f9a3ce5eb1611 | [
"MIT",
"Unlicense"
] | null | null | null | csv/jython/read/csv_read.py | ekzemplaro/data_base_language | e77030367ffc595f1fac8583f03f9a3ce5eb1611 | [
"MIT",
"Unlicense"
] | null | null | null | #! /usr/bin/jython
# -*- coding: utf-8 -*-
#
# csv_read.py
#
# Jul/20/2015
#
import sys
import string
#
sys.path.append ('/var/www/data_base/common/python_common')
sys.path.append ('/var/www/data_base/common/jython_common')
from jython_text_manipulate import csv_read_proc
from text_manipulate import dict_display_p... | 23.807692 | 70 | 0.547658 | #! /usr/bin/jython
# -*- coding: utf-8 -*-
#
# csv_read.py
#
# Jul/20/2015
#
import sys
import string
#
sys.path.append ('/var/www/data_base/common/python_common')
sys.path.append ('/var/www/data_base/common/jython_common')
from jython_text_manipulate import csv_read_proc
from text_manipulate import dict_display_p... | 0 | 0 | 0 |
26071bdd01318e33824299c65d33ba75f9ced7f8 | 2,738 | py | Python | src/VersionControlProvider/Github/InputConfig.py | flexiooss/flexio-flow | 47491c7e5b49a02dc859028de0d486edc0014b26 | [
"Apache-2.0"
] | null | null | null | src/VersionControlProvider/Github/InputConfig.py | flexiooss/flexio-flow | 47491c7e5b49a02dc859028de0d486edc0014b26 | [
"Apache-2.0"
] | 44 | 2019-04-05T06:08:15.000Z | 2021-09-13T19:37:49.000Z | src/VersionControlProvider/Github/InputConfig.py | flexiooss/flexio-flow | 47491c7e5b49a02dc859028de0d486edc0014b26 | [
"Apache-2.0"
] | null | null | null | from subprocess import Popen, PIPE
from typing import Optional, List
from requests import Response
from Core.ConfigHandler import ConfigHandler
from VersionControlProvider.Github.ConfigGithub import ConfigGithub
from VersionControlProvider.Github.Github import Github
| 41.484848 | 108 | 0.648283 | from subprocess import Popen, PIPE
from typing import Optional, List
from requests import Response
from Core.ConfigHandler import ConfigHandler
from VersionControlProvider.Github.ConfigGithub import ConfigGithub
from VersionControlProvider.Github.Github import Github
class InputConfig:
def __init__(self, config... | 2,259 | -3 | 211 |
4d0e48de9e001677785607935c416ad8c994fce0 | 198 | py | Python | tests/test_integration.py | techieslayj/FSU-Sci-Comp-Github-Tutorial | 2573fc802e0bde47a3bf4f080255ec2518a2fb95 | [
"MIT"
] | null | null | null | tests/test_integration.py | techieslayj/FSU-Sci-Comp-Github-Tutorial | 2573fc802e0bde47a3bf4f080255ec2518a2fb95 | [
"MIT"
] | 6 | 2019-02-28T19:07:38.000Z | 2019-03-01T21:45:14.000Z | tests/test_integration.py | techieslayj/FSU-Sci-Comp-Github-Tutorial | 2573fc802e0bde47a3bf4f080255ec2518a2fb95 | [
"MIT"
] | 8 | 2019-03-01T21:10:06.000Z | 2021-08-23T16:32:37.000Z | import numpy as np
from integration import *
| 19.8 | 43 | 0.661616 | import numpy as np
from integration import *
def test_trapezoid():
func = lambda x: np.sin(x)
est_I = trapezoid(func, 0, np.pi, 2000)
true_I = 2.0
assert np.isclose(est_I, true_I)
| 129 | 0 | 23 |
5107d647882f810d0bdeb3763081762daca8e9bb | 541 | py | Python | setup.py | serranoycandela/huiini_client | 1c5f828634dabc9a951d542b0b4f328566fabf30 | [
"MIT"
] | null | null | null | setup.py | serranoycandela/huiini_client | 1c5f828634dabc9a951d542b0b4f328566fabf30 | [
"MIT"
] | 21 | 2018-11-19T23:08:29.000Z | 2018-11-22T16:07:01.000Z | setup.py | serranoycandela/huiini_client | 1c5f828634dabc9a951d542b0b4f328566fabf30 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from distutils.core import setup
import py2exe, sys
sys.argv.append('py2exe')
#C:\Python34\python.exe setup.py
setup(
windows=[
{
"script": "huiini.py",
"icon_resources": [(1, "myicon.ico")]
}
],
options={
... | 21.64 | 98 | 0.432532 | # -*- coding: utf-8 -*-
from distutils.core import setup
import py2exe, sys
sys.argv.append('py2exe')
#C:\Python34\python.exe setup.py
setup(
windows=[
{
"script": "huiini.py",
"icon_resources": [(1, "myicon.ico")]
}
],
options={
... | 0 | 0 | 0 |
01bbb52d526d294f328f4ebe24d0eb6d13b4a9ac | 8,595 | py | Python | src/covid_scrape.py | wcbeard/covid_models | 16c732273f715045aea150f94717229e54bf5b50 | [
"MIT"
] | null | null | null | src/covid_scrape.py | wcbeard/covid_models | 16c732273f715045aea150f94717229e54bf5b50 | [
"MIT"
] | null | null | null | src/covid_scrape.py | wcbeard/covid_models | 16c732273f715045aea150f94717229e54bf5b50 | [
"MIT"
] | null | null | null | import datetime as dt
import itertools as it
from pathlib import Path
import re
import simplejson
import altair.vegalite.v3 as A
from bs4 import BeautifulSoup
import requests
import pandas as pd
import numpy as np
pth = Path("~/repos/covid/data").expanduser()
url_ga_county = url_ga = "https://dph.georgia.gov/covid-19... | 23.612637 | 79 | 0.575334 | import datetime as dt
import itertools as it
from pathlib import Path
import re
import simplejson
import altair.vegalite.v3 as A
from bs4 import BeautifulSoup
import requests
import pandas as pd
import numpy as np
pth = Path("~/repos/covid/data").expanduser()
url_ga_county = url_ga = "https://dph.georgia.gov/covid-19... | 4,281 | 0 | 479 |
e78a65cb0a0daff6c93d979cd3e33e9189fce8df | 2,276 | py | Python | Solver.py | Naedri/Hackathon-Impact-triangulation | 454eaca57828f62f7c09e8ffadd1f7ffc40e74ba | [
"MIT"
] | null | null | null | Solver.py | Naedri/Hackathon-Impact-triangulation | 454eaca57828f62f7c09e8ffadd1f7ffc40e74ba | [
"MIT"
] | null | null | null | Solver.py | Naedri/Hackathon-Impact-triangulation | 454eaca57828f62f7c09e8ffadd1f7ffc40e74ba | [
"MIT"
] | null | null | null | import time
from math import sqrt
from collections import OrderedDict
class Solver(object):
"""executes the alogirithms in order to find the intersections"""
| 39.929825 | 217 | 0.56283 | import time
from math import sqrt
from collections import OrderedDict
class Solver(object):
"""executes the alogirithms in order to find the intersections"""
def __init__(self, algo, circles):
self.algo = algo
self.circles = circles
def find_intersect(self):
# if (self.getAlgo() ... | 1,977 | 0 | 135 |
3524a37c3832d45d66d53587eeda411a36e45d3d | 2,834 | py | Python | bp_pas/stats.py | cambridgeltl/jp-pred-arg | bef8ed686b336e07506139cfddf7eb351d2ba3c0 | [
"MIT"
] | null | null | null | bp_pas/stats.py | cambridgeltl/jp-pred-arg | bef8ed686b336e07506139cfddf7eb351d2ba3c0 | [
"MIT"
] | 1 | 2020-07-30T12:19:34.000Z | 2020-07-30T12:19:34.000Z | bp_pas/stats.py | cambridgeltl/jp-pred-arg | bef8ed686b336e07506139cfddf7eb351d2ba3c0 | [
"MIT"
] | null | null | null | import numpy as np
| 27.784314 | 112 | 0.503881 | import numpy as np
def show_case_dist(corpus):
print('\nCASE DISTRIBUTION')
case_types = np.zeros((3, 5))
n_prds = 0
for doc in corpus:
for sent in doc:
for w in sent:
if w.is_prd is False:
continue
flag = False
f... | 2,743 | 0 | 69 |
398552cdef48af00a29f3aaad7dc0559249ffd7f | 27,158 | py | Python | npl/likelihood_functions.py | laravomfell/tvd_loss | b30a925f95985a03ff70bfa40a6ec3662432779d | [
"MIT"
] | 1 | 2021-07-21T14:56:59.000Z | 2021-07-21T14:56:59.000Z | npl/likelihood_functions.py | laravomfell/tvd_loss | b30a925f95985a03ff70bfa40a6ec3662432779d | [
"MIT"
] | null | null | null | npl/likelihood_functions.py | laravomfell/tvd_loss | b30a925f95985a03ff70bfa40a6ec3662432779d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 14 09:35:37 2020
@author: Jeremias Knoblauch and Lara Vomfell
Description: Likelihood function wrappers for use within NPL class
"""
import numpy as np
import pdb
from scipy.stats import poisson, norm, binom
from scipy.optimize import minimize
im... | 37.771905 | 108 | 0.559062 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 14 09:35:37 2020
@author: Jeremias Knoblauch and Lara Vomfell
Description: Likelihood function wrappers for use within NPL class
"""
import numpy as np
import pdb
from scipy.stats import poisson, norm, binom
from scipy.optimize import minimize
im... | 17,491 | 1,425 | 841 |
57629d8608d7585637c3a45074580991baa03cb1 | 1,105 | py | Python | networking/main.py | fred5229/IOT | 9fa6d5346476b35baf09337ffa04b2b1fb03f69c | [
"MIT"
] | null | null | null | networking/main.py | fred5229/IOT | 9fa6d5346476b35baf09337ffa04b2b1fb03f69c | [
"MIT"
] | null | null | null | networking/main.py | fred5229/IOT | 9fa6d5346476b35baf09337ffa04b2b1fb03f69c | [
"MIT"
] | null | null | null | import time
import machine
from network import WLAN
from mqtt import MQTTClient # Grapped from https://github.com/pycom/pycom-libraries/blob/master/examples/mqtt/mqtt.py
# Add to your /lib folder and upload
import pycom
pycom.heartbeat(False) # disable the heartbeat LED
# Configuration va... | 32.5 | 117 | 0.739367 | import time
import machine
from network import WLAN
from mqtt import MQTTClient # Grapped from https://github.com/pycom/pycom-libraries/blob/master/examples/mqtt/mqtt.py
# Add to your /lib folder and upload
import pycom
pycom.heartbeat(False) # disable the heartbeat LED
# Configuration va... | 0 | 0 | 0 |
6d2835fc66c2e0355f29b5dfc5de50d338ce23d4 | 763 | py | Python | class3/exercises/exercise2/exercise2.py | EndlessDynamics/Fork_nornir_course | 04bf7e3819659f481a4e04059152877b795177b2 | [
"Apache-2.0"
] | 60 | 2019-05-11T05:23:10.000Z | 2022-03-30T08:03:43.000Z | class3/exercises/exercise2/exercise2.py | EndlessDynamics/Fork_nornir_course | 04bf7e3819659f481a4e04059152877b795177b2 | [
"Apache-2.0"
] | 14 | 2021-03-31T19:08:08.000Z | 2021-09-15T17:29:40.000Z | class3/exercises/exercise2/exercise2.py | EndlessDynamics/Fork_nornir_course | 04bf7e3819659f481a4e04059152877b795177b2 | [
"Apache-2.0"
] | 21 | 2019-08-08T21:30:46.000Z | 2022-03-28T06:22:25.000Z | from nornir import InitNornir
from nornir.core.filter import F
if __name__ == "__main__":
main()
| 21.8 | 54 | 0.614679 | from nornir import InitNornir
from nornir.core.filter import F
def main():
nr = InitNornir()
# Exercise 2a
print("\nExercise 2a")
print("-" * 20)
arista1 = nr.filter(name="arista1")
print(arista1.inventory.hosts)
print("-" * 20)
print("\nExercise 2b")
print("-" * 20)
wan_devs... | 636 | 0 | 23 |
50927bf55bb6ed949cd938f236ba1859e3cc4a4a | 926 | py | Python | gui/migrations/0003_auto_20210927_1857.py | blakejakopovic/lndg | 45506b55ed6c2f554ef3c13a6863e75ebb292f07 | [
"MIT"
] | 56 | 2021-09-11T14:56:33.000Z | 2022-03-31T04:52:18.000Z | gui/migrations/0003_auto_20210927_1857.py | SatoshiNakamotoBitcoin/lndg | 41d3acb8e87c6f58420cc4fbef114bb802a7ad85 | [
"MIT"
] | 37 | 2021-09-23T18:28:36.000Z | 2022-03-30T00:35:45.000Z | gui/migrations/0003_auto_20210927_1857.py | SatoshiNakamotoBitcoin/lndg | 41d3acb8e87c6f58420cc4fbef114bb802a7ad85 | [
"MIT"
] | 15 | 2021-09-30T23:48:03.000Z | 2022-03-28T21:21:50.000Z | # Generated by Django 3.2.7 on 2021-09-27 18:57
from django.db import migrations, models
| 25.722222 | 52 | 0.561555 | # Generated by Django 3.2.7 on 2021-09-27 18:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gui', '0002_auto_20210923_1538'),
]
operations = [
migrations.RenameField(
model_name='channels',
old_name='base_fee... | 0 | 812 | 23 |
916d5b41a3fe1c8012d32880f1a79aa5e89ea8b1 | 13,011 | py | Python | foundation_tenant/tests/test_models_to_string.py | smegurus/smegurus-django | 053973b5ff0b997c52bfaca8daf8e07db64a877c | [
"BSD-4-Clause"
] | 1 | 2020-07-16T10:58:23.000Z | 2020-07-16T10:58:23.000Z | foundation_tenant/tests/test_models_to_string.py | smegurus/smegurus-django | 053973b5ff0b997c52bfaca8daf8e07db64a877c | [
"BSD-4-Clause"
] | 13 | 2018-11-30T02:29:39.000Z | 2022-03-11T23:35:49.000Z | foundation_tenant/tests/test_models_to_string.py | smegurus/smegurus-django | 053973b5ff0b997c52bfaca8daf8e07db64a877c | [
"BSD-4-Clause"
] | null | null | null | from django.core import mail
from django.core.signing import Signer
from django.db import transaction
from django.contrib.auth.models import User, Group
from django.utils import translation
from django.core.urlresolvers import resolve, reverse
from rest_framework.test import APITestCase
from django_tenants.test.cases i... | 33.882813 | 93 | 0.644455 | from django.core import mail
from django.core.signing import Signer
from django.db import transaction
from django.contrib.auth.models import User, Group
from django.utils import translation
from django.core.urlresolvers import resolve, reverse
from rest_framework.test import APITestCase
from django_tenants.test.cases i... | 8,068 | 1,863 | 23 |
62d7920dc05a18824a8af528e230f5a46ec28702 | 2,439 | py | Python | sensor_stick/scripts/segmentation.py | DrPanigrahi/RoboND-Perception-Project | 5d755c4a82ef4f7e4bc99c836ae5e03dbda03dcd | [
"MIT"
] | null | null | null | sensor_stick/scripts/segmentation.py | DrPanigrahi/RoboND-Perception-Project | 5d755c4a82ef4f7e4bc99c836ae5e03dbda03dcd | [
"MIT"
] | null | null | null | sensor_stick/scripts/segmentation.py | DrPanigrahi/RoboND-Perception-Project | 5d755c4a82ef4f7e4bc99c836ae5e03dbda03dcd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Author(s): Smruti Panigrahi
# Import modules
import rospy
import pcl
import numpy as np
import ctypes
import struct
import sensor_msgs.point_cloud2 as pc2
from sensor_msgs.msg import PointCloud2, PointField
from std_msgs.msg import Header
from random import randint
#from pcl_helper import *
i... | 31.675325 | 106 | 0.755228 | #!/usr/bin/env python
# Author(s): Smruti Panigrahi
# Import modules
import rospy
import pcl
import numpy as np
import ctypes
import struct
import sensor_msgs.point_cloud2 as pc2
from sensor_msgs.msg import PointCloud2, PointField
from std_msgs.msg import Header
from random import randint
#from pcl_helper import *
i... | 1,202 | 0 | 22 |
ada378632a2467ac04bdf3b6c2d9fe593fcbd1d1 | 2,202 | py | Python | pysoa/common/transport/http2_gateway/client.py | zetahernandez/pysoa | 006e55ba877196a42c64f2ff453583d366082d55 | [
"Apache-2.0"
] | null | null | null | pysoa/common/transport/http2_gateway/client.py | zetahernandez/pysoa | 006e55ba877196a42c64f2ff453583d366082d55 | [
"Apache-2.0"
] | null | null | null | pysoa/common/transport/http2_gateway/client.py | zetahernandez/pysoa | 006e55ba877196a42c64f2ff453583d366082d55 | [
"Apache-2.0"
] | null | null | null | from __future__ import (
absolute_import,
unicode_literals,
)
import uuid
from pysoa.common.metrics import TimerResolution
from pysoa.common.transport.base import (
ClientTransport,
)
from pysoa.common.transport.exceptions import MessageReceiveTimeout
from pysoa.common.transport.http2_gateway.settings imp... | 37.965517 | 119 | 0.698456 | from __future__ import (
absolute_import,
unicode_literals,
)
import uuid
from pysoa.common.metrics import TimerResolution
from pysoa.common.transport.base import (
ClientTransport,
)
from pysoa.common.transport.exceptions import MessageReceiveTimeout
from pysoa.common.transport.http2_gateway.settings imp... | 1,512 | 145 | 22 |
3eeb13b272956f7df0575c68e031eb841be38c5a | 5,558 | py | Python | code/plot_WTmap_ntwrkX.py | ParhamP/Global-Trade-Network | 106d3e55fba04e72feda2844d092745ce170e55d | [
"BSD-3-Clause"
] | 2 | 2021-08-22T10:02:08.000Z | 2021-11-09T11:30:31.000Z | code/plot_WTmap_ntwrkX.py | ParhamP/Global-Trade-Network | 106d3e55fba04e72feda2844d092745ce170e55d | [
"BSD-3-Clause"
] | null | null | null | code/plot_WTmap_ntwrkX.py | ParhamP/Global-Trade-Network | 106d3e55fba04e72feda2844d092745ce170e55d | [
"BSD-3-Clause"
] | null | null | null | import pickle
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
import utils.plot_functions as pf
import utils.data_manipulation as dm
import utils.network_manipulation as nm
from ast import literal_eval # to evaluate what is in a string literally.
flg_plot_graph_on_map = True
flg_imshow_adja... | 38.068493 | 143 | 0.677762 | import pickle
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
import utils.plot_functions as pf
import utils.data_manipulation as dm
import utils.network_manipulation as nm
from ast import literal_eval # to evaluate what is in a string literally.
flg_plot_graph_on_map = True
flg_imshow_adja... | 0 | 0 | 0 |
4aba22e8b14fd539db32357e1c82e363f67f6c20 | 10,499 | py | Python | mtp_2D_7l/randomsurface/randomSurface.py | chinchay/graphene-oxide | 6da0cc8eb951415e71e8c169f868ee9141186c2e | [
"MIT"
] | null | null | null | mtp_2D_7l/randomsurface/randomSurface.py | chinchay/graphene-oxide | 6da0cc8eb951415e71e8c169f868ee9141186c2e | [
"MIT"
] | null | null | null | mtp_2D_7l/randomsurface/randomSurface.py | chinchay/graphene-oxide | 6da0cc8eb951415e71e8c169f868ee9141186c2e | [
"MIT"
] | null | null | null | #%%
import importlib
from numpy.core.fromnumeric import transpose
import aseAtoms2cfg
import myread
importlib.reload(aseAtoms2cfg)
importlib.reload(myread)
import copy
from random import random
import numpy as np
# seed random number generator
from aseAtoms2cfg import atoms2cfg
from ase.build import graphene_nanoribb... | 30.431884 | 154 | 0.549481 | #%%
import importlib
from numpy.core.fromnumeric import transpose
import aseAtoms2cfg
import myread
importlib.reload(aseAtoms2cfg)
importlib.reload(myread)
import copy
from random import random
import numpy as np
# seed random number generator
from aseAtoms2cfg import atoms2cfg
from ase.build import graphene_nanoribb... | 8,348 | 0 | 134 |
8623085c6c201a6aef5194e8d05dbb61a551f5e4 | 875 | py | Python | waybar-watson.py | joshmuente/waybar-watson | ede88e1c710b0b90b41789e04232beca84d54869 | [
"MIT"
] | null | null | null | waybar-watson.py | joshmuente/waybar-watson | ede88e1c710b0b90b41789e04232beca84d54869 | [
"MIT"
] | null | null | null | waybar-watson.py | joshmuente/waybar-watson | ede88e1c710b0b90b41789e04232beca84d54869 | [
"MIT"
] | 1 | 2022-01-13T15:51:05.000Z | 2022-01-13T15:51:05.000Z | #!/usr/bin/env python3
import watson
import time
import json
import arrow
import datetime
if __name__ == "__main__":
main()
| 32.407407 | 96 | 0.558857 | #!/usr/bin/env python3
import watson
import time
import json
import arrow
import datetime
def main():
while True:
wat = watson.Watson()
if wat.is_started:
project = wat.current.get('project')
tags = wat.current.get('tags')
started = arrow.now() - wat.current.get(... | 723 | 0 | 23 |
8a1fcff5a1562e98511787ec3b0bda6b27b718a0 | 12,093 | py | Python | verejne/api_GetInfos.py | mirecmrozek/verejne.digital | 8aed7311d75b6d15c8c4b5bbbf0d15ade3ce031a | [
"Apache-2.0"
] | null | null | null | verejne/api_GetInfos.py | mirecmrozek/verejne.digital | 8aed7311d75b6d15c8c4b5bbbf0d15ade3ce031a | [
"Apache-2.0"
] | null | null | null | verejne/api_GetInfos.py | mirecmrozek/verejne.digital | 8aed7311d75b6d15c8c4b5bbbf0d15ade3ce031a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
# --- UTILITY METHODS ---
def _convert_dates_to_strings(row):
""" Given a database row returned by psycopg2,
convert all dates to strings (usually used
to ensure JSON serialisability). """
for key in row:
if type(row[key]) =... | 31.329016 | 125 | 0.566691 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
# --- UTILITY METHODS ---
def _convert_dates_to_strings(row):
""" Given a database row returned by psycopg2,
convert all dates to strings (usually used
to ensure JSON serialisability). """
for key in row:
if type(row[key]) =... | 10,473 | 0 | 320 |
f35e086725dbbf1b045cca1de6228fbbc4d21154 | 97 | py | Python | sygicmaps/__init__.py | Sygic/sygic-maps-services-python | 3a2971dbfe0f68d6d2908478247d92367f4f531d | [
"MIT"
] | 2 | 2017-10-23T08:08:26.000Z | 2018-02-07T12:29:30.000Z | sygicmaps/__init__.py | Sygic/sygic-maps-services-python | 3a2971dbfe0f68d6d2908478247d92367f4f531d | [
"MIT"
] | 1 | 2018-03-16T14:23:11.000Z | 2018-03-21T13:09:46.000Z | sygicmaps/__init__.py | Sygic/sygic-maps-services-python | 3a2971dbfe0f68d6d2908478247d92367f4f531d | [
"MIT"
] | 1 | 2019-06-13T08:20:30.000Z | 2019-06-13T08:20:30.000Z | from sygicmaps.client import Client
from sygicmaps.input import Input
__version__ = "0.2.7-dev"
| 19.4 | 35 | 0.793814 | from sygicmaps.client import Client
from sygicmaps.input import Input
__version__ = "0.2.7-dev"
| 0 | 0 | 0 |
2e04004221b85f008ff5c2de8f52ace3e881949d | 679 | py | Python | examples/eval_model.py | markr-fu-berlin/ParlAI | 23f014c38ee502091fdd8623f5c8a6f2c3216e92 | [
"BSD-3-Clause"
] | 2 | 2020-03-22T10:18:09.000Z | 2020-05-06T21:48:47.000Z | examples/eval_model.py | urvishdesai/dialogue-encoding-tasks-parlai | 29743cc7b47c413c2181f68c0b7ef40a6f06a40f | [
"BSD-3-Clause"
] | null | null | null | examples/eval_model.py | urvishdesai/dialogue-encoding-tasks-parlai | 29743cc7b47c413c2181f68c0b7ef40a6f06a40f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
"""... | 33.95 | 77 | 0.765832 | #!/usr/bin/env python3
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
"""... | 0 | 0 | 0 |
6b0ac29059d70fa19dac6fa7c35e8c5c0152e982 | 52,238 | py | Python | utils/BaiduTextApi/config/config.py | haodaohong/zimt8 | 41c1a8493775002b8a29075125b362991035cfe8 | [
"Apache-2.0"
] | 1 | 2021-09-30T05:46:44.000Z | 2021-09-30T05:46:44.000Z | utils/BaiduTextApi/config/config.py | haodaohong/zimt8 | 41c1a8493775002b8a29075125b362991035cfe8 | [
"Apache-2.0"
] | null | null | null | utils/BaiduTextApi/config/config.py | haodaohong/zimt8 | 41c1a8493775002b8a29075125b362991035cfe8 | [
"Apache-2.0"
] | 1 | 2021-09-24T15:46:39.000Z | 2021-09-24T15:46:39.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2019/2/13 08:58
# @User : zhunishengrikuaile
# @File : config.py
# @Email : binary@shujian.org
# @MyBlog : WWW.SHUJIAN.ORG
# @NetName : 書劍
# @Software: 百度识图Api封装
# 配置文件
'''
应用ID: 14348843
应用API_KEY: wc68dHtiY9mwuD7980EXr1I2
应用SECRET_KEY: dCaMG095LvB9p... | 62.410992 | 279 | 0.539933 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2019/2/13 08:58
# @User : zhunishengrikuaile
# @File : config.py
# @Email : binary@shujian.org
# @MyBlog : WWW.SHUJIAN.ORG
# @NetName : 書劍
# @Software: 百度识图Api封装
# 配置文件
'''
应用ID: 14348843
应用API_KEY: wc68dHtiY9mwuD7980EXr1I2
应用SECRET_KEY: dCaMG095LvB9p... | 0 | 0 | 0 |
de6c10906f31d374b65912f5233777fb3ecfd68c | 1,468 | py | Python | rivers2stratigraphy/geom.py | amoodie/rivers2stratigraphy | 3978f0ea4bd087332ee0215f5a003d7f63152598 | [
"MIT"
] | 3 | 2018-04-13T19:17:14.000Z | 2018-04-26T04:36:54.000Z | rivers2stratigraphy/geom.py | amoodie/rivers2stratigraphy | 3978f0ea4bd087332ee0215f5a003d7f63152598 | [
"MIT"
] | 13 | 2018-03-01T03:56:41.000Z | 2018-09-24T16:27:53.000Z | rivers2stratigraphy/geom.py | amoodie/rivers2stratigraphy | 3978f0ea4bd087332ee0215f5a003d7f63152598 | [
"MIT"
] | null | null | null | # geometry calculations
# TODO:
# - swap to x^(0.5) instead of sqrt for speed?
import numpy as np
# from scipy.spatial import distance
| 26.690909 | 65 | 0.596049 | # geometry calculations
# TODO:
# - swap to x^(0.5) instead of sqrt for speed?
import numpy as np
# from scipy.spatial import distance
def Qhatfun(Qwf, D50, g):
# dimensionless Qw, Wilkerson and Parker, 2011
return Qwf / (np.sqrt(g * D50) * D50**2)
def Repfun(D50, R, g, nu):
# particle Reynolds num, W... | 1,113 | 0 | 210 |
fbc6f2fca03cbeec5ed0a2f86a463517745cc994 | 841 | py | Python | Machine learning/sentdex course/Machine learning/Classification/SVM.py | ahmedosaka/HACKER_RANK | f594fa8e1eeed0598f7151556a1068865cf9be91 | [
"MIT"
] | null | null | null | Machine learning/sentdex course/Machine learning/Classification/SVM.py | ahmedosaka/HACKER_RANK | f594fa8e1eeed0598f7151556a1068865cf9be91 | [
"MIT"
] | null | null | null | Machine learning/sentdex course/Machine learning/Classification/SVM.py | ahmedosaka/HACKER_RANK | f594fa8e1eeed0598f7151556a1068865cf9be91 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 28 20:46:54 2021
@author: ahmed
"""
import numpy as np
from sklearn import preprocessing, neighbors, svm
from sklearn.model_selection import train_test_split
import pandas as pd
df = pd.read_csv('breast-cancer-wisconsin.txt')
df.replace('?',-99999, inplace=True)
df.drop... | 25.484848 | 72 | 0.707491 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 28 20:46:54 2021
@author: ahmed
"""
import numpy as np
from sklearn import preprocessing, neighbors, svm
from sklearn.model_selection import train_test_split
import pandas as pd
df = pd.read_csv('breast-cancer-wisconsin.txt')
df.replace('?',-99999, inplace=True)
df.drop... | 0 | 0 | 0 |
b460a825cadf8df73353c7a21bf3258eed4a974f | 1,654 | py | Python | setup.py | haideralipunjabi/cli-badges | 1b3ca16f2ce857692e18b317661f776f36f77cf7 | [
"MIT"
] | 26 | 2020-08-24T08:48:14.000Z | 2021-07-29T01:22:10.000Z | setup.py | haideralipunjabi/cli-badges | 1b3ca16f2ce857692e18b317661f776f36f77cf7 | [
"MIT"
] | null | null | null | setup.py | haideralipunjabi/cli-badges | 1b3ca16f2ce857692e18b317661f776f36f77cf7 | [
"MIT"
] | 3 | 2020-08-24T09:11:53.000Z | 2020-10-06T18:14:57.000Z | import setuptools
from cli_badges import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="cli_badges", # Replace with your own username
version=__version__,
author="Haider Ali Punjabi",
author_email="me@haideralipunjabi.com",
keywords=["color",... | 40.341463 | 148 | 0.632406 | import setuptools
from cli_badges import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="cli_badges", # Replace with your own username
version=__version__,
author="Haider Ali Punjabi",
author_email="me@haideralipunjabi.com",
keywords=["color",... | 0 | 0 | 0 |
8b5440c388a0e23fc37d317c8b9cf69042bde00b | 3,445 | py | Python | src/plugins/auto_translator/utils/emojis.py | shinnenijou/JiBot | c468a67e301597ca702170aded96c5145d864115 | [
"MIT"
] | null | null | null | src/plugins/auto_translator/utils/emojis.py | shinnenijou/JiBot | c468a67e301597ca702170aded96c5145d864115 | [
"MIT"
] | null | null | null | src/plugins/auto_translator/utils/emojis.py | shinnenijou/JiBot | c468a67e301597ca702170aded96c5145d864115 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import emoji
from typing import Tuple
from nonebot.adapters.onebot.v11 import Message, MessageSegment
# CONSTANT
PLAIN_TEXT = ['face', 'reply', 'at', 'text'] | 35.153061 | 95 | 0.566328 | # -*- coding: utf-8 -*-
import emoji
from typing import Tuple
from nonebot.adapters.onebot.v11 import Message, MessageSegment
# CONSTANT
PLAIN_TEXT = ['face', 'reply', 'at', 'text']
async def get_qq_name(bot, group_id, user_id) -> str:
user_info = await bot.get_group_member_info(
group_id=group_id, user_i... | 2,979 | 4 | 280 |
b77e254dcd7074555563b21dcff233c816f50825 | 4,177 | py | Python | cloudmesh_client/common/menu.py | cloudmesh/client | a5fc7dbaf2c51f1227cff346aedea4bf7f563fa9 | [
"Apache-2.0"
] | 3 | 2016-07-16T20:35:41.000Z | 2017-03-27T23:31:27.000Z | cloudmesh_client/common/menu.py | cloudmesh/client | a5fc7dbaf2c51f1227cff346aedea4bf7f563fa9 | [
"Apache-2.0"
] | 259 | 2015-06-18T19:19:14.000Z | 2021-09-23T23:22:30.000Z | cloudmesh_client/common/menu.py | cloudmesh/client | a5fc7dbaf2c51f1227cff346aedea4bf7f563fa9 | [
"Apache-2.0"
] | 19 | 2015-12-09T05:55:13.000Z | 2018-12-02T08:08:43.000Z | """Ascii menu class"""
from __future__ import print_function
from cloudmesh_client.common.Printer import Printer
from builtins import input
def ascii_menu(title=None, menu_list=None):
"""
creates a simple ASCII menu from a list of tuples containing a label
and a functions reference. The function should n... | 26.605096 | 76 | 0.457505 | """Ascii menu class"""
from __future__ import print_function
from cloudmesh_client.common.Printer import Printer
from builtins import input
def ascii_menu(title=None, menu_list=None):
"""
creates a simple ASCII menu from a list of tuples containing a label
and a functions reference. The function should n... | 1,974 | 0 | 100 |
410af6125ce9122561d5ee02c51cd87d7b717679 | 600 | py | Python | Cryptography tools/code/XOR/XOR.py | BLueberryPieBLue/CTF-learn | aea7cec71afbc096680270080ed3f4530d1660e7 | [
"MIT"
] | null | null | null | Cryptography tools/code/XOR/XOR.py | BLueberryPieBLue/CTF-learn | aea7cec71afbc096680270080ed3f4530d1660e7 | [
"MIT"
] | null | null | null | Cryptography tools/code/XOR/XOR.py | BLueberryPieBLue/CTF-learn | aea7cec71afbc096680270080ed3f4530d1660e7 | [
"MIT"
] | null | null | null | # -*- coding: cp936 -*-
A=[]
B=[]
f=open('1.txt','r')
c=[]
for i in range(0,16):
a = f.readline()
b = a.split()
c.append(b)
#print(c)
for i in c:
A.append(i[0])
B.append(i[1])
#print (A)
#print (B)
xor=[]
for i in range(0,len(A)):
for j in range(0,len(A[0])):
d = int(... | 15 | 38 | 0.421667 | # -*- coding: cp936 -*-
A=[]
B=[]
f=open('1.txt','r')
c=[]
for i in range(0,16):
a = f.readline()
b = a.split()
c.append(b)
#print(c)
for i in c:
A.append(i[0])
B.append(i[1])
#print (A)
#print (B)
xor=[]
for i in range(0,len(A)):
for j in range(0,len(A[0])):
d = int(... | 0 | 0 | 0 |
5ef15734eb1500e405463f7f53fccd58adec65d4 | 8,971 | py | Python | files/parallelize_DALEC_LAI_All.py | wanmeng8888/CodingDiary | 3b29c96e39d5f126ed3cdcc6de595d863c380e7b | [
"Apache-2.0"
] | 1 | 2020-05-05T15:50:05.000Z | 2020-05-05T15:50:05.000Z | files/parallelize_DALEC_LAI_All.py | wanmeng8888/CodingDiary | 3b29c96e39d5f126ed3cdcc6de595d863c380e7b | [
"Apache-2.0"
] | null | null | null | files/parallelize_DALEC_LAI_All.py | wanmeng8888/CodingDiary | 3b29c96e39d5f126ed3cdcc6de595d863c380e7b | [
"Apache-2.0"
] | null | null | null | #! python
#-*- coding: utf-8 -*-
# 标准化输出。
from __future__ import print_function
# 各种包。
import os, sys, time
import math
# PYMC
import pymc as pm
from pymc import Uniform, Normal, MCMC, AdaptiveMetropolis
# NUMPY
import numpy as np
# SPARK
from pyspark.sql import SparkSession
# 外部依赖项
from model_DALEC_LAI_All import init... | 46.005128 | 268 | 0.518783 | #! python
#-*- coding: utf-8 -*-
# 标准化输出。
from __future__ import print_function
# 各种包。
import os, sys, time
import math
# PYMC
import pymc as pm
from pymc import Uniform, Normal, MCMC, AdaptiveMetropolis
# NUMPY
import numpy as np
# SPARK
from pyspark.sql import SparkSession
# 外部依赖项
from model_DALEC_LAI_All import init... | 7,646 | 0 | 22 |
b79ae8ff4875c0aa5aa2308a21e83223aeaa5891 | 549 | py | Python | clean-nbs/tasks/load.py | ploomber/posts | 5f739cf04ff77932c34d5d3ad8d6d94dfe97f051 | [
"Apache-2.0"
] | 15 | 2020-11-30T19:31:30.000Z | 2022-01-16T15:09:16.000Z | clean-nbs/tasks/load.py | ploomber/posts | 5f739cf04ff77932c34d5d3ad8d6d94dfe97f051 | [
"Apache-2.0"
] | 3 | 2022-01-13T03:51:14.000Z | 2022-03-12T01:01:41.000Z | clean-nbs/tasks/load.py | ploomber/posts | 5f739cf04ff77932c34d5d3ad8d6d94dfe97f051 | [
"Apache-2.0"
] | 8 | 2021-07-28T02:19:00.000Z | 2022-02-06T16:03:24.000Z | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# %%
import pandas as pd
# %% tags=["pa... | 18.931034 | 74 | 0.591985 | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# %%
import pandas as pd
# %% tags=["pa... | 0 | 0 | 0 |
8bb02a5f9be7f352c56748cc26bcb9adf601f186 | 3,040 | py | Python | pysprint/tests/test_autofft.py | kingablgh/PySprint | c3e76fbf1287d18d78699145f5301593aff47ba0 | [
"MIT"
] | 13 | 2020-05-29T14:53:13.000Z | 2022-02-09T17:29:19.000Z | pysprint/tests/test_autofft.py | kingablgh/PySprint | c3e76fbf1287d18d78699145f5301593aff47ba0 | [
"MIT"
] | 8 | 2019-10-14T18:23:26.000Z | 2021-09-14T16:42:27.000Z | pysprint/tests/test_autofft.py | kingablgh/PySprint | c3e76fbf1287d18d78699145f5301593aff47ba0 | [
"MIT"
] | 1 | 2020-10-07T06:42:17.000Z | 2020-10-07T06:42:17.000Z | import unittest
from unittest.mock import patch
import numpy as np
import pytest
import pysprint
from pysprint import FFTMethod, Generator
from pysprint.core._fft_tools import (
find_roi,
find_center,
_ensure_window_at_origin,
predict_fwhm,
)
from pysprint.utils import NotCalculatedException
# ... | 25.982906 | 81 | 0.620066 | import unittest
from unittest.mock import patch
import numpy as np
import pytest
import pysprint
from pysprint import FFTMethod, Generator
from pysprint.core._fft_tools import (
find_roi,
find_center,
_ensure_window_at_origin,
predict_fwhm,
)
from pysprint.utils import NotCalculatedException
class T... | 2,261 | 16 | 287 |
7348e774dca4fc13f76ffcfb8586eb5f3c6f9da7 | 3,307 | py | Python | catch_a_trtl.py | Kyan-milk/github-slideshow | a8cf0ce5288ae2d085e3f47a76a65f305dae35a8 | [
"MIT"
] | 1 | 2021-11-03T20:53:59.000Z | 2021-11-03T20:53:59.000Z | catch_a_trtl.py | Kyan-milk/github-slideshow | a8cf0ce5288ae2d085e3f47a76a65f305dae35a8 | [
"MIT"
] | 2 | 2021-10-06T20:27:55.000Z | 2021-10-07T23:45:17.000Z | catch_a_trtl.py | Kyan-milk/github-slideshow | a8cf0ce5288ae2d085e3f47a76a65f305dae35a8 | [
"MIT"
] | null | null | null | import turtle as trtl
import random as rand
# leaderboard variables
leaderboard_file_name = "a122_leaderboard.txt"
leader_names_list = []
leader_scores_list = []
player_name = input ("Please enter your name:")
import leaderboard as lb
score = 0
colors = ["black", "sky blue", "salmon", "orchid", "pale ... | 26.669355 | 108 | 0.699123 | import turtle as trtl
import random as rand
# leaderboard variables
leaderboard_file_name = "a122_leaderboard.txt"
leader_names_list = []
leader_scores_list = []
player_name = input ("Please enter your name:")
import leaderboard as lb
score = 0
def manage_leaderboard():
global leader_scores_lis... | 1,787 | 0 | 186 |
81b4c5bbdec104e1d7aa50badc3acaf557f2fd20 | 125 | py | Python | kshell_utilities/kshell_exceptions.py | GaffaSnobb/kshell-utilities | 6e07d073ea742bbeb92662aaeb2f8cfe2abaa0cb | [
"MIT"
] | 1 | 2021-04-15T21:07:03.000Z | 2021-04-15T21:07:03.000Z | kshell_utilities/kshell_exceptions.py | JonKDahl/kshell_utilities | ad4b40137bfa84ea238ebd44624e3c890b90517c | [
"MIT"
] | null | null | null | kshell_utilities/kshell_exceptions.py | JonKDahl/kshell_utilities | ad4b40137bfa84ea238ebd44624e3c890b90517c | [
"MIT"
] | null | null | null | class KshellDataStructureError(Exception):
"""
Raise when KSHELL data file has unexpected structure / syntax.
""" | 31.25 | 66 | 0.712 | class KshellDataStructureError(Exception):
"""
Raise when KSHELL data file has unexpected structure / syntax.
""" | 0 | 0 | 0 |
742f393dd195008d665fa4029e4a9f04c566d444 | 6,218 | py | Python | modtox/new_tests/Molecules/test_CollectionFromTarget.py | danielSoler93/modtox | 757234140cc780f57d031b46d9293fc2bf95d18d | [
"Apache-2.0"
] | 4 | 2019-09-22T22:57:30.000Z | 2020-03-18T13:20:50.000Z | modtox/new_tests/Molecules/test_CollectionFromTarget.py | danielSoler93/ModTox | 757234140cc780f57d031b46d9293fc2bf95d18d | [
"Apache-2.0"
] | 21 | 2019-09-16T11:07:13.000Z | 2019-11-20T15:06:06.000Z | modtox/new_tests/Molecules/test_CollectionFromTarget.py | danielSoler93/ModTox | 757234140cc780f57d031b46d9293fc2bf95d18d | [
"Apache-2.0"
] | 2 | 2019-09-07T17:07:55.000Z | 2020-03-18T13:20:52.000Z | import typing
from modtox.modtox.Molecules.target_col import CollectionFromTarget, IDs
from modtox.modtox.Molecules.mol import MoleculeFromInChI
from modtox.modtox.utils.enums import Database, StandardTypes
from unittest.mock import MagicMock, Mock, PropertyMock, patch
import pickle5
## sm stands for molecule identi... | 30.331707 | 82 | 0.642329 | import typing
from modtox.modtox.Molecules.target_col import CollectionFromTarget, IDs
from modtox.modtox.Molecules.mol import MoleculeFromInChI
from modtox.modtox.utils.enums import Database, StandardTypes
from unittest.mock import MagicMock, Mock, PropertyMock, patch
import pickle5
## sm stands for molecule identi... | 44 | -7 | 56 |
0fd4fa03a38f40f452e7288c8fe9015dd26bbabd | 6,292 | py | Python | astroquery/utils/tap/xmlparser/tableSaxParser.py | rickynilsson/astroquery | b7edec0d8e36b11c25baa39ad72e4160bc30d465 | [
"BSD-3-Clause"
] | 577 | 2015-02-12T18:23:49.000Z | 2022-03-22T21:38:58.000Z | astroquery/utils/tap/xmlparser/tableSaxParser.py | rickynilsson/astroquery | b7edec0d8e36b11c25baa39ad72e4160bc30d465 | [
"BSD-3-Clause"
] | 1,812 | 2015-01-01T08:02:20.000Z | 2022-03-31T13:03:52.000Z | astroquery/utils/tap/xmlparser/tableSaxParser.py | rickynilsson/astroquery | b7edec0d8e36b11c25baa39ad72e4160bc30d465 | [
"BSD-3-Clause"
] | 322 | 2015-02-23T19:31:29.000Z | 2022-03-25T18:51:30.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=============
TAP plus
=============
@author: Juan Carlos Segovia
@contact: juan.carlos.segovia@sciops.esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 30 jun. 2016
"""
import xml.sax
from ... | 35.348315 | 82 | 0.632867 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=============
TAP plus
=============
@author: Juan Carlos Segovia
@contact: juan.carlos.segovia@sciops.esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 30 jun. 2016
"""
import xml.sax
from ... | 4,985 | 0 | 551 |
f58d3753c04971e66819c438e4602de813f9e286 | 2,404 | py | Python | explorer/urls.py | AthenaExplorer/xm_s_explorer | b8ccd57e7bd493f46c493a967ec22e42171a6091 | [
"MIT"
] | null | null | null | explorer/urls.py | AthenaExplorer/xm_s_explorer | b8ccd57e7bd493f46c493a967ec22e42171a6091 | [
"MIT"
] | null | null | null | explorer/urls.py | AthenaExplorer/xm_s_explorer | b8ccd57e7bd493f46c493a967ec22e42171a6091 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from explorer import views
urlpatterns = [
# 首页
url(r'^get_block_chart$', views.get_block_chart), # 爆块信息统计
url(r'^get_overview$', views.get_overview), # 概览
url(r'^get_hashrate_ranking$', views.get_hashrate_ranking), # 算力走势-有效算力
url(r'^get_power_valid$', views.ge... | 47.137255 | 113 | 0.68802 | from django.conf.urls import url
from explorer import views
urlpatterns = [
# 首页
url(r'^get_block_chart$', views.get_block_chart), # 爆块信息统计
url(r'^get_overview$', views.get_overview), # 概览
url(r'^get_hashrate_ranking$', views.get_hashrate_ranking), # 算力走势-有效算力
url(r'^get_power_valid$', views.ge... | 0 | 0 | 0 |
96bcaf36d4506a8131d2cc2102a611fcf76b5197 | 6,921 | py | Python | vmdgadgets/projectile.py | Hashi4/vmdgadgets | 07ff21c2ce20ab6dbae410d365b6c2189635944a | [
"Apache-2.0"
] | null | null | null | vmdgadgets/projectile.py | Hashi4/vmdgadgets | 07ff21c2ce20ab6dbae410d365b6c2189635944a | [
"Apache-2.0"
] | null | null | null | vmdgadgets/projectile.py | Hashi4/vmdgadgets | 07ff21c2ce20ab6dbae410d365b6c2189635944a | [
"Apache-2.0"
] | null | null | null | import math
import numpy as np
import os
import vmdutil
from vmdutil import vmddef
from lookat import LookAt, MotionFrame
FPS = 30
MIXEL = 0.08
G = -9.8 / MIXEL / FPS / FPS
GV = (0, G, 0) # fixed
HALFG = G / 2
cp_all = vmddef.BONE_LERP_CONTROLPOINTS
replace_controlpoints(cp_all, vmdutil.PARABOLA2_CONTROLPOINTS,... | 37.410811 | 77 | 0.598468 | import math
import numpy as np
import os
import vmdutil
from vmdutil import vmddef
from lookat import LookAt, MotionFrame
FPS = 30
MIXEL = 0.08
G = -9.8 / MIXEL / FPS / FPS
GV = (0, G, 0) # fixed
HALFG = G / 2
def project_asap(pos_target, v_target, v_bullet):
# ||pos + v_t * t - 1/2gt**2|| = v_b * t
g = vm... | 6,085 | 4 | 330 |
025aa1ffe30dbd4bfd3b69b47a28e63ef7ebe43f | 324 | py | Python | backend/events/migrations/0007_remove_event_user.py | ShivanS93/green-your-impact | ef52a1526e22c7852a70e962902ee47966ef7258 | [
"MIT"
] | 2 | 2021-09-04T07:14:41.000Z | 2022-02-22T17:54:25.000Z | backend/events/migrations/0007_remove_event_user.py | ShivanS93/green-your-impact | ef52a1526e22c7852a70e962902ee47966ef7258 | [
"MIT"
] | 2 | 2021-09-04T04:50:11.000Z | 2021-09-19T09:40:33.000Z | backend/events/migrations/0007_remove_event_user.py | ShivanS93/green-your-impact | ef52a1526e22c7852a70e962902ee47966ef7258 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-24 01:05
from django.db import migrations
| 18 | 47 | 0.58642 | # Generated by Django 3.2.6 on 2021-08-24 01:05
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("events", "0006_auto_20210824_0013"),
]
operations = [
migrations.RemoveField(
model_name="event",
name="user",
),
... | 0 | 218 | 23 |
be9a5e245ff76ed6681a2750c91a421bf0879c29 | 2,278 | py | Python | app/fuzzy_clock.py | rdavid/dotfiles | f540f4af083b800a2a25a766c05fd5dff7183a46 | [
"0BSD"
] | 1 | 2019-08-19T16:22:39.000Z | 2019-08-19T16:22:39.000Z | app/fuzzy_clock.py | rdavid/dotfiles | f540f4af083b800a2a25a766c05fd5dff7183a46 | [
"0BSD"
] | null | null | null | app/fuzzy_clock.py | rdavid/dotfiles | f540f4af083b800a2a25a766c05fd5dff7183a46 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
from time import localtime
from sys import exc_info
from sys import exit
DEFAULT_RESOLUTION = 5
MIDDAY = 12
HOUR_WORD_MAPPINGS = {
0: "midnight",
1: "one",
2: "two",
3: "three",
4: "four",
5: "five",
6: "six",
7: "seven",
... | 23.484536 | 76 | 0.613257 | #!/usr/bin/env python
from __future__ import print_function
from time import localtime
from sys import exc_info
from sys import exit
DEFAULT_RESOLUTION = 5
MIDDAY = 12
HOUR_WORD_MAPPINGS = {
0: "midnight",
1: "one",
2: "two",
3: "three",
4: "four",
5: "five",
6: "six",
7: "seven",
... | 1,101 | 0 | 115 |
5e9f92b7edb886b47d04d5a5c5f2649bd57c7cab | 2,103 | py | Python | main.py | 3-24/icalKSA | 6d735da3ef6a1917ad9bb4192f82ca0a5566dd25 | [
"MIT"
] | null | null | null | main.py | 3-24/icalKSA | 6d735da3ef6a1917ad9bb4192f82ca0a5566dd25 | [
"MIT"
] | null | null | null | main.py | 3-24/icalKSA | 6d735da3ef6a1917ad9bb4192f82ca0a5566dd25 | [
"MIT"
] | null | null | null | from icalendar import Calendar, Event
import urllib.request
from bs4 import BeautifulSoup
mainParse(2018)
| 30.926471 | 115 | 0.460295 | from icalendar import Calendar, Event
import urllib.request
from bs4 import BeautifulSoup
def get_html(url):
fp = urllib.request.urlopen(url)
mybytes = fp.read()
mystr = mybytes.decode("utf8")
fp.close()
return mystr
def get_data(url):
list = []
content = get_html(url)
soup = Beauti... | 1,985 | 0 | 69 |
672eb84aa907f5080e45db551089bbb04363f001 | 2,488 | py | Python | commands/mount.py | gvb84/dawgmon | 9d9574d6a5777395f785b8b08cd26e30ef66abf5 | [
"BSD-3-Clause"
] | 2 | 2017-09-19T15:11:21.000Z | 2019-04-17T19:17:58.000Z | commands/mount.py | gvb84/dawgmon | 9d9574d6a5777395f785b8b08cd26e30ef66abf5 | [
"BSD-3-Clause"
] | null | null | null | commands/mount.py | gvb84/dawgmon | 9d9574d6a5777395f785b8b08cd26e30ef66abf5 | [
"BSD-3-Clause"
] | null | null | null | from . import *
| 32.311688 | 111 | 0.603296 | from . import *
def change_attr_list_to_dict(attrs):
ret = {}
for attr in attrs:
lf = attr.find("=")
val = attr[lf+1:] if lf != -1 else None
name = attr[0:lf] if lf != -1 else attr
ret[name] = val
return ret
class MountpointsCommand(ShellCommand):
name = "list_mount"
command = "mount"
desc = "analyze ch... | 2,242 | 184 | 46 |
b219c0ee91fa37b6762d358800f55de47b3902a6 | 31 | py | Python | pyterprise/__init__.py | flaviotorres/terraform-enterprise-api-python-client | 7f3752dd6dfc51243a7102895d6d286000b543b4 | [
"MIT"
] | null | null | null | pyterprise/__init__.py | flaviotorres/terraform-enterprise-api-python-client | 7f3752dd6dfc51243a7102895d6d286000b543b4 | [
"MIT"
] | null | null | null | pyterprise/__init__.py | flaviotorres/terraform-enterprise-api-python-client | 7f3752dd6dfc51243a7102895d6d286000b543b4 | [
"MIT"
] | null | null | null | from .tfe_client import Client
| 15.5 | 30 | 0.83871 | from .tfe_client import Client
| 0 | 0 | 0 |
f34143429f45a824e3cef13e0581abaa0128883f | 4,701 | py | Python | python-flask-server/swagger_server/models/protein.py | broadinstitute/depmap-api | 37776fc40fd343f8c8ebe25f0f064c2947d048be | [
"MIT"
] | 1 | 2020-02-03T20:29:03.000Z | 2020-02-03T20:29:03.000Z | python-flask-server/swagger_server/models/protein.py | broadinstitute/depmap-api | 37776fc40fd343f8c8ebe25f0f064c2947d048be | [
"MIT"
] | null | null | null | python-flask-server/swagger_server/models/protein.py | broadinstitute/depmap-api | 37776fc40fd343f8c8ebe25f0f064c2947d048be | [
"MIT"
] | 2 | 2020-05-14T22:31:09.000Z | 2021-04-15T22:44:40.000Z | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
class Protein(Model):
"""NOTE: This class is auto generated by the swagger cod... | 27.816568 | 166 | 0.627526 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
class Protein(Model):
"""NOTE: This class is auto generated by the swagger cod... | 0 | 0 | 0 |
d21022a91d3ada35d9c2ff4e6559379747914f81 | 1,437 | py | Python | examples/frompapers/Diesmann_et_al_1999.py | Abhayindia/Angela-A-Simulator-for-Spiking-Neurals | 7e7b718e228535c2a91df0657be67f4f178fc19a | [
"BSD-2-Clause"
] | 1 | 2020-10-15T05:38:55.000Z | 2020-10-15T05:38:55.000Z | examples/frompapers/Diesmann_et_al_1999.py | Abhayindia/Angela-A-Simulator-for-Spiking-Neurals | 7e7b718e228535c2a91df0657be67f4f178fc19a | [
"BSD-2-Clause"
] | null | null | null | examples/frompapers/Diesmann_et_al_1999.py | Abhayindia/Angela-A-Simulator-for-Spiking-Neurals | 7e7b718e228535c2a91df0657be67f4f178fc19a | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
'''
Synfire chains
--------------
M. Diesmann et al. (1999). Stable propagation of synchronous spiking in cortical
neural networks. Nature 402, 529-533.
'''
from angela2 import *
duration = 100*ms
# Neuron model parameters
Vr = -70*mV
Vt = -55*mV
taum = 10*ms
taupsp = 0.325*ms
weight = 4.86*mV
#... | 26.611111 | 99 | 0.629784 | #!/usr/bin/env python
'''
Synfire chains
--------------
M. Diesmann et al. (1999). Stable propagation of synchronous spiking in cortical
neural networks. Nature 402, 529-533.
'''
from angela2 import *
duration = 100*ms
# Neuron model parameters
Vr = -70*mV
Vt = -55*mV
taum = 10*ms
taupsp = 0.325*ms
weight = 4.86*mV
#... | 0 | 0 | 0 |
11499bf14c69e8922764dbc34a5bfd57ff891652 | 3,412 | py | Python | Project2/RL.py | jhmfreitas/AI-Project | 5ba40c73e97d905db98787c9b84976dc49330905 | [
"MIT"
] | 1 | 2021-02-01T17:52:12.000Z | 2021-02-01T17:52:12.000Z | Project2/RL.py | jhmfreitas/AI-Project | 5ba40c73e97d905db98787c9b84976dc49330905 | [
"MIT"
] | null | null | null | Project2/RL.py | jhmfreitas/AI-Project | 5ba40c73e97d905db98787c9b84976dc49330905 | [
"MIT"
] | null | null | null | #87671-Joao Freitas 87693-Pedro Soares Grupo 15
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 16 20:31:54 2017
@author: mlopes
"""
import numpy as np
import random
from tempfile import TemporaryFile
outfile = TemporaryFile()
| 31.88785 | 108 | 0.509379 | #87671-Joao Freitas 87693-Pedro Soares Grupo 15
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 16 20:31:54 2017
@author: mlopes
"""
import numpy as np
import random
from tempfile import TemporaryFile
outfile = TemporaryFile()
class finiteMDP:
def __init__(self, nS, nA, gamma, P=[], R=[], absorv=[]):
se... | 2,961 | -5 | 218 |
d10c4e749aed94d7047ebdbe76005fa871e8fd9f | 421 | py | Python | TagScriptEngine/block/strictvariablegetter.py | djthegr8/TagScript | cbcea6b4e07f10ed9ffe665406c4c21dd9730fec | [
"CC-BY-4.0"
] | 24 | 2017-09-06T20:39:44.000Z | 2022-03-21T10:21:35.000Z | TagScriptEngine/block/strictvariablegetter.py | djthegr8/TagScript | cbcea6b4e07f10ed9ffe665406c4c21dd9730fec | [
"CC-BY-4.0"
] | 5 | 2021-01-01T23:07:04.000Z | 2022-02-28T13:26:43.000Z | TagScriptEngine/block/strictvariablegetter.py | djthegr8/TagScript | cbcea6b4e07f10ed9ffe665406c4c21dd9730fec | [
"CC-BY-4.0"
] | 20 | 2017-09-07T14:35:30.000Z | 2022-03-26T14:52:22.000Z | from .. import Interpreter, adapter
from ..interface import Block
from typing import Optional
import random
| 35.083333 | 79 | 0.755344 | from .. import Interpreter, adapter
from ..interface import Block
from typing import Optional
import random
class StrictVariableGetterBlock(Block):
def will_accept(self, ctx : Interpreter.Context) -> bool:
return ctx.verb.declaration in ctx.response.variables
def process(self, ctx : Interpreter.Contex... | 219 | 18 | 76 |
8f38a28e6374818dcb4f3bb9c8acec4d0f7244c6 | 2,180 | py | Python | dcorm/model.py | homeinfogmbh/dcorm | 7dc19259dad5252afea4b574a533240506b524d1 | [
"MIT"
] | 2 | 2021-12-23T13:49:26.000Z | 2021-12-23T15:16:46.000Z | dcorm/model.py | homeinfogmbh/dcorm | 7dc19259dad5252afea4b574a533240506b524d1 | [
"MIT"
] | null | null | null | dcorm/model.py | homeinfogmbh/dcorm | 7dc19259dad5252afea4b574a533240506b524d1 | [
"MIT"
] | null | null | null | """Model definition."""
from dataclasses import dataclass
from typing import Any, Optional
from dcorm.alias import Alias
from dcorm.column import Column
from dcorm.database import Database
from dcorm.engine import Engine
from dcorm.path import Path
__all__ = ['ModelType', 'Model']
class ModelType(type):
"""Me... | 27.594937 | 67 | 0.627064 | """Model definition."""
from dataclasses import dataclass
from typing import Any, Optional
from dcorm.alias import Alias
from dcorm.column import Column
from dcorm.database import Database
from dcorm.engine import Engine
from dcorm.path import Path
__all__ = ['ModelType', 'Model']
class ModelType(type):
"""Me... | 215 | 0 | 53 |
cb402bb5751a410686be3a0e717989e7bd1b4f83 | 1,052 | py | Python | tests/test_datacredit.py | mmfink/fort-pymdwizard | 96f46e8cc2594b82b475b4f3fcae96a05ebc03e4 | [
"CC-BY-4.0"
] | 53 | 2017-05-01T05:03:33.000Z | 2022-03-13T04:49:15.000Z | tests/test_datacredit.py | mmfink/fort-pymdwizard | 96f46e8cc2594b82b475b4f3fcae96a05ebc03e4 | [
"CC-BY-4.0"
] | 109 | 2017-05-17T15:15:40.000Z | 2022-03-24T21:12:45.000Z | tests/test_datacredit.py | mmfink/fort-pymdwizard | 96f46e8cc2594b82b475b4f3fcae96a05ebc03e4 | [
"CC-BY-4.0"
] | 17 | 2017-02-08T16:18:18.000Z | 2021-01-28T19:38:09.000Z | from __future__ import print_function
import sys
sys.path.append(r"../..")
import sys
from pytestqt import qtbot
from lxml import etree
from PyQt5.QtWidgets import QWidget, QPlainTextEdit
from pymdwizard.gui import datacred
| 22.869565 | 71 | 0.707224 | from __future__ import print_function
import sys
sys.path.append(r"../..")
import sys
from pytestqt import qtbot
from lxml import etree
from PyQt5.QtWidgets import QWidget, QPlainTextEdit
from pymdwizard.gui import datacred
def test_datacredit_from_xml(qtbot):
widget = datacred.Datacred()
qtbot.addWidget... | 775 | 0 | 46 |
d928f68e34da4371718321758eb22ad55f44dcbe | 396 | py | Python | compendium/initsegment/__init__.py | vanatteveldt/compendium-dodo | 81422e4e261fc8bd023c893d2a007a6c89dfc5ab | [
"MIT"
] | null | null | null | compendium/initsegment/__init__.py | vanatteveldt/compendium-dodo | 81422e4e261fc8bd023c893d2a007a6c89dfc5ab | [
"MIT"
] | 1 | 2021-02-06T15:26:04.000Z | 2021-02-06T15:26:04.000Z | compendium/initsegment/__init__.py | vanatteveldt/compendium-dodo | 81422e4e261fc8bd023c893d2a007a6c89dfc5ab | [
"MIT"
] | null | null | null | """
Init segments (phases)
"""
from compendium.initsegment.checksegment import CheckSegment
from compendium.initsegment.folderstructure import FolderStructureSegment
from compendium.initsegment.github import GithubSegment
from compendium.initsegment.pyenv import PyEnvSegment
SEGMENTS = [
GithubSegment,
... | 24.75 | 73 | 0.772727 | """
Init segments (phases)
"""
from compendium.initsegment.checksegment import CheckSegment
from compendium.initsegment.folderstructure import FolderStructureSegment
from compendium.initsegment.github import GithubSegment
from compendium.initsegment.pyenv import PyEnvSegment
SEGMENTS = [
GithubSegment,
... | 0 | 0 | 0 |
e53cd076c4db78323ec67b8154a8e9a3d3e3da6d | 3,591 | py | Python | kneaddata/tests/basic_tests.py | zwets/kneaddata | 16fe3f6bde213f0c7fc5132e65ce7e30c3a95e42 | [
"MIT"
] | 41 | 2020-06-07T20:07:55.000Z | 2022-03-12T05:57:11.000Z | kneaddata/tests/basic_tests.py | zwets/kneaddata | 16fe3f6bde213f0c7fc5132e65ce7e30c3a95e42 | [
"MIT"
] | 23 | 2020-05-28T20:41:40.000Z | 2022-03-17T00:52:06.000Z | kneaddata/tests/basic_tests.py | zwets/kneaddata | 16fe3f6bde213f0c7fc5132e65ce7e30c3a95e42 | [
"MIT"
] | 17 | 2020-08-02T01:35:44.000Z | 2022-01-21T09:45:42.000Z | import unittest
import tempfile
import os
import logging
import filecmp
import cfg
import utils
from kneaddata import run
from kneaddata import utilities
class TestHumann2Functions(unittest.TestCase):
"""
Test the functions found in kneaddata
"""
def test_read_in_file_n_lines(self):
... | 32.351351 | 105 | 0.641882 | import unittest
import tempfile
import os
import logging
import filecmp
import cfg
import utils
from kneaddata import run
from kneaddata import utilities
class TestHumann2Functions(unittest.TestCase):
"""
Test the functions found in kneaddata
"""
def setUp(self):
# set up nullhandler for... | 108 | 0 | 31 |
94e82c13f1d55ceec0b80181667099e9cf347ddc | 7,085 | py | Python | sdk/python/pulumi_aws_native/dms/certificate.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | 29 | 2021-09-30T19:32:07.000Z | 2022-03-22T21:06:08.000Z | sdk/python/pulumi_aws_native/dms/certificate.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | 232 | 2021-09-30T19:26:26.000Z | 2022-03-31T23:22:06.000Z | sdk/python/pulumi_aws_native/dms/certificate.py | AaronFriel/pulumi-aws-native | 5621690373ac44accdbd20b11bae3be1baf022d1 | [
"Apache-2.0"
] | 4 | 2021-11-10T19:42:01.000Z | 2022-02-05T10:15:49.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__a... | 43.734568 | 192 | 0.67043 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__a... | 2,729 | 3,749 | 45 |
41d1605a27cb4fc3a059a9ac18f696fd1e303e9c | 392 | py | Python | h3m/rmg/modules/test/gen.py | dmitrystril/homm3tools | 5687f581a4eb5e7b0e8f48794d7be4e3b0a8cc8b | [
"MIT"
] | 113 | 2015-08-09T08:36:55.000Z | 2022-03-21T10:42:46.000Z | h3m/rmg/modules/test/gen.py | dmitrystril/homm3tools | 5687f581a4eb5e7b0e8f48794d7be4e3b0a8cc8b | [
"MIT"
] | 40 | 2015-08-23T06:36:34.000Z | 2022-01-03T21:19:40.000Z | h3m/rmg/modules/test/gen.py | dmitrystril/homm3tools | 5687f581a4eb5e7b0e8f48794d7be4e3b0a8cc8b | [
"MIT"
] | 27 | 2015-08-09T08:40:39.000Z | 2022-03-28T08:03:12.000Z | from phlm import *
| 21.777778 | 43 | 0.665816 | from phlm import *
def gen(settings):
map = HeroesMap()
map.xyz_set_terrain(0,0,0, Snow)
map.xyz_set_road(5, 5, 0, Dirt)
map.xyz_set_river(6, 5, 0, Clear)
map.xyz2_set_road(5, 7, 10, 7, 0, Gravel)
map.xyz2_set_river(5, 8, 10, 8, 0, Icy)
map.xyz2_set_terrain(4, 7, 11, 7, 0, Snow)
map.xyz2_set_terrain(4, 8, 1... | 350 | 0 | 23 |
cfdbd5ecfe24cd4886a92bd63a9446b1d9c0f67b | 1,260 | py | Python | api/resources/role_list.py | nikmons/screwdriver | 9e59ea5f6338eb8377475f139318c203b4c1a118 | [
"MIT"
] | 1 | 2018-10-29T07:08:44.000Z | 2018-10-29T07:08:44.000Z | api/resources/role_list.py | nikmons/screwdriver | 9e59ea5f6338eb8377475f139318c203b4c1a118 | [
"MIT"
] | 49 | 2018-11-06T07:10:41.000Z | 2019-01-14T12:48:08.000Z | api/resources/role_list.py | nikmons/screwdriver | 9e59ea5f6338eb8377475f139318c203b4c1a118 | [
"MIT"
] | 2 | 2019-01-12T10:13:23.000Z | 2019-01-12T10:18:04.000Z | from flask import Flask, jsonify, abort, make_response
from flask_restful import Api, Resource, reqparse, marshal
from flasgger import swag_from
from flask_jwt_extended import jwt_required, get_jwt_identity
from app import db
from models import models
from resources.fields import role_fields
| 33.157895 | 78 | 0.642857 | from flask import Flask, jsonify, abort, make_response
from flask_restful import Api, Resource, reqparse, marshal
from flasgger import swag_from
from flask_jwt_extended import jwt_required, get_jwt_identity
from app import db
from models import models
from resources.fields import role_fields
class RoleListAPI(Resour... | 737 | 205 | 23 |
9a17210b5849d3e3d170fc2cf42441cecda8e7f9 | 2,193 | py | Python | POStagging/ImportRDSTagger.py | danielTLevy/Permutation-Equivariant-Seq2Seq | d15f9af1e8751ef25eb93afd30f8be1e68d09d06 | [
"MIT"
] | null | null | null | POStagging/ImportRDSTagger.py | danielTLevy/Permutation-Equivariant-Seq2Seq | d15f9af1e8751ef25eb93afd30f8be1e68d09d06 | [
"MIT"
] | null | null | null | POStagging/ImportRDSTagger.py | danielTLevy/Permutation-Equivariant-Seq2Seq | d15f9af1e8751ef25eb93afd30f8be1e68d09d06 | [
"MIT"
] | null | null | null | from RDRPOSTagger.InitialTagger.InitialTagger import initializeCorpus, initializeSentence
from RDRPOSTagger.SCRDRlearner.Object import FWObject
from RDRPOSTagger.SCRDRlearner.SCRDRTree import SCRDRTree
from RDRPOSTagger.SCRDRlearner.SCRDRTreeLearner import SCRDRTreeLearner
from RDRPOSTagger.Utility.Config import NUMBER... | 42.173077 | 110 | 0.699954 | from RDRPOSTagger.InitialTagger.InitialTagger import initializeCorpus, initializeSentence
from RDRPOSTagger.SCRDRlearner.Object import FWObject
from RDRPOSTagger.SCRDRlearner.SCRDRTree import SCRDRTree
from RDRPOSTagger.SCRDRlearner.SCRDRTreeLearner import SCRDRTreeLearner
from RDRPOSTagger.Utility.Config import NUMBER... | 1,154 | 0 | 104 |
981fed76f7352ef95bfa0deaae5450bdb6f9af72 | 2,020 | py | Python | Android/NDK/android-ndk-r20b-win/build/tools/build-renderscript.py | X018/CCTOOL | 989af4d7edab82bf540400eb72eca4e7447d722c | [
"MIT"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | Android/NDK/android-ndk-r20b-win/build/tools/build-renderscript.py | X018/CCTOOL | 989af4d7edab82bf540400eb72eca4e7447d722c | [
"MIT"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | Android/NDK/android-ndk-r20b-win/build/tools/build-renderscript.py | X018/CCTOOL | 989af4d7edab82bf540400eb72eca4e7447d722c | [
"MIT"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | #!/usr/bin/env python
#
# Copyright (C) 2016 The Android Open Source Project
#
# 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 req... | 31.076923 | 84 | 0.69604 | #!/usr/bin/env python
#
# Copyright (C) 2016 The Android Open Source Project
#
# 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 req... | 1,047 | 0 | 46 |
6f1c9b4d431dc363eb9283b6ae2aebfbf758a740 | 7,630 | py | Python | src/container/mesos-manager/mesos_manager/mesos_server.py | kaweue/contrail-controller | 66a8f1d13e2c28ddae6b5a5be6f068a03bea94e3 | [
"Apache-2.0"
] | null | null | null | src/container/mesos-manager/mesos_manager/mesos_server.py | kaweue/contrail-controller | 66a8f1d13e2c28ddae6b5a5be6f068a03bea94e3 | [
"Apache-2.0"
] | 2 | 2018-12-04T02:20:52.000Z | 2018-12-22T06:16:30.000Z | src/container/mesos-manager/mesos_manager/mesos_server.py | kaweue/contrail-controller | 66a8f1d13e2c28ddae6b5a5be6f068a03bea94e3 | [
"Apache-2.0"
] | 1 | 2018-12-04T02:07:47.000Z | 2018-12-04T02:07:47.000Z | #
# Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
#
"""
MESOS CNI Server
"""
# Standard library import
import bottle
import json
# Application library import
from cfgm_common.rest import LinkObject
from mesos_cni import MESOSCniDataObject
from vnc_api.vnc_api import *
# end
# end
# Pub... | 31.791667 | 77 | 0.571822 | #
# Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
#
"""
MESOS CNI Server
"""
# Standard library import
import bottle
import json
# Application library import
from cfgm_common.rest import LinkObject
from mesos_cni import MESOSCniDataObject
from vnc_api.vnc_api import *
class MesosServer(object):
... | 6,484 | 5 | 480 |
65df4ffaf14f6c66395fac92292945224f63c74a | 692 | py | Python | xxcmd/__init__.py | grking/xxcmd | 287811a68d0bed0939ea888b555cacd1ac8b5a0e | [
"MIT"
] | null | null | null | xxcmd/__init__.py | grking/xxcmd | 287811a68d0bed0939ea888b555cacd1ac8b5a0e | [
"MIT"
] | null | null | null | xxcmd/__init__.py | grking/xxcmd | 287811a68d0bed0939ea888b555cacd1ac8b5a0e | [
"MIT"
] | null | null | null | """A helper for remembering useful shell commands."""
import os
from subprocess import check_output, CalledProcessError
from .cmdmanager import CmdManager
from .dbitem import DBItem
from .main import main, __version__
# Inspect git version if we're in a git repo
__dev_version__ = ''
thisdir = os.path.dirname(os.path.... | 30.086957 | 76 | 0.693642 | """A helper for remembering useful shell commands."""
import os
from subprocess import check_output, CalledProcessError
from .cmdmanager import CmdManager
from .dbitem import DBItem
from .main import main, __version__
# Inspect git version if we're in a git repo
__dev_version__ = ''
thisdir = os.path.dirname(os.path.... | 0 | 0 | 0 |