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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
15e31514a9fcc45da82364eec547a0384aec823d | 225 | py | Python | Problem_20/main.py | jdalzatec/EulerProject | 2f2f4d9c009be7fd63bb229bb437ea75db77d891 | [
"MIT"
] | 1 | 2022-03-28T05:32:58.000Z | 2022-03-28T05:32:58.000Z | Problem_20/main.py | jdalzatec/EulerProject | 2f2f4d9c009be7fd63bb229bb437ea75db77d891 | [
"MIT"
] | null | null | null | Problem_20/main.py | jdalzatec/EulerProject | 2f2f4d9c009be7fd63bb229bb437ea75db77d891 | [
"MIT"
] | null | null | null | from functools import reduce
from math import factorial
if __name__ == '__main__':
main() | 18.75 | 59 | 0.635556 | from functools import reduce
from math import factorial
def main():
num = 100
value = factorial(num)
suma = reduce(lambda x, y: int(x) + int(y), str(value))
print(suma)
if __name__ == '__main__':
main() | 107 | 0 | 23 |
e962e1a7780ef210d97a0010b131b297ddef4442 | 782 | py | Python | hotel_test.py | joeryan/100days | 87ec10843018a43a8a93816df5f45e85521c1ac9 | [
"MIT"
] | null | null | null | hotel_test.py | joeryan/100days | 87ec10843018a43a8a93816df5f45e85521c1ac9 | [
"MIT"
] | null | null | null | hotel_test.py | joeryan/100days | 87ec10843018a43a8a93816df5f45e85521c1ac9 | [
"MIT"
] | null | null | null | import pytest
from hotel import Hotel
| 26.066667 | 53 | 0.716113 | import pytest
from hotel import Hotel
def test_check_in_a_guest():
hotel = Hotel()
hotel.check_in('Bob Barker', 302)
assert(('Bob Barker' in hotel.guests()) == True)
def test_does_not_accept_guest_in_occupied_room():
hotel = Hotel()
hotel.check_in('Bob Barker', 303)
assert(hotel.check_in('Roy Orbison', 30... | 628 | 0 | 115 |
17b6282c7573cb41d82adbd3f2e2fcbdd8890ba2 | 6,462 | py | Python | source/services/lex-bot/other_intents/test_help_intent.py | s3799570/P000075CSITCP | dcf9f388a22baffc99e01b445e5d95089a896113 | [
"Apache-2.0"
] | 3 | 2021-10-30T12:53:47.000Z | 2022-02-09T06:33:08.000Z | source/services/lex-bot/other_intents/test_help_intent.py | s3799570/P000075CSITCP | dcf9f388a22baffc99e01b445e5d95089a896113 | [
"Apache-2.0"
] | 10 | 2021-12-20T17:41:54.000Z | 2022-02-27T10:33:23.000Z | source/services/lex-bot/other_intents/test_help_intent.py | s3799570/P000075CSITCP | dcf9f388a22baffc99e01b445e5d95089a896113 | [
"Apache-2.0"
] | 3 | 2021-10-30T12:53:42.000Z | 2022-03-21T08:18:47.000Z | ######################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 52.536585 | 191 | 0.50325 | ######################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 4,597 | 157 | 22 |
42ceed1a1a21505baf6adca410e9fdef4602f5b8 | 131,835 | py | Python | pareto/operational_water_management/operational_produced_water_optimization_model.py | ksbeattie/project-pareto | aafa060d938ff253691447c080d6727e3f719b36 | [
"BSD-3-Clause-LBNL"
] | 4 | 2022-01-28T17:39:33.000Z | 2022-02-25T20:15:53.000Z | pareto/operational_water_management/operational_produced_water_optimization_model.py | ksbeattie/project-pareto | aafa060d938ff253691447c080d6727e3f719b36 | [
"BSD-3-Clause-LBNL"
] | 24 | 2021-11-12T14:31:52.000Z | 2022-03-29T19:02:34.000Z | pareto/operational_water_management/operational_produced_water_optimization_model.py | ksbeattie/project-pareto | aafa060d938ff253691447c080d6727e3f719b36 | [
"BSD-3-Clause-LBNL"
] | 5 | 2021-11-10T15:27:16.000Z | 2022-02-25T16:53:38.000Z | #####################################################################################################
# PARETO was produced under the DOE Produced Water Application for Beneficial Reuse Environmental
# Impact and Treatment Optimization (PARETO), and is copyright (c) 2021 by the software owners: The
# Regents of the Uni... | 34.385759 | 152 | 0.520605 | #####################################################################################################
# PARETO was produced under the DOE Produced Water Application for Beneficial Reuse Environmental
# Impact and Treatment Optimization (PARETO), and is copyright (c) 2021 by the software owners: The
# Regents of the Uni... | 128,620 | 37 | 92 |
1becc35c1544729b291b76e5e1c8312395737ac8 | 8,641 | py | Python | get_ext_repo.py | natemellendorf/configpy | 750da5eaef33cede9f3ef532453d63e507f34a2c | [
"MIT"
] | 4 | 2020-01-20T06:46:33.000Z | 2021-07-28T21:53:29.000Z | get_ext_repo.py | natemellendorf/configpy | 750da5eaef33cede9f3ef532453d63e507f34a2c | [
"MIT"
] | 5 | 2020-03-24T17:00:44.000Z | 2021-12-13T19:59:01.000Z | get_ext_repo.py | natemellendorf/configpy | 750da5eaef33cede9f3ef532453d63e507f34a2c | [
"MIT"
] | null | null | null | import requests
from pprint import pprint
import redis
import json
from datetime import datetime
from config_snips import cluster_config
if __name__ == '__main__':
github = 'https://github.com/natemellendorf/tr_templates'
gitlab = 'http://gitlab/root/awesome'
test = get_ext_repo(gitlab)
pprint(test)... | 36.306723 | 121 | 0.490568 | import requests
from pprint import pprint
import redis
import json
from datetime import datetime
from config_snips import cluster_config
def current_time():
current_time = str(datetime.now().time())
no_sec = current_time.split('.')
time = no_sec.pop(0)
return time
def static_error(error):
new_dat... | 8,228 | 0 | 92 |
5b158e28007251306ff82f9b52ca056b2713569a | 15,114 | py | Python | valueIteration/value_iteration_4D.py | kensukenk/optimized_dp | 4771787366ca04139c168c8988dad378ad404ab6 | [
"MIT"
] | 41 | 2020-06-23T01:58:03.000Z | 2022-03-28T01:45:12.000Z | valueIteration/value_iteration_4D.py | kensukenk/optimized_dp | 4771787366ca04139c168c8988dad378ad404ab6 | [
"MIT"
] | 1 | 2021-08-01T06:58:57.000Z | 2021-08-01T06:58:57.000Z | valueIteration/value_iteration_4D.py | kensukenk/optimized_dp | 4771787366ca04139c168c8988dad378ad404ab6 | [
"MIT"
] | 20 | 2020-06-05T20:52:02.000Z | 2022-03-01T03:17:39.000Z | import heterocl as hcl
import numpy as np
import time
import os
######################################### HELPER FUNCTIONS #########################################
# Update the value function at position (i,j,k,l)
# iVals: holds index values (i,j,k,l) that correspond to state values (si,sj,sk,sl)
# intermeds: ... | 60.943548 | 173 | 0.494707 | import heterocl as hcl
import numpy as np
import time
import os
######################################### HELPER FUNCTIONS #########################################
# Update the value function at position (i,j,k,l)
# iVals: holds index values (i,j,k,l) that correspond to state values (si,sj,sk,sl)
# intermeds: ... | 13,675 | 0 | 134 |
e914cdbaf9db38c6a1e4d3a7709ce06b88ad5dcc | 957 | py | Python | blog/templatetags/blog_tags.py | Volodichev/Django | cebc9629987bc02067a1aa8d6e4ff901a24d1f98 | [
"MIT"
] | null | null | null | blog/templatetags/blog_tags.py | Volodichev/Django | cebc9629987bc02067a1aa8d6e4ff901a24d1f98 | [
"MIT"
] | null | null | null | blog/templatetags/blog_tags.py | Volodichev/Django | cebc9629987bc02067a1aa8d6e4ff901a24d1f98 | [
"MIT"
] | null | null | null | from django import template
from blog.models import Category
register = template.Library()
def get_categories(context, order, count):
"""Получаю список категорий"""
# categories = Category.objects.filter(published=True, parent__isnull=True).order_by(order)
categories = Category.objects.filter(published=... | 34.178571 | 95 | 0.746082 | from django import template
from blog.models import Category
register = template.Library()
def get_categories(context, order, count):
"""Получаю список категорий"""
# categories = Category.objects.filter(published=True, parent__isnull=True).order_by(order)
categories = Category.objects.filter(published=... | 0 | 0 | 0 |
8e7e0be8d21bf4d81ac8c4f4330098fdfbc73d8a | 774 | py | Python | 2017/day4/puzzle2.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | 2017/day4/puzzle2.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | 2017/day4/puzzle2.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# http://adventofcode.com/2017/day/4
import sys
if __name__ == '__main__':
main(sys.argv)
| 23.454545 | 66 | 0.590439 | #!/usr/bin/env python3
# http://adventofcode.com/2017/day/4
import sys
def load_passphrases(datafile):
with open(datafile, 'rb') as f:
return [line.decode('utf-8').strip('\n') for line in f]
def main(argv):
datafile = argv[1]
passphrases = load_passphrases(datafile)
valid = 0
invalid =... | 605 | 0 | 46 |
f679f0ada9270379bfe42846ba1ec73d464a78cf | 128 | py | Python | lifelist/api/admin.py | andela-mnzomo/life-list | 28a7fa9d16e2b322e4a1bce269dbe7331e783534 | [
"Unlicense"
] | 3 | 2017-08-17T07:12:03.000Z | 2017-10-18T11:13:44.000Z | lifelist/api/admin.py | andela-mnzomo/life-list | 28a7fa9d16e2b322e4a1bce269dbe7331e783534 | [
"Unlicense"
] | 1 | 2018-05-30T14:38:52.000Z | 2018-05-30T14:38:52.000Z | lifelist/api/admin.py | andela-mnzomo/life-list | 28a7fa9d16e2b322e4a1bce269dbe7331e783534 | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from models import Bucketlist, Item
admin.site.register(Bucketlist)
admin.site.register(Item)
| 21.333333 | 35 | 0.828125 | from django.contrib import admin
from models import Bucketlist, Item
admin.site.register(Bucketlist)
admin.site.register(Item)
| 0 | 0 | 0 |
59e10b8a316f3d2f6e6fe62963da3255be088523 | 1,690 | py | Python | setup.py | GrammaTech/gtirb-capstone | f46d90e9cd733c632620e5d8c921a4b9f011020a | [
"MIT"
] | 6 | 2020-04-10T15:19:30.000Z | 2021-04-13T22:54:17.000Z | setup.py | GrammaTech/gtirb-capstone | f46d90e9cd733c632620e5d8c921a4b9f011020a | [
"MIT"
] | null | null | null | setup.py | GrammaTech/gtirb-capstone | f46d90e9cd733c632620e5d8c921a4b9f011020a | [
"MIT"
] | 3 | 2020-07-10T22:52:32.000Z | 2021-02-13T19:52:22.000Z | #
# Copyright (C) 2020 GrammaTech, Inc.
#
# This code is licensed under the MIT license. See the LICENSE file in
# the project root for license terms.
#
# This project is sponsored by the Office of Naval Research, One Liberty
# Center, 875 N. Randolph Street, Arlington, VA 22203 under contract #
# N68335-17-C-0700. Th... | 30.178571 | 79 | 0.597041 | #
# Copyright (C) 2020 GrammaTech, Inc.
#
# This code is licensed under the MIT license. See the LICENSE file in
# the project root for license terms.
#
# This project is sponsored by the Office of Naval Research, One Liberty
# Center, 875 N. Randolph Street, Arlington, VA 22203 under contract #
# N68335-17-C-0700. Th... | 0 | 0 | 0 |
2f88913b6f9fe5c8a3c60c7802a9be91b9c38253 | 360 | py | Python | drf_registration/api/__init__.py | rti/drf-registration | 0d631730e1730a7778398f4c1e811ca0df57e260 | [
"MIT"
] | 1 | 2020-12-07T04:44:51.000Z | 2020-12-07T04:44:51.000Z | drf_registration/api/__init__.py | cunguyendev/drf-registration | 2a9e5ffbffa23bdc787c8363bdd0ffd170cf6bb6 | [
"MIT"
] | null | null | null | drf_registration/api/__init__.py | cunguyendev/drf-registration | 2a9e5ffbffa23bdc787c8363bdd0ffd170cf6bb6 | [
"MIT"
] | null | null | null | from .login import LoginView, SocialLoginView
from .logout import LogoutView
from .register import RegisterView, VerifyView, ActivateView
from .profile import ProfileView
from .change_password import ChangePasswordView
from .reset_password import ResetPasswordView, ResetPasswordConfirmView, ResetPasswordCompleteView
fr... | 45 | 98 | 0.875 | from .login import LoginView, SocialLoginView
from .logout import LogoutView
from .register import RegisterView, VerifyView, ActivateView
from .profile import ProfileView
from .change_password import ChangePasswordView
from .reset_password import ResetPasswordView, ResetPasswordConfirmView, ResetPasswordCompleteView
fr... | 0 | 0 | 0 |
4d1b9062f6dd748ffda8b31a1aceb57d2db1dec1 | 155 | py | Python | blogs/admin.py | AnkushCh/Finalproject | 880d29390043a506c8c4f570b8005b9f4660454b | [
"MIT"
] | 1 | 2020-12-01T09:59:21.000Z | 2020-12-01T09:59:21.000Z | blogs/admin.py | AnkushCh/Finalproject | 880d29390043a506c8c4f570b8005b9f4660454b | [
"MIT"
] | null | null | null | blogs/admin.py | AnkushCh/Finalproject | 880d29390043a506c8c4f570b8005b9f4660454b | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Post, Comments
# Register your models here.
admin.site.register(Post)
admin.site.register(Comments)
| 19.375 | 34 | 0.8 | from django.contrib import admin
from .models import Post, Comments
# Register your models here.
admin.site.register(Post)
admin.site.register(Comments)
| 0 | 0 | 0 |
96bd8ee23bf397dd5607427f8c9e71c375b4e70e | 7,439 | py | Python | unitx/UnitXListener.py | 0ED/UnitX | f3c8c564cb7822cebb24ebc000ca454f3222fbf2 | [
"MIT"
] | 2 | 2016-03-13T08:35:58.000Z | 2016-03-13T19:20:07.000Z | unitx/UnitXListener.py | 0ED/UnitX | f3c8c564cb7822cebb24ebc000ca454f3222fbf2 | [
"MIT"
] | 1 | 2016-11-04T23:34:21.000Z | 2016-11-04T23:34:21.000Z | unitx/UnitXListener.py | supertask/UnitX | f3c8c564cb7822cebb24ebc000ca454f3222fbf2 | [
"MIT"
] | null | null | null | # Generated from UnitX.g4 by ANTLR 4.5.1
from antlr4 import *
# This class defines a complete listener for a parse tree produced by UnitXParser.
# Enter a parse tree produced by UnitXParser#program.
# Exit a parse tree produced by UnitXParser#program.
# Enter a parse tree produced by UnitXParser#typeDe... | 25.216949 | 82 | 0.680737 | # Generated from UnitX.g4 by ANTLR 4.5.1
from antlr4 import *
# This class defines a complete listener for a parse tree produced by UnitXParser.
class UnitXListener(ParseTreeListener):
# Enter a parse tree produced by UnitXParser#program.
def enterProgram(self, ctx):
pass
# Exit a parse tree prod... | 1,530 | 18 | 1,686 |
b77cf51d7f72fbf4600506697564ae15a5c5100a | 13,850 | py | Python | wagon_tracking/tracking.py | TheCamilovisk/pytorch-ssd | 83f7adafd5a1d44e53fea20b34f80b367b0a7ca4 | [
"MIT"
] | null | null | null | wagon_tracking/tracking.py | TheCamilovisk/pytorch-ssd | 83f7adafd5a1d44e53fea20b34f80b367b0a7ca4 | [
"MIT"
] | null | null | null | wagon_tracking/tracking.py | TheCamilovisk/pytorch-ssd | 83f7adafd5a1d44e53fea20b34f80b367b0a7ca4 | [
"MIT"
] | 1 | 2019-10-07T17:00:52.000Z | 2019-10-07T17:00:52.000Z | from copy import deepcopy
import cv2 as cv
import numpy as np
from sortedcontainers import SortedDict
import vision.utils.box_utils_numpy as box_utils
from wagon_tracking.transforms import ImageDownscaleTransform
| 33.293269 | 87 | 0.600361 | from copy import deepcopy
import cv2 as cv
import numpy as np
from sortedcontainers import SortedDict
import vision.utils.box_utils_numpy as box_utils
from wagon_tracking.transforms import ImageDownscaleTransform
class OpticalMovementEstimator:
def __init__(self, update_interval=5, frame_downscale_factor=None)... | 12,803 | 14 | 812 |
8b466cd90199311e8b4ba4a9c518eb5896fa30b4 | 2,539 | py | Python | projeto-02/graph.py | henrique-tavares/IFB-Analise-de-Algoritmos | 36db7672fea45ce8ab9dce5bbe41aec30be18465 | [
"MIT"
] | null | null | null | projeto-02/graph.py | henrique-tavares/IFB-Analise-de-Algoritmos | 36db7672fea45ce8ab9dce5bbe41aec30be18465 | [
"MIT"
] | null | null | null | projeto-02/graph.py | henrique-tavares/IFB-Analise-de-Algoritmos | 36db7672fea45ce8ab9dce5bbe41aec30be18465 | [
"MIT"
] | 1 | 2021-07-15T23:50:37.000Z | 2021-07-15T23:50:37.000Z | from __future__ import annotations
from collections import defaultdict
from math import ceil
from typing import Dict, NamedTuple
from random import randint, sample
if __name__ == "__main__":
# g = Graph.random_generator(10, 0.2)
# print(g)
# print(len(g["0"].values()))
for i in (0.25, 0.5, 1):
... | 29.183908 | 93 | 0.590784 | from __future__ import annotations
from collections import defaultdict
from math import ceil
from typing import Dict, NamedTuple
from random import randint, sample
class Edge(NamedTuple):
vertice: str
distance: float
bidrectional: bool = False
class Graph:
def __init__(self) -> None:
self.el... | 1,784 | 321 | 46 |
369bbf3c6fcc3f3fa0a093ab85e4f12dd895b953 | 6,306 | py | Python | estar/src/moeadd/moeadd_ref/moeadd_supplementary.py | tatikhonova/FEDOT.Algs | aeb539f52bfbdb0ba8f4975e9ea7cb5a60859e25 | [
"BSD-3-Clause"
] | null | null | null | estar/src/moeadd/moeadd_ref/moeadd_supplementary.py | tatikhonova/FEDOT.Algs | aeb539f52bfbdb0ba8f4975e9ea7cb5a60859e25 | [
"BSD-3-Clause"
] | null | null | null | estar/src/moeadd/moeadd_ref/moeadd_supplementary.py | tatikhonova/FEDOT.Algs | aeb539f52bfbdb0ba8f4975e9ea7cb5a60859e25 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 30 14:04:57 2020
@author: mike_ubuntu
"""
from copy import deepcopy
import numpy as np
| 42.897959 | 149 | 0.629718 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 30 14:04:57 2020
@author: mike_ubuntu
"""
from copy import deepcopy
import numpy as np
def check_dominance(target, compared_with) -> bool:
flag = False
for obj_fun_idx in range(len(target.obj_fun)):
if target.ob... | 5,524 | 388 | 277 |
43cf2550196fb601b5410a14ffba60cec95eaddd | 692 | py | Python | scripts/controller.py | kato-masahiro/raspimouse_maze_manual | e5b6317bbb889de416b52dc1a61790c9e235c084 | [
"BSD-3-Clause"
] | null | null | null | scripts/controller.py | kato-masahiro/raspimouse_maze_manual | e5b6317bbb889de416b52dc1a61790c9e235c084 | [
"BSD-3-Clause"
] | null | null | null | scripts/controller.py | kato-masahiro/raspimouse_maze_manual | e5b6317bbb889de416b52dc1a61790c9e235c084 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import rospy
import math
from sensor_msgs.msg import Joy
from geometry_msgs.msg import Twist
if __name__ == '__main__':
rospy.init_node('joy_twist')
joy_twist = JoyTwist()
rospy.spin()
| 30.086957 | 87 | 0.643064 | #!/usr/bin/env python
import rospy
import math
from sensor_msgs.msg import Joy
from geometry_msgs.msg import Twist
class JoyTwist(object):
def __init__(self):
self._joy_sub = rospy.Subscriber('joy', Joy, self.joy_callback, queue_size = 1)
self._twist_pub = rospy.Publisher('/cmd_vel', Twist, queue_s... | 394 | 2 | 76 |
974da76cfbed60fb31e44aeefba7b8b79a4e2ee8 | 719 | py | Python | py/day07.py | kwinkunks/aoc21 | 4fccd605334ad55b6ddc34bdd1921b1d42fc8a42 | [
"Apache-2.0"
] | null | null | null | py/day07.py | kwinkunks/aoc21 | 4fccd605334ad55b6ddc34bdd1921b1d42fc8a42 | [
"Apache-2.0"
] | null | null | null | py/day07.py | kwinkunks/aoc21 | 4fccd605334ad55b6ddc34bdd1921b1d42fc8a42 | [
"Apache-2.0"
] | null | null | null | import numpy as np
if __name__ == "__main__":
# Part 1.
assert part1(get_data(7, 'test')) == 37, "Part 1 failed."
print(f"Part 1: {part1(get_data(7, 'data')):.0f}")
# Part 2.
assert part2(get_data(7, 'test')) == 168, "Part 2 failed."
print(f"Part 2: {part2(get_data(7, 'data')):.0f}")
| 27.653846 | 62 | 0.588317 | import numpy as np
def get_data(day, dataset):
with open(f'../js/day{day:02d}/{dataset}.txt', 'r') as f:
return np.array(list(map(int, f.read().split(','))))
def part1(data):
return np.abs(data - np.median(data)).sum()
def part2(data):
points = np.arange(2000).reshape(-1, 1)
dists = np.abs(np... | 337 | 0 | 69 |
3ff95edb9cad1101f186963ca13d6372c9ea44db | 1,193 | py | Python | demo_wait.py | rdagger/micropython-ads1220 | c90f939517c8163b234210b8cf91b3ce948b5b1c | [
"MIT"
] | 2 | 2021-08-25T11:40:23.000Z | 2022-02-28T05:31:18.000Z | demo_wait.py | rdagger/micropython-ads1220 | c90f939517c8163b234210b8cf91b3ce948b5b1c | [
"MIT"
] | null | null | null | demo_wait.py | rdagger/micropython-ads1220 | c90f939517c8163b234210b8cf91b3ce948b5b1c | [
"MIT"
] | 1 | 2021-08-08T11:39:47.000Z | 2021-08-08T11:39:47.000Z | """ADS1220 example (polling ADC).
Uses single shot mode and wait for data ready."""
from time import sleep
from machine import Pin, SPI # type: ignore
from ads1220 import ADC
cs = 15 # Chip select pin
drdy = 27 # Data ready pin
spi = SPI(1,
baudrate=10000000, # 10 MHz (try lower speed to troubleshoot)... | 28.404762 | 74 | 0.600168 | """ADS1220 example (polling ADC).
Uses single shot mode and wait for data ready."""
from time import sleep
from machine import Pin, SPI # type: ignore
from ads1220 import ADC
cs = 15 # Chip select pin
drdy = 27 # Data ready pin
spi = SPI(1,
baudrate=10000000, # 10 MHz (try lower speed to troubleshoot)... | 0 | 0 | 0 |
4cf5ed14c9a66510d6acd4017cb1faca8edf5750 | 2,265 | py | Python | tfx_addons/feast_examplegen/component_test.py | BACtaki/tfx-addons | 130465c2cdaae45728535ea09e4bf38f4ca9eb38 | [
"Apache-2.0"
] | 1 | 2021-07-10T00:25:06.000Z | 2021-07-10T00:25:06.000Z | tfx_addons/feast_examplegen/component_test.py | BACtaki/tfx-addons | 130465c2cdaae45728535ea09e4bf38f4ca9eb38 | [
"Apache-2.0"
] | 4 | 2021-11-13T03:10:19.000Z | 2022-02-18T19:00:47.000Z | tfx_addons/feast_examplegen/component_test.py | BACtaki/tfx-addons | 130465c2cdaae45728535ea09e4bf38f4ca9eb38 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# 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 applicabl... | 37.75 | 80 | 0.647241 | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# 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 applicabl... | 1,246 | 0 | 46 |
e19d19ef0a9751a966e5539a1d4f246e5698feea | 10,309 | py | Python | tools/apollo4b_scripts/am_defines.py | vaxradius/Apollo4B-SDK-2021.02.08 | 507e328b16a179f5d5b18685d5be4a5c6753f852 | [
"BSD-3-Clause"
] | 2 | 2021-11-04T03:48:20.000Z | 2021-12-27T01:34:31.000Z | tools/apollo4b_scripts/am_defines.py | vaxradius/Apollo4B-SDK-2021.02.08 | 507e328b16a179f5d5b18685d5be4a5c6753f852 | [
"BSD-3-Clause"
] | null | null | null | tools/apollo4b_scripts/am_defines.py | vaxradius/Apollo4B-SDK-2021.02.08 | 507e328b16a179f5d5b18685d5be4a5c6753f852 | [
"BSD-3-Clause"
] | 2 | 2021-11-04T03:47:21.000Z | 2021-12-27T01:30:28.000Z | #!/usr/bin/env python3
# Utility functioins
import sys
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Signature import pss
from Crypto.Hash import SHA256
import array
import hashlib
import hmac
import os
import binascii
MAX_DOWNLOAD_SIZE = ... | 34.135762 | 112 | 0.484237 | #!/usr/bin/env python3
# Utility functioins
import sys
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Signature import pss
from Crypto.Hash import SHA256
import array
import hashlib
import hmac
import os
import binascii
MAX_DOWNLOAD_SIZE = ... | 2,967 | 0 | 332 |
f72fef007e9ec6112672dfd0e87b7ec609049c6a | 2,115 | py | Python | scrape_artists/artists.py | flannerykj/python_scrape | c5166431810432c24e04150eb305b3ec2a899a91 | [
"MIT"
] | null | null | null | scrape_artists/artists.py | flannerykj/python_scrape | c5166431810432c24e04150eb305b3ec2a899a91 | [
"MIT"
] | null | null | null | scrape_artists/artists.py | flannerykj/python_scrape | c5166431810432c24e04150eb305b3ec2a899a91 | [
"MIT"
] | null | null | null |
import csv
import requests
import socket
from bs4 import BeautifulSoup
import re
import json
with open('artists.json', 'w') as outfile:
json.dump(parse_artists(), outfile)
'''artist_urls = get_artist_urls()
artist_array = compile_artist_profiles(artist_urls)
outfile = open("./toronto-artists.csv", "wb")
writer ... | 33.571429 | 144 | 0.605674 |
import csv
import requests
import socket
from bs4 import BeautifulSoup
import re
import json
def parse_artists():
artist_profiles = []
try:
url = 'http://wx.toronto.ca/inter/pmmd/streetart.nsf/artists?OpenView'
response = requests.get(url)
html = response.content
soup = Beautif... | 1,692 | 0 | 46 |
6b4633f252cbbf76f44dce400dc91c131a603c52 | 22,669 | py | Python | pgcli/packages/sqlcompletion.py | akshay-joshi/pgcli | 51c4cf495cab0722f0f474dceb502746e8e7c5ed | [
"BSD-3-Clause"
] | null | null | null | pgcli/packages/sqlcompletion.py | akshay-joshi/pgcli | 51c4cf495cab0722f0f474dceb502746e8e7c5ed | [
"BSD-3-Clause"
] | null | null | null | pgcli/packages/sqlcompletion.py | akshay-joshi/pgcli | 51c4cf495cab0722f0f474dceb502746e8e7c5ed | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
import sys
import re
import sqlparse
from collections import namedtuple
from sqlparse.sql import Comparison, Identifier, Where
from .parseutils.utils import (
last_word, find_prev_keyword, parse_partial_identifier)
from .parseutils.tables import extract_tables
from .parseutils.... | 38.357022 | 79 | 0.619613 | from __future__ import print_function
import sys
import re
import sqlparse
from collections import namedtuple
from sqlparse.sql import Comparison, Identifier, Where
from .parseutils.utils import (
last_word, find_prev_keyword, parse_partial_identifier)
from .parseutils.tables import extract_tables
from .parseutils.... | 16,500 | 771 | 138 |
5b21e44116bbbcc52b3378dbbcba99b01edbe18e | 2,397 | py | Python | db/Answer.py | sysu-team1/BackEnd | 4773545897fee3aa7a767cbe6d011372623e1e58 | [
"MIT"
] | 1 | 2019-11-19T09:08:50.000Z | 2019-11-19T09:08:50.000Z | db/Answer.py | sysu-team1/BackEnd | 4773545897fee3aa7a767cbe6d011372623e1e58 | [
"MIT"
] | null | null | null | db/Answer.py | sysu-team1/BackEnd | 4773545897fee3aa7a767cbe6d011372623e1e58 | [
"MIT"
] | null | null | null | import random
from .prepare import app, db, model_repr
class Answer(db.Model):
'''
使用的sql语句:
```sql
CREATE TABLE `answers` (
`accept_id` int(11) NOT NULL COMMENT '接受id',
`problem_id` int(11) NOT NULL COMMENT '问题id',
`answer` int(11) NOT NULL DEFAULT '-1' COMMENT '具体答案的选项',
... | 38.66129 | 109 | 0.656237 | import random
from .prepare import app, db, model_repr
class Answer(db.Model):
'''
使用的sql语句:
```sql
CREATE TABLE `answers` (
`accept_id` int(11) NOT NULL COMMENT '接受id',
`problem_id` int(11) NOT NULL COMMENT '问题id',
`answer` int(11) NOT NULL DEFAULT '-1' COMMENT '具体答案的选项',
... | 480 | 0 | 50 |
0b00751199a21103bbd2d9de1bbc3315e858f87a | 2,476 | py | Python | switch_inputs/bioenergy_clean.py | Switch-Mexico/switch-inputs | e2afa96c40b516435c350d525119e4594f1b7eca | [
"MIT"
] | 1 | 2020-07-14T21:50:28.000Z | 2020-07-14T21:50:28.000Z | switch_inputs/bioenergy_clean.py | Switch-Mexico/switch-inputs | e2afa96c40b516435c350d525119e4594f1b7eca | [
"MIT"
] | 14 | 2018-12-14T23:21:09.000Z | 2019-05-10T21:42:36.000Z | switch_inputs/bioenergy_clean.py | Switch-Mexico/switch-inputs | e2afa96c40b516435c350d525119e4594f1b7eca | [
"MIT"
] | 1 | 2020-07-14T21:50:37.000Z | 2020-07-14T21:50:37.000Z | """
Clean bioenergy data from AZEL
"""
import os
import json
import itertools
import geopandas as gpd
import pandas as pd
os.makedirs('data', exist_ok=True)
projection = 'epsg:4326'
name = ['pecuarios', 'forestales', 'industriales', 'urbanos']
scenario = ['E3', 'E1']
for scenario, name in itertools.product(scena... | 38.6875 | 82 | 0.550485 | """
Clean bioenergy data from AZEL
"""
import os
import json
import itertools
import geopandas as gpd
import pandas as pd
os.makedirs('data', exist_ok=True)
projection = 'epsg:4326'
name = ['pecuarios', 'forestales', 'industriales', 'urbanos']
scenario = ['E3', 'E1']
for scenario, name in itertools.product(scena... | 0 | 0 | 0 |
1e25f3f0b115342908828bb75c9bb105ab2844b3 | 1,720 | py | Python | bounds/essentials.py | rkirov/code_bounds | 2855c3bfd2972c98d93b891c4f737b6f320c2664 | [
"Unlicense"
] | null | null | null | bounds/essentials.py | rkirov/code_bounds | 2855c3bfd2972c98d93b891c4f737b6f320c2664 | [
"Unlicense"
] | null | null | null | bounds/essentials.py | rkirov/code_bounds | 2855c3bfd2972c98d93b891c4f737b6f320c2664 | [
"Unlicense"
] | null | null | null |
#the table should be read T[deg][a] where a is the multiplicity of the Q
def build1DCeilingTable(c):
'''entry for A is max k s.t. l(A) = l(A+kP) and l(A+kQ) '''
max_deg = [0 for _ in range(c.m)]
CLP = c.fill_degree_table_reverse(update, max_deg)
CLQ = c.fill_degree_table_reverse(update, max_deg)
re... | 38.222222 | 74 | 0.629651 | def l_values(c):
minus_one_deg = [0 for _ in range(c.m)]
def update(div, minus_p_val, minus_q_val):
return minus_p_val + div.is_P_nongap()
lval = c.fill_degree_table(update, minus_one_deg)
return ['LVAL'], [lval]
def build_floor_table(c):
#if l(D) = 0, floor is assigned to be [0,1], XXX: w... | 1,248 | 0 | 122 |
47a1ef61a50d752f006c753ce45eb846e946bcb9 | 1,850 | py | Python | DSM/estrutura_dados/Entregas/PROVA SUBSTITUTIVA/exclusao.py | murillotlopes/DSM-Python | 2822b9b1b988936ab098c7052180ee3c3d7dd735 | [
"MIT"
] | null | null | null | DSM/estrutura_dados/Entregas/PROVA SUBSTITUTIVA/exclusao.py | murillotlopes/DSM-Python | 2822b9b1b988936ab098c7052180ee3c3d7dd735 | [
"MIT"
] | null | null | null | DSM/estrutura_dados/Entregas/PROVA SUBSTITUTIVA/exclusao.py | murillotlopes/DSM-Python | 2822b9b1b988936ab098c7052180ee3c3d7dd735 | [
"MIT"
] | null | null | null | # 1. Observe os dois métodos de exclusão listados abaixo.
#
# 2. Identifique a quais estruturas pertencem os métodos, respectivamente.
# R: A primeira é Lista duplamente encadeada (double_linked), metodo de remoção. A segunda é Lista encadeada, metodo de remoção
#
# 3. Explique qual a diferença FUNDAMENTAL entre ... | 33.636364 | 302 | 0.648649 | # 1. Observe os dois métodos de exclusão listados abaixo.
#
# 2. Identifique a quais estruturas pertencem os métodos, respectivamente.
# R: A primeira é Lista duplamente encadeada (double_linked), metodo de remoção. A segunda é Lista encadeada, metodo de remoção
#
# 3. Explique qual a diferença FUNDAMENTAL entre ... | 1,140 | 0 | 44 |
728ed67c9adf8bf2a90007fb924fb783092d33e8 | 9,864 | py | Python | invenio_rest/csrf.py | max-moser/invenio-rest | 1b6bd04c953b0e9662314d5ee9601e966196f332 | [
"MIT"
] | null | null | null | invenio_rest/csrf.py | max-moser/invenio-rest | 1b6bd04c953b0e9662314d5ee9601e966196f332 | [
"MIT"
] | null | null | null | invenio_rest/csrf.py | max-moser/invenio-rest | 1b6bd04c953b0e9662314d5ee9601e966196f332 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2020 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""CSRF Middleware.
The implementation is highly inspred from Django's initial implementa... | 32.662252 | 79 | 0.662612 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2020 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""CSRF Middleware.
The implementation is highly inspred from Django's initial implementa... | 2,644 | 0 | 214 |
64796e0dca6ac811f76e9b1d579e2ef14b18c171 | 849 | py | Python | polymetis/polymetis/tests/python/polymetis/test_gripper_interface.py | ali-senguel/fairo-explore | 893481da270eed1e6d504c71e483d685ca9218d1 | [
"MIT"
] | null | null | null | polymetis/polymetis/tests/python/polymetis/test_gripper_interface.py | ali-senguel/fairo-explore | 893481da270eed1e6d504c71e483d685ca9218d1 | [
"MIT"
] | null | null | null | polymetis/polymetis/tests/python/polymetis/test_gripper_interface.py | ali-senguel/fairo-explore | 893481da270eed1e6d504c71e483d685ca9218d1 | [
"MIT"
] | null | null | null | import pytest
import unittest
from unittest.mock import MagicMock
from polymetis import GripperInterface
import polymetis_pb2
@pytest.fixture
@pytest.mark.parametrize("blocking", [True, False])
| 26.53125 | 81 | 0.765607 | import pytest
import unittest
from unittest.mock import MagicMock
from polymetis import GripperInterface
import polymetis_pb2
@pytest.fixture
def mocked_gripper(request):
gripper = GripperInterface()
gripper.grpc_connection = MagicMock()
return gripper
@pytest.mark.parametrize("blocking", [True, False]... | 606 | 0 | 44 |
152b6caaa0f282aa664a559068342555529558dd | 978 | py | Python | sites/web/web/migrations/0005_auto_20210117_1826.py | PrathameshBolade/yats | 93bb5271255120b7131a3bc416e3386428a4d3ec | [
"MIT"
] | 54 | 2015-01-26T07:56:59.000Z | 2022-03-10T18:48:05.000Z | sites/web/web/migrations/0005_auto_20210117_1826.py | PrathameshBolade/yats | 93bb5271255120b7131a3bc416e3386428a4d3ec | [
"MIT"
] | 8 | 2015-03-15T18:33:39.000Z | 2021-12-21T14:23:11.000Z | sites/web/web/migrations/0005_auto_20210117_1826.py | PrathameshBolade/yats | 93bb5271255120b7131a3bc416e3386428a4d3ec | [
"MIT"
] | 23 | 2015-02-19T16:55:35.000Z | 2022-03-11T19:49:06.000Z | # Generated by Django 2.2.10 on 2021-01-17 17:26
from django.db import migrations, models
| 33.724138 | 169 | 0.610429 | # Generated by Django 2.2.10 on 2021-01-17 17:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0004_auto_20180911_1440'),
]
operations = [
migrations.AlterField(
model_name='test',
name='billing_type',
... | 0 | 863 | 23 |
215fb216f7f044d8ecbf8c81133f5e55057f1c0a | 10,676 | py | Python | tests/test_commands.py | voroneril/pixi | aefe0e4d6b8799f98c959487d3501c17ecec42d8 | [
"Apache-2.0"
] | 1 | 2020-11-09T00:03:04.000Z | 2020-11-09T00:03:04.000Z | tests/test_commands.py | voroneril/pixi | aefe0e4d6b8799f98c959487d3501c17ecec42d8 | [
"Apache-2.0"
] | 1 | 2019-08-05T15:52:27.000Z | 2019-08-05T15:52:27.000Z | tests/test_commands.py | voroneril/pixi | aefe0e4d6b8799f98c959487d3501c17ecec42d8 | [
"Apache-2.0"
] | 1 | 2020-11-10T03:33:06.000Z | 2020-11-10T03:33:06.000Z | from pathlib import Path
from shutil import copyfile
from unittest import mock
import click
from click.testing import CliRunner
from pixivapi import BadApiResponse, LoginError, Visibility
from pixi.commands import (
_confirm_table_wipe,
_get_starting_bookmark_offset,
artist,
auth,
bookmarks,
c... | 33.258567 | 85 | 0.637411 | from pathlib import Path
from shutil import copyfile
from unittest import mock
import click
from click.testing import CliRunner
from pixivapi import BadApiResponse, LoginError, Visibility
from pixi.commands import (
_confirm_table_wipe,
_get_starting_bookmark_offset,
artist,
auth,
bookmarks,
c... | 8,711 | 0 | 423 |
4fd3ea83be0511369dac144b43bafc6128ea8267 | 4,873 | py | Python | src/beast.py | yotamfr/skempi | 9e5dbb7661a36c973edb0e94cf8bfe843f839e66 | [
"MIT"
] | 1 | 2021-11-08T14:16:40.000Z | 2021-11-08T14:16:40.000Z | src/beast.py | yotamfr/skempi | 9e5dbb7661a36c973edb0e94cf8bfe843f839e66 | [
"MIT"
] | 16 | 2019-12-16T21:16:26.000Z | 2022-03-11T23:33:34.000Z | src/beast.py | yotamfr/skempi | 9e5dbb7661a36c973edb0e94cf8bfe843f839e66 | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torch import optim
from vae import *
from loader import *
from skempi_lib import *
from torch_utils import *
BATCH_SIZE = 32
LR = 1e-3
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
add_arguments(parser)
args = parser.parse_... | 34.316901 | 102 | 0.601683 | import torch
from torch import nn
from torch import optim
from vae import *
from loader import *
from skempi_lib import *
from torch_utils import *
BATCH_SIZE = 32
LR = 1e-3
def get_loss(aa_hat, aa, x_hat, x, mu, logvar):
KLD = -0.5 * torch.sum(1 + logvar - mu.pow(2) - logvar.exp())
L1 = nn.L1Loss(reduction... | 2,826 | 0 | 115 |
e5c1d44e5f230d87e88a537feae2bd6b367c70b9 | 898 | py | Python | scripts/query_all_orders.py | egorsimchuk/binance_bot | af1caac32f8d4804aea3af83250fd4530d9787df | [
"Unlicense"
] | 1 | 2022-03-13T01:07:08.000Z | 2022-03-13T01:07:08.000Z | scripts/query_all_orders.py | egorsimchuk/binance_bot | af1caac32f8d4804aea3af83250fd4530d9787df | [
"Unlicense"
] | 4 | 2022-02-20T10:33:45.000Z | 2022-03-03T22:59:24.000Z | scripts/query_all_orders.py | egorsimchuk/binance_bot | af1caac32f8d4804aea3af83250fd4530d9787df | [
"Unlicense"
] | null | null | null | import argparse
from src.client.client import ClientHelper
import logging
from src.data.orders_handler import load_and_process
from src.data.preprocessing.orders import OrdersProcessor
from src.utils.logging import log_format, log_level
logging.basicConfig(format=log_format, level=log_level)
if __name__ == '__main__... | 42.761905 | 123 | 0.77951 | import argparse
from src.client.client import ClientHelper
import logging
from src.data.orders_handler import load_and_process
from src.data.preprocessing.orders import OrdersProcessor
from src.utils.logging import log_format, log_level
logging.basicConfig(format=log_format, level=log_level)
if __name__ == '__main__... | 0 | 0 | 0 |
d69331e986956345298d242355aaa1cd0eefe66f | 138 | py | Python | day13/aoc-day13.py | SebastiaanZ/aoc-2018 | fb4d6db2ed592fa17554c80531384afdc0c34180 | [
"MIT"
] | 1 | 2019-03-16T19:20:11.000Z | 2019-03-16T19:20:11.000Z | day13/aoc-day13.py | SebastiaanZ/aoc-2018 | fb4d6db2ed592fa17554c80531384afdc0c34180 | [
"MIT"
] | null | null | null | day13/aoc-day13.py | SebastiaanZ/aoc-2018 | fb4d6db2ed592fa17554c80531384afdc0c34180 | [
"MIT"
] | null | null | null | from railroads import Track
track = Track("day13-input.txt")
track.run_partone()
track2 = Track("day13-input.txt")
track2.run_parttwo()
| 17.25 | 33 | 0.753623 | from railroads import Track
track = Track("day13-input.txt")
track.run_partone()
track2 = Track("day13-input.txt")
track2.run_parttwo()
| 0 | 0 | 0 |
ac305c92f5ce9e62d182f5076f44c90f41ffa6af | 4,339 | py | Python | side_projects/extract_chr16_cpg/extract_location_and_context_to_csv.py | methylgrammarlab/proj_scwgbs | 287196898796eb617fef273bfaf9e978a57047dc | [
"MIT"
] | null | null | null | side_projects/extract_chr16_cpg/extract_location_and_context_to_csv.py | methylgrammarlab/proj_scwgbs | 287196898796eb617fef273bfaf9e978a57047dc | [
"MIT"
] | null | null | null | side_projects/extract_chr16_cpg/extract_location_and_context_to_csv.py | methylgrammarlab/proj_scwgbs | 287196898796eb617fef273bfaf9e978a57047dc | [
"MIT"
] | null | null | null | """
Extract information about chr16 for several patients for ben
"""
import pandas as pd
crc01_path = r"H:\Study\university\Computational-Biology\Year " \
r"3\Projects\proj_scwgbs\resource\cpg_format\filtered_by_bl_and_cpgi\CRC01\all_cpg_ratios_CRC01_chr16.dummy.pkl.zip"
crc11_path = r"H:\Study\universit... | 41.721154 | 129 | 0.690943 | """
Extract information about chr16 for several patients for ben
"""
import pandas as pd
crc01_path = r"H:\Study\university\Computational-Biology\Year " \
r"3\Projects\proj_scwgbs\resource\cpg_format\filtered_by_bl_and_cpgi\CRC01\all_cpg_ratios_CRC01_chr16.dummy.pkl.zip"
crc11_path = r"H:\Study\universit... | 0 | 0 | 0 |
59e12014ee9c4a44c159a0e0cd44aac722333c28 | 1,509 | py | Python | setup.py | SUNET/eduid-queue | e7d090978220a4beaf61e5d893233120d8e79cdd | [
"BSD-2-Clause"
] | null | null | null | setup.py | SUNET/eduid-queue | e7d090978220a4beaf61e5d893233120d8e79cdd | [
"BSD-2-Clause"
] | null | null | null | setup.py | SUNET/eduid-queue | e7d090978220a4beaf61e5d893233120d8e79cdd | [
"BSD-2-Clause"
] | null | null | null | from pathlib import PurePath
from typing import List
from setuptools import find_packages, setup
version = '0.0.4'
def load_requirements(path: PurePath) -> List[str]:
""" Load dependencies from a requirements.txt style file, ignoring comments etc. """
res = []
with open(path) as fd:
for line in ... | 31.4375 | 98 | 0.648774 | from pathlib import PurePath
from typing import List
from setuptools import find_packages, setup
version = '0.0.4'
def load_requirements(path: PurePath) -> List[str]:
""" Load dependencies from a requirements.txt style file, ignoring comments etc. """
res = []
with open(path) as fd:
for line in ... | 0 | 0 | 0 |
939dd53c6999e793bc3ce2b6e8b9689a8b6c18aa | 3,451 | py | Python | fft_fluid_solver.py | 0xrabbyte/taichi_simple_fluid_solver | 992924edeee66a74e747b4503fa381637eabf03f | [
"MIT"
] | 3 | 2021-12-16T04:58:13.000Z | 2021-12-21T12:43:31.000Z | fft_fluid_solver.py | 0xrabbyte/taichi_simple_fluid_solver | 992924edeee66a74e747b4503fa381637eabf03f | [
"MIT"
] | null | null | null | fft_fluid_solver.py | 0xrabbyte/taichi_simple_fluid_solver | 992924edeee66a74e747b4503fa381637eabf03f | [
"MIT"
] | null | null | null | from numpy.core.fromnumeric import shape
import taichi as ti
import numpy as np
lin_iters = 20
N = 64
dt = 0.1
diff = 0.0
visc = 0.0
force = 5e5
source = 100.0
dvel = False
v = ti.Vector.field(2, float, shape=(N + 2, N + 2), offset = (-1, -1))
v_prev = ti.Vector.field(2, float, shape=(N + 2, N + 2),... | 31.372727 | 102 | 0.454361 | from numpy.core.fromnumeric import shape
import taichi as ti
import numpy as np
lin_iters = 20
N = 64
dt = 0.1
diff = 0.0
visc = 0.0
force = 5e5
source = 100.0
dvel = False
v = ti.Vector.field(2, float, shape=(N + 2, N + 2), offset = (-1, -1))
v_prev = ti.Vector.field(2, float, shape=(N + 2, N + 2),... | 2,526 | 0 | 214 |
0a242dfa84979d870503e1a938700b15f2f94260 | 1,000 | py | Python | helpers/populate_zones.py | qbrc-cnap/cnap | 624683e91a64c3b4934b578c59db850242d2f94c | [
"MIT"
] | 1 | 2021-07-08T14:06:04.000Z | 2021-07-08T14:06:04.000Z | helpers/populate_zones.py | qbrc-cnap/cnap | 624683e91a64c3b4934b578c59db850242d2f94c | [
"MIT"
] | 12 | 2020-02-12T00:10:53.000Z | 2021-06-10T21:24:45.000Z | helpers/populate_zones.py | qbrc-cnap/cnap | 624683e91a64c3b4934b578c59db850242d2f94c | [
"MIT"
] | null | null | null | import sys
import os
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.realpath(os.pardir))
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cnap_v2.settings')
import django
from django.conf import settings
django.setup()
from base.models import AvailableZones, CurrentZone
if __name__ =... | 33.333333 | 88 | 0.708 | import sys
import os
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.realpath(os.pardir))
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cnap_v2.settings')
import django
from django.conf import settings
django.setup()
from base.models import AvailableZones, CurrentZone
if __name__ =... | 0 | 0 | 0 |
3df290dfe185dd739a6cc9a5cc23a766723dd5a9 | 2,163 | py | Python | reward/space/continuous.py | lgvaz/torchrl | cfff8acaf70d1fec72169162b95ab5ad3547d17a | [
"MIT"
] | 5 | 2018-06-21T14:33:40.000Z | 2018-08-18T02:26:03.000Z | reward/space/continuous.py | lgvaz/reward | cfff8acaf70d1fec72169162b95ab5ad3547d17a | [
"MIT"
] | null | null | null | reward/space/continuous.py | lgvaz/reward | cfff8acaf70d1fec72169162b95ab5ad3547d17a | [
"MIT"
] | 2 | 2018-05-08T03:34:49.000Z | 2018-06-22T15:04:17.000Z | import torch
import numpy as np, reward.utils as U
from pathlib import Path
from .space import Space
| 35.459016 | 96 | 0.66528 | import torch
import numpy as np, reward.utils as U
from pathlib import Path
from .space import Space
class Continuous(Space):
def __init__(self, low=None, high=None, shape=None):
low, high = np.array(low), np.array(high)
assert low.shape == high.shape if shape is None else True
shape = sha... | 1,395 | 454 | 202 |
5223cec5815747015e2cf337d69de35d96fdb7b8 | 2,129 | py | Python | household/migrations/0002_auto_20200303_1532.py | desafinadude/municipal-data | 1c86c55bbb59f9c8087f6920fae3585dd90d5d43 | [
"MIT"
] | 19 | 2018-01-09T10:54:15.000Z | 2022-01-25T13:10:55.000Z | household/migrations/0002_auto_20200303_1532.py | desafinadude/municipal-data | 1c86c55bbb59f9c8087f6920fae3585dd90d5d43 | [
"MIT"
] | 29 | 2018-01-12T12:12:38.000Z | 2022-01-31T15:30:36.000Z | household/migrations/0002_auto_20200303_1532.py | desafinadude/municipal-data | 1c86c55bbb59f9c8087f6920fae3585dd90d5d43 | [
"MIT"
] | 13 | 2018-02-11T02:12:57.000Z | 2021-11-22T11:03:22.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2020-03-03 13:32
from __future__ import unicode_literals
from django.db import migrations
| 41.745098 | 70 | 0.753405 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2020-03-03 13:32
from __future__ import unicode_literals
from django.db import migrations
def add_financial_year(apps, schema_editor):
FinancialYear = apps.get_model('household', 'FinancialYear')
FinancialYear.objects.create(budget_year="2015/2016")
... | 1,576 | 290 | 115 |
767933a3cbc4c4860d84dbb36a3ae605a156b0cb | 9,566 | py | Python | src/condor_tensorflow/metrics.py | GarrettJenkinson/condor_tensorflow | db715a2db6a5c0dbf610f5ad82cec16e2ab3d3d8 | [
"Apache-2.0"
] | 9 | 2021-10-31T16:39:35.000Z | 2022-02-19T17:51:07.000Z | src/condor_tensorflow/metrics.py | GarrettJenkinson/condor_tensorflow | db715a2db6a5c0dbf610f5ad82cec16e2ab3d3d8 | [
"Apache-2.0"
] | 4 | 2022-01-01T19:52:55.000Z | 2022-02-16T00:38:40.000Z | src/condor_tensorflow/metrics.py | GarrettJenkinson/condor_tensorflow | db715a2db6a5c0dbf610f5ad82cec16e2ab3d3d8 | [
"Apache-2.0"
] | 4 | 2021-10-31T17:50:29.000Z | 2022-02-11T02:54:47.000Z | import tensorflow as tf
from tensorflow.keras import backend as K
class OrdinalMeanAbsoluteError(tf.keras.metrics.Metric):
"""Computes mean absolute error for ordinal labels."""
def __init__(self, name="mean_absolute_error_labels",
**kwargs):
"""Creates a `OrdinalMeanAbsoluteError` i... | 38.728745 | 82 | 0.614363 | import tensorflow as tf
from tensorflow.keras import backend as K
class OrdinalMeanAbsoluteError(tf.keras.metrics.Metric):
"""Computes mean absolute error for ordinal labels."""
def __init__(self, name="mean_absolute_error_labels",
**kwargs):
"""Creates a `OrdinalMeanAbsoluteError` i... | 112 | 0 | 54 |
c28dee9c33942755f7781bf26747522afc2dd87d | 529 | py | Python | code-everyday-challenge/n62_the_king.py | ved93/deliberate-practice-challenges | 2fccdbb9d2baaa16f888055c081a8d04804c0045 | [
"MIT"
] | null | null | null | code-everyday-challenge/n62_the_king.py | ved93/deliberate-practice-challenges | 2fccdbb9d2baaa16f888055c081a8d04804c0045 | [
"MIT"
] | null | null | null | code-everyday-challenge/n62_the_king.py | ved93/deliberate-practice-challenges | 2fccdbb9d2baaa16f888055c081a8d04804c0045 | [
"MIT"
] | null | null | null |
#https://www.geeksforgeeks.org/puzzle-maximum-number-kings-chessboard-without-check/
if __name__ == '__main__':
print(main(9,3)) | 15.558824 | 84 | 0.449905 |
#https://www.geeksforgeeks.org/puzzle-maximum-number-kings-chessboard-without-check/
def main(l,w):
l, w = max(l,w), min(w,l)
result = 0
count = 0
mn=min(l // 3,w//3)
count += mn*8
bl = l%3
if bl == 2:
count += (w//3)*5
count+=(w%3)*2-1
if bl == 1:
count += ... | 366 | 0 | 22 |
a7287aeae17119d193ebe8345b7de35f2d5dd0af | 333 | py | Python | testapp/wagtail_wordpress_importer/migrations/0042_delete_customfieldsgrouplocation.py | nickmoreton/wagtail_wordpress_importer | fbe6b60ae624edac3f42a62ce30af4a0c548b4ed | [
"MIT"
] | null | null | null | testapp/wagtail_wordpress_importer/migrations/0042_delete_customfieldsgrouplocation.py | nickmoreton/wagtail_wordpress_importer | fbe6b60ae624edac3f42a62ce30af4a0c548b4ed | [
"MIT"
] | null | null | null | testapp/wagtail_wordpress_importer/migrations/0042_delete_customfieldsgrouplocation.py | nickmoreton/wagtail_wordpress_importer | fbe6b60ae624edac3f42a62ce30af4a0c548b4ed | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-01-10 21:41
from django.db import migrations
| 19.588235 | 66 | 0.648649 | # Generated by Django 3.1.4 on 2021-01-10 21:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtail_wordpress_importer', '0041_auto_20210110_0628'),
]
operations = [
migrations.DeleteModel(
name='CustomFieldsGroupLocation',
... | 0 | 227 | 23 |
8aff30b1325031846426585dc6e6d56c20755efe | 1,601 | py | Python | systraymgr.py | DawningW/My-Minisite-Server | 3a44656d24cf91e7d2706aea289217a903e109f3 | [
"MIT"
] | 1 | 2020-02-21T15:56:54.000Z | 2020-02-21T15:56:54.000Z | systraymgr.py | DawningW/My-Minisite-Server | 3a44656d24cf91e7d2706aea289217a903e109f3 | [
"MIT"
] | 1 | 2020-02-10T07:15:39.000Z | 2020-02-10T07:15:39.000Z | systraymgr.py | DawningW/My-Minisite-Server | 3a44656d24cf91e7d2706aea289217a903e109f3 | [
"MIT"
] | null | null | null | # coding=utf-8
import os
import threading
import logging
import utils
if utils.getSystem() == utils.System.WINDOWS:
from SysTrayIcon import SysTrayIcon
trayThread = None
tray = None
show = True
def initTray():
"初始化系统托盘线程"
logging.info("Start a new thread to manage system tray.")
global trayThread
... | 24.257576 | 87 | 0.632105 | # coding=utf-8
import os
import threading
import logging
import utils
if utils.getSystem() == utils.System.WINDOWS:
from SysTrayIcon import SysTrayIcon
trayThread = None
tray = None
show = True
def initTray():
"初始化系统托盘线程"
logging.info("Start a new thread to manage system tray.")
global trayThread
... | 0 | 0 | 0 |
07bcdf98fadb839414b17802415bfa04081f4e76 | 315 | py | Python | 0072 Invert Tree.py | ansabgillani/binarysearchcomproblems | 12fe8632f8cbb5058c91a55bae53afa813a3247e | [
"MIT"
] | 1 | 2020-12-29T21:17:26.000Z | 2020-12-29T21:17:26.000Z | 0072 Invert Tree.py | ansabgillani/binarysearchcomproblems | 12fe8632f8cbb5058c91a55bae53afa813a3247e | [
"MIT"
] | null | null | null | 0072 Invert Tree.py | ansabgillani/binarysearchcomproblems | 12fe8632f8cbb5058c91a55bae53afa813a3247e | [
"MIT"
] | 4 | 2021-09-09T17:42:43.000Z | 2022-03-18T04:54:03.000Z | # class Tree:
# def __init__(self, val, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
| 28.636364 | 81 | 0.561905 | # class Tree:
# def __init__(self, val, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def solve(self, root):
if root:
root.left, root.right = self.solve(root.right), self.solve(root.left)
return root
| 124 | -6 | 48 |
e3245e7e8922075b4ab710aae52ceed5897380aa | 720 | py | Python | spkcspider/apps/spider/management/commands/update_dynamic_content.py | devkral/spkbspider | 97e448b4da412acebd66c4469c7fcdd07bf90ed2 | [
"MIT"
] | 5 | 2019-06-24T14:15:54.000Z | 2021-05-14T23:16:31.000Z | spkcspider/apps/spider/management/commands/update_dynamic_content.py | devkral/spkbspider | 97e448b4da412acebd66c4469c7fcdd07bf90ed2 | [
"MIT"
] | 2 | 2018-06-19T09:56:18.000Z | 2018-11-20T12:02:44.000Z | spkcspider/apps/spider/management/commands/update_dynamic_content.py | devkral/spkbspider | 97e448b4da412acebd66c4469c7fcdd07bf90ed2 | [
"MIT"
] | null | null | null | import logging
from django.core.management.base import BaseCommand
| 34.285714 | 68 | 0.65 | import logging
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Update dynamic spider content e.g. permissions, content'
def handle(self, *args, **options):
from spkcspider.apps.spider.signals import update_dynamic
self.log = logging.getLogger(__name__)... | 526 | 102 | 23 |
b41bd65de72b54228d27b15eb7cb53acfa278bd8 | 8,458 | py | Python | rflow/command.py | otaviog/rflow | 8594b9c3e9e1da61382f80b66e749cf7b8a33676 | [
"MIT"
] | 6 | 2019-08-26T11:36:58.000Z | 2020-12-15T21:01:24.000Z | rflow/command.py | otaviog/rflow | 8594b9c3e9e1da61382f80b66e749cf7b8a33676 | [
"MIT"
] | null | null | null | rflow/command.py | otaviog/rflow | 8594b9c3e9e1da61382f80b66e749cf7b8a33676 | [
"MIT"
] | 1 | 2020-04-13T08:05:27.000Z | 2020-04-13T08:05:27.000Z | """Command-line interfacing workflows"""
import argparse
import os
import sys
import imp
import inspect
import argcomplete
from . import core
from . common import WorkflowError, WORKFLOW_DEFAULT_FILENAME
from . import decorators
from . userargument import USER_ARGS_CONTEXT
from . _ui import ui
from . import _util a... | 28.478114 | 95 | 0.657011 | """Command-line interfacing workflows"""
import argparse
import os
import sys
import imp
import inspect
import argcomplete
from . import core
from . common import WorkflowError, WORKFLOW_DEFAULT_FILENAME
from . import decorators
from . userargument import USER_ARGS_CONTEXT
from . _ui import ui
from . import _util a... | 3,983 | -5 | 233 |
d17c1ec8c4e434997012bd6fecb4cf01d7f5f931 | 1,965 | py | Python | catkin_ws/src/wheel_odom/src/read_encoder.py | AndySer37/duckietown_text | cc7ae0d48c182c991a2afa67bf40d3f0f0e5cd49 | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/wheel_odom/src/read_encoder.py | AndySer37/duckietown_text | cc7ae0d48c182c991a2afa67bf40d3f0f0e5cd49 | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/wheel_odom/src/read_encoder.py | AndySer37/duckietown_text | cc7ae0d48c182c991a2afa67bf40d3f0f0e5cd49 | [
"CC-BY-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
import tf
import serial
import numpy as np
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Point
from std_msgs.msg import Int64
global x, y, theta, v_L, v_R, v_x, v_y, omega
x = 0
y = 0
theta = 0
v_L = 0
v_R = 0
v_x = 0
v_y = 0
omega = 0
pub_tf = False # Use estimate ... | 26.554054 | 77 | 0.680916 | #!/usr/bin/env python
import rospy
import tf
import serial
import numpy as np
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Point
from std_msgs.msg import Int64
global x, y, theta, v_L, v_R, v_x, v_y, omega
x = 0
y = 0
theta = 0
v_L = 0
v_R = 0
v_x = 0
v_y = 0
omega = 0
pub_tf = False # Use estimate ... | 1,297 | 0 | 23 |
e2b0eb16ff59352823b96b85f477cffe67241cc6 | 309 | py | Python | umich-notebook/global_nbgrader_config.py | IllumiDesk/umich-stacks | 92161237f9031ee7e7689fd7b1177c2b5271560a | [
"MIT"
] | 1 | 2021-11-09T20:59:00.000Z | 2021-11-09T20:59:00.000Z | umich-notebook/global_nbgrader_config.py | IllumiDesk/umich-stacks | 92161237f9031ee7e7689fd7b1177c2b5271560a | [
"MIT"
] | 2 | 2021-08-07T04:01:16.000Z | 2021-08-08T00:18:25.000Z | umich-notebook/global_nbgrader_config.py | IllumiDesk/umich-stacks | 92161237f9031ee7e7689fd7b1177c2b5271560a | [
"MIT"
] | 1 | 2020-11-09T02:06:41.000Z | 2020-11-09T02:06:41.000Z | from nbgrader.auth import JupyterHubAuthPlugin
c = get_config()
c.Application.log_level = 30
c.Authenticator.plugin_class = JupyterHubAuthPlugin
c.Exchange.path_includes_course = True
c.Exchange.root = "/srv/nbgrader/exchange"
c.ExecutePreprocessor.iopub_timeout=1800
c.ExecutePreprocessor.timeout=3600
| 20.6 | 51 | 0.825243 | from nbgrader.auth import JupyterHubAuthPlugin
c = get_config()
c.Application.log_level = 30
c.Authenticator.plugin_class = JupyterHubAuthPlugin
c.Exchange.path_includes_course = True
c.Exchange.root = "/srv/nbgrader/exchange"
c.ExecutePreprocessor.iopub_timeout=1800
c.ExecutePreprocessor.timeout=3600
| 0 | 0 | 0 |
ee3d0f2a05ffe897c50b9010e85f734270d74d14 | 5,826 | py | Python | CommitReveal.py | AleBuser/IOTA-Commit-Reveal | f9d00dfd56070b5a9a71addfc876bd628859731e | [
"MIT"
] | null | null | null | CommitReveal.py | AleBuser/IOTA-Commit-Reveal | f9d00dfd56070b5a9a71addfc876bd628859731e | [
"MIT"
] | null | null | null | CommitReveal.py | AleBuser/IOTA-Commit-Reveal | f9d00dfd56070b5a9a71addfc876bd628859731e | [
"MIT"
] | null | null | null | from iota import Iota
from iota import Address, ProposedTransaction, Tag, Transaction
from iota import TryteString
from iota import ProposedBundle
from iota.commands.extended import utils
from datetime import datetime
from pprint import pprint
import hashlib
import time
import random
import string
| 30.030928 | 146 | 0.651562 | from iota import Iota
from iota import Address, ProposedTransaction, Tag, Transaction
from iota import TryteString
from iota import ProposedBundle
from iota.commands.extended import utils
from datetime import datetime
from pprint import pprint
import hashlib
import time
import random
import string
class CommitReveal... | 5,080 | 415 | 23 |
8647ff7e2ccc891de38e05613dc057b290d1ed18 | 32,540 | py | Python | tests/admin_changelist/tests.py | devops2014/djangosite | db77915c9fd35a203edd8206f702ee4082f04d4a | [
"BSD-3-Clause"
] | null | null | null | tests/admin_changelist/tests.py | devops2014/djangosite | db77915c9fd35a203edd8206f702ee4082f04d4a | [
"BSD-3-Clause"
] | null | null | null | tests/admin_changelist/tests.py | devops2014/djangosite | db77915c9fd35a203edd8206f702ee4082f04d4a | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import datetime
from django.contrib import admin
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.templatetags.admin_list import pagination
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.admi... | 45.766526 | 164 | 0.653934 | from __future__ import unicode_literals
import datetime
from django.contrib import admin
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.templatetags.admin_list import pagination
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.admi... | 4,826 | 26,150 | 113 |
db0f8ab101b84a60021a859ef789132b6c6130ab | 4,723 | py | Python | emukit/examples/multi_fidelity_dgp/baseline_model_wrappers.py | ndalchau/emukit | eb6754ea016a7cd82b275bb4075676b5ed662634 | [
"Apache-2.0"
] | 152 | 2020-10-24T13:12:57.000Z | 2022-03-25T11:35:41.000Z | emukit/examples/multi_fidelity_dgp/baseline_model_wrappers.py | Tony-Chiong/emukit | a068c8d5e06b2ae8b038f67bf2e4f66c4d91651a | [
"Apache-2.0"
] | 87 | 2020-10-26T10:29:25.000Z | 2022-03-04T11:17:59.000Z | emukit/examples/multi_fidelity_dgp/baseline_model_wrappers.py | Tony-Chiong/emukit | a068c8d5e06b2ae8b038f67bf2e4f66c4d91651a | [
"Apache-2.0"
] | 41 | 2020-10-24T11:59:21.000Z | 2022-03-22T17:08:30.000Z | """
These are emukit model wrappers that contain the specific optimization procedures we found worked well for each model.
The constructor for each model takes X and Y as lists, with each entry of the list corresponding to data for a fidelity
"""
import logging
import GPy
import numpy as np
from ...core.interfaces i... | 33.027972 | 119 | 0.665043 | """
These are emukit model wrappers that contain the specific optimization procedures we found worked well for each model.
The constructor for each model takes X and Y as lists, with each entry of the list corresponding to data for a fidelity
"""
import logging
import GPy
import numpy as np
from ...core.interfaces i... | 1,590 | 0 | 371 |
43156f04320249b2999a07df3fb80e4552695395 | 1,278 | py | Python | aztk_cli/spark/endpoints/job/delete.py | lachiemurray/aztk | 8d00a2c444313e77b6b0662f8287fcd9fd67898c | [
"MIT"
] | null | null | null | aztk_cli/spark/endpoints/job/delete.py | lachiemurray/aztk | 8d00a2c444313e77b6b0662f8287fcd9fd67898c | [
"MIT"
] | null | null | null | aztk_cli/spark/endpoints/job/delete.py | lachiemurray/aztk | 8d00a2c444313e77b6b0662f8287fcd9fd67898c | [
"MIT"
] | null | null | null | import argparse
import typing
import aztk.spark
from aztk_cli import log, config
| 33.631579 | 100 | 0.611111 | import argparse
import typing
import aztk.spark
from aztk_cli import log, config
def setup_parser(parser: argparse.ArgumentParser):
parser.add_argument('--id',
dest='job_id',
required=True,
help='The unique id of your AZTK Job')
parser.ad... | 1,149 | 0 | 46 |
dea20d08c65d75f519b5060b937d68920ccbea77 | 8,174 | py | Python | masp/spherical_array_processing/evaluate_sht_filters.py | andresperezlopez/masp | c6385b6635b5e86233152ccfea2df15caee6acc7 | [
"BSD-3-Clause"
] | 19 | 2020-06-07T10:58:11.000Z | 2022-02-10T08:48:15.000Z | masp/spherical_array_processing/evaluate_sht_filters.py | andresperezlopez/masp | c6385b6635b5e86233152ccfea2df15caee6acc7 | [
"BSD-3-Clause"
] | null | null | null | masp/spherical_array_processing/evaluate_sht_filters.py | andresperezlopez/masp | c6385b6635b5e86233152ccfea2df15caee6acc7 | [
"BSD-3-Clause"
] | 5 | 2020-06-29T07:12:03.000Z | 2021-11-06T12:25:47.000Z | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Copyright (c) 2019, Eurecat / UPF
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of... | 40.465347 | 139 | 0.630536 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Copyright (c) 2019, Eurecat / UPF
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of... | 0 | 0 | 0 |
ec129eab7264ce4762df078524cdc7e14a10fc29 | 483 | py | Python | backend/flask_app/getData.py | avtansh-code/traffic-congestion | 5bdab6e64fd45ba17eabf18c846cc51e4b3e45fc | [
"MIT"
] | 3 | 2018-04-12T21:10:56.000Z | 2021-01-14T07:14:43.000Z | backend/flask_app/getData.py | avtansh-code/traffic-congestion | 5bdab6e64fd45ba17eabf18c846cc51e4b3e45fc | [
"MIT"
] | null | null | null | backend/flask_app/getData.py | avtansh-code/traffic-congestion | 5bdab6e64fd45ba17eabf18c846cc51e4b3e45fc | [
"MIT"
] | 2 | 2019-10-06T06:38:26.000Z | 2020-12-29T05:06:33.000Z | import pandas as pd
import sys
import math
import requests | 40.25 | 161 | 0.714286 | import pandas as pd
import sys
import math
import requests
def getData():
my_url = "https://firebasestorage.googleapis.com/v0/b/traffic-predictor-233145.appspot.com/o/output.csv?alt=media&token=9b79b904-17ff-4fd0-9637-55844ef9cdf2"
r = requests.get(my_url, allow_redirects=True)
open('output.csv', 'wb').wri... | 402 | 0 | 23 |
07c09b4f3e610e9e9acb328dbcd7cb6d5ad95305 | 707 | py | Python | linkedlist/first_cyclic_node.py | AnshulPatni/Algorithms | c8bcfb86d50f68041921e5140f01821ac12d9521 | [
"MIT"
] | 2 | 2018-04-30T19:31:04.000Z | 2018-05-05T14:29:45.000Z | linkedlist/first_cyclic_node.py | AnshulPatni/Algorithms | c8bcfb86d50f68041921e5140f01821ac12d9521 | [
"MIT"
] | null | null | null | linkedlist/first_cyclic_node.py | AnshulPatni/Algorithms | c8bcfb86d50f68041921e5140f01821ac12d9521 | [
"MIT"
] | 1 | 2018-04-16T12:45:49.000Z | 2018-04-16T12:45:49.000Z | """
Given a linked list, find the first node of a cycle in it.
1 -> 2 -> 3 -> 4 -> 5 -> 1 => 1
A -> B -> C -> D -> E -> C => C
Note: The solution is a direct implementation
Floyd's cycle-finding algorithm (Floyd's Tortoise and Hare).
"""
def firstCyclicNode(head):
"""
:type head: ... | 23.566667 | 70 | 0.5686 | """
Given a linked list, find the first node of a cycle in it.
1 -> 2 -> 3 -> 4 -> 5 -> 1 => 1
A -> B -> C -> D -> E -> C => C
Note: The solution is a direct implementation
Floyd's cycle-finding algorithm (Floyd's Tortoise and Hare).
"""
def firstCyclicNode(head):
"""
:type head: ... | 0 | 0 | 0 |
569b8568f568c9cc9c98f203a6144f0b659dd00e | 2,453 | py | Python | Arduino Robot/PC_Clients/PythonRobotController/RESTPublishClient/RESTClient.py | wso2-incubator/device-cloud-appliances | c91229cede8f0a302446a4ad0aaba7cfd86898cc | [
"Apache-2.0"
] | null | null | null | Arduino Robot/PC_Clients/PythonRobotController/RESTPublishClient/RESTClient.py | wso2-incubator/device-cloud-appliances | c91229cede8f0a302446a4ad0aaba7cfd86898cc | [
"Apache-2.0"
] | null | null | null | Arduino Robot/PC_Clients/PythonRobotController/RESTPublishClient/RESTClient.py | wso2-incubator/device-cloud-appliances | c91229cede8f0a302446a4ad0aaba7cfd86898cc | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
import serial
import time
import requests
import datetime
import thread
import time
bluetoothSerial = serial.Serial( "/dev/tty.HC-06-DevB", baudrate=9600 )
serverIP = "localhost"
serverPort = "8080"
publisherEndpoint = "/ConnectedDevices/pushdata"
#"/pushdata/{ip}/{owner}/{type}/{mac}/{time}/{pin... | 22.504587 | 135 | 0.614757 | #! /usr/bin/python
import serial
import time
import requests
import datetime
import thread
import time
bluetoothSerial = serial.Serial( "/dev/tty.HC-06-DevB", baudrate=9600 )
serverIP = "localhost"
serverPort = "8080"
publisherEndpoint = "/ConnectedDevices/pushdata"
#"/pushdata/{ip}/{owner}/{type}/{mac}/{time}/{pin... | 1,680 | -8 | 117 |
556b37bde6ed7dc092a133d1fa97a7da1e6d3eaf | 1,626 | py | Python | redis/concurrency/threadpool_imgur.py | fengpf/py | 21f18573d97036d2b3796a16436de1895064def0 | [
"MIT"
] | 148 | 2015-03-20T08:50:52.000Z | 2022-02-20T21:18:53.000Z | threadpool_imgur.py | volker48/python-concurrency | 184db1527bbf48c1483cb0657f4696dc953867cb | [
"MIT"
] | 9 | 2015-10-16T09:01:36.000Z | 2022-03-11T23:20:57.000Z | threadpool_imgur.py | gwsu2008/python-concurrency | 252ddb1d7196b8a386dc3dc3564d8da8f30eff28 | [
"MIT"
] | 73 | 2015-03-20T09:31:22.000Z | 2022-01-17T13:10:05.000Z | ####
# This sample is published as part of the blog article at www.toptal.com/blog
# Visit www.toptal.com/blog and subscribe to our newsletter to read great posts
####
import logging
import os
from concurrent.futures import ThreadPoolExecutor
from functools import partial
from time import time
from download import se... | 36.954545 | 122 | 0.730627 | ####
# This sample is published as part of the blog article at www.toptal.com/blog
# Visit www.toptal.com/blog and subscribe to our newsletter to read great posts
####
import logging
import os
from concurrent.futures import ThreadPoolExecutor
from functools import partial
from time import time
from download import se... | 1,057 | 0 | 23 |
4a6c182e6f0778cf4a38745e6fe085b2dadf7e3f | 1,228 | py | Python | userena/middleware.py | mortenwh/django-userena | 6919ffa7764c6a4a493b0be4e624855c22398bfb | [
"BSD-3-Clause"
] | 501 | 2015-01-05T19:45:27.000Z | 2022-03-16T02:56:24.000Z | userena/middleware.py | mortenwh/django-userena | 6919ffa7764c6a4a493b0be4e624855c22398bfb | [
"BSD-3-Clause"
] | 119 | 2015-01-09T08:43:39.000Z | 2018-11-13T16:59:38.000Z | userena/middleware.py | mortenwh/django-userena | 6919ffa7764c6a4a493b0be4e624855c22398bfb | [
"BSD-3-Clause"
] | 202 | 2015-01-06T11:54:56.000Z | 2021-09-03T03:31:33.000Z | from django.utils import translation
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from userena import settings as userena_settings
from userena.compat import SiteProfileNotAvailable
from userena.utils import get_user_profile
class UserenaLocaleMiddleware(object):
"""
... | 37.212121 | 88 | 0.658795 | from django.utils import translation
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from userena import settings as userena_settings
from userena.compat import SiteProfileNotAvailable
from userena.utils import get_user_profile
class UserenaLocaleMiddleware(object):
"""
... | 673 | 0 | 26 |
d8454e302db0e3b89273f2a1027420e601f162e4 | 278 | py | Python | 1_beginner/chapter7/solutions/first_three_words.py | code4tomorrow/Python | 035b6f5d8fd635a16caaff78bcd3f582663dadc3 | [
"MIT"
] | 4 | 2021-03-01T00:32:45.000Z | 2021-05-21T22:01:52.000Z | 1_beginner/chapter7/solutions/first_three_words.py | code4tomorrow/Python | 035b6f5d8fd635a16caaff78bcd3f582663dadc3 | [
"MIT"
] | 29 | 2020-09-12T22:56:04.000Z | 2021-09-25T17:08:42.000Z | 1_beginner/chapter7/solutions/first_three_words.py | code4tomorrow/Python | 035b6f5d8fd635a16caaff78bcd3f582663dadc3 | [
"MIT"
] | 7 | 2021-02-25T01:50:55.000Z | 2022-02-28T00:00:42.000Z | """
First Three Words
Write a program which asks
the user to enter a sentence.
Print the first three words in the sentence.
(Assume the user enters at least 3 words.)
"""
sentence = input("Enter a sentence: ")
words = sentence.split()
for word in words[:3]:
print(word)
| 17.375 | 44 | 0.708633 | """
First Three Words
Write a program which asks
the user to enter a sentence.
Print the first three words in the sentence.
(Assume the user enters at least 3 words.)
"""
sentence = input("Enter a sentence: ")
words = sentence.split()
for word in words[:3]:
print(word)
| 0 | 0 | 0 |
b6b6f58927be4d96e344bc459e393288445d1051 | 404 | py | Python | Employment_System/apps/users/migrations/0002_user_imgurl.py | rui1106/Graduation_Project | 77457588f82cfa8c35b74fc60ec3c1ffd5271600 | [
"CC0-1.0"
] | null | null | null | Employment_System/apps/users/migrations/0002_user_imgurl.py | rui1106/Graduation_Project | 77457588f82cfa8c35b74fc60ec3c1ffd5271600 | [
"CC0-1.0"
] | null | null | null | Employment_System/apps/users/migrations/0002_user_imgurl.py | rui1106/Graduation_Project | 77457588f82cfa8c35b74fc60ec3c1ffd5271600 | [
"CC0-1.0"
] | null | null | null | # Generated by Django 2.2.5 on 2022-03-02 12:32
from django.db import migrations, models
| 21.263158 | 85 | 0.591584 | # Generated by Django 2.2.5 on 2022-03-02 12:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='ImgUrl',
field=m... | 0 | 294 | 23 |
81d2cae57ab8e0815f198becb724e531a46d96fe | 3,183 | py | Python | gtkssw.py | dmitriiweb/Stopwatch | f8b1921da6b6a823e6d874cc5fe3fe5c366d2f06 | [
"MIT"
] | 1 | 2020-11-09T10:44:16.000Z | 2020-11-09T10:44:16.000Z | gtkssw.py | dmitriiweb/Stopwatch | f8b1921da6b6a823e6d874cc5fe3fe5c366d2f06 | [
"MIT"
] | null | null | null | gtkssw.py | dmitriiweb/Stopwatch | f8b1921da6b6a823e6d874cc5fe3fe5c366d2f06 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import datetime
import os
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GObject
BASEDIR = os.path.dirname(os.path.abspath(__file__))
if __name__ == '__main__':
win = StopWatch()
icon_path = os.path.join(BASEDIR, 'stopwatch.png')
win.set_icon_from_file... | 32.151515 | 98 | 0.650016 | #!/usr/bin/env python3
import datetime
import os
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GObject
BASEDIR = os.path.dirname(os.path.abspath(__file__))
class StopWatch(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title='Stopwatch')
self.create_variab... | 2,503 | 7 | 265 |
d325bb8b5bd131bccf2d5094bfd89865d38cb9f5 | 417 | py | Python | blog/migrations/0004_blogpost_image.py | skynette/CSMD | 8b3f90adad2d18569ef44b235a1213c547f94f22 | [
"CC-BY-3.0"
] | null | null | null | blog/migrations/0004_blogpost_image.py | skynette/CSMD | 8b3f90adad2d18569ef44b235a1213c547f94f22 | [
"CC-BY-3.0"
] | null | null | null | blog/migrations/0004_blogpost_image.py | skynette/CSMD | 8b3f90adad2d18569ef44b235a1213c547f94f22 | [
"CC-BY-3.0"
] | null | null | null | # Generated by Django 3.0.6 on 2021-01-10 17:55
from django.db import migrations, models
| 21.947368 | 89 | 0.592326 | # Generated by Django 3.0.6 on 2021-01-10 17:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_blogpost_views'),
]
operations = [
migrations.AddField(
model_name='blogpost',
name='image',
... | 0 | 303 | 23 |
6771a7c9409ba16d21ba2ac2dc43bc32f72bf439 | 2,565 | py | Python | apps/student_mgmt/app.py | PrasadHonrao/python-samples | faa48aa3eaf2d67b8cef0114e1f6ef08e2c1300a | [
"MIT"
] | 3 | 2018-08-20T13:00:01.000Z | 2021-09-18T04:19:46.000Z | apps/student_mgmt/app.py | PrasadHonrao/python-samples | faa48aa3eaf2d67b8cef0114e1f6ef08e2c1300a | [
"MIT"
] | 1 | 2021-06-25T20:25:02.000Z | 2021-08-19T22:44:31.000Z | apps/student_mgmt/app.py | PrasadHonrao/python-samples | faa48aa3eaf2d67b8cef0114e1f6ef08e2c1300a | [
"MIT"
] | 1 | 2021-09-18T23:51:20.000Z | 2021-09-18T23:51:20.000Z | """
Student management module
"""
students = []
def get_student_title_case() -> str:
"""
Function to return student name in title case
:return: student name
"""
students_title_case = []
for student in students:
students_title_case.append(student["name"].title())
retur... | 26.173469 | 81 | 0.65575 | """
Student management module
"""
students = []
def get_student_title_case() -> str:
"""
Function to return student name in title case
:return: student name
"""
students_title_case = []
for student in students:
students_title_case.append(student["name"].title())
retur... | 0 | 0 | 0 |
f0ad7e1d335e7dbc804e10acdfb62405c8e28311 | 1,096 | py | Python | rllib/utils/spaces/repeated.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 22 | 2018-05-08T05:52:34.000Z | 2020-04-01T10:09:55.000Z | rllib/utils/spaces/repeated.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 73 | 2021-09-25T07:11:39.000Z | 2022-03-26T07:10:59.000Z | rllib/utils/spaces/repeated.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 10 | 2018-04-27T10:50:59.000Z | 2020-02-24T02:41:43.000Z | import gym
import numpy as np
from ray.rllib.utils.annotations import PublicAPI
@PublicAPI
class Repeated(gym.Space):
"""Represents a variable-length list of child spaces.
Example:
self.observation_space = spaces.Repeated(spaces.Box(4,), max_len=10)
--> from 0 to 10 boxes of shape (4,)
... | 28.102564 | 76 | 0.623175 | import gym
import numpy as np
from ray.rllib.utils.annotations import PublicAPI
@PublicAPI
class Repeated(gym.Space):
"""Represents a variable-length list of child spaces.
Example:
self.observation_space = spaces.Repeated(spaces.Box(4,), max_len=10)
--> from 0 to 10 boxes of shape (4,)
... | 511 | 0 | 108 |
f188b0989d76a3e9d827b499042fb58f173865f0 | 1,334 | py | Python | scripts/common_features.py | kdelwat/LangEvolve | 6e400f9e3d7ff7bc0dce0d1db0af3682b2ad0e01 | [
"MIT"
] | 29 | 2016-12-18T08:44:26.000Z | 2022-03-20T09:39:22.000Z | scripts/common_features.py | kdelwat/LangEvolve | 6e400f9e3d7ff7bc0dce0d1db0af3682b2ad0e01 | [
"MIT"
] | 11 | 2016-11-22T01:13:11.000Z | 2022-03-04T21:21:15.000Z | scripts/common_features.py | kdelwat/LangEvolve | 6e400f9e3d7ff7bc0dce0d1db0af3682b2ad0e01 | [
"MIT"
] | 5 | 2017-02-07T08:54:49.000Z | 2022-01-13T15:23:45.000Z | # common_features.py
# Invoke on the command line like: python common_features.py pbtd
# Outputs all features common to all of the given segments, to help
# in rule writing.
from tabulate import tabulate
import csv
import sys
import os.path as path
base_directory = path.dirname(path.dirname(path.abspath(__file__)))
s... | 31.023256 | 79 | 0.66042 | # common_features.py
# Invoke on the command line like: python common_features.py pbtd
# Outputs all features common to all of the given segments, to help
# in rule writing.
from tabulate import tabulate
import csv
import sys
import os.path as path
base_directory = path.dirname(path.dirname(path.abspath(__file__)))
s... | 647 | 0 | 23 |
eb7f5a8a820668422a863c8028972cebdb13707d | 8,150 | py | Python | simplemud.py | alexandershuping/MuddySwamp | c9fea7f9b5b0c372afdffdbc24f29eb90fd5881d | [
"MIT"
] | null | null | null | simplemud.py | alexandershuping/MuddySwamp | c9fea7f9b5b0c372afdffdbc24f29eb90fd5881d | [
"MIT"
] | null | null | null | simplemud.py | alexandershuping/MuddySwamp | c9fea7f9b5b0c372afdffdbc24f29eb90fd5881d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import time
import sys
# import the MUD server class
from mudserver import MudServer, Event, EventType
#prints to stderr
VERBOSE_PRINT = False
# structure defining the rooms in the game. Try adding more rooms to the game!
rooms = {
"Tavern": {
"description": "You're in a cozy taver... | 43.351064 | 89 | 0.480613 | #!/usr/bin/env python
import time
import sys
# import the MUD server class
from mudserver import MudServer, Event, EventType
#prints to stderr
def err_print(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
VERBOSE_PRINT = False
def v_print(*args, **kwargs):
if VERBOSE_PRINT:
err_print(*args, **kwargs)
... | 107 | 0 | 44 |
67e72487e0c252d181d62a1ff9eaf9df986e0154 | 322 | py | Python | shopit/forms/flag.py | dinoperovic/djangoshop-shopit | b42a2bf0ec319817eb37ef939608b04498fc4ff2 | [
"BSD-3-Clause"
] | 14 | 2016-11-25T16:06:20.000Z | 2018-08-30T19:20:41.000Z | shopit/forms/flag.py | dinoperovic/djangoshop-shopit | b42a2bf0ec319817eb37ef939608b04498fc4ff2 | [
"BSD-3-Clause"
] | 3 | 2017-04-14T13:18:22.000Z | 2018-07-18T11:34:53.000Z | shopit/forms/flag.py | dinoperovic/django-shop | b42a2bf0ec319817eb37ef939608b04498fc4ff2 | [
"BSD-3-Clause"
] | 6 | 2019-04-07T23:52:54.000Z | 2020-09-20T05:30:07.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from mptt.forms import MPTTAdminForm
from parler.forms import TranslatableModelForm
from shopit.models.flag import Flag
| 23 | 58 | 0.751553 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from mptt.forms import MPTTAdminForm
from parler.forms import TranslatableModelForm
from shopit.models.flag import Flag
class FlagModelForm(MPTTAdminForm, TranslatableModelForm):
class Meta:
model = Flag
exclude = [... | 0 | 95 | 23 |
4a45ce3726c6ff7902572a389f2c5f6afdff316e | 4,066 | py | Python | Nesting software/sheet.py | prasadbhatane/Nesting_Software_and_Automated_Marker | 4d75bb799c17376845d2a5a60c046d9ef5c27011 | [
"Apache-2.0"
] | 1 | 2020-12-12T01:06:15.000Z | 2020-12-12T01:06:15.000Z | Nesting software/sheet.py | prasadbhatane/Nesting_Software_and_Automated_Marker | 4d75bb799c17376845d2a5a60c046d9ef5c27011 | [
"Apache-2.0"
] | 1 | 2020-12-14T00:36:12.000Z | 2021-01-17T05:35:39.000Z | Nesting software/sheet.py | prasadbhatane/Nesting_Software_and_Automated_Marker | 4d75bb799c17376845d2a5a60c046d9ef5c27011 | [
"Apache-2.0"
] | 2 | 2020-10-27T08:19:50.000Z | 2021-08-30T03:31:34.000Z | from point import Point
from rectangle import Rectangle
from utils import areOverlapping
| 36.630631 | 116 | 0.511559 | from point import Point
from rectangle import Rectangle
from utils import areOverlapping
class Sheet:
def __init__(self, length, breadth):
self.length = length
self.breadth = breadth
self.area = length * breadth
self.cornerPoints = set() # contains tuples (x, y)
... | 3,813 | -9 | 168 |
e42b7212e9b3fc61daf5b1358fef5f37df1dac80 | 1,623 | py | Python | re_findall.py | akiselev1/hackerrank-solutions | 53c2a76c71c9b3553c077ccfde5178b27594ae72 | [
"MIT"
] | null | null | null | re_findall.py | akiselev1/hackerrank-solutions | 53c2a76c71c9b3553c077ccfde5178b27594ae72 | [
"MIT"
] | null | null | null | re_findall.py | akiselev1/hackerrank-solutions | 53c2a76c71c9b3553c077ccfde5178b27594ae72 | [
"MIT"
] | null | null | null | """
Created by akiselev on 2019-06-13
re.findall()
The expression re.findall() returns all the non-overlapping matches of patterns in a string as a list of strings.
Code
>>> import re
>>> re.findall(r'\w','http://www.hackerrank.com/')
['h', 't', 't', 'p', 'w', 'w', 'w', 'h', 'a', 'c', 'k', 'e', 'r', 'r', 'a', 'n... | 24.969231 | 146 | 0.676525 | """
Created by akiselev on 2019-06-13
re.findall()
The expression re.findall() returns all the non-overlapping matches of patterns in a string as a list of strings.
Code
>>> import re
>>> re.findall(r'\w','http://www.hackerrank.com/')
['h', 't', 't', 'p', 'w', 'w', 'w', 'h', 'a', 'c', 'k', 'e', 'r', 'r', 'a', 'n... | 0 | 0 | 0 |
ddc3ae83023e4553b939bfb770711ae4531a84d8 | 3,120 | py | Python | launcher.py | nomanbaig98/syntax-analyzer-python | 426d4890603c6075d126217718ed413a065aad42 | [
"MIT"
] | null | null | null | launcher.py | nomanbaig98/syntax-analyzer-python | 426d4890603c6075d126217718ed413a065aad42 | [
"MIT"
] | null | null | null | launcher.py | nomanbaig98/syntax-analyzer-python | 426d4890603c6075d126217718ed413a065aad42 | [
"MIT"
] | null | null | null | from antlr4 import FileStream, CommonTokenStream
from src.Python3Lexer import Python3Lexer
from src.Python3Parser import Python3Parser
from antlr4.tree.Tree import TerminalNodeImpl
from antlr4.error.ErrorListener import ErrorListener
import json
class FileErrorListener(ErrorListener):
"""Class for storing errors ... | 27.610619 | 79 | 0.674038 | from antlr4 import FileStream, CommonTokenStream
from src.Python3Lexer import Python3Lexer
from src.Python3Parser import Python3Parser
from antlr4.tree.Tree import TerminalNodeImpl
from antlr4.error.ErrorListener import ErrorListener
import json
class FileErrorListener(ErrorListener):
"""Class for storing errors ... | 402 | 0 | 77 |
5319ef793827510e97e9ddc010233d47d84e71ec | 334 | py | Python | tridentstream/dbs/memory/handler.py | tridentstream/mediaserver | 5d47d766df2e8dca076e41348062567a569019fd | [
"MIT"
] | 6 | 2020-01-03T14:50:09.000Z | 2021-09-13T01:44:31.000Z | tridentstream/dbs/memory/handler.py | tidalstream/mediaserver | 5d47d766df2e8dca076e41348062567a569019fd | [
"MIT"
] | null | null | null | tridentstream/dbs/memory/handler.py | tidalstream/mediaserver | 5d47d766df2e8dca076e41348062567a569019fd | [
"MIT"
] | null | null | null | from unplugged import Schema
from ...plugins import DatabasePlugin
| 15.181818 | 49 | 0.637725 | from unplugged import Schema
from ...plugins import DatabasePlugin
class MemoryDatabasePlugin(dict, DatabasePlugin):
plugin_name = "memory"
config_schema = Schema
def __init__(self, config):
pass
def unload(self):
self.clear()
def sync(self):
pass
def close(self):... | 51 | 191 | 23 |
1c9de91a508d69159b4450a7cb1f1f58bb9f5d59 | 1,885 | py | Python | StateMainMenu.py | Exs1de/TicTacToe | 0119ab798b1c04cd1d003c9c95591415d1576156 | [
"MIT"
] | 1 | 2019-04-29T19:41:12.000Z | 2019-04-29T19:41:12.000Z | StateMainMenu.py | Exs1de/TicTacToe | 0119ab798b1c04cd1d003c9c95591415d1576156 | [
"MIT"
] | null | null | null | StateMainMenu.py | Exs1de/TicTacToe | 0119ab798b1c04cd1d003c9c95591415d1576156 | [
"MIT"
] | null | null | null | import GUI
from GUI import root, tk, MyButton
import ButtonClickHandler as BH
from ButtonClickHandler import MainMenuButtons as M
| 38.469388 | 83 | 0.46313 | import GUI
from GUI import root, tk, MyButton
import ButtonClickHandler as BH
from ButtonClickHandler import MainMenuButtons as M
class StateMainMenu(object):
def __init__(self):
GUI.root.title("TIC TAC TOE")
self.GAME_WIDTH = GUI.GAME_WIDTH
self.GAME_HEIGHT = GUI.GAME_HEIGHT
... | 1,690 | 7 | 52 |
ea5999e87cc8e8afb85868ea9a64bdbb2d0d5632 | 3,824 | py | Python | project/optimizer.py | AnyByte/ErgoKB | 4aa192b0e23872681fa3a3bab4706408aeac6619 | [
"MIT"
] | null | null | null | project/optimizer.py | AnyByte/ErgoKB | 4aa192b0e23872681fa3a3bab4706408aeac6619 | [
"MIT"
] | 3 | 2020-03-14T14:54:25.000Z | 2021-12-13T20:31:53.000Z | project/optimizer.py | AnyByte/ErgoKB | 4aa192b0e23872681fa3a3bab4706408aeac6619 | [
"MIT"
] | null | null | null | import random
from copy import deepcopy
| 37.490196 | 119 | 0.653766 | import random
from copy import deepcopy
class Optimizer:
def __init__(self):
self.results = []
self.best_index = 0
self.min_score = 0
self.last_score = 0
self.consequent_bad_score_count = 0
self.consequent_score_count = 0
self.last_min_score = 0
sel... | 4,247 | -5 | 103 |
1bf19843567acc9a0e6fa51958307c151fa4cdf0 | 503 | py | Python | mediafeed/api/server.py | media-feed/mediafeed | c2fb37b20a5bc41a4299193fa9b11f8a3e3b2acf | [
"MIT"
] | null | null | null | mediafeed/api/server.py | media-feed/mediafeed | c2fb37b20a5bc41a4299193fa9b11f8a3e3b2acf | [
"MIT"
] | null | null | null | mediafeed/api/server.py | media-feed/mediafeed | c2fb37b20a5bc41a4299193fa9b11f8a3e3b2acf | [
"MIT"
] | null | null | null | import os
from bottle import Bottle, response
from whitenoise import WhiteNoise
from ..settings import DATA_PATH
api = Bottle()
@api.hook('after_request')
application = WhiteNoise(api)
application.add_files(os.path.join(DATA_PATH, 'thumbnails'), prefix='thumbnails/')
application.add_files(os.path.join(DATA_PATH... | 23.952381 | 82 | 0.747515 | import os
from bottle import Bottle, response
from whitenoise import WhiteNoise
from ..settings import DATA_PATH
api = Bottle()
@api.hook('after_request')
def enable_cors():
response.headers['Access-Control-Allow-Origin'] = '*'
response.headers['Access-Control-Allow-Methods'] = 'GET, POST, DELETE'
appli... | 130 | 0 | 22 |
f0821f7691b0cefe6e266ce8feb7fa9ca9ca7209 | 300 | py | Python | katas/kyu_7/what_is_my_name_score_1.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | katas/kyu_7/what_is_my_name_score_1.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | katas/kyu_7/what_is_my_name_score_1.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | # for testing only, 'alpha' is included in the preloaded section on Codewars
alpha = {'ABCDE': 1, 'FGHIJ': 2, 'KLMNO': 3, 'PQRST': 4, 'UVWXY': 5}
| 37.5 | 76 | 0.643333 | # for testing only, 'alpha' is included in the preloaded section on Codewars
alpha = {'ABCDE': 1, 'FGHIJ': 2, 'KLMNO': 3, 'PQRST': 4, 'UVWXY': 5}
def name_score(name):
scores = {k: v for keys, v in alpha.iteritems() for k in keys}
return {name: sum(scores.get(a, 0) for a in name.upper())}
| 130 | 0 | 23 |
2875aa0e22df649277cae1742669f39f25d038f2 | 1,932 | py | Python | qdk/qdk/chemistry/broombridge.py | Anatoliy-Litvinenko/qdk-python | 74b2638a404717424090023ef49afb3045ea920e | [
"MIT"
] | 53 | 2021-01-21T23:38:09.000Z | 2022-03-29T16:34:42.000Z | qdk/qdk/chemistry/broombridge.py | Anatoliy-Litvinenko/qdk-python | 74b2638a404717424090023ef49afb3045ea920e | [
"MIT"
] | 152 | 2021-01-23T07:01:49.000Z | 2022-03-31T19:43:21.000Z | qdk/qdk/chemistry/broombridge.py | slowy07/qdk-python | e4ce0c433cc986bc1c746e9a58f3f05733c657e2 | [
"MIT"
] | 47 | 2021-01-30T20:15:46.000Z | 2022-03-25T23:35:28.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
##
# Module for loading and encoding Broombridge data
##
import logging
from qsharp.chemistry import load_broombridge, load_input_state, encode
from typing import List, Tuple
NumQubits = int
HamiltonianTermList = Tuple[List[Tuple[List[int], List... | 29.723077 | 79 | 0.728778 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
##
# Module for loading and encoding Broombridge data
##
import logging
from qsharp.chemistry import load_broombridge, load_input_state, encode
from typing import List, Tuple
NumQubits = int
HamiltonianTermList = Tuple[List[Tuple[List[int], List... | 0 | 0 | 0 |
262be4baffa1f0ba78fdcc51038b21e05e64bc18 | 193 | py | Python | TSIS5/10.py | ayazhan112/python- | fba09ecc25e11dbfb116f273838b13174f66126d | [
"MIT"
] | null | null | null | TSIS5/10.py | ayazhan112/python- | fba09ecc25e11dbfb116f273838b13174f66126d | [
"MIT"
] | null | null | null | TSIS5/10.py | ayazhan112/python- | fba09ecc25e11dbfb116f273838b13174f66126d | [
"MIT"
] | null | null | null | from collections import Counter
print('Number of words:', word_count('test.txt'))
| 27.571429 | 50 | 0.668394 | from collections import Counter
def word_count(file_name):
with open(file_name, 'r') as f:
return Counter(f.read().split())
print('Number of words:', word_count('test.txt'))
| 84 | 0 | 23 |
510971622a2d34c62749680ee58612a8430d1019 | 7,136 | py | Python | torchreid/engine/image/triplet.py | Vill-Lab/IGOAS | 42ca1d45e441f993c95b5e8f33c9f97ea3b916f3 | [
"MIT"
] | 8 | 2021-05-27T10:19:28.000Z | 2021-10-15T12:38:04.000Z | torchreid/engine/image/triplet.py | Vill-Lab/IGOAS | 42ca1d45e441f993c95b5e8f33c9f97ea3b916f3 | [
"MIT"
] | 3 | 2021-06-23T12:06:39.000Z | 2021-09-12T08:40:44.000Z | torchreid/engine/image/triplet.py | Vill-Lab/IGOAS | 42ca1d45e441f993c95b5e8f33c9f97ea3b916f3 | [
"MIT"
] | 6 | 2021-05-27T10:19:18.000Z | 2021-11-13T12:02:17.000Z | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import time
import datetime
import torch
import torchreid
from torchreid.engine import engine
from torchreid.losses import CrossEntropyLoss, TripletLoss, HctLoss
from torchreid.utils import AverageMeter, open... | 38.160428 | 120 | 0.582399 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import time
import datetime
import torch
import torchreid
from torchreid.engine import engine
from torchreid.losses import CrossEntropyLoss, TripletLoss, HctLoss
from torchreid.utils import AverageMeter, open... | 4,726 | 0 | 54 |
11bdfe506c8bdf705d13a3bfae5ffc73fd0be948 | 1,335 | py | Python | HSCTF2021/Crypto/opisthocomus-hoazin.py | yl-ang/CTF | a075231a3dc32630a26f3b2d4dfc1dd9b9f1e0b9 | [
"MIT"
] | null | null | null | HSCTF2021/Crypto/opisthocomus-hoazin.py | yl-ang/CTF | a075231a3dc32630a26f3b2d4dfc1dd9b9f1e0b9 | [
"MIT"
] | null | null | null | HSCTF2021/Crypto/opisthocomus-hoazin.py | yl-ang/CTF | a075231a3dc32630a26f3b2d4dfc1dd9b9f1e0b9 | [
"MIT"
] | 3 | 2021-06-28T09:52:07.000Z | 2021-09-22T03:28:40.000Z | # crypto/opisthocomus-hoazin
e, n = (65537, 15888457769674642859708800597310299725338251830976423740469342107745469667544014118426981955901595652146093596535042454720088489883832573612094938281276141337632202496209218136026441342435018861975571842724577501821204305185018320446993699281538507826943542962060000957702417... | 222.5 | 633 | 0.836704 | # crypto/opisthocomus-hoazin
e, n = (65537, 15888457769674642859708800597310299725338251830976423740469342107745469667544014118426981955901595652146093596535042454720088489883832573612094938281276141337632202496209218136026441342435018861975571842724577501821204305185018320446993699281538507826943542962060000957702417... | 0 | 0 | 0 |
a9312b6a278eb78e59ba06e693a5e9f1f7d1cb2c | 284 | py | Python | problem/01000~09999/02511/2511.pypy3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 1 | 2019-04-19T16:37:44.000Z | 2019-04-19T16:37:44.000Z | problem/01000~09999/02511/2511.pypy3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 1 | 2019-04-20T11:42:44.000Z | 2019-04-20T11:42:44.000Z | problem/01000~09999/02511/2511.pypy3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 3 | 2019-04-19T16:37:47.000Z | 2021-10-25T00:45:00.000Z | a,b,A,B,l=list(map(int, input().split())), list(map(int, input().split())),0,0,0
for i in range(10): (A,B,l) = (A+3,B,1) if a[i]>b[i] else (A,B+3,2) if a[i]<b[i] else (A+1,B+1,l)
print('{} {}\n{}'.format(A,B, 'A' if A>B or (A==B and l==1) else 'B' if A<B or (A==B and l==2) else 'D')) | 94.666667 | 105 | 0.521127 | a,b,A,B,l=list(map(int, input().split())), list(map(int, input().split())),0,0,0
for i in range(10): (A,B,l) = (A+3,B,1) if a[i]>b[i] else (A,B+3,2) if a[i]<b[i] else (A+1,B+1,l)
print('{} {}\n{}'.format(A,B, 'A' if A>B or (A==B and l==1) else 'B' if A<B or (A==B and l==2) else 'D')) | 0 | 0 | 0 |
70ac7ff92d4189250299cb7c47f28f8a6c285c49 | 1,452 | py | Python | kombu_aliyun_mqs/aliyun_mqs/mqs_exception.py | YuelianINC/kombu-aliyun-mqs | c385e256c9c020effde03f10bb73f323e4548973 | [
"Apache-2.0"
] | 1 | 2017-04-20T03:43:08.000Z | 2017-04-20T03:43:08.000Z | kombu_aliyun_mqs/aliyun_mqs/mqs_exception.py | YuelianINC/kombu-aliyun-mqs | c385e256c9c020effde03f10bb73f323e4548973 | [
"Apache-2.0"
] | null | null | null | kombu_aliyun_mqs/aliyun_mqs/mqs_exception.py | YuelianINC/kombu-aliyun-mqs | c385e256c9c020effde03f10bb73f323e4548973 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
| 30.893617 | 68 | 0.65427 | # -*- coding: utf-8 -*-
class MQSExceptionBase(Exception):
def __init__(self, type, message):
self.type = type
self.message = message
def get_info(self):
return "(\"%s\" \"%s\")\n" % (self.type, self.message)
def __str__(self):
return "MQSExceptionBase %s" % (self.get_inf... | 856 | 121 | 442 |
3f4387a58d4f1914a658e49891ce4cb5c24e3ba2 | 7,610 | py | Python | apps/python/MiTuner_socket_server.py | UBTEDU/ZLK38AVS | 050ac1d98fbb65bd5bacd4e2024a65a4465a5731 | [
"MIT"
] | 1 | 2020-03-30T05:50:08.000Z | 2020-03-30T05:50:08.000Z | apps/python/MiTuner_socket_server.py | UBTEDU/ZLK38AVS | 050ac1d98fbb65bd5bacd4e2024a65a4465a5731 | [
"MIT"
] | null | null | null | apps/python/MiTuner_socket_server.py | UBTEDU/ZLK38AVS | 050ac1d98fbb65bd5bacd4e2024a65a4465a5731 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# MiTuner_socket_server.py -- Python 2.7 socket server to be used with MiTuner Bridge
# Copyright 2018 Microsemi Inc. All rights reserved.
#Licensed under the MIT License. See LICENSE.txt in the project root for license information.
from os.path import dirname, realpath, isfile
import argpars... | 31.446281 | 147 | 0.508936 | #!/usr/bin/env python
# MiTuner_socket_server.py -- Python 2.7 socket server to be used with MiTuner Bridge
# Copyright 2018 Microsemi Inc. All rights reserved.
#Licensed under the MIT License. See LICENSE.txt in the project root for license information.
from os.path import dirname, realpath, isfile
import argpars... | 3,623 | 0 | 220 |
4c89e38833d63e400656e1c2d7eb7aca26967cc1 | 314 | py | Python | privacy_evaluator/datasets/tf/cifar10.py | chen-yuxuan/privacy-evaluator | ed4852408108c3e6a01216af4183261945fd7e67 | [
"MIT"
] | 7 | 2021-04-10T15:01:19.000Z | 2022-02-08T14:45:21.000Z | privacy_evaluator/datasets/tf/cifar10.py | chen-yuxuan/privacy-evaluator | ed4852408108c3e6a01216af4183261945fd7e67 | [
"MIT"
] | 175 | 2021-04-13T08:32:27.000Z | 2021-08-30T09:44:51.000Z | privacy_evaluator/datasets/tf/cifar10.py | chen-yuxuan/privacy-evaluator | ed4852408108c3e6a01216af4183261945fd7e67 | [
"MIT"
] | 21 | 2021-04-13T08:03:36.000Z | 2021-10-05T15:35:01.000Z | import tensorflow as tf
from .tf import TFDataset
class TFCIFAR10(TFDataset):
"""`TFCIFAR10` class.
Represents a CIFAR10 dataset class for TensorFlow.
"""
TF_MODULE = tf.keras.datasets.cifar10
DATASET_SIZE = {"train": 50000, "test": 10000}
INPUT_SHAPE = (32, 32, 3)
N_CLASSES = 10
| 19.625 | 54 | 0.66879 | import tensorflow as tf
from .tf import TFDataset
class TFCIFAR10(TFDataset):
"""`TFCIFAR10` class.
Represents a CIFAR10 dataset class for TensorFlow.
"""
TF_MODULE = tf.keras.datasets.cifar10
DATASET_SIZE = {"train": 50000, "test": 10000}
INPUT_SHAPE = (32, 32, 3)
N_CLASSES = 10
| 0 | 0 | 0 |
c660ad90eae4fb538c71d5a8dc812c1fba056f81 | 4,732 | py | Python | signing.py | tsunghowu/DiskImageCreator | b56d6cdf20fcedc70f64f1a89a73934460ac9973 | [
"MIT"
] | 1 | 2021-03-07T12:13:58.000Z | 2021-03-07T12:13:58.000Z | signing.py | tsunghowu/DiskImageCreator | b56d6cdf20fcedc70f64f1a89a73934460ac9973 | [
"MIT"
] | null | null | null | signing.py | tsunghowu/DiskImageCreator | b56d6cdf20fcedc70f64f1a89a73934460ac9973 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# File name: name.py
import sys
import json
import os
import rsa
import struct
import json
from block import *
from controlblock import *
base = [str(x) for x in range(10)] + [chr(x) for x in range(ord('A'), ord('A') + 6)]
if __name__ == '__main__':
print 'Signing Tool for the new Secure Boo... | 36.682171 | 105 | 0.560862 | #!/usr/bin/env python
# File name: name.py
import sys
import json
import os
import rsa
import struct
import json
from block import *
from controlblock import *
base = [str(x) for x in range(10)] + [chr(x) for x in range(ord('A'), ord('A') + 6)]
def object_compare(x, y): #used for compare key in dict.
if x['Seq']... | 179 | 0 | 23 |
91ed008cb5ddfd5bd67892c75d563cdad9ee65b3 | 11,416 | py | Python | tools/android/loading/analyze.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | tools/android/loading/analyze.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | tools/android/loading/analyze.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | #! /usr/bin/python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import cgi
import json
import logging
import os
import subprocess
import sys
import tempfile
import time
_SRC_DIR = os.pa... | 33.576471 | 80 | 0.689296 | #! /usr/bin/python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import cgi
import json
import logging
import os
import subprocess
import sys
import tempfile
import time
_SRC_DIR = os.pa... | 5,718 | 0 | 253 |
e81227345046c3387bafe57f51f7ca3bcc8dc923 | 2,675 | py | Python | ding/worker/coordinator/resource_manager.py | sailxjx/DI-engine | c6763f8e2ba885a2a02f611195a1b5f8b50bff00 | [
"Apache-2.0"
] | 464 | 2021-07-08T07:26:33.000Z | 2022-03-31T12:35:16.000Z | ding/worker/coordinator/resource_manager.py | sailxjx/DI-engine | c6763f8e2ba885a2a02f611195a1b5f8b50bff00 | [
"Apache-2.0"
] | 177 | 2021-07-09T08:22:55.000Z | 2022-03-31T07:35:22.000Z | ding/worker/coordinator/resource_manager.py | sailxjx/DI-engine | c6763f8e2ba885a2a02f611195a1b5f8b50bff00 | [
"Apache-2.0"
] | 92 | 2021-07-08T12:16:37.000Z | 2022-03-31T09:24:41.000Z | import random
class NaiveResourceManager(object):
r"""
Overview:
the naive resource manager
Interface:
__init__, assign_collector, assign_learner, update
"""
def __init__(self) -> None:
r"""
Overview:
init the resouce manager
"""
self._w... | 37.152778 | 80 | 0.617196 | import random
class NaiveResourceManager(object):
r"""
Overview:
the naive resource manager
Interface:
__init__, assign_collector, assign_learner, update
"""
def __init__(self) -> None:
r"""
Overview:
init the resouce manager
"""
self._w... | 582 | 0 | 54 |
86fa212ba13d057b37a3828ca0036bad8f61bb80 | 523 | py | Python | database/serializers.py | taixingbi/tmp | e3f941f04f08279df59ef016debfe7eb826fc639 | [
"MIT"
] | null | null | null | database/serializers.py | taixingbi/tmp | e3f941f04f08279df59ef016debfe7eb826fc639 | [
"MIT"
] | 7 | 2020-06-06T01:22:35.000Z | 2022-02-10T10:22:37.000Z | database/serializers.py | taixingbi/tmp | e3f941f04f08279df59ef016debfe7eb826fc639 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Ml_test
#from .models import Account, Teleconference_transcribe
from rest_framework import filters
# class Teleconference_transcribeSerializer(serializers.HyperlinkedModelSerializer):
# class Meta:
# model = Teleconference_transcribe
# fi... | 32.6875 | 84 | 0.759082 | from rest_framework import serializers
from .models import Ml_test
#from .models import Account, Teleconference_transcribe
from rest_framework import filters
class Ml_testSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Ml_test
fields = ['email', 'name']
# class Teleconfer... | 0 | 118 | 23 |
a4be4402db5e8948e7572b20983b2d63d21cfd9c | 11,313 | py | Python | update.py | Hmaksu/Zoom-Duration-Calculator | 118dbc17997b54f398914fb399ca2c882b0d0969 | [
"MIT"
] | null | null | null | update.py | Hmaksu/Zoom-Duration-Calculator | 118dbc17997b54f398914fb399ca2c882b0d0969 | [
"MIT"
] | null | null | null | update.py | Hmaksu/Zoom-Duration-Calculator | 118dbc17997b54f398914fb399ca2c882b0d0969 | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import filedialog
from tkinter.ttk import *
import os
import xlrd
import xlsxwriter
root = Tk()
root.title("CivilCon")
root.iconbitmap("CC.ico")
root.geometry("500x500")
e = CivilCon(root)
root.mainloop()
| 45.616935 | 497 | 0.455847 | from tkinter import *
from tkinter import filedialog
from tkinter.ttk import *
import os
import xlrd
import xlsxwriter
root = Tk()
root.title("CivilCon")
root.iconbitmap("CC.ico")
root.geometry("500x500")
class CivilCon:
def __init__(self, master): #First Page
self.master = master
... | 10,907 | -6 | 157 |
7c1a8a729126d66fb236ad7b867867032e450e54 | 6,836 | py | Python | tools/svctool/svctool.py | ricaun/basicmac | 69e55e953b652ef26e52819ab77559e4a81baf70 | [
"BSD-3-Clause"
] | 1 | 2021-11-27T22:56:15.000Z | 2021-11-27T22:56:15.000Z | tools/svctool/svctool.py | ricaun/basicmac | 69e55e953b652ef26e52819ab77559e4a81baf70 | [
"BSD-3-Clause"
] | null | null | null | tools/svctool/svctool.py | ricaun/basicmac | 69e55e953b652ef26e52819ab77559e4a81baf70 | [
"BSD-3-Clause"
] | 1 | 2021-04-03T09:55:58.000Z | 2021-04-03T09:55:58.000Z | #!/usr/bin/env python3
# Copyright (C) 2016-2019 Semtech (International) AG. All rights reserved.
#
# This file is subject to the terms and conditions defined in file 'LICENSE',
# which is part of this source code package.
import os
import shlex
import sys
import re
import yaml
from typing import Callable,Dict,List,... | 36.169312 | 111 | 0.526624 | #!/usr/bin/env python3
# Copyright (C) 2016-2019 Semtech (International) AG. All rights reserved.
#
# This file is subject to the terms and conditions defined in file 'LICENSE',
# which is part of this source code package.
import os
import shlex
import sys
import re
import yaml
from typing import Callable,Dict,List,... | 4,923 | 1,106 | 307 |
060d91d98cf50dfe7b09fa612b44c1ea377349ae | 5,502 | py | Python | predict.py | pr-shukla/maddpg-keras | 8e3d1501f78ac2b78ee2c7053dc9299862386c17 | [
"MIT"
] | 4 | 2021-09-22T13:38:05.000Z | 2022-02-11T02:09:54.000Z | predict.py | pr-shukla/maddpg-keras | 8e3d1501f78ac2b78ee2c7053dc9299862386c17 | [
"MIT"
] | null | null | null | predict.py | pr-shukla/maddpg-keras | 8e3d1501f78ac2b78ee2c7053dc9299862386c17 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from tensorflow.keras import layers
import matplotlib.pyplot as plt
import math
from tensorflow.keras.models import load_model
from matplotlib import animation
from env_predict import *
from buffer import *
from model import *
from noise import *
dt = 0.4
v = 1... | 26.839024 | 95 | 0.626136 | import numpy as np
import tensorflow as tf
from tensorflow.keras import layers
import matplotlib.pyplot as plt
import math
from tensorflow.keras.models import load_model
from matplotlib import animation
from env_predict import *
from buffer import *
from model import *
from noise import *
dt = 0.4
v = 1... | 662 | 0 | 71 |
f55dcd389b1ce65f032913fdadc7cedcd8041d35 | 1,185 | py | Python | demo/blog/views.py | andrewebdev/django-ostinato | 2c435dea23319be6e9011e7381afca2b4092b5a2 | [
"MIT"
] | 5 | 2015-01-28T09:56:48.000Z | 2020-05-22T21:07:30.000Z | demo/blog/views.py | andrewebdev/django-ostinato | 2c435dea23319be6e9011e7381afca2b4092b5a2 | [
"MIT"
] | 18 | 2015-02-03T15:37:22.000Z | 2020-06-05T16:41:15.000Z | demo/blog/views.py | andrewebdev/django-ostinato | 2c435dea23319be6e9011e7381afca2b4092b5a2 | [
"MIT"
] | 2 | 2015-02-23T19:34:59.000Z | 2017-01-22T02:10:12.000Z | from ostinato.pages.views import PageView
from django.views.generic.detail import DetailView
from django.views.generic.dates import DateDetailView
from ostinato.pages.models import Page
from blog.models import Entry
| 28.902439 | 71 | 0.696203 | from ostinato.pages.views import PageView
from django.views.generic.detail import DetailView
from django.views.generic.dates import DateDetailView
from ostinato.pages.models import Page
from blog.models import Entry
class LandingPageView(PageView):
def get_context_data(self, **kwargs):
c = super(Landing... | 567 | 301 | 96 |
62eb9db8c4f68adc489a91c82ddfa41ecb1db6aa | 919 | py | Python | question_2/data_for_analysis/main.py | juliuskrahn/media-analysis-climate-change | a31834fe92e3c13f42f9c446f720c8e173cd4e12 | [
"MIT"
] | 1 | 2021-11-09T10:04:59.000Z | 2021-11-09T10:04:59.000Z | question_2/data_for_analysis/main.py | juliuskrahn/media-analysis-climate-change | a31834fe92e3c13f42f9c446f720c8e173cd4e12 | [
"MIT"
] | null | null | null | question_2/data_for_analysis/main.py | juliuskrahn/media-analysis-climate-change | a31834fe92e3c13f42f9c446f720c8e173cd4e12 | [
"MIT"
] | null | null | null | """Load article sample (1%) into spreadsheet for manual content analysis"""
import pandas as pd
import utils
from question_1.is_about_climate_change_sql_statement import is_about_climate_change_sql_statement
import os.path
if __name__ == "__main__":
main()
| 31.689655 | 98 | 0.618063 | """Load article sample (1%) into spreadsheet for manual content analysis"""
import pandas as pd
import utils
from question_1.is_about_climate_change_sql_statement import is_about_climate_change_sql_statement
import os.path
def main():
if not os.path.isdir("output"):
os.mkdir("output")
for publisher ... | 632 | 0 | 23 |
bfc6f72eba9b045c2ed844c9865387f1e8e14d5d | 8,036 | py | Python | BE_PESCAO/philipp_plot.py | srio/shadow3-scripts | 10712641333c29ca9854e9cc60d86cb321f3762b | [
"MIT"
] | 1 | 2019-10-30T10:06:15.000Z | 2019-10-30T10:06:15.000Z | BE_PESCAO/philipp_plot.py | srio/shadow3-scripts | 10712641333c29ca9854e9cc60d86cb321f3762b | [
"MIT"
] | null | null | null | BE_PESCAO/philipp_plot.py | srio/shadow3-scripts | 10712641333c29ca9854e9cc60d86cb321f3762b | [
"MIT"
] | null | null | null | import numpy
from srxraylib.plot.gol import plot
import scipy.constants as codata
import xraylib
if __name__ == "__main__":
do_calculate_spectrum = True
diamond_thickness_in_mm = 0.8
outfile = "spectrumE.dat"
rho = 1.848
if do_calculate_spectrum:
energy, flux = create_spectrum()
... | 37.551402 | 123 | 0.62556 | import numpy
from srxraylib.plot.gol import plot
import scipy.constants as codata
import xraylib
def create_spectrum():
#
# script to make the calculations (created by XOPPY:undulator_spectrum)
#
from orangecontrib.xoppy.util.xoppy_undulators import xoppy_calc_undulator_spectrum
energy, flux, s... | 3,519 | 0 | 92 |
7fbd230fad03dd0a383182ed4e5574ce0bb47687 | 833 | py | Python | wyr/generators/twitter.py | kcsaff/wyr | 7f7a924f38dc627b2a1c1fc014c0324a75696d06 | [
"MIT"
] | null | null | null | wyr/generators/twitter.py | kcsaff/wyr | 7f7a924f38dc627b2a1c1fc014c0324a75696d06 | [
"MIT"
] | null | null | null | wyr/generators/twitter.py | kcsaff/wyr | 7f7a924f38dc627b2a1c1fc014c0324a75696d06 | [
"MIT"
] | null | null | null | import random
import html
from functools import cached_property
from wyr.console import Console
| 27.766667 | 80 | 0.655462 | import random
import html
from functools import cached_property
from wyr.console import Console
class TweetGrabber(object):
def __init__(self, keys, console=None):
self.__keys = keys
if console is None:
console = Console()
self.__console = console
def random_tweet(self, qu... | 604 | 107 | 23 |
39bdcd851d1e101d6ce64bed3b83cb9b64c547f3 | 1,955 | py | Python | examples/get_bitmex_data.py | mstumberger/Quantdom | 2649aba90c741618a75900691480ddb720c461f4 | [
"Apache-2.0"
] | 1 | 2018-10-04T17:10:40.000Z | 2018-10-04T17:10:40.000Z | examples/get_bitmex_data.py | mstumberger/Quantdom | 2649aba90c741618a75900691480ddb720c461f4 | [
"Apache-2.0"
] | null | null | null | examples/get_bitmex_data.py | mstumberger/Quantdom | 2649aba90c741618a75900691480ddb720c461f4 | [
"Apache-2.0"
] | null | null | null | import requests
import math
import pandas as pd
from datetime import datetime
from datetime import timedelta
import requests
interval = 1
symbol = 'XBTUSD'
# get data from
timestamp_from = 1514761200
# till
timestamp_now = 1536530400
max_back_time = 0
max_bars = 10080
max_bars_time = ((interval * 60) * max_bars)
tim... | 31.031746 | 162 | 0.658312 | import requests
import math
import pandas as pd
from datetime import datetime
from datetime import timedelta
import requests
interval = 1
symbol = 'XBTUSD'
# get data from
timestamp_from = 1514761200
# till
timestamp_now = 1536530400
max_back_time = 0
max_bars = 10080
max_bars_time = ((interval * 60) * max_bars)
tim... | 0 | 0 | 0 |
3ff79e66feee5dba038657ba5493972b25ff3838 | 934 | py | Python | funcionalidade/migrations/0001_initial.py | LeandroMelloo/curso_completo_django_rest_framework_alura | 3d319db12e955049361dd0d3673958a277778a84 | [
"Apache-2.0"
] | null | null | null | funcionalidade/migrations/0001_initial.py | LeandroMelloo/curso_completo_django_rest_framework_alura | 3d319db12e955049361dd0d3673958a277778a84 | [
"Apache-2.0"
] | null | null | null | funcionalidade/migrations/0001_initial.py | LeandroMelloo/curso_completo_django_rest_framework_alura | 3d319db12e955049361dd0d3673958a277778a84 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-05 22:52
from django.db import migrations, models
| 29.1875 | 95 | 0.524625 | # Generated by Django 3.2.6 on 2021-08-05 22:52
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Funcionalidade',
fields=[
('id', models.Aut... | 0 | 820 | 23 |
18b75a173943329d828fd3d13ff3565c010de306 | 9,545 | py | Python | Bayesian methods for Machine Learning/VAE.py | gesuwen/Machine-Learning | 02a93e4cc32a6707c018386f2f745f9937f94adc | [
"MIT"
] | null | null | null | Bayesian methods for Machine Learning/VAE.py | gesuwen/Machine-Learning | 02a93e4cc32a6707c018386f2f745f9937f94adc | [
"MIT"
] | null | null | null | Bayesian methods for Machine Learning/VAE.py | gesuwen/Machine-Learning | 02a93e4cc32a6707c018386f2f745f9937f94adc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# A Variational Autoencoder trained on the MNIST dataset.
import tensorflow as tf
import keras
import numpy as np
import matplotlib.pyplot as plt
from keras.layers import Input, Dense, Lambda, InputLayer, concatenate
from keras.models import Model, Sequential
from keras import backend as K
from... | 40.617021 | 142 | 0.647774 | # -*- coding: utf-8 -*-
# A Variational Autoencoder trained on the MNIST dataset.
import tensorflow as tf
import keras
import numpy as np
import matplotlib.pyplot as plt
from keras.layers import Input, Dense, Lambda, InputLayer, concatenate
from keras.models import Model, Sequential
from keras import backend as K
from... | 625 | 0 | 46 |
76673c3b226ffe79dd6282ebdcd2d60cbe0a1ca2 | 2,098 | py | Python | python/betacal/__init__.py | REFRAME/betacal | 7c4a733a1f5b52a8a1700a8e793ac75ec16c9177 | [
"MIT"
] | 8 | 2018-07-19T21:15:45.000Z | 2021-07-09T09:44:19.000Z | python/betacal/__init__.py | REFRAME/betacal | 7c4a733a1f5b52a8a1700a8e793ac75ec16c9177 | [
"MIT"
] | 2 | 2017-11-14T12:32:37.000Z | 2021-03-11T20:53:39.000Z | python/betacal/__init__.py | REFRAME/betacal | 7c4a733a1f5b52a8a1700a8e793ac75ec16c9177 | [
"MIT"
] | 3 | 2017-02-09T05:08:12.000Z | 2020-05-27T12:40:25.000Z | from .beta_calibration import _BetaCal, _BetaAMCal, _BetaABCal
from sklearn.base import BaseEstimator, RegressorMixin
class BetaCalibration(BaseEstimator, RegressorMixin):
"""Wrapper class for the three Beta regression models introduced in
Kull, M., Silva Filho, T.M. and Flach, P. Beta calibration: a well-fo... | 30.405797 | 80 | 0.591992 | from .beta_calibration import _BetaCal, _BetaAMCal, _BetaABCal
from sklearn.base import BaseEstimator, RegressorMixin
class BetaCalibration(BaseEstimator, RegressorMixin):
"""Wrapper class for the three Beta regression models introduced in
Kull, M., Silva Filho, T.M. and Flach, P. Beta calibration: a well-fo... | 321 | 0 | 26 |
c77ab43acfa82cf80be4632e5a48c50eb706dbb7 | 3,304 | py | Python | src/sequential/adult/adult_costs.py | ppnaumann/CSCF | ea8af1f2fdec3a90a041324a32893d5dadc7e14b | [
"MIT"
] | null | null | null | src/sequential/adult/adult_costs.py | ppnaumann/CSCF | ea8af1f2fdec3a90a041324a32893d5dadc7e14b | [
"MIT"
] | null | null | null | src/sequential/adult/adult_costs.py | ppnaumann/CSCF | ea8af1f2fdec3a90a041324a32893d5dadc7e14b | [
"MIT"
] | null | null | null | import numpy as np
from feature_cost_model.action_cost import ActionCost
| 35.913043 | 86 | 0.65224 | import numpy as np
from feature_cost_model.action_cost import ActionCost
class IncreaseAgeCosts(ActionCost):
def __init__(self, features, dependency_graph=None):
self.features = features
feature_idx = self.features["age"]
super().__init__(feature_idx, dependency_graph)
def _get_costs... | 2,754 | 92 | 380 |