hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1a8e0d86ca92f6140e1650e9e04b88cb3b882acb | 49 | py | Python | torchlib/deep_rl/algorithm/policy_gradient/__init__.py | vermouth1992/mbrl_hvac | 2402b1bfa36dff74df669bd1bd1956eb8c346923 | [
"MIT"
] | 2 | 2020-12-22T10:02:59.000Z | 2020-12-22T19:57:55.000Z | torchlib/deep_rl/algorithm/policy_gradient/__init__.py | Sayani21/mbrl-hvac | eb0e2213cc2734b1a8f83e485180cc622ffced5d | [
"MIT"
] | 1 | 2022-03-12T00:52:44.000Z | 2022-03-12T00:52:44.000Z | torchlib/deep_rl/algorithm/policy_gradient/__init__.py | Sayani21/mbrl-hvac | eb0e2213cc2734b1a8f83e485180cc622ffced5d | [
"MIT"
] | 1 | 2021-07-19T15:40:26.000Z | 2021-07-19T15:40:26.000Z | from . import a2c, ppo
__all__ = ['a2c', 'ppo']
| 12.25 | 24 | 0.591837 |
1a8e25ab8ede870b19356578b22445e2db81bfab | 9,573 | py | Python | juneberry/loader.py | sei-nmvanhoudnos/Juneberry | a4824bc74180134a9ef5326addbc83110177102c | [
"MIT"
] | null | null | null | juneberry/loader.py | sei-nmvanhoudnos/Juneberry | a4824bc74180134a9ef5326addbc83110177102c | [
"MIT"
] | null | null | null | juneberry/loader.py | sei-nmvanhoudnos/Juneberry | a4824bc74180134a9ef5326addbc83110177102c | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# ==========================================================================================================================================================
# Copyright 2021 Carnegie Mellon University.
#
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIA... | 42.928251 | 156 | 0.697065 |
1a8e2b843eec8026fa679aa87b97d6314bc64b85 | 3,006 | py | Python | Tracked/test/locationMap_test.py | EnzoBrancaccio/tracked | c32905da259d8ac9e2261294d6f56fd92efd7bc9 | [
"CC0-1.0"
] | null | null | null | Tracked/test/locationMap_test.py | EnzoBrancaccio/tracked | c32905da259d8ac9e2261294d6f56fd92efd7bc9 | [
"CC0-1.0"
] | null | null | null | Tracked/test/locationMap_test.py | EnzoBrancaccio/tracked | c32905da259d8ac9e2261294d6f56fd92efd7bc9 | [
"CC0-1.0"
] | null | null | null | '''
Created on 09.06.2021
@author: Enzo Brancaccio
'''
import unittest
import tracked.locationMap as lm
from tracked.location import Location
class Test(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
# case 1: prefix = ""
# case 2: prefix = "case2"
# case ... | 33.775281 | 83 | 0.60978 |
1a8e6d63cace925d869907271dc6b3a00b38dd3a | 7,989 | py | Python | article_1.py | OmnesRes/infarction | 50c21fe0c1edbfc1d828dbd09927bb3d94e7a449 | [
"MIT"
] | 1 | 2018-02-27T20:38:10.000Z | 2018-02-27T20:38:10.000Z | article_1.py | OmnesRes/infarction | 50c21fe0c1edbfc1d828dbd09927bb3d94e7a449 | [
"MIT"
] | 1 | 2017-09-20T08:54:33.000Z | 2017-09-20T09:20:18.000Z | article_1.py | OmnesRes/infarction | 50c21fe0c1edbfc1d828dbd09927bb3d94e7a449 | [
"MIT"
] | null | null | null | ##load data, functions and modules
from functions import *
##table 1
print 'Table 1'
print '{0:<30}{1:^20}{2:^20}{3:^20}'.format('','$4 buffet','$8 buffet','F test (p value)')
#possible F statistic ranges for the Age summary stats
means=[44.16,46.08]
sds=[19.00,14.46]
sizes=[64,65]
min_means=[44.16+.005,46.08-.005]
... | 44.383333 | 216 | 0.682564 |
1a8e7e16e011b658bc158a30d37a9948b12996e1 | 506 | py | Python | cgatpipelines/tools/pipeline_docs/pipeline_exome_cancer/trackers/Signature.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 49 | 2015-04-13T16:49:25.000Z | 2022-03-29T10:29:14.000Z | cgatpipelines/tools/pipeline_docs/pipeline_exome_cancer/trackers/Signature.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 252 | 2015-04-08T13:23:34.000Z | 2019-03-18T21:51:29.000Z | cgatpipelines/tools/pipeline_docs/pipeline_exome_cancer/trackers/Signature.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 22 | 2015-05-21T00:37:52.000Z | 2019-09-25T05:04:27.000Z | from CGATReport.Tracker import *
from exomeReport import *
class SnpSummary(ExomeTracker):
def __call__(self, track, slice=None):
table = "mutational_signature"
statement = '''SELECT * FROM %(table)s;''' % locals()
return self.getAll(statement)
class SnpSummaryTable(ExomeTracker):
... | 24.095238 | 61 | 0.658103 |
1a8f0bb091d2cfaead024155029394da9a553e22 | 2,847 | py | Python | nn/td_prediction_lstm_V4.py | frmccann/DRL-ice-hockey | 6e743a0f554ba5fe4f8c4ded02abe33ffe571370 | [
"MIT"
] | null | null | null | nn/td_prediction_lstm_V4.py | frmccann/DRL-ice-hockey | 6e743a0f554ba5fe4f8c4ded02abe33ffe571370 | [
"MIT"
] | null | null | null | nn/td_prediction_lstm_V4.py | frmccann/DRL-ice-hockey | 6e743a0f554ba5fe4f8c4ded02abe33ffe571370 | [
"MIT"
] | null | null | null | import tensorflow as tf
class td_prediction_lstm_V4:
def __init__(self, FEATURE_NUMBER, H_SIZE, MAX_TRACE_LENGTH, learning_rate, rnn_type='bp_last_step'):
"""
define a dynamic LSTM
"""
with tf.name_scope("LSTM_layer"):
self.rnn_input = tf.placeholder(tf.float32, [None, ... | 49.086207 | 113 | 0.61398 |
1a8f1a520ee2f5977854918d8c2e233bcec790a2 | 1,783 | py | Python | User interface/singlepage1/singlepage/views.py | fangyiyu/CS50_web_programming | 8d6f304772ae8bd8cd373f17545d507c6e55768e | [
"MIT"
] | 2 | 2021-04-05T15:29:08.000Z | 2022-03-08T11:07:21.000Z | Lecture 6 : User Interfaces/src6/singlepage2/singlepage/views.py | Sumanth-Talluri/CS50-Web-Programming-with-Python-and-JavaScript | 8d5f83f4354f1f27138a2a9c40317d358f3b2f9a | [
"MIT"
] | null | null | null | Lecture 6 : User Interfaces/src6/singlepage2/singlepage/views.py | Sumanth-Talluri/CS50-Web-Programming-with-Python-and-JavaScript | 8d5f83f4354f1f27138a2a9c40317d358f3b2f9a | [
"MIT"
] | null | null | null | from django.http import Http404, HttpResponse
from django.shortcuts import render
# Create your views here.
def index(request):
return render(request, "singlepage/index.html")
texts = ["Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tortor mauris, maximus semper volutpat vitae, varius placerat d... | 99.055556 | 665 | 0.78295 |
1a8f301f31a39a2efd0983fdc69a5c85fd983aa2 | 1,330 | py | Python | mosqito/loudness/loudness_zwicker_lowpass_intp.py | dnbaumann/MoSQITo | d84a91008b6225cd940f0a2a44c3a987297f4c56 | [
"Apache-2.0"
] | null | null | null | mosqito/loudness/loudness_zwicker_lowpass_intp.py | dnbaumann/MoSQITo | d84a91008b6225cd940f0a2a44c3a987297f4c56 | [
"Apache-2.0"
] | null | null | null | mosqito/loudness/loudness_zwicker_lowpass_intp.py | dnbaumann/MoSQITo | d84a91008b6225cd940f0a2a44c3a987297f4c56 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@date Created on Fri May 22 2020
@author martin_g for Eomys
"""
# Standard library imports
import math
# Third party imports
import numpy as np
# Local application imports
def loudness_zwicker_lowpass_intp(loudness, tau, sample_rate):
"""1st order low-pass with linear interpolation o... | 24.62963 | 68 | 0.602256 |
1a8f3e8c8061bcdcde044440fb4df9e565f443fb | 1,103 | py | Python | gorna/views/wiki_history_handler.py | bukun/gorna | 3db74e97e1e4f1b223686a6bb45fa231521cbc1b | [
"MIT"
] | null | null | null | gorna/views/wiki_history_handler.py | bukun/gorna | 3db74e97e1e4f1b223686a6bb45fa231521cbc1b | [
"MIT"
] | null | null | null | gorna/views/wiki_history_handler.py | bukun/gorna | 3db74e97e1e4f1b223686a6bb45fa231521cbc1b | [
"MIT"
] | null | null | null | from pyramid.response import Response
from pyramid.view import view_config
from pyramid.view import view_defaults
from ..models import Rating
from sqlalchemy.exc import DBAPIError
from ..models.mymodel import MyModel
import os
@view_defaults(route_name='view_wiki_man')
class PostHist(object):
def __init__(self,... | 22.06 | 72 | 0.714415 |
1a8f58767bcaea378fe1b398eb6d9e83ea0a7e4e | 1,298 | py | Python | hs_core/tests/api/native/test_user_from_id.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_core/tests/api/native/test_user_from_id.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_core/tests/api/native/test_user_from_id.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z |
import unittest
from django.contrib.auth.models import User, Group
from django.test import TestCase
from hs_core import hydroshare
class TestUserFromId(TestCase):
def setUp(self):
self.hydroshare_author_group, _ = Group.objects.get_or_create(name='Hydroshare Author')
self.user = hydroshare.cre... | 23.6 | 95 | 0.590909 |
1a8f76901bb95fe1bc65c0d942402e26ea946768 | 4,534 | py | Python | simpleimages/utils.py | canada-nyc/django-simpleimages | ebeb77a8cc9a7c7188295f41ced5112e8410ccd7 | [
"MIT"
] | 3 | 2015-11-09T23:09:56.000Z | 2020-08-20T15:30:02.000Z | simpleimages/utils.py | canada-nyc/django-simpleimages | ebeb77a8cc9a7c7188295f41ced5112e8410ccd7 | [
"MIT"
] | 7 | 2015-04-16T15:46:41.000Z | 2020-08-27T13:20:12.000Z | simpleimages/utils.py | canada-nyc/django-simpleimages | ebeb77a8cc9a7c7188295f41ced5112e8410ccd7 | [
"MIT"
] | 2 | 2015-04-16T15:47:04.000Z | 2018-11-05T16:45:18.000Z | import os
from simpleimages.django_compat import import_by_path
def get_caller():
from django.conf import settings
caller_text = getattr(
settings,
'SIMPLEIMAGES_TRANSFORM_CALLER',
'simpleimages.callers.default'
)
return import_by_path(caller_text)
def perform_transformatio... | 39.086207 | 133 | 0.714821 |
1a8f8274efcae15d15b1781bf1707cd87cc58da3 | 2,451 | py | Python | empower/restserver/validate.py | imec-idlab/empower-runtime | eda52649f855722fdec1d02e25a28c61a8fbda06 | [
"Apache-2.0"
] | 2 | 2020-02-28T15:54:01.000Z | 2020-11-24T08:45:11.000Z | empower/restserver/validate.py | imec-idlab/empower-runtime | eda52649f855722fdec1d02e25a28c61a8fbda06 | [
"Apache-2.0"
] | null | null | null | empower/restserver/validate.py | imec-idlab/empower-runtime | eda52649f855722fdec1d02e25a28c61a8fbda06 | [
"Apache-2.0"
] | 1 | 2020-03-02T16:41:20.000Z | 2020-03-02T16:41:20.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2018 Roberto Riggio
#
# 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... | 27.233333 | 75 | 0.581803 |
1a8f83bd867ddb8b3ace36b28dc17c43bacf7ebc | 5,850 | py | Python | code/scripts/nnetSolve.py | 19428861/DeepCube-and-DeepCubePlus | 2b980623242e287580b5ae4c8b4a03dce70a87e5 | [
"MIT"
] | 1 | 2019-12-25T13:26:45.000Z | 2019-12-25T13:26:45.000Z | code/scripts/nnetSolve.py | 19428861/DeepCube-and-DeepCubePlus | 2b980623242e287580b5ae4c8b4a03dce70a87e5 | [
"MIT"
] | 1 | 2020-01-14T01:07:07.000Z | 2020-01-14T01:07:07.000Z | code/scripts/nnetSolve.py | 19428861/DeepCube-and-DeepCubePlus | 2b980623242e287580b5ae4c8b4a03dce70a87e5 | [
"MIT"
] | 2 | 2020-10-06T09:32:56.000Z | 2020-11-24T02:45:31.000Z | import os
import sys
import numpy as np
import pickle as pickle
import argparse
import time
from subprocess import Popen, PIPE
from multiprocessing import Process, Queue
o_path = os.getcwd()
sys.path.append(o_path)
sys.path.append('./')
sys.path.append('../')
sys.path.append('../code')
sys.path.append('../data')
sys.pa... | 31.793478 | 130 | 0.625299 |
1a8f98a0c6a86298b72a8db6e4a5089df4bc0ae3 | 4,012 | py | Python | picraft/exc.py | waveform80/picraft | c2ca6e23178ba0f58470aef0c0c71f551f2275f8 | [
"BSD-3-Clause"
] | 54 | 2015-06-09T01:13:35.000Z | 2022-03-20T08:12:19.000Z | picraft/exc.py | Tominous/picraft | 6676dcc09f797a8518999803467f2a90b09ed19e | [
"BSD-3-Clause"
] | 21 | 2015-06-07T21:57:22.000Z | 2019-01-21T20:17:06.000Z | picraft/exc.py | Tominous/picraft | 6676dcc09f797a8518999803467f2a90b09ed19e | [
"BSD-3-Clause"
] | 13 | 2015-06-10T05:41:27.000Z | 2020-05-29T10:46:23.000Z | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# An alternate Python Minecraft library for the Rasperry-Pi
# Copyright (c) 2013-2016 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... | 31.590551 | 81 | 0.762961 |
1a8fa631974bc1afdbdac8370247cc4321814a7d | 406 | py | Python | examples/set_vacuum.py | mmm-group/mmmg_tools | ef80afb9ced66103578bf07aeeb001cf8c6ca848 | [
"MIT"
] | null | null | null | examples/set_vacuum.py | mmm-group/mmmg_tools | ef80afb9ced66103578bf07aeeb001cf8c6ca848 | [
"MIT"
] | null | null | null | examples/set_vacuum.py | mmm-group/mmmg_tools | ef80afb9ced66103578bf07aeeb001cf8c6ca848 | [
"MIT"
] | null | null | null | from mmmg_tools.objects import Structure
structure = Structure.from_file('CONTCAR')
for i in range(3):
print(f'{i} No PB')
s = Structure.from_structure(structure.structure)
s.set_vacuum(15, axis=i)
s.write_file(f'{i}-nopb-POSCAR')
print(f'{i} PB')
s = Structure.from_structure(structure.structur... | 31.230769 | 53 | 0.694581 |
1a8fb3580019e87e4a218996962371a87647972d | 6,314 | py | Python | mrubis_controller/marl/data/logs/merge_data.py | hpi-sam/robust-marl4sas | b0fca6ae2370c67fcafb1a72fb1c4dc7a636e0c5 | [
"MIT"
] | null | null | null | mrubis_controller/marl/data/logs/merge_data.py | hpi-sam/robust-marl4sas | b0fca6ae2370c67fcafb1a72fb1c4dc7a636e0c5 | [
"MIT"
] | 57 | 2022-01-11T08:06:44.000Z | 2022-03-10T10:31:34.000Z | mrubis_controller/marl/data/logs/merge_data.py | hpi-sam/robust-marl4sas | b0fca6ae2370c67fcafb1a72fb1c4dc7a636e0c5 | [
"MIT"
] | null | null | null | import os
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
from torch import ceil
dir_path = os.path.dirname(os.path.realpath(__file__))
def build_plot(data, title, path):
colors = ['#B1063A', '#134293', '#058B79', '#DD9108', '#009e61',
'#5a6065', '#00799e', '... | 38.5 | 160 | 0.588533 |
1a8fc3e62546c4617fb7b162dfef634d757fa000 | 2,157 | py | Python | src/indriya_msgs/python/time_pb2.py | praveenv4k/Indriya | a74a4b8bb9f04b5e858305769e892edfcab32df5 | [
"MIT"
] | 1 | 2017-07-12T15:30:58.000Z | 2017-07-12T15:30:58.000Z | src/indriya_msgs/python/time_pb2.py | praveenv4k/Indriya | a74a4b8bb9f04b5e858305769e892edfcab32df5 | [
"MIT"
] | null | null | null | src/indriya_msgs/python/time_pb2.py | praveenv4k/Indriya | a74a4b8bb9f04b5e858305769e892edfcab32df5 | [
"MIT"
] | 1 | 2016-03-09T12:34:19.000Z | 2016-03-09T12:34:19.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: time.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflecti... | 28.012987 | 145 | 0.736208 |
1a8fd68f7472852f04dc3b8700a4912847e5b305 | 2,882 | py | Python | KijijiAutoPoster.py | SohrabAmin/KijijiAutoPoster | 2f7993632d47d8606a1a6f8ee67d6b614c5a7d73 | [
"MIT"
] | 1 | 2020-09-15T05:06:30.000Z | 2020-09-15T05:06:30.000Z | KijijiAutoPoster.py | SohrabAmin/KijijiAutoPoster | 2f7993632d47d8606a1a6f8ee67d6b614c5a7d73 | [
"MIT"
] | null | null | null | KijijiAutoPoster.py | SohrabAmin/KijijiAutoPoster | 2f7993632d47d8606a1a6f8ee67d6b614c5a7d73 | [
"MIT"
] | null | null | null | from selenium import webdriver
from KijijiAPI import LaptopAd, User, click_element, send_to_element, enter_element, select_element_index, upload_photos
driver_path = '/Users/sohrab/env/bin/geckodriver'
email = 'xakifij100@imail1.net'
password = '_Mypassword123'
phone_number = '647-416-9050'
postal_code = 'L5L 1C6'
l... | 38.426667 | 206 | 0.69084 |
1a8ff271d5e3e16c2834956800c61c4641b8d1bf | 3,034 | py | Python | setup.py | StepNeverStop/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 371 | 2019-04-26T00:37:33.000Z | 2022-03-31T07:33:12.000Z | setup.py | BlueFisher/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 47 | 2019-07-21T11:51:57.000Z | 2021-08-31T08:45:22.000Z | setup.py | BlueFisher/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 102 | 2019-06-29T13:11:15.000Z | 2022-03-28T13:51:04.000Z | #!/usr/bin/env python3
# encoding: utf-8
import platform
from importlib import util as import_util
from setuptools import find_packages, setup
spec = import_util.spec_from_file_location('_metadata', 'rls/_metadata.py')
_metadata = import_util.module_from_spec(spec)
spec.loader.exec_module(_metadata)
with open('READM... | 32.276596 | 113 | 0.638431 |
1a9011248fc47c4c1a170028b0a7d1af805e408d | 617 | py | Python | tests/fixtures/in/E10.py | lig/wrast | 7a4b140d79548e3eb48ba6d1e63b8765e2060981 | [
"MIT"
] | 2 | 2017-12-29T06:09:18.000Z | 2017-12-29T20:05:38.000Z | tests/fixtures/in/E10.py | lig/wrast | 7a4b140d79548e3eb48ba6d1e63b8765e2060981 | [
"MIT"
] | null | null | null | tests/fixtures/in/E10.py | lig/wrast | 7a4b140d79548e3eb48ba6d1e63b8765e2060981 | [
"MIT"
] | null | null | null | #: E101 E122 W191 W191
if True:
pass
change_2_log = \
"""Change 2 by slamb@testclient on 2006/04/13 21:46:23
creation
"""
p4change = {
2: change_2_log,
}
class TestP4Poller(unittest.TestCase):
def setUp(self):
self.setUpGetProcessOutput()
return self.setUpChangeSource()
def tearDown(... | 15.04878 | 54 | 0.628849 |
1a907950c3de67dda66538f3a5f66577573f1581 | 6,266 | py | Python | zerver/lib/request.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | null | null | null | zerver/lib/request.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | 1 | 2019-11-02T09:06:05.000Z | 2019-11-02T09:06:05.000Z | zerver/lib/request.py | erinis-eligro/zulip-outcasts | 51153a6ce219370aee79bfe462f6e4fb956993d9 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from functools import wraps
import ujson
from six.moves import zip
from django.utils.translation import ugettext as _
class JsonableError(Exception):
def __init__(self, error, status_code=400):
self.error = error
self.status_code = status_code
def __str_... | 37.975758 | 103 | 0.653208 |
1a9082a5c16c8a7c96d6bc55b139256372c8c191 | 4,770 | py | Python | rstblog/modules/latex.py | agateau/rstblog | 680d567a8bf42f3fce6e3cc067547cb171e7b373 | [
"BSD-3-Clause"
] | null | null | null | rstblog/modules/latex.py | agateau/rstblog | 680d567a8bf42f3fce6e3cc067547cb171e7b373 | [
"BSD-3-Clause"
] | null | null | null | rstblog/modules/latex.py | agateau/rstblog | 680d567a8bf42f3fce6e3cc067547cb171e7b373 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
rstblog.modules.latex
~~~~~~~~~~~~~~~~~~~~~
Simple latex support for formulas.
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import os
import re
import tempfile
import shutil
from hashlib import sha1
from os impor... | 30.382166 | 78 | 0.601258 |
1a908c241ecf124498ed6c0dffd89e1729ba13ca | 22,298 | py | Python | tests/getl/transform/test_transform.py | husqvarnagroup/GETL | 37251abf12bac2efed1fe463b09a288d85969141 | [
"MIT"
] | 8 | 2020-06-10T09:00:17.000Z | 2021-06-07T18:02:19.000Z | tests/getl/transform/test_transform.py | husqvarnagroup/GETL | 37251abf12bac2efed1fe463b09a288d85969141 | [
"MIT"
] | 5 | 2020-07-03T10:39:25.000Z | 2021-08-30T14:52:47.000Z | tests/getl/transform/test_transform.py | husqvarnagroup/GETL | 37251abf12bac2efed1fe463b09a288d85969141 | [
"MIT"
] | 1 | 2020-05-28T07:53:48.000Z | 2020-05-28T07:53:48.000Z | """Unit test for GETL transform function."""
# pylint: disable=W0212
import json
from unittest import mock
import pytest
from pyspark.sql import DataFrame, functions as F, types as T
import getl.blocks.transform.transform as tr
from tests.getl.data.samples import create_princess_age_null_df, create_princess_df
####... | 29.378129 | 103 | 0.582788 |
1a90960ef1f4bf411b2c6ee1a3a3fce71f405a7b | 40,768 | py | Python | posthog/queries/test/test_retention.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | null | null | null | posthog/queries/test/test_retention.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | 1 | 2022-02-15T00:47:35.000Z | 2022-02-15T00:47:35.000Z | posthog/queries/test/test_retention.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | 1 | 2021-09-08T19:45:03.000Z | 2021-09-08T19:45:03.000Z | import json
from datetime import datetime
import pytz
from rest_framework import status
from posthog.constants import (
FILTER_TEST_ACCOUNTS,
RETENTION_FIRST_TIME,
RETENTION_TYPE,
TREND_FILTER_TYPE_ACTIONS,
TREND_FILTER_TYPE_EVENTS,
TRENDS_LINEAR,
)
from posthog.models import Action, ActionSte... | 41.055388 | 138 | 0.430411 |
1a90e8fb51491416786dff090c8ebbab7059dcc4 | 4,642 | py | Python | tests/generators/test_markov.py | escofresco/makeschool_fsp2_realtweets | a1df7c54e5ef3d5a91282141389200248b40f695 | [
"MIT"
] | null | null | null | tests/generators/test_markov.py | escofresco/makeschool_fsp2_realtweets | a1df7c54e5ef3d5a91282141389200248b40f695 | [
"MIT"
] | 9 | 2019-11-17T22:33:15.000Z | 2021-06-02T00:37:50.000Z | tests/generators/test_markov.py | escofresco/makeschool_fsp2_realtweets | a1df7c54e5ef3d5a91282141389200248b40f695 | [
"MIT"
] | null | null | null | from collections import Counter, defaultdict
from dataclasses import dataclass
import pickle
import unittest
from grams.markov import Markov, MC, HMM
from grams.grams import Histogram
from grams.stats import FreqDist
from grams.utils import generate_samples
@dataclass
class TD:
SIMPLE_CORPUS = "A man. A plan. A ... | 35.707692 | 127 | 0.521327 |
1a914c08a2d93904874f7df2e46adeb4132d6b82 | 1,048 | py | Python | sdks/python/test/test_AlertingJiraBugtrackerSettings.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_AlertingJiraBugtrackerSettings.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_AlertingJiraBugtrackerSettings.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 26.2 | 121 | 0.751908 |
1a915c72bd90d3c5f284e82efe88a193618b1874 | 2,237 | py | Python | tests/outlookservices/test_outlook_calendar.py | stardust85/Office365-REST-Python-Client | cd369c607c7d137a000734e9c5e8f03ae3e3c603 | [
"MIT"
] | null | null | null | tests/outlookservices/test_outlook_calendar.py | stardust85/Office365-REST-Python-Client | cd369c607c7d137a000734e9c5e8f03ae3e3c603 | [
"MIT"
] | null | null | null | tests/outlookservices/test_outlook_calendar.py | stardust85/Office365-REST-Python-Client | cd369c607c7d137a000734e9c5e8f03ae3e3c603 | [
"MIT"
] | null | null | null | from tests.outlookservices.outlook_case import OutlookClientTestCase
class TestOutlookCalendar(OutlookClientTestCase):
def test1_create_event(self):
event_payload = {
"Subject": "Discuss the Calendar REST API",
"Body": {
"ContentType": "HTML",
"Conte... | 36.080645 | 89 | 0.55342 |
1a917976b2dc948800de8cdf533ac3e100b727c9 | 37,398 | py | Python | mathics/builtin/list/eol.py | rebcabin/mathics-core | 0cbf808fb9fb91e0a32d0aa9d1af1477d0258f41 | [
"Apache-2.0"
] | null | null | null | mathics/builtin/list/eol.py | rebcabin/mathics-core | 0cbf808fb9fb91e0a32d0aa9d1af1477d0258f41 | [
"Apache-2.0"
] | null | null | null | mathics/builtin/list/eol.py | rebcabin/mathics-core | 0cbf808fb9fb91e0a32d0aa9d1af1477d0258f41 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Elements of Lists
Functions for accessing elements of lists using either indices, positions, or patterns of criteria.
"""
from itertools import chain
from mathics.builtin.base import (
BinaryOperator,
Builtin,
InvalidLevelspecError,
PartError,
)
from mathics.builtin.lis... | 27.438004 | 225 | 0.499064 |
1a9183b0153f1791d48e5bca37ecc0245d09234e | 6,315 | py | Python | src/guesswhat/train/train_guesser.py | ash567/guess_what | 092653695cb2a14cbb12df619b894d983c065a67 | [
"Apache-2.0"
] | null | null | null | src/guesswhat/train/train_guesser.py | ash567/guess_what | 092653695cb2a14cbb12df619b894d983c065a67 | [
"Apache-2.0"
] | null | null | null | src/guesswhat/train/train_guesser.py | ash567/guess_what | 092653695cb2a14cbb12df619b894d983c065a67 | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import os
# Replaced because of some pickle error
# from multiprocessing import Pool
from multiprocess import Pool
from distutils.util import strtobool
import tensorflow as tf
from generic.data_provider.iterator import Iterator
from generic.tf_utils.evaluator import Evaluator
from gener... | 40.741935 | 142 | 0.653682 |
1a91ddab7ed60e55d202c1cd84ef4067715b3371 | 2,300 | py | Python | pycrust/tools/mako.py | alertedsnake/pycrust | ceb5da9ff92b892adc9a3057afdfe84f3e529313 | [
"MIT"
] | 1 | 2019-03-25T05:33:30.000Z | 2019-03-25T05:33:30.000Z | pycrust/tools/mako.py | iwannaPython/pycrust | ceb5da9ff92b892adc9a3057afdfe84f3e529313 | [
"MIT"
] | null | null | null | pycrust/tools/mako.py | iwannaPython/pycrust | ceb5da9ff92b892adc9a3057afdfe84f3e529313 | [
"MIT"
] | 1 | 2019-03-25T05:33:11.000Z | 2019-03-25T05:33:11.000Z | """
Mako Templates
--------------
Mako templating code was based on the code and discussion at
http://tools.cherrypy.org/wiki/Mako
To use the Mako renderer:
cherrypy.tools.mako = cherrypy.Tool('on_start_resource',
MakoLoader(directories=['/path/to/templates']))
Then in your h... | 28.75 | 94 | 0.593043 |
1a91de6000c9c4f6638d179a01c7870a42665b96 | 792 | py | Python | itunesearch/util.py | neysofu/itunesearch | 98ab3a57e5700894d3513cbded3dce5021864738 | [
"MIT"
] | 2 | 2016-10-07T22:40:53.000Z | 2016-10-08T15:57:04.000Z | itunesearch/util.py | neysofu/itunesearch | 98ab3a57e5700894d3513cbded3dce5021864738 | [
"MIT"
] | 1 | 2016-08-05T14:36:26.000Z | 2016-10-07T14:14:24.000Z | itunesearch/util.py | neysofu/itunesearch | 98ab3a57e5700894d3513cbded3dce5021864738 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import itunesearch.content
# Errors
# ------
class MalformedRequestError(Exception):
pass
class DefectiveResponseError(Exception):
pass
# Helpers
# -------
def wrapper_class(response):
# Nothing can describe the feelings `wrapperType` and `kind` cause
wrap = 'wrapperType'
if wrap in re... | 23.294118 | 67 | 0.72601 |
1a91e2c140e9b9868bb5f56b7d42f03b4ab8c4d8 | 12,242 | py | Python | backend/app/main/controller/invitation_controller.py | mike42/bring-a-plate | a28f9b221502614466ff53c0f870bc01ca29c311 | [
"MIT"
] | 2 | 2016-10-14T03:52:17.000Z | 2020-02-25T08:58:40.000Z | backend/app/main/controller/invitation_controller.py | mike42/bring-a-plate | a28f9b221502614466ff53c0f870bc01ca29c311 | [
"MIT"
] | null | null | null | backend/app/main/controller/invitation_controller.py | mike42/bring-a-plate | a28f9b221502614466ff53c0f870bc01ca29c311 | [
"MIT"
] | null | null | null | import csv
import io
from flask import request, make_response
from flask_login import login_required, current_user
from flask_restplus import Resource, Namespace, fields, abort
from app.main import db
from app.main.model.allergen import Allergen
from app.main.model.invitation import Invitation, InvitationPerson, Atte... | 41.639456 | 123 | 0.668845 |
1a91f0385b843148ebe015e0585b1307317a294b | 33,173 | py | Python | virtualzap/src/plugin.py | pololoko111/enigma2-plugins | 79b4e5e15663bcda7d1b679769e10942915f5bf5 | [
"OLDAP-2.3"
] | null | null | null | virtualzap/src/plugin.py | pololoko111/enigma2-plugins | 79b4e5e15663bcda7d1b679769e10942915f5bf5 | [
"OLDAP-2.3"
] | null | null | null | virtualzap/src/plugin.py | pololoko111/enigma2-plugins | 79b4e5e15663bcda7d1b679769e10942915f5bf5 | [
"OLDAP-2.3"
] | null | null | null | #
# VirtualZap E2
#
# $Id$
#
# Coded by Dr.Best (c) 2010
# Coding idea and design by Vali
# Support: www.dreambox-tools.info
#
# This plugin is licensed under the Creative Commons
# Attribution-NonCommercial-ShareAlike 3.0 Unported
# License. To view a copy of this license, visit
# http://creativecommons.org... | 43.534121 | 290 | 0.733066 |
1a91f13ded75088d72d866966c64d7532ebc544a | 2,913 | py | Python | chapter_9_security/generate_password.py | fancyerii/voicebook | def82da8577086d0361643a05fec2463006533a9 | [
"Apache-2.0"
] | 1 | 2020-03-05T01:19:17.000Z | 2020-03-05T01:19:17.000Z | chapter_9_security/generate_password.py | fancyerii/voicebook | def82da8577086d0361643a05fec2463006533a9 | [
"Apache-2.0"
] | null | null | null | chapter_9_security/generate_password.py | fancyerii/voicebook | def82da8577086d0361643a05fec2463006533a9 | [
"Apache-2.0"
] | null | null | null | '''
================================================
## VOICEBOOK REPOSITORY ##
================================================
repository name: voicebook
repository version: 1.0
repository link: https://github.com/jim-schwoebel/voicebook
author: Jim Schwoebel
author contact: js@neur... | 37.346154 | 121 | 0.624442 |
1a921362c1c34a3e521f318d68a5afbc3c15fd52 | 207 | py | Python | notebook/notebook.py | mauabe/galileo-notebook | 7877125bb6892e2a2600f383934156fec1a54067 | [
"MIT"
] | 1 | 2019-02-26T11:12:43.000Z | 2019-02-26T11:12:43.000Z | notebook/notebook.py | mauabe/galileo-notebook | 7877125bb6892e2a2600f383934156fec1a54067 | [
"MIT"
] | null | null | null | notebook/notebook.py | mauabe/galileo-notebook | 7877125bb6892e2a2600f383934156fec1a54067 | [
"MIT"
] | null | null | null | def convert (my_name):
"""
Print a line about converting a notebook.
Args:
my_name (str): person's name
Returns:
None
"""
print(f"I'll convert a notebook for you some day, {my_name}.") | 20.7 | 64 | 0.637681 |
1a92233486ed1b9a032ce87a54a075adcff52905 | 4,621 | py | Python | dnacentersdk/api/v1_3_3/users.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | dnacentersdk/api/v1_3_3/users.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | dnacentersdk/api/v1_3_3/users.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""DNA Center Users API wrapper.
Copyright (c) 2019-2020 Cisco and/or its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including withou... | 34.744361 | 78 | 0.653105 |
1a923849ce531d22e83fcaa4a5811fc1d98c20e9 | 6,787 | py | Python | tests/components/zha/common.py | dagobert/home-assistant | 33dcb071dab25dd93ce7bcfae70315ace5af4702 | [
"Apache-2.0"
] | 1 | 2019-03-24T13:30:10.000Z | 2019-03-24T13:30:10.000Z | tests/components/zha/common.py | dagobert/home-assistant | 33dcb071dab25dd93ce7bcfae70315ace5af4702 | [
"Apache-2.0"
] | 1 | 2019-02-09T15:44:11.000Z | 2019-02-09T15:44:11.000Z | tests/components/zha/common.py | pc-coholic/home-assistant | 24914aade50f7f4f813380b58292d5e91dc47f41 | [
"Apache-2.0"
] | 1 | 2019-09-28T07:06:08.000Z | 2019-09-28T07:06:08.000Z | """Common test objects."""
import time
from unittest.mock import patch, Mock
from homeassistant.const import STATE_UNAVAILABLE
from homeassistant.components.zha.core.helpers import convert_ieee
from homeassistant.components.zha.core.const import (
DATA_ZHA, DATA_ZHA_CONFIG, DATA_ZHA_DISPATCHERS, DATA_ZHA_BRIDGE_ID
... | 34.805128 | 78 | 0.672609 |
1a9252c4d3a637549ffa12e51642003a718b1034 | 2,752 | py | Python | src/rubrix/sdk/models/text_classification_search_aggregations_metadata.py | sakares/rubrix | 791ffb29815b5d24f2bbbb0fa422f85f8b30098f | [
"Apache-2.0"
] | null | null | null | src/rubrix/sdk/models/text_classification_search_aggregations_metadata.py | sakares/rubrix | 791ffb29815b5d24f2bbbb0fa422f85f8b30098f | [
"Apache-2.0"
] | null | null | null | src/rubrix/sdk/models/text_classification_search_aggregations_metadata.py | sakares/rubrix | 791ffb29815b5d24f2bbbb0fa422f85f8b30098f | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021-present, the Recognai S.L. team.
#
# 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 ... | 32.761905 | 107 | 0.711846 |
1a92682be7ae0a232447f403ecf7878beb3a17e5 | 616 | py | Python | cyberserver/servers/utilities/text_wrappers.py | csd3345/cybermap-server | f9cad5e59547d30c1e6e13c8b4b39e6ea46746cb | [
"Unlicense",
"MIT"
] | null | null | null | cyberserver/servers/utilities/text_wrappers.py | csd3345/cybermap-server | f9cad5e59547d30c1e6e13c8b4b39e6ea46746cb | [
"Unlicense",
"MIT"
] | null | null | null | cyberserver/servers/utilities/text_wrappers.py | csd3345/cybermap-server | f9cad5e59547d30c1e6e13c8b4b39e6ea46746cb | [
"Unlicense",
"MIT"
] | null | null | null | def wrap_by_word(text, n):
"""
returns a string where \n is inserted between every n words
:url https://www.reddit.com/r/learnpython/comments/4i2z4u/how_to_add_a_new_line_after_every_nth_word/
"""
a = text.split()
to_return = str()
for i in range(0, len(a), n):
to_return += ' '.join... | 28 | 105 | 0.602273 |
1a92ce5b3ef46af0b1b83e75dd938405a6343e47 | 2,824 | py | Python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy_py3.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy_py3.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy_py3.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 42.149254 | 139 | 0.656161 |
1a92f63544e023058ffb360227a5f27465731259 | 469 | py | Python | blousebrothers/users/migrations/0018_user_last_dossier_url.py | sladinji/blousebrothers | 461de3ba011c0aaed3f0014136c4497b6890d086 | [
"MIT"
] | 1 | 2022-01-27T11:58:10.000Z | 2022-01-27T11:58:10.000Z | blousebrothers/users/migrations/0018_user_last_dossier_url.py | sladinji/blousebrothers | 461de3ba011c0aaed3f0014136c4497b6890d086 | [
"MIT"
] | 5 | 2021-03-19T00:01:54.000Z | 2022-03-11T23:46:21.000Z | blousebrothers/users/migrations/0018_user_last_dossier_url.py | sladinji/blousebrothers | 461de3ba011c0aaed3f0014136c4497b6890d086 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-08-28 09:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0017_set_score'),
]
operations = [
migrations.AddField(
... | 22.333333 | 74 | 0.618337 |
1a9305aa4cf7be0ba66932c7cad94fd84703d587 | 3,775 | py | Python | TianChi/JingNanShuZi/src/exceptionhandling.py | cookcv/competition | b687cd549d6cb069438f8e574de869a0cac68265 | [
"MIT"
] | 1 | 2020-11-30T16:34:38.000Z | 2020-11-30T16:34:38.000Z | TianChi/JingNanShuZi/src/exceptionhandling.py | sunnykai/competition | b687cd549d6cb069438f8e574de869a0cac68265 | [
"MIT"
] | 1 | 2019-07-17T12:57:07.000Z | 2019-07-17T12:57:07.000Z | TianChi/JingNanShuZi/src/exceptionhandling.py | sunnykai/competition | b687cd549d6cb069438f8e574de869a0cac68265 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import re
class PrepareData:
def __init__(self,train_data,test_data):
# 变量初始化
self.train = train_data
self.test = test_data
def exceptionHandling(self):
good_cols = list(self.train.columns)
self.train = self.train[self.train['收率... | 32.826087 | 112 | 0.488212 |
1a930fde145b4941f939061f45b6f6b76903133b | 939 | py | Python | hackerrank/30-days-of-code/day24-linked-list-deletion.py | AmrMKayid/KayAlgo | df6e2b5b0f74174d5c0950520f0c47b04212dfaa | [
"MIT"
] | 1 | 2019-02-11T13:29:32.000Z | 2019-02-11T13:29:32.000Z | hackerrank/30-days-of-code/day24-linked-list-deletion.py | AmrMKayid/KayAlgo | df6e2b5b0f74174d5c0950520f0c47b04212dfaa | [
"MIT"
] | 1 | 2019-02-11T15:26:36.000Z | 2019-02-11T15:26:36.000Z | hackerrank/30-days-of-code/day24-linked-list-deletion.py | AmrMKayid/KayAlgo | df6e2b5b0f74174d5c0950520f0c47b04212dfaa | [
"MIT"
] | null | null | null | class Node:
def __init__(self, data):
self.data = data
self.next = None
class Solution:
def insert(self, head, data):
p = Node(data)
if head == None:
head = p
elif head.next == None:
head.next = p
else:
start = head
while (start.next != None):
start = star... | 18.78 | 36 | 0.584665 |
1a9332dc427eefb3a723b7c7f0a5b58b7cdd45a3 | 2,403 | py | Python | slowotok.py | casper01/SlowotokSolver | 6245840a5631f0d9bcc0be0426bb4f9fe043a7cd | [
"MIT"
] | null | null | null | slowotok.py | casper01/SlowotokSolver | 6245840a5631f0d9bcc0be0426bb4f9fe043a7cd | [
"MIT"
] | null | null | null | slowotok.py | casper01/SlowotokSolver | 6245840a5631f0d9bcc0be0426bb4f9fe043a7cd | [
"MIT"
] | null | null | null | from typing import List, Tuple
from dictionary import Dictionary
import settings
from trie import TrieNode
class Slowotok:
def __init__(self):
self.board = None
print('Ladowanie slownika...')
self.dictionary = Dictionary()
print('Sukces!')
self.usedWords = set()
def se... | 33.375 | 109 | 0.532667 |
1a939f788af46cc794dc7812ca2bcae218697dd6 | 9,792 | py | Python | app/routes.py | PhtRaveller/covid19-ru | 04d7df2c1fc390767a9dc0836c47c8658544f848 | [
"MIT"
] | 9 | 2020-05-09T19:01:36.000Z | 2021-08-14T17:50:16.000Z | app/routes.py | PhtRaveller/covid19-ru | 04d7df2c1fc390767a9dc0836c47c8658544f848 | [
"MIT"
] | 5 | 2020-10-20T22:28:30.000Z | 2022-03-12T00:24:52.000Z | app/routes.py | PhtRaveller/covid19-ru | 04d7df2c1fc390767a9dc0836c47c8658544f848 | [
"MIT"
] | 3 | 2020-04-21T12:02:23.000Z | 2020-11-14T08:01:00.000Z | """Routes for CoVID-19 dashboard app."""
from flask import render_template
from app import covid_app
from app import data
from app import plotting
from app import config as cfg
from app import constants as cts
from bokeh.embed import components
def filter_secondary_links(region, num_links=2):
"""Return `num_link... | 43.136564 | 105 | 0.518995 |
1a93b864401c5ecc335611480215c1f3147dde4e | 2,546 | py | Python | PythonProjects/23-TkinterCommunication/src/m1e_communication_without_comments.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/23-TkinterCommunication/src/m1e_communication_without_comments.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/23-TkinterCommunication/src/m1e_communication_without_comments.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | """ Same as m1e_communication but without comments, to focus on the code. """
import tkinter
from tkinter import ttk
import mqtt_for_csse120 as communicator
def main(who_am_i):
game = Game(who_am_i)
game.start()
class Game(object):
def __init__(self, who_am_i):
self.gui = GUI(self)
can... | 28.606742 | 79 | 0.573841 |
1a93c6a9160121bada8ce37b6c4d7d97eadf69b6 | 616 | py | Python | app/model/source/rais.py | smartlab-br/datahub-api | 193e71172bb4891a5bbffc902da07ef57df9ab07 | [
"MIT"
] | 1 | 2019-07-25T21:15:05.000Z | 2019-07-25T21:15:05.000Z | app/model/source/rais.py | smartlab-br/datahub-api | 193e71172bb4891a5bbffc902da07ef57df9ab07 | [
"MIT"
] | 44 | 2019-08-05T15:24:00.000Z | 2022-01-31T23:11:31.000Z | app/model/source/rais.py | smartlab-br/datahub-api | 193e71172bb4891a5bbffc902da07ef57df9ab07 | [
"MIT"
] | 1 | 2021-05-11T07:49:51.000Z | 2021-05-11T07:49:51.000Z | ''' Classes to create options dictionary for RAIS datasources '''
from model.source.base import BaseSource
class Rais(BaseSource):
''' Base Option builder class for RAIS datasources '''
def get_options_rules_empresa(self, options, local_cols, df, persp):
subset_rules = ["and", f"eq-tp_estab-1"]
... | 38.5 | 79 | 0.637987 |
1a93d89bc64acda8178b99ab419208ba07924dcb | 1,133 | py | Python | flask_hackernews_clone/tasks/thumbnail.py | andyguwc/flask-hackernews-clone | 8b3f5a5e58f8e71e6991a248cc5287e753f43048 | [
"MIT"
] | null | null | null | flask_hackernews_clone/tasks/thumbnail.py | andyguwc/flask-hackernews-clone | 8b3f5a5e58f8e71e6991a248cc5287e753f43048 | [
"MIT"
] | null | null | null | flask_hackernews_clone/tasks/thumbnail.py | andyguwc/flask-hackernews-clone | 8b3f5a5e58f8e71e6991a248cc5287e753f43048 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from flask import current_app
from PIL import Image
from zipfile import ZipFile
from flask_hackernews_clone import settings
from flask_hackernews_clone.extensions import celery
@celery.task
def make_thumbnails(file_path, thumbnails=[]):
"""Take an image file directory and thumn... | 27.634146 | 90 | 0.646955 |
1a9417775335d78d5ed6cf4debf8d7696b8cad1c | 5,285 | py | Python | synapse/resources/users-plugin/users.py | mrmuxl/synapse-agent | 615ccc8faefa0f7d66d070a7444fe57e67e3bae1 | [
"MIT"
] | 1 | 2016-06-23T05:56:53.000Z | 2016-06-23T05:56:53.000Z | synapse/resources/users-plugin/users.py | mrmuxl/synapse-agent | 615ccc8faefa0f7d66d070a7444fe57e67e3bae1 | [
"MIT"
] | null | null | null | synapse/resources/users-plugin/users.py | mrmuxl/synapse-agent | 615ccc8faefa0f7d66d070a7444fe57e67e3bae1 | [
"MIT"
] | null | null | null | from synapse.resources.resources import ResourcesController
from synapse.synapse_exceptions import ResourceException
from synapse.logger import logger
@logger
class UsersController(ResourcesController):
__resource__ = "users"
def read(self, res_id=None, attributes=None):
"""
Gets information... | 33.03125 | 78 | 0.527152 |
1a942f6af41e5c2f3edd2f9b87a289231295a906 | 9,441 | py | Python | botx/models/attachments.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 13 | 2021-01-21T12:43:10.000Z | 2022-03-23T11:11:59.000Z | botx/models/attachments.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 259 | 2020-02-26T08:51:03.000Z | 2022-03-23T11:08:36.000Z | botx/models/attachments.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 5 | 2019-12-02T16:19:22.000Z | 2021-11-22T20:33:34.000Z | """Module with attachments for botx."""
from typing import List, Optional, Union, cast
from pydantic import Field
from botx.models.base import BotXBaseModel
from botx.models.enums import AttachmentsTypes, LinkProtos
from botx.models.files import File
try:
from typing import Literal # noqa: WPS433
except Import... | 25.447439 | 87 | 0.636691 |
1a945bd0d5c70f3a8e43c2ca4818202a1955c3f7 | 7,719 | py | Python | test_maildir2mbox.py | axfelix/maildir2mbox | 671417695c483c12756e8c3b11fd285bf5b52061 | [
"Unlicense"
] | 83 | 2015-02-12T22:12:26.000Z | 2022-03-01T05:56:16.000Z | test_maildir2mbox.py | axfelix/maildir2mbox | 671417695c483c12756e8c3b11fd285bf5b52061 | [
"Unlicense"
] | 6 | 2019-04-17T06:26:09.000Z | 2020-06-08T05:15:01.000Z | test_maildir2mbox.py | axfelix/maildir2mbox | 671417695c483c12756e8c3b11fd285bf5b52061 | [
"Unlicense"
] | 16 | 2015-08-05T12:52:06.000Z | 2021-09-12T08:34:14.000Z | """
The file is under no license. See LICENSE.txt for more details.
"""
import unittest, shutil, sys
from pathlib import Path
from maildir2mbox import convert
class TestMaildir2Mbox(unittest.TestCase):
def setUp(self):
self.mbox_path = Path('test_data/mbox_toto')
self.mbox_dir ... | 43.610169 | 98 | 0.642052 |
1a945f1be71ceb167b5500d9bf02f4fb0e08f93f | 5,768 | py | Python | collections/ansible_collections/ansible/netcommon/tests/unit/mock/yaml_helper.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | null | null | null | collections/ansible_collections/ansible/netcommon/tests/unit/mock/yaml_helper.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | null | null | null | collections/ansible_collections/ansible/netcommon/tests/unit/mock/yaml_helper.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | 2 | 2021-03-30T14:26:02.000Z | 2021-04-01T18:17:29.000Z | import io
import yaml
from ansible.module_utils.six import PY3
from ansible.parsing.yaml.loader import AnsibleLoader
from ansible.parsing.yaml.dumper import AnsibleDumper
class YamlTestUtils(object):
"""Mixin class to combine with a unittest.TestCase subclass."""
def _loader(self, stream):
"""Vault ... | 34.957576 | 89 | 0.626907 |
1a947a7117033a6ddc05235926a247a132ec553f | 32,117 | py | Python | test/functional/fundrawtransaction.py | biblepay/biblepay | 6af4517c623620f60cabc228cc2f63c35d1beb5b | [
"MIT"
] | 63 | 2017-07-25T21:57:21.000Z | 2022-02-05T02:58:03.000Z | test/functional/fundrawtransaction.py | biblepay/biblepay | 6af4517c623620f60cabc228cc2f63c35d1beb5b | [
"MIT"
] | 105 | 2017-09-04T00:52:17.000Z | 2021-05-22T13:58:37.000Z | test/functional/fundrawtransaction.py | biblepay/biblepay | 6af4517c623620f60cabc228cc2f63c35d1beb5b | [
"MIT"
] | 62 | 2017-08-04T19:48:40.000Z | 2021-07-07T12:21:12.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the fundrawtransaction RPC."""
from test_framework.test_framework import BitcoinTestFramework
fro... | 44.668985 | 214 | 0.570352 |
1a949ac36498586f8350c8af7b2d05209e896cab | 34,588 | py | Python | GPU Accelerated/ANN_gpu.py | meghshukla/Fully-Connected-Neural-Network-in-Python-3 | 09f8072ac198fe1c2daddc07412b33ac4ede5862 | [
"MIT"
] | null | null | null | GPU Accelerated/ANN_gpu.py | meghshukla/Fully-Connected-Neural-Network-in-Python-3 | 09f8072ac198fe1c2daddc07412b33ac4ede5862 | [
"MIT"
] | null | null | null | GPU Accelerated/ANN_gpu.py | meghshukla/Fully-Connected-Neural-Network-in-Python-3 | 09f8072ac198fe1c2daddc07412b33ac4ede5862 | [
"MIT"
] | null | null | null | #To see the submission demonstration, run ANNGui, which executes the GUI and makes calls to functions written here.
#Project submission of Megh Shukla : 173310008 and Ushasi Chaudhari : 174310003
#Project demonstrated on 2nd May, VIP Lab at 10pm to Deepak Sir
#Project title : GPU acceleration for Neural Networks using... | 50.346434 | 247 | 0.64771 |
1a94fa422db28b408b524cae20f663decc2e9b8b | 8,175 | py | Python | nc_programs/conformer_search_multigpu.py | plin1112/ANI-Tools | 76280c918fc79fee8c266b8bc9ab57f86104ec99 | [
"MIT"
] | 8 | 2018-10-30T16:48:44.000Z | 2021-03-08T01:44:41.000Z | nc_programs/conformer_search_multigpu.py | plin1112/ANI-Tools | 76280c918fc79fee8c266b8bc9ab57f86104ec99 | [
"MIT"
] | null | null | null | nc_programs/conformer_search_multigpu.py | plin1112/ANI-Tools | 76280c918fc79fee8c266b8bc9ab57f86104ec99 | [
"MIT"
] | 5 | 2018-04-05T15:51:12.000Z | 2019-05-23T21:38:31.000Z | import pyaniasetools as pya
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.ML.Cluster import Butina
import pybel
import hdnntools as hdt
import numpy as np
from multiprocessing import Process
import multiprocessing
import time
#################PARAMETERS#######################
#netdir = '/home/jsm... | 32.440476 | 121 | 0.63682 |
1a94fd85b3c6f9e3deecac4b7a01274343fc6646 | 231 | py | Python | zhusuan/distributions/__init__.py | thuwzy/ZhuSuan-PyTorch | 471e4d401a6edce07312b01b2b76fa2c56b15c0f | [
"MIT"
] | 12 | 2021-08-11T10:28:21.000Z | 2022-03-12T14:20:02.000Z | zhusuan/distributions/__init__.py | thuwzy/ZhuSuan-PyTorch | 471e4d401a6edce07312b01b2b76fa2c56b15c0f | [
"MIT"
] | null | null | null | zhusuan/distributions/__init__.py | thuwzy/ZhuSuan-PyTorch | 471e4d401a6edce07312b01b2b76fa2c56b15c0f | [
"MIT"
] | 2 | 2021-08-17T12:05:15.000Z | 2022-01-12T09:47:49.000Z | from .normal import *
from .bernoulli import *
from .logistic import *
from .beta import *
from .gamma import *
from .laplace import *
from .uniform import *
from .studentT import *
from .possion import *
from .exponential import * | 23.1 | 26 | 0.744589 |
1a9548063ecd028001798a33f93dfbff5e0e1c90 | 7,421 | py | Python | VMEncryption/main/Common.py | jamvar/azure-linux-extensions | 66610daae2ef09f7920d9c4aa2e99a3035fe76a6 | [
"Apache-2.0"
] | null | null | null | VMEncryption/main/Common.py | jamvar/azure-linux-extensions | 66610daae2ef09f7920d9c4aa2e99a3035fe76a6 | [
"Apache-2.0"
] | null | null | null | VMEncryption/main/Common.py | jamvar/azure-linux-extensions | 66610daae2ef09f7920d9c4aa2e99a3035fe76a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2015 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 34.041284 | 131 | 0.689934 |
1a95699247e9a592c799d7e6bca4944bc0910a15 | 10,641 | py | Python | moopt/pgen.py | viguardieiro/moopt | 7f6f68c2fe52ca2d329a40f82ecbd54113e20221 | [
"BSD-3-Clause"
] | 1 | 2022-01-12T18:57:27.000Z | 2022-01-12T18:57:27.000Z | moopt/pgen.py | viguardieiro/moopt | 7f6f68c2fe52ca2d329a40f82ecbd54113e20221 | [
"BSD-3-Clause"
] | null | null | null | moopt/pgen.py | viguardieiro/moopt | 7f6f68c2fe52ca2d329a40f82ecbd54113e20221 | [
"BSD-3-Clause"
] | 1 | 2020-03-04T02:01:57.000Z | 2020-03-04T02:01:57.000Z | # -*- coding: utf-8 -*-
"""
Noninferior Set Estimation implementation
Author: Marcos M. Raimundo <marcosmrai@gmail.com>
Laboratory of Bioinformatics and Bioinspired Computing
FEEC - University of Campinas
Reference:
Cohon, Jared L., Church, Richard L., Sheer, Daniel P.
Generating multiobjectiv... | 31.669643 | 79 | 0.56583 |
1a9585727998e185f4ff09287290df6ac1956503 | 2,046 | py | Python | source_sklearn/train.py | Supearnesh/ml-plagiarism-svm | 9ebc4de196b5f8c588b356f3f846300918a04652 | [
"MIT"
] | 3 | 2020-06-28T22:35:51.000Z | 2021-11-15T10:55:25.000Z | source_sklearn/train.py | Supearnesh/ml-plagiarism-svm | 9ebc4de196b5f8c588b356f3f846300918a04652 | [
"MIT"
] | null | null | null | source_sklearn/train.py | Supearnesh/ml-plagiarism-svm | 9ebc4de196b5f8c588b356f3f846300918a04652 | [
"MIT"
] | 2 | 2020-09-24T13:14:56.000Z | 2022-02-08T16:51:49.000Z | from __future__ import print_function
import argparse
import os
import pandas as pd
from sklearn.externals import joblib
## DONE: Import any additional libraries you need to define a model
from sklearn import svm
# Provided model load function
def model_fn(model_dir):
"""Load model from the model_dir. This is t... | 29.228571 | 103 | 0.677419 |
1a9585ca6c6f6193cd5a52328bd70399c9415811 | 706 | py | Python | largest_palindrome_product/solution.py | codejacktsu/projecteuler | 04c76e09a2975ee5ecb73025e7813bee457bd569 | [
"MIT"
] | null | null | null | largest_palindrome_product/solution.py | codejacktsu/projecteuler | 04c76e09a2975ee5ecb73025e7813bee457bd569 | [
"MIT"
] | null | null | null | largest_palindrome_product/solution.py | codejacktsu/projecteuler | 04c76e09a2975ee5ecb73025e7813bee457bd569 | [
"MIT"
] | null | null | null | """
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the product of two 3-digit numbers.
"""
from util import timer
@timer
def largest_palindrome_product(n):
""" largest palindrome of produ... | 21.393939 | 133 | 0.610482 |
1a95c4b3e8d74bfa31ebf4d2836746e3dfc9f89b | 3,165 | py | Python | Scripts/read_DailyOutput.py | zmlabe/ThicknessSensitivity | 6defdd897a61d7d1a02f34a9f4ec92b2b17b3075 | [
"MIT"
] | 1 | 2017-10-22T02:22:14.000Z | 2017-10-22T02:22:14.000Z | Scripts/read_DailyOutput.py | zmlabe/ThicknessSensitivity | 6defdd897a61d7d1a02f34a9f4ec92b2b17b3075 | [
"MIT"
] | null | null | null | Scripts/read_DailyOutput.py | zmlabe/ThicknessSensitivity | 6defdd897a61d7d1a02f34a9f4ec92b2b17b3075 | [
"MIT"
] | 4 | 2018-04-05T17:55:36.000Z | 2022-03-31T07:05:01.000Z | """
Script reads in daily data from WACCM4 experiments (CIT,HIT,FIT)
Notes
-----
Author : Zachary Labe
Date : 6 September 2017
Usage
-----
readMeanExperi(directory,varid,experi,level)
"""
def readMeanExperi(directory,varid,experi,level):
"""
Function reads daily data from WACCM4 simulation... | 30.728155 | 74 | 0.5406 |
1a95c83bd854fedc7ff4a843cac8956283a4a3c2 | 1,210 | py | Python | oscar/lib/python2.7/site-packages/django/contrib/contenttypes/migrations/0002_remove_content_type_name.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/contrib/contenttypes/migrations/0002_remove_content_type_name.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/contrib/contenttypes/migrations/0002_remove_content_type_name.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def add_legacy_name(apps, schema_editor):
ContentType = apps.get_model('contenttypes', 'ContentType')
for ct in ContentType.objects.all():
try:
ct.name = apps.get_model(ct.ap... | 28.139535 | 94 | 0.567769 |
1a95df0f55419aba2076d7f6c33fb8b767033057 | 2,491 | py | Python | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_generated/v7_0/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_generated/v7_0/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_generated/v7_0/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 42.948276 | 108 | 0.670413 |
1a9621794afda6fbbbba50984a2b0d51e494f20a | 7,607 | py | Python | boot/scripts/photomateur_api.py | maxmlr/rpi-photobooth | bd479e321320d433bbc33c678b3e0a97640b6cb5 | [
"MIT"
] | 1 | 2021-11-08T20:46:00.000Z | 2021-11-08T20:46:00.000Z | boot/scripts/photomateur_api.py | maxmlr/rpi-photobooth | bd479e321320d433bbc33c678b3e0a97640b6cb5 | [
"MIT"
] | 72 | 2020-01-23T16:56:30.000Z | 2021-11-14T23:25:15.000Z | boot/scripts/photomateur_api.py | maxmlr/rpi-photobooth | bd479e321320d433bbc33c678b3e0a97640b6cb5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import requests
import time
import json
import pystemd.journal
from pystemd.systemd1 import Unit
from helpers import retry, source, inlineReplace, run_command
class PhotomateurAPI:
photobooth_config = '/boot/photobooth.conf'
entrypoint = 'https://admin.photomateur.de/api/v1... | 41.796703 | 129 | 0.529907 |
1a9647b10ea519b4a379c798436df960659e2f6f | 18,621 | py | Python | tests/interpolators/test_rave_trajectory.py | Puttichai/toppra | 4d7dbfdc0772b72e4cc8283c944baf142357a76e | [
"MIT"
] | 1 | 2018-12-18T23:53:57.000Z | 2018-12-18T23:53:57.000Z | tests/interpolators/test_rave_trajectory.py | Puttichai/toppra | 4d7dbfdc0772b72e4cc8283c944baf142357a76e | [
"MIT"
] | 1 | 2020-06-01T21:27:23.000Z | 2020-06-01T21:27:23.000Z | tests/interpolators/test_rave_trajectory.py | Puttichai/toppra | 4d7dbfdc0772b72e4cc8283c944baf142357a76e | [
"MIT"
] | 2 | 2020-04-06T16:22:25.000Z | 2020-06-12T00:45:10.000Z | import numpy as np
import pytest
try:
import openravepy as orpy
FOUND_OPENRAVE = True
except ImportError:
FOUND_OPENRAVE = False
import toppra
@pytest.fixture(scope='module')
def env():
env = orpy.Environment()
env.Load('data/lab1.env.xml')
env.GetRobots()[0].SetActiveDOFs(range(7))
yield ... | 241.831169 | 6,795 | 0.818001 |
1a964aa103113e864139fc975f2a99ebee2c724d | 2,597 | py | Python | tests/test_firmware_device.py | cbajumpa/pi-top-Python-Common-Library | 28b0301de0c5468714518e669742ef6be7738ce6 | [
"Apache-2.0"
] | 1 | 2021-05-12T14:21:12.000Z | 2021-05-12T14:21:12.000Z | tests/test_firmware_device.py | cbajumpa/pi-top-Python-Common-Library | 28b0301de0c5468714518e669742ef6be7738ce6 | [
"Apache-2.0"
] | 10 | 2020-12-01T11:27:24.000Z | 2021-07-28T23:29:20.000Z | tests/test_firmware_device.py | cbajumpa/pi-top-Python-Common-Library | 28b0301de0c5468714518e669742ef6be7738ce6 | [
"Apache-2.0"
] | 1 | 2021-02-01T21:17:56.000Z | 2021-02-01T21:17:56.000Z | from unittest import TestCase
from sys import modules
from unittest.mock import Mock
from parameterized import parameterized
mock_logger = modules["pitopcommon.logger"] = Mock()
mock_i2c_device = modules["pitopcommon.i2c_device"] = Mock()
# import after applying mocks
from pitopcommon.common_ids import FirmwareDevice... | 30.552941 | 79 | 0.662303 |
1a964bce50e34448a0c1f5fb3305e40d316d84b5 | 2,113 | py | Python | custom_components/xiaomi_gateway3/core/converters/__init__.py | zvldz/homeassistant | becbe7087e3cf152cce2f9bb3670e3a0a283fc79 | [
"BSD-2-Clause"
] | 13 | 2019-06-04T12:23:25.000Z | 2021-11-23T17:24:27.000Z | custom_components/xiaomi_gateway3/core/converters/__init__.py | zvldz/homeassistant | becbe7087e3cf152cce2f9bb3670e3a0a283fc79 | [
"BSD-2-Clause"
] | 1 | 2020-10-22T11:14:24.000Z | 2020-10-22T18:36:30.000Z | custom_components/xiaomi_gateway3/core/converters/__init__.py | zvldz/homeassistant | becbe7087e3cf152cce2f9bb3670e3a0a283fc79 | [
"BSD-2-Clause"
] | 1 | 2020-08-25T18:41:34.000Z | 2020-08-25T18:41:34.000Z | import logging
from dataclasses import dataclass
from typing import List, Optional
from .base import Converter, LUMI_GLOBALS
from .const import GATEWAY, ZIGBEE, BLE, MESH, MESH_GROUP_MODEL, UNKNOWN
from .devices import DEVICES
try:
# loading external converters
# noinspection PyUnresolvedReferences
from x... | 28.173333 | 79 | 0.613346 |
1a967946b98814b3789d53facc858b929435ad19 | 632 | py | Python | commonblocks/templatetags/commonblocks_tags.py | springload/wagtailblocks | 2226597db2fad52e661eed14e5fc8de0a1a8b347 | [
"MIT"
] | 25 | 2015-11-27T09:22:50.000Z | 2018-01-28T23:42:51.000Z | commonblocks/templatetags/commonblocks_tags.py | springload/wagtailcommonblocks | 2226597db2fad52e661eed14e5fc8de0a1a8b347 | [
"MIT"
] | 7 | 2018-03-21T04:46:51.000Z | 2021-04-14T05:15:33.000Z | commonblocks/templatetags/commonblocks_tags.py | springload/wagtailblocks | 2226597db2fad52e661eed14e5fc8de0a1a8b347 | [
"MIT"
] | 6 | 2016-11-12T20:11:34.000Z | 2018-03-12T15:49:07.000Z | from django import template
from django.utils.safestring import mark_safe
from commonblocks.simple_rich_text import SimpleRichText
try:
from wagtail.core.rich_text import expand_db_html
except ImportError:
from wagtail.wagtailcore.rich_text import expand_db_html
register = template.Library()
@register.fil... | 22.571429 | 84 | 0.724684 |
1a9684ad67405d64f77ab9ef3bb616afe4c41d70 | 7,890 | py | Python | python3/knapsack/wPoint.py | CostaBru/knapsack | cdd95de759c20b0cdeef4064fbbed10df1ab76d0 | [
"MIT"
] | 1 | 2021-03-06T16:38:28.000Z | 2021-03-06T16:38:28.000Z | python3/knapsack/wPoint.py | CostaBru/knapsack | cdd95de759c20b0cdeef4064fbbed10df1ab76d0 | [
"MIT"
] | null | null | null | python3/knapsack/wPoint.py | CostaBru/knapsack | cdd95de759c20b0cdeef4064fbbed10df1ab76d0 | [
"MIT"
] | null | null | null | """
Copyright Feb 2021 Konstantin Briukhnov (kooltew at gmail.com) (@CostaBru). San-Francisco Bay Area.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limit... | 25.369775 | 146 | 0.609252 |
1a969407fdb2410d5165933ea8279da129b9c8d2 | 18,514 | py | Python | A1/knn.py | luckyrabbit85/EECS-498-007-598-005-Deep-Learning-for-Computer-Vision | a23c3cff297681f423b8389c6dcd0a2af475246e | [
"MIT"
] | 1 | 2021-07-13T17:55:12.000Z | 2021-07-13T17:55:12.000Z | A1/knn.py | luckyrabbit85/EECS-498-007-598-005-Deep-Learning-for-Computer-Vision | a23c3cff297681f423b8389c6dcd0a2af475246e | [
"MIT"
] | null | null | null | A1/knn.py | luckyrabbit85/EECS-498-007-598-005-Deep-Learning-for-Computer-Vision | a23c3cff297681f423b8389c6dcd0a2af475246e | [
"MIT"
] | null | null | null | """
Implements a K-Nearest Neighbor classifier in PyTorch.
"""
import torch
import statistics
def hello():
"""
This is a sample function that we will try to import and run to ensure that
our environment is correctly set up on Google Colab.
"""
print('Hello from knn.py!')
def compute_distances_two_loops(x_... | 45.046229 | 94 | 0.550718 |
1a96caf4d0518ecbfa836e257fc9d7b98767796c | 5,342 | py | Python | duoclieu/admin.py | alibaba1233456789/hieu_nguyen123 | 19728f33eae02cfdaa4d9190d9d3053d4267b992 | [
"MIT"
] | null | null | null | duoclieu/admin.py | alibaba1233456789/hieu_nguyen123 | 19728f33eae02cfdaa4d9190d9d3053d4267b992 | [
"MIT"
] | null | null | null | duoclieu/admin.py | alibaba1233456789/hieu_nguyen123 | 19728f33eae02cfdaa4d9190d9d3053d4267b992 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import LoiNoiDauDL, HoThucVat, DuocLieu, DacDiemVaPhanBo, BoPhanDung, DacDiemViPhauVaBot, ThanhPhanHoaHoc, TacDungVaCongDung, CheBien, HinhAnhMinhHoa, ChePham, ChuY, GhiChu, HinhAnhBoSung, TenKhoaHoc
#--------------------------------------
admin.site.register(LoiNoiDauDL)... | 30.701149 | 246 | 0.65219 |
1a96d0985be8ee09438892aba5abb81b5ac8b861 | 729 | py | Python | django-backend/user_profile/urls.py | isystematics/SoarCast | 6ba8d7db76e2ba1ad5fd1ab3636dd202b11450b0 | [
"Apache-2.0"
] | 2 | 2021-06-08T16:35:30.000Z | 2022-03-18T16:04:48.000Z | django-backend/user_profile/urls.py | isystematics/SoarCast | 6ba8d7db76e2ba1ad5fd1ab3636dd202b11450b0 | [
"Apache-2.0"
] | 4 | 2022-02-22T18:43:07.000Z | 2022-02-22T18:45:25.000Z | django-backend/user_profile/urls.py | isystematics/SoarCast | 6ba8d7db76e2ba1ad5fd1ab3636dd202b11450b0 | [
"Apache-2.0"
] | null | null | null | from django.conf import settings
from django.conf.urls.static import static
from django.urls import path
from .views import (
TOTPCreateView,
TOTPVerifyView,
ChangePasswordView,
RefreshTokenView
)
urlpatterns = [
path('change-password/', ChangePasswordView.as_view(), name='change-password'),
path(... | 31.695652 | 97 | 0.742112 |
1a96daead9b4381f663f7b2282e8d356935e7190 | 5,959 | py | Python | sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_managed_rule_sets_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_managed_rule_sets_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/operations/_managed_rule_sets_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 41.096552 | 143 | 0.67075 |
1a970d20ad7735770e85a436325576b8306f1a11 | 4,133 | py | Python | django_enum_choices/tests/e2e/tests.py | okapies/django-enum-choices | f913ad8eb74e73fda77662018a5f03b929799aea | [
"MIT"
] | 73 | 2019-06-21T15:20:15.000Z | 2021-11-18T16:05:52.000Z | django_enum_choices/tests/e2e/tests.py | okapies/django-enum-choices | f913ad8eb74e73fda77662018a5f03b929799aea | [
"MIT"
] | 36 | 2019-06-21T14:48:44.000Z | 2021-11-25T14:42:33.000Z | django_enum_choices/tests/e2e/tests.py | okapies/django-enum-choices | f913ad8eb74e73fda77662018a5f03b929799aea | [
"MIT"
] | 13 | 2019-07-24T12:42:41.000Z | 2021-11-18T16:06:35.000Z | import os
import shutil
from subprocess import check_output
import shlex
import psycopg2
from psycopg2.extras import DictCursor
class Database:
def get_column_size(self):
cursor = self.connection.cursor(
cursor_factory=DictCursor
)
query = """
SELECT character_maximum... | 25.512346 | 93 | 0.669973 |
1a9714bfea5d0d52b15388d422addf658c2f7342 | 5,065 | py | Python | oscar/lib/python2.7/site-packages/prompt_toolkit/contrib/telnet/protocol.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/prompt_toolkit/contrib/telnet/protocol.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/prompt_toolkit/contrib/telnet/protocol.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """
Parser for the Telnet protocol. (Not a complete implementation of the telnet
specification, but sufficient for a command line interface.)
Inspired by `Twisted.conch.telnet`.
"""
from __future__ import unicode_literals
import struct
from six import int2byte, binary_type, iterbytes
from .log import logg... | 27.82967 | 77 | 0.508391 |
1a971c8baae6e2203942d80d94fd9de022c21730 | 619 | py | Python | app/search/query_executor.py | mbroz/feel-the-streets | 6e21a496f1530b0500ca66e11712f3f31cd857ae | [
"MIT"
] | 5 | 2018-03-19T19:04:53.000Z | 2021-02-19T16:44:04.000Z | app/search/query_executor.py | mbroz/feel-the-streets | 6e21a496f1530b0500ca66e11712f3f31cd857ae | [
"MIT"
] | 6 | 2020-04-18T16:14:22.000Z | 2021-08-14T09:23:16.000Z | app/search/query_executor.py | mbroz/feel-the-streets | 6e21a496f1530b0500ca66e11712f3f31cd857ae | [
"MIT"
] | 1 | 2021-01-10T18:47:38.000Z | 2021-01-10T18:47:38.000Z | from PySide2.QtCore import QThread, Signal
from PySide2.QtWidgets import QApplication
from ..services import map
from ..geometry_utils import distance_filter
class QueryExecutor(QThread):
results_ready = Signal(list)
def __init__(self, query, position, distance):
super().__init__()
s... | 32.578947 | 84 | 0.696284 |
1a971d96669ccbdb4d28df67497cbdaf6a6fd131 | 5,319 | py | Python | codes/utils/data_utils.py | finaluzi/EGVSR-infer | 0b07a52ac370dddd42bfade57072304beaf872fc | [
"MIT"
] | 3 | 2021-11-07T22:07:15.000Z | 2021-11-21T18:05:29.000Z | codes/utils/data_utils.py | finaluzi/EGVSR-infer | 0b07a52ac370dddd42bfade57072304beaf872fc | [
"MIT"
] | null | null | null | codes/utils/data_utils.py | finaluzi/EGVSR-infer | 0b07a52ac370dddd42bfade57072304beaf872fc | [
"MIT"
] | 1 | 2022-03-11T05:45:50.000Z | 2022-03-11T05:45:50.000Z | from PIL import Image
import os
import os.path as osp
from scipy import signal
import cv2
import numpy as np
import torch
import torch.nn.functional as F
def create_kernel(opt):
sigma = opt['dataset']['degradation'].get('sigma', 1.5)
ksize = 1 + 2 * int(sigma * 3.0)
gkern1d = signal.gaussian(ksize, std=... | 31.473373 | 88 | 0.597293 |
1a9759d801197c29c896aa3ef7681a33ff9adc7c | 38,542 | py | Python | demisto_sdk/commands/common/update_id_set.py | SepioSystems/demisto-sdk | f28007a637b7a38f4165bc522328ccbbd9b05628 | [
"MIT"
] | null | null | null | demisto_sdk/commands/common/update_id_set.py | SepioSystems/demisto-sdk | f28007a637b7a38f4165bc522328ccbbd9b05628 | [
"MIT"
] | null | null | null | demisto_sdk/commands/common/update_id_set.py | SepioSystems/demisto-sdk | f28007a637b7a38f4165bc522328ccbbd9b05628 | [
"MIT"
] | null | null | null | import glob
import itertools
import json
import os
import re
import time
from collections import OrderedDict
from distutils.version import LooseVersion
from functools import partial
from multiprocessing import Pool, cpu_count
import click
from demisto_sdk.commands.common.constants import (
BETA_INTEGRATION_REGEX, ... | 38.580581 | 120 | 0.658736 |
1a975cedc51358ca3913b84883c93ec5f7eeedef | 5,314 | py | Python | ginga/misc/ParamSet.py | SimonKrughoff/ginga | abcd284228400092b2d7b73bb51d30632e90ee03 | [
"BSD-3-Clause"
] | null | null | null | ginga/misc/ParamSet.py | SimonKrughoff/ginga | abcd284228400092b2d7b73bb51d30632e90ee03 | [
"BSD-3-Clause"
] | null | null | null | ginga/misc/ParamSet.py | SimonKrughoff/ginga | abcd284228400092b2d7b73bb51d30632e90ee03 | [
"BSD-3-Clause"
] | null | null | null | #
# ParamSet.py -- Groups of widgets holding parameters
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from ginga.misc import Callback, Bunch
from ginga.gw import Widgets
class Param(Bunch.Bunch):
pass
class ParamSet(Callback.Callbacks):
def _... | 32.802469 | 76 | 0.546669 |
1a976f632436631db869d122ea9a4921b0a1f148 | 19,489 | py | Python | gammapy/irf/edisp/kernel.py | isu-veritas/gammapy | 715b041d7d3925bd51109dc9534634263a2f2d12 | [
"BSD-3-Clause"
] | null | null | null | gammapy/irf/edisp/kernel.py | isu-veritas/gammapy | 715b041d7d3925bd51109dc9534634263a2f2d12 | [
"BSD-3-Clause"
] | null | null | null | gammapy/irf/edisp/kernel.py | isu-veritas/gammapy | 715b041d7d3925bd51109dc9534634263a2f2d12 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from astropy.io import fits
from astropy.table import Table
from astropy.units import Quantity
from astropy.visualization import quantity_support
from gammapy.maps import MapAxis
from gammapy.utils.scripts import make_path
from ..core im... | 33.144558 | 108 | 0.589615 |
1a979d76f29b11c0bd788ba808595394ceb35d29 | 132,478 | py | Python | src/main.py | hnolCol/ComplexFinder | bd3b5ec358e362d9ccb33e33d8ae070c99706303 | [
"MIT"
] | 3 | 2021-04-06T11:01:53.000Z | 2021-09-20T12:01:56.000Z | src/main.py | hnolCol/ComplexFinder | bd3b5ec358e362d9ccb33e33d8ae070c99706303 | [
"MIT"
] | 3 | 2021-11-18T09:56:12.000Z | 2022-03-12T00:52:46.000Z | src/main.py | hnolCol/ComplexFinder | bd3b5ec358e362d9ccb33e33d8ae070c99706303 | [
"MIT"
] | 2 | 2021-06-12T16:34:18.000Z | 2021-11-23T08:57:04.000Z |
#python imports
import os
import gc
import string
import random
import time
import pickle
import shutil
from datetime import datetime
#internal imports
from modules.Signal import Signal
from modules.Database import Database
from modules.Predictor import Classifier, ComplexBuilder
from modules.utils import calcula... | 50.029456 | 400 | 0.577847 |
1a97c44d5958c39110595e70ef0ffea357860bb2 | 6,164 | py | Python | plugins/holland.lib.lvm/tests/ext3/test_base.py | Alibloke/holland | e630b511a95ed8e36205e8300e632018918223ff | [
"BSD-3-Clause"
] | null | null | null | plugins/holland.lib.lvm/tests/ext3/test_base.py | Alibloke/holland | e630b511a95ed8e36205e8300e632018918223ff | [
"BSD-3-Clause"
] | null | null | null | plugins/holland.lib.lvm/tests/ext3/test_base.py | Alibloke/holland | e630b511a95ed8e36205e8300e632018918223ff | [
"BSD-3-Clause"
] | null | null | null | # pylint: skip-file
import sys
import logging
from nose.tools import *
from holland.lib.lvm.base import *
from holland.lib.lvm.util import getdevice
from tests.constants import *
def test_basevolume():
assert_raises(NotImplementedError, Volume)
class Test(Volume):
pass
ok_(Test())
volume = ... | 35.425287 | 87 | 0.638222 |
1a97c8c5f7677e6e6f46db37d3133698309450b4 | 2,192 | py | Python | contrib/scrooge/src/python/pants/contrib/scrooge/tasks/thrift_util.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | contrib/scrooge/src/python/pants/contrib/scrooge/tasks/thrift_util.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | 1 | 2018-09-04T17:37:34.000Z | 2018-09-04T19:42:58.000Z | contrib/scrooge/src/python/pants/contrib/scrooge/tasks/thrift_util.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import re
INCLUDE_PARSER = re.compile(r'^\s*include\s+"([^"]+)"\s*([\/\/|\#].*)*$')
def find_includes(basedirs, source, log=None):
"""Finds all thrift files included by the... | 30.444444 | 94 | 0.68385 |
1a97d6d3a3260eb9af3ece702100225e7309dc92 | 5,111 | py | Python | archABM/aerosol_model_mit.py | vishalbelsare/ArchABM | 4a5ed9506ba96c38e1f3d7f53d6e469f28fe6873 | [
"MIT"
] | 8 | 2021-07-19T11:54:00.000Z | 2022-03-29T01:45:07.000Z | archABM/aerosol_model_mit.py | vishalbelsare/ArchABM | 4a5ed9506ba96c38e1f3d7f53d6e469f28fe6873 | [
"MIT"
] | null | null | null | archABM/aerosol_model_mit.py | vishalbelsare/ArchABM | 4a5ed9506ba96c38e1f3d7f53d6e469f28fe6873 | [
"MIT"
] | 1 | 2021-08-19T23:56:56.000Z | 2021-08-19T23:56:56.000Z | from typing import Tuple
from .parameters import Parameters
from .aerosol_model import AerosolModel
class AerosolModelMIT(AerosolModel):
"""Aerosol transmission estimator
MIT COVID-19 Indoor Safety Guideline :cite:`Bazante2018995118,Bazant2021.04.04.21254903,Risbeck2021.06.21.21259287`
Theoretical m... | 48.67619 | 226 | 0.706515 |
1a97f5e262f71d3498135f5f49cd06eb4b4e4bc6 | 1,706 | py | Python | tests/integration/aiodi/test_builder.py | ticdenis/python-aiodi | 4ad35145674f5ec0ed6324bec7dd186ab0a8bc33 | [
"MIT"
] | 1 | 2021-11-10T00:21:34.000Z | 2021-11-10T00:21:34.000Z | tests/integration/aiodi/test_builder.py | ticdenis/python-aiodi | 4ad35145674f5ec0ed6324bec7dd186ab0a8bc33 | [
"MIT"
] | 1 | 2022-01-29T15:40:26.000Z | 2022-02-20T20:08:55.000Z | tests/integration/aiodi/test_builder.py | ticdenis/python-aiodi | 4ad35145674f5ec0ed6324bec7dd186ab0a8bc33 | [
"MIT"
] | null | null | null | from logging import Logger
from pathlib import Path
import pytest
from sample.apps.settings import container
from sample.libs.users.application.finder_service import UserFinderService
from sample.libs.users.application.register_service import UserRegisterService
from sample.libs.users.domain.repositories import UserR... | 47.388889 | 117 | 0.765533 |
1a9806bfdf6f84007b9336809d5c03d4ea365cea | 57 | py | Python | file_handler.py | 0xaesc/cryptor | cab8799960cf791d6a3ac38c880b0c66fcd58dae | [
"CC0-1.0"
] | 1 | 2020-01-20T13:41:04.000Z | 2020-01-20T13:41:04.000Z | file_handler.py | 0xaesc/cryptor | cab8799960cf791d6a3ac38c880b0c66fcd58dae | [
"CC0-1.0"
] | 3 | 2020-01-20T14:43:26.000Z | 2020-06-07T18:37:24.000Z | file_handler.py | 0xaesc/cryptor | cab8799960cf791d6a3ac38c880b0c66fcd58dae | [
"CC0-1.0"
] | null | null | null |
def read_cipher(infile):
print('reading' + infile)
| 11.4 | 29 | 0.666667 |
1a9816a8523b5d7f8783711e4deaedb4abe9ed47 | 748 | py | Python | tests/models/PNN_test.py | limingdata/DeepCTR | 9569a171f2d1aa400e15175c09fea49cdd7ab5b7 | [
"MIT"
] | 2 | 2019-04-10T09:39:33.000Z | 2019-04-10T09:39:35.000Z | tests/models/PNN_test.py | Gearchen/DeepCTR | bd5dc215e1c21bf12e6b5297d10f293c45e16c77 | [
"MIT"
] | null | null | null | tests/models/PNN_test.py | Gearchen/DeepCTR | bd5dc215e1c21bf12e6b5297d10f293c45e16c77 | [
"MIT"
] | 1 | 2019-08-09T16:33:27.000Z | 2019-08-09T16:33:27.000Z | import pytest
from deepctr.models import PNN
from ..utils import check_model, get_test_data
@pytest.mark.parametrize(
'use_inner, use_outter,sparse_feature_num',
[(True, True, 1), (True, False, 2), (False, True, 3), (False, False, 1)
]
)
def test_PNN(use_inner, use_outter, sparse_feature_num):
model... | 31.166667 | 96 | 0.709893 |
1a981867f33a3980f92361d9d05f39d974077b3b | 11,405 | py | Python | src/Untitled-1.py | B06901052/deep-stabilization | b6030b463cf1f1128660e900669f43e742aa2651 | [
"Apache-2.0"
] | null | null | null | src/Untitled-1.py | B06901052/deep-stabilization | b6030b463cf1f1128660e900669f43e742aa2651 | [
"Apache-2.0"
] | null | null | null | src/Untitled-1.py | B06901052/deep-stabilization | b6030b463cf1f1128660e900669f43e742aa2651 | [
"Apache-2.0"
] | null | null | null | # %%
import cv2
import numpy as np
from importlib import reload
import matplotlib.pyplot as plt
from IPython.display import Video
import torch
from torchvision import transforms
from torchvision.io import read_video, read_video_timestamps
import kornia as K
import kornia.feature as KF
from kornia_moons.feature import... | 30.332447 | 172 | 0.676107 |
1a984feef93566c3eb29deaf05ff859f69ee1182 | 4,943 | py | Python | tests/handling/test_delays.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | tests/handling/test_delays.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | tests/handling/test_delays.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | import asyncio
import datetime
import logging
import freezegun
import pytest
import kopf
from kopf.reactor.effects import WAITING_KEEPALIVE_INTERVAL
from kopf.reactor.handling import TemporaryError
from kopf.reactor.processing import process_resource_event
from kopf.storage.states import HandlerState
from kopf.struct... | 41.537815 | 97 | 0.700789 |
1a98536403c5d2d7b17e5455e6ca8c7cb65ccbf2 | 2,319 | py | Python | t/umash_traces.py | warmchang/umash | d56c343ce9bdf7d1eea59ab73898005bdf92888a | [
"MIT"
] | 108 | 2020-08-24T00:34:20.000Z | 2022-03-13T08:43:22.000Z | t/umash_traces.py | warmchang/umash | d56c343ce9bdf7d1eea59ab73898005bdf92888a | [
"MIT"
] | 26 | 2020-08-25T06:08:05.000Z | 2022-02-26T16:37:04.000Z | t/umash_traces.py | warmchang/umash | d56c343ce9bdf7d1eea59ab73898005bdf92888a | [
"MIT"
] | 7 | 2020-08-25T05:52:12.000Z | 2022-03-05T02:31:38.000Z | """
Decodes umash call traces.
"""
from hashlib import blake2b
import bz2
import os
import re
import shutil
import urllib.request
SELF_DIR = os.path.dirname(os.path.abspath(__file__))
CACHE_DIR = os.path.abspath(SELF_DIR + "/../traces") + "/"
STARTUP_URL = "https://github.com/backtrace-labs/umash/wiki/traces/startup... | 30.116883 | 124 | 0.651143 |
1a985c052fe0b71635e04ca69deeb8a2b58c2928 | 2,867 | py | Python | src/dfn_utils.py | komeisugiura/defn18 | 0b44ea59dcefd51e84b90f6e45e2dab250b89811 | [
"BSD-3-Clause-Clear"
] | 10 | 2019-02-13T17:34:38.000Z | 2022-02-20T06:59:36.000Z | src/dfn_utils.py | komeisugiura/defn18 | 0b44ea59dcefd51e84b90f6e45e2dab250b89811 | [
"BSD-3-Clause-Clear"
] | 1 | 2022-01-13T08:31:56.000Z | 2022-01-19T04:06:21.000Z | src/dfn_utils.py | komeisugiura/defn18 | 0b44ea59dcefd51e84b90f6e45e2dab250b89811 | [
"BSD-3-Clause-Clear"
] | 5 | 2019-02-23T02:45:31.000Z | 2021-08-11T06:10:06.000Z | #!/usr/bin/env python3
# coding: utf-8
"""
Utility functions for Deep Flare Net
"""
from __future__ import division, absolute_import, print_function, unicode_literals
from datetime import datetime as dt
import numpy as np
import tensorflow as tf
def make_iso8601_filename(prefix="tmp"):
"""
e.g. tmp_171106T... | 27.04717 | 82 | 0.575166 |
1a986500a07e7075c0f5be582dc88cf0a2b06dff | 364 | py | Python | tests/unit/models/reddit/mixins/test__init__.py | Lordshinjo/asyncpraw | d94d89a992d9b5b300439ea6884a9df1d95511e2 | [
"BSD-2-Clause"
] | 72 | 2020-07-14T02:02:21.000Z | 2022-03-15T13:10:02.000Z | tests/unit/models/reddit/mixins/test__init__.py | Lordshinjo/asyncpraw | d94d89a992d9b5b300439ea6884a9df1d95511e2 | [
"BSD-2-Clause"
] | 68 | 2020-07-16T05:29:43.000Z | 2022-03-14T12:04:56.000Z | tests/unit/models/reddit/mixins/test__init__.py | Lordshinjo/asyncpraw | d94d89a992d9b5b300439ea6884a9df1d95511e2 | [
"BSD-2-Clause"
] | 19 | 2020-07-22T15:34:30.000Z | 2022-03-27T20:28:46.000Z | import pytest
from asyncpraw.models.reddit.mixins import ThingModerationMixin
from .... import UnitTest
class TestThingModerationMixin(UnitTest):
async def test_must_be_extended(self):
with pytest.raises(NotImplementedError):
await ThingModerationMixin().send_removal_message(
... | 26 | 63 | 0.700549 |
1a98a5ac9f93e0030ea93b3291fa2b34a15e1d96 | 139,423 | py | Python | kmip/tests/unit/core/objects/test_objects.py | smira/PyKMIP | 54f3688a14bcc442b270765e21732b77d18b2a72 | [
"Apache-2.0"
] | null | null | null | kmip/tests/unit/core/objects/test_objects.py | smira/PyKMIP | 54f3688a14bcc442b270765e21732b77d18b2a72 | [
"Apache-2.0"
] | null | null | null | kmip/tests/unit/core/objects/test_objects.py | smira/PyKMIP | 54f3688a14bcc442b270765e21732b77d18b2a72 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | 36.37438 | 79 | 0.621088 |
1a98a8f8044b744851ede50611ae8cafe04b44ef | 3,676 | py | Python | step-1/Code/getTrainingData.py | yogeshchellappa/cs839DataScience | e51a553b34500b7cc14144d2125f70549441f589 | [
"MIT"
] | null | null | null | step-1/Code/getTrainingData.py | yogeshchellappa/cs839DataScience | e51a553b34500b7cc14144d2125f70549441f589 | [
"MIT"
] | 1 | 2018-02-19T08:30:58.000Z | 2018-02-20T21:46:46.000Z | step-1/Code/getTrainingData.py | yogeshchellappa/cs839DataScience | e51a553b34500b7cc14144d2125f70549441f589 | [
"MIT"
] | null | null | null | import os
import glob
import string
import json
import re
import sys
from collections import OrderedDict
def preprocessingRules():
"""
Returns translator object which encapsulates all the string cleaning we do
"""
unnecessaryCharacters = string.punctuation + string.digits + '\n\t\r'
# We need to retain the punc... | 24.184211 | 110 | 0.647715 |
1a98e02fc7e1485cc219cb3b961efbe2d02ce2aa | 2,240 | py | Python | perm_security/TokenStrategy/TokenStrategy.py | TheJoeSmo/perm-security | 2fd8ceb4fc72cce5889f55731056665a887399e1 | [
"MIT"
] | null | null | null | perm_security/TokenStrategy/TokenStrategy.py | TheJoeSmo/perm-security | 2fd8ceb4fc72cce5889f55731056665a887399e1 | [
"MIT"
] | null | null | null | perm_security/TokenStrategy/TokenStrategy.py | TheJoeSmo/perm-security | 2fd8ceb4fc72cce5889f55731056665a887399e1 | [
"MIT"
] | null | null | null | from typing import Optional, Set
from abc import ABC, abstractmethod
from discord import Member
from perm_banana import Permission
from ..MemberAdapter.MemberAdapter import MemberAdapter
class TokenStrategy(ABC):
"""A series of commands to be used to generate tokens"""
@abstractmethod
async def generat... | 33.432836 | 107 | 0.626339 |
1a98e2e5ea16b16282cc02bbd9bde33b8a91b357 | 2,439 | py | Python | thgsp/bga/osglm.py | bwdeng20/thgsp | 785b3ff291d72ee51e51e4cdbfd4bab63f8de9ac | [
"BSD-3-Clause"
] | 22 | 2021-01-13T05:15:38.000Z | 2022-01-17T01:37:29.000Z | thgsp/bga/osglm.py | bwdeng20/thgsp | 785b3ff291d72ee51e51e4cdbfd4bab63f8de9ac | [
"BSD-3-Clause"
] | 2 | 2021-03-26T04:36:39.000Z | 2022-01-11T16:17:56.000Z | thgsp/bga/osglm.py | bwdeng20/thgsp | 785b3ff291d72ee51e51e4cdbfd4bab63f8de9ac | [
"BSD-3-Clause"
] | 2 | 2021-01-13T05:15:43.000Z | 2022-01-01T12:51:32.000Z | import numpy as np
from scipy.sparse import lil_matrix, eye
from .utils import bipartite_mask
def osglm(A, lc=None, vtx_color=None):
r"""
The oversampled bipartite graph approximation method proposed in [1]_
Parameters
----------
A: SparseTensor
The adjacent matrix of grap... | 32.092105 | 119 | 0.615006 |
1a98ea71938a0c0163592899a1c18d465cb80d0b | 2,968 | py | Python | st2debug/st2debug/processors.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 1 | 2020-11-21T10:11:25.000Z | 2020-11-21T10:11:25.000Z | st2debug/st2debug/processors.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 1 | 2015-06-08T15:27:11.000Z | 2015-06-08T15:27:11.000Z | st2debug/st2debug/processors.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 13 | 2017-01-12T11:07:20.000Z | 2019-04-19T09:55:49.000Z | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 29.386139 | 77 | 0.703167 |
1a98ed7f415fff7948574ebc5a98b74c35b034c4 | 5,490 | py | Python | hashicorp_vault_client/hashicorp_vault_client/models/body42.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | null | null | null | hashicorp_vault_client/hashicorp_vault_client/models/body42.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | 2 | 2019-09-30T20:56:41.000Z | 2019-10-02T00:22:07.000Z | hashicorp_vault_client/hashicorp_vault_client/models/body42.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
HashiCorp Vault API
HTTP API that gives you full access to Vault. All API routes are prefixed with `/v1/`. # noqa: E501
OpenAPI spec version: 1.2.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class... | 27.727273 | 112 | 0.559199 |
1a98ffa4392e447e82ee556b55ba9f0a2e95c0d3 | 4,883 | py | Python | environments/websocketenv.py | TeamJumpstart/InformatiCup2021 | a4d07992f772d3a1e9ef715fa8e9ce2234cd47a4 | [
"MIT"
] | 10 | 2021-04-18T17:54:02.000Z | 2021-07-26T19:58:41.000Z | environments/websocketenv.py | DiddiZ/InformatiCup2021 | a4d07992f772d3a1e9ef715fa8e9ce2234cd47a4 | [
"MIT"
] | 1 | 2021-04-21T15:13:41.000Z | 2021-04-21T15:13:41.000Z | environments/websocketenv.py | DiddiZ/InformatiCup2021 | a4d07992f772d3a1e9ef715fa8e9ce2234cd47a4 | [
"MIT"
] | 1 | 2021-04-20T09:42:50.000Z | 2021-04-20T09:42:50.000Z | import asyncio
import json
import logging
import time
from datetime import datetime, timedelta
import numpy as np
import requests
import websockets
from environments.spe_ed import Player
from environments.spe_ed_env import Spe_edEnv
class WebsocketEnv(Spe_edEnv):
"""Environment for playing on the online server ... | 38.448819 | 120 | 0.646938 |
1a990d55113848a33cbc68ae8c056107ef752b4d | 30,407 | py | Python | phr/ciudadano/models.py | richardqa/django-ex | e5b8585f28a97477150ac5daf5e55c74b70d87da | [
"CC0-1.0"
] | null | null | null | phr/ciudadano/models.py | richardqa/django-ex | e5b8585f28a97477150ac5daf5e55c74b70d87da | [
"CC0-1.0"
] | null | null | null | phr/ciudadano/models.py | richardqa/django-ex | e5b8585f28a97477150ac5daf5e55c74b70d87da | [
"CC0-1.0"
] | null | null | null | import re
from django.contrib.postgres.fields.array import ArrayField
from django.core.validators import MaxValueValidator, MinValueValidator, RegexValidator
from django.db import models
from django.utils import timezone
from dateutil.relativedelta import relativedelta
from multiselectfield import MultiSelectField
f... | 50.847826 | 119 | 0.730621 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.