hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 3 248 | max_forks_repo_name stringlengths 5 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 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7a00ecf5169810e7505addc750380ef02512919a | 5,377 | py | Python | python/jittor/test/test_grad.py | llehtahw/jittor | d83389117fd026a0881dd713e658ce5ae2a75bcb | [
"Apache-2.0"
] | 1 | 2020-11-13T10:08:00.000Z | 2020-11-13T10:08:00.000Z | python/jittor/test/test_grad.py | llehtahw/jittor | d83389117fd026a0881dd713e658ce5ae2a75bcb | [
"Apache-2.0"
] | null | null | null | python/jittor/test/test_grad.py | llehtahw/jittor | d83389117fd026a0881dd713e658ce5ae2a75bcb | [
"Apache-2.0"
] | null | null | null | # ***************************************************************
# Copyright (c) 2020 Jittor. Authors: Dun Liang <[email protected]>. All Rights Reserved.
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
# ********************************... | 32.197605 | 92 | 0.455644 | 4,105 | 0.763437 | 0 | 0 | 0 | 0 | 0 | 0 | 598 | 0.111214 |
7a012bf9cfedafb87b6096b3721323abb9371444 | 846 | py | Python | mre/helper/Range.py | alvarofpp/mre | 025a5f10b92a0a4bf32d673509958b660871b2f6 | [
"MIT"
] | 7 | 2019-04-21T18:25:49.000Z | 2020-12-22T19:13:25.000Z | mre/helper/Range.py | alvarofpp/mre | 025a5f10b92a0a4bf32d673509958b660871b2f6 | [
"MIT"
] | 12 | 2019-08-10T02:09:43.000Z | 2021-10-02T15:29:48.000Z | mre/helper/Range.py | alvarofpp/mre | 025a5f10b92a0a4bf32d673509958b660871b2f6 | [
"MIT"
] | 22 | 2019-04-21T18:25:54.000Z | 2020-10-04T21:43:12.000Z | from typing import Union
from mre.Regex import Regex
class Range(Regex):
def __init__(self, minimum: Union[str, int] = 0, maximum: Union[str, int] = 9):
super().__init__('{}-{}'.format(minimum, maximum))
@staticmethod
def digits(minimum: int = 0, maximum: int = 9):
return Range(minimum, ... | 26.4375 | 83 | 0.568558 | 789 | 0.932624 | 0 | 0 | 615 | 0.72695 | 0 | 0 | 13 | 0.015366 |
7a014283816fd43c5b99389dd4a3fcc4eb6396ff | 3,463 | py | Python | tests/python/unittest/test_tir_transform_remove_weight_layout_rewrite_block.py | driazati/tvm | b76c817986040dc070d215cf32523d9b2adc8e8b | [
"Apache-2.0"
] | 1 | 2021-12-13T22:07:00.000Z | 2021-12-13T22:07:00.000Z | tests/python/unittest/test_tir_transform_remove_weight_layout_rewrite_block.py | driazati/tvm | b76c817986040dc070d215cf32523d9b2adc8e8b | [
"Apache-2.0"
] | 7 | 2022-02-17T23:04:46.000Z | 2022-03-31T22:22:55.000Z | tests/python/unittest/test_tir_transform_remove_weight_layout_rewrite_block.py | driazati/tvm | b76c817986040dc070d215cf32523d9b2adc8e8b | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.641304 | 76 | 0.547791 | 0 | 0 | 0 | 0 | 2,134 | 0.616229 | 0 | 0 | 1,028 | 0.296852 |
7a0383028d6c513dd8786b4e28fcf20c534cff1a | 341 | py | Python | CS1/Ch11/Artwork.py | DoctorOac/SwosuCsPythonExamples | 07476b9b4ef9a6f8bd68921aef19e8f00183b1e7 | [
"Apache-2.0"
] | 1 | 2022-03-28T18:27:10.000Z | 2022-03-28T18:27:10.000Z | CS1/Ch11/Artwork.py | DoctorOac/SwosuCsPythonExamples | 07476b9b4ef9a6f8bd68921aef19e8f00183b1e7 | [
"Apache-2.0"
] | 1 | 2022-01-11T16:27:40.000Z | 2022-01-11T16:27:40.000Z | CS1/Ch11/Artwork.py | DoctorOac/SwosuCsPythonExamples | 07476b9b4ef9a6f8bd68921aef19e8f00183b1e7 | [
"Apache-2.0"
] | 7 | 2022-03-25T21:01:42.000Z | 2022-03-28T18:51:24.000Z | from Artist import Artist
class Artwork:
def __init__(self, title='None', year_created=0,\
artist=Artist()):
self.title = title
self.year_created = year_created
self.artist = artist
def print_info(self):
self.artist.print_info()
print('Title: %s, %d' % (self.title,... | 26.230769 | 64 | 0.630499 | 313 | 0.917889 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 0.061584 |
7a03cb031046f0f5a4ab04de791c5d2ae9f6699d | 2,249 | py | Python | nearproteins/__init__.py | audy/nearproteins | ed426a98004c7608894a63c6b445ff60ae251d05 | [
"MIT"
] | null | null | null | nearproteins/__init__.py | audy/nearproteins | ed426a98004c7608894a63c6b445ff60ae251d05 | [
"MIT"
] | 1 | 2019-07-10T05:47:01.000Z | 2019-07-10T17:23:52.000Z | nearproteins/__init__.py | audy/nearproteins | ed426a98004c7608894a63c6b445ff60ae251d05 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from collections import defaultdict
from itertools import product
import json
import random
import sys
from annoy import AnnoyIndex
from Bio import SeqIO
import numpy as np
class FeatureGenerator:
def __init__(self, k=2):
''' '''
self.k = k
self.alphabet = [ 'A'... | 22.267327 | 85 | 0.578924 | 2,045 | 0.909293 | 0 | 0 | 0 | 0 | 0 | 0 | 350 | 0.155625 |
7a042b77715a588fe196553691f390b7d45b469f | 314 | py | Python | arm_control/src/orientation.py | ALxander19/zobov_arm | 8b5b322b53a7a0d9c91fcbc720473a2a6e6f5826 | [
"BSD-2-Clause"
] | null | null | null | arm_control/src/orientation.py | ALxander19/zobov_arm | 8b5b322b53a7a0d9c91fcbc720473a2a6e6f5826 | [
"BSD-2-Clause"
] | null | null | null | arm_control/src/orientation.py | ALxander19/zobov_arm | 8b5b322b53a7a0d9c91fcbc720473a2a6e6f5826 | [
"BSD-2-Clause"
] | null | null | null | # tf.transformations alternative is not yet available in tf2
from tf.transformations import quaternion_from_euler
if __name__ == '__main__':
# RPY to convert: 90deg, 0, -90deg
q = quaternion_from_euler(1.5707, 0, -1.5707)
print "The quaternion representation is %s %s %s %s." % (q[0], q[1], q[2], q[3])
| 31.4 | 82 | 0.694268 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 151 | 0.480892 |
7a05099cb4069ff152e86f9e7700bcfd829e2375 | 2,997 | py | Python | django_server/fvh_courier/rest/tests/base.py | ForumViriumHelsinki/CityLogistics | df4efef49bdc740a1dc47d0bda49ce2b3833e9c1 | [
"MIT"
] | 1 | 2021-11-02T03:21:48.000Z | 2021-11-02T03:21:48.000Z | django_server/fvh_courier/rest/tests/base.py | ForumViriumHelsinki/CityLogistics | df4efef49bdc740a1dc47d0bda49ce2b3833e9c1 | [
"MIT"
] | 136 | 2019-12-03T14:52:17.000Z | 2022-02-26T21:18:15.000Z | django_server/fvh_courier/rest/tests/base.py | ForumViriumHelsinki/CityLogistics | df4efef49bdc740a1dc47d0bda49ce2b3833e9c1 | [
"MIT"
] | 2 | 2020-06-23T23:58:08.000Z | 2020-12-08T13:19:28.000Z | import datetime
from django.contrib.auth.models import User, Group
from django.utils import timezone
from rest_framework.test import APITestCase
import fvh_courier.models.base
from fvh_courier import models
class FVHAPITestCase(APITestCase):
def assert_dict_contains(self, superset, subset, path=''):
for... | 36.54878 | 112 | 0.593594 | 2,790 | 0.92938 | 0 | 0 | 0 | 0 | 0 | 0 | 355 | 0.118254 |
7a0915dbc8c3508d29e923526b1c9bacf3a1ca69 | 12,039 | py | Python | pynoorm/binder.py | jpeyret/pynoorm | d6f7e0e102bb0eb4865beff75cf671b560ebc8b2 | [
"MIT"
] | 2 | 2016-04-14T23:11:06.000Z | 2016-06-04T22:39:10.000Z | pynoorm/binder.py | jpeyret/pynoorm | d6f7e0e102bb0eb4865beff75cf671b560ebc8b2 | [
"MIT"
] | null | null | null | pynoorm/binder.py | jpeyret/pynoorm | d6f7e0e102bb0eb4865beff75cf671b560ebc8b2 | [
"MIT"
] | 1 | 2022-01-16T15:19:16.000Z | 2022-01-16T15:19:16.000Z | """
Binder classes perform two functions through their format method
- given a query template with %(somevar)s python substition
class MyClass(object):
pass
arg1 = MyClass()
arg1.customer = 101
default = MyClass()
default.customer = 201
arg2.country = "CAN"
qry, sub = format("
... | 27.675862 | 93 | 0.572971 | 10,212 | 0.848243 | 0 | 0 | 1,144 | 0.095025 | 0 | 0 | 5,941 | 0.49348 |
7a0b66937d09d19c265c09560989c32e86648150 | 4,313 | py | Python | parselglossy/documentation.py | dev-cafe/parseltongue | 834e78724bb90dfa19748d7f65f6af02d525e3f2 | [
"MIT"
] | 5 | 2019-03-11T18:42:26.000Z | 2021-08-24T18:24:05.000Z | parselglossy/documentation.py | dev-cafe/parseltongue | 834e78724bb90dfa19748d7f65f6af02d525e3f2 | [
"MIT"
] | 105 | 2018-12-04T03:07:22.000Z | 2022-03-24T13:04:48.000Z | parselglossy/documentation.py | dev-cafe/parseltongue | 834e78724bb90dfa19748d7f65f6af02d525e3f2 | [
"MIT"
] | 1 | 2019-02-08T09:54:49.000Z | 2019-02-08T09:54:49.000Z | # -*- coding: utf-8 -*-
#
# parselglossy -- Generic input parsing library, speaking in tongues
# Copyright (C) 2020 Roberto Di Remigio, Radovan Bast, and contributors.
#
# This file is part of parselglossy.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associate... | 31.713235 | 121 | 0.644563 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,891 | 0.670299 |
7a0b7b8522bbe2e3900e18756663a43a8ac174f7 | 2,765 | py | Python | functions/print_initial_values.py | CINPLA/edNEGmodel_analysis | be8854c563376a14ee7d15e51d98d0d82be96a35 | [
"MIT"
] | null | null | null | functions/print_initial_values.py | CINPLA/edNEGmodel_analysis | be8854c563376a14ee7d15e51d98d0d82be96a35 | [
"MIT"
] | null | null | null | functions/print_initial_values.py | CINPLA/edNEGmodel_analysis | be8854c563376a14ee7d15e51d98d0d82be96a35 | [
"MIT"
] | null | null | null | import numpy as np
def print_initial_values(init_cell):
phi_sn, phi_se, phi_sg, phi_dn, phi_de, phi_dg, phi_msn, phi_mdn, phi_msg, phi_mdg = init_cell.membrane_potentials()
E_Na_sn, E_Na_sg, E_Na_dn, E_Na_dg, E_K_sn, E_K_sg, E_K_dn, E_K_dg, E_Cl_sn, E_Cl_sg, E_Cl_dn, E_Cl_dg, E_Ca_sn, E_Ca_dn = init_... | 56.428571 | 158 | 0.637975 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 548 | 0.198192 |
7a0c0a5f5ecb615e0a6336ce27fac2621034f8ff | 21,021 | py | Python | anyway/parsers/cbs.py | edermon/anyway | 3523b7871b7eebeca225e088af653ba074e5bee3 | [
"BSD-3-Clause"
] | null | null | null | anyway/parsers/cbs.py | edermon/anyway | 3523b7871b7eebeca225e088af653ba074e5bee3 | [
"BSD-3-Clause"
] | null | null | null | anyway/parsers/cbs.py | edermon/anyway | 3523b7871b7eebeca225e088af653ba074e5bee3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import glob
import os
import json
from collections import OrderedDict
import itertools
import re
from datetime import datetime
import six
from six import iteritems
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy import or_
from .. import field_names, localization
from ..models impo... | 43.521739 | 120 | 0.667999 | 0 | 0 | 1,650 | 0.078366 | 0 | 0 | 0 | 0 | 4,287 | 0.20361 |
7a0d3a18b6c3bcab1db31cd7020fbecfa8d1cc2b | 7,709 | py | Python | src/tests/test_pagure_flask_api_project_delete_project.py | yifengyou/learn-pagure | e54ba955368918c92ad2be6347b53bb2c24a228c | [
"Unlicense"
] | null | null | null | src/tests/test_pagure_flask_api_project_delete_project.py | yifengyou/learn-pagure | e54ba955368918c92ad2be6347b53bb2c24a228c | [
"Unlicense"
] | null | null | null | src/tests/test_pagure_flask_api_project_delete_project.py | yifengyou/learn-pagure | e54ba955368918c92ad2be6347b53bb2c24a228c | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
(c) 2020 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <[email protected]>
"""
from __future__ import unicode_literals, absolute_import
import datetime
import json
import unittest
import shutil
import sys
import tempfile
import os
import pygit2
from celery.result import Ea... | 37.42233 | 188 | 0.572578 | 7,138 | 0.925931 | 0 | 0 | 549 | 0.071215 | 0 | 0 | 1,721 | 0.223246 |
7a0ed4f58fe297f5e920c7a02179f8ba85d4d8b4 | 3,827 | py | Python | 06_reproducibility/workflow_pipeline/my_pipeline/pipeline/configs.py | fanchi/ml-design-patterns | 6f686601d2385a11a517f8394324062ec6094e14 | [
"Apache-2.0"
] | 1,149 | 2020-04-09T21:20:56.000Z | 2022-03-31T02:41:53.000Z | 06_reproducibility/workflow_pipeline/my_pipeline/pipeline/configs.py | dfinke/ml-design-patterns | 6f686601d2385a11a517f8394324062ec6094e14 | [
"Apache-2.0"
] | 28 | 2020-06-14T15:17:59.000Z | 2022-02-17T10:13:08.000Z | 06_reproducibility/workflow_pipeline/my_pipeline/pipeline/configs.py | dfinke/ml-design-patterns | 6f686601d2385a11a517f8394324062ec6094e14 | [
"Apache-2.0"
] | 296 | 2020-04-28T06:26:41.000Z | 2022-03-31T06:52:33.000Z | # Copyright 2020 Google LLC. 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 applicable law or a... | 37.519608 | 104 | 0.736608 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,184 | 0.831983 |
7a0ee0d44c1b61902945942d2ba7e385c1519999 | 4,707 | py | Python | tests/test_vcf_info_annotator.py | apaul7/VAtools | 9e969cfdb605ec5e65a6aa60a416d7d74a8ff4fd | [
"MIT"
] | 15 | 2019-03-20T06:55:04.000Z | 2022-02-22T06:16:56.000Z | tests/test_vcf_info_annotator.py | apaul7/VAtools | 9e969cfdb605ec5e65a6aa60a416d7d74a8ff4fd | [
"MIT"
] | 27 | 2019-03-05T18:20:19.000Z | 2022-03-04T14:58:36.000Z | tests/test_vcf_info_annotator.py | apaul7/VAtools | 9e969cfdb605ec5e65a6aa60a416d7d74a8ff4fd | [
"MIT"
] | 4 | 2019-03-19T10:33:38.000Z | 2022-02-23T13:40:33.000Z | import unittest
import sys
import os
import py_compile
from vatools import vcf_info_annotator
import tempfile
from filecmp import cmp
class VcfInfoEncoderTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
base_dir = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file_... | 40.930435 | 183 | 0.599745 | 4,571 | 0.971107 | 0 | 0 | 306 | 0.06501 | 0 | 0 | 972 | 0.206501 |
7a0f470f2ade1699e468a55aa0458f89b6b1d2f2 | 17,965 | py | Python | bddtests/peer/admin_pb2.py | hacera-jonathan/fabric | 3ba291e8fbb0246aa440e02cba54d16924649479 | [
"Apache-2.0"
] | null | null | null | bddtests/peer/admin_pb2.py | hacera-jonathan/fabric | 3ba291e8fbb0246aa440e02cba54d16924649479 | [
"Apache-2.0"
] | 1 | 2021-03-20T05:34:24.000Z | 2021-03-20T05:34:24.000Z | bddtests/peer/admin_pb2.py | hacera-jonathan/fabric | 3ba291e8fbb0246aa440e02cba54d16924649479 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: peer/admin.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 _re... | 41.77907 | 1,109 | 0.74044 | 4,737 | 0.263679 | 0 | 0 | 0 | 0 | 0 | 0 | 4,990 | 0.277762 |
7a11c84dcc647f7a847b687bafc676e5c125037d | 4,002 | py | Python | tests/basic_test.py | c0fec0de/anycache | 1848d9b85cd11c16c271284e0911ba5628391835 | [
"Apache-2.0"
] | 13 | 2018-02-07T15:52:07.000Z | 2022-02-18T12:37:40.000Z | tests/basic_test.py | c0fec0de/anycache | 1848d9b85cd11c16c271284e0911ba5628391835 | [
"Apache-2.0"
] | 2 | 2018-09-23T15:43:32.000Z | 2021-09-21T00:34:55.000Z | tests/basic_test.py | c0fec0de/anycache | 1848d9b85cd11c16c271284e0911ba5628391835 | [
"Apache-2.0"
] | 1 | 2020-01-20T23:58:54.000Z | 2020-01-20T23:58:54.000Z | from pathlib import Path
from tempfile import mkdtemp
from nose.tools import eq_
from anycache import AnyCache
from anycache import get_defaultcache
from anycache import anycache
def test_basic():
"""Basic functionality."""
@anycache()
def myfunc(posarg, kwarg=3):
# count the number of calls
... | 21.063158 | 53 | 0.581709 | 232 | 0.057971 | 0 | 0 | 876 | 0.218891 | 0 | 0 | 342 | 0.085457 |
7a11f415ef1c8a456c66c6b816eed5e347dea42d | 2,173 | py | Python | self-paced-labs/vertex-ai/vertex-pipelines/tfx/tfx_taxifare_tips/model_training/model_runner.py | Glairly/introduction_to_tensorflow | aa0a44d9c428a6eb86d1f79d73f54c0861b6358d | [
"Apache-2.0"
] | 2 | 2022-01-06T11:52:57.000Z | 2022-01-09T01:53:56.000Z | self-paced-labs/vertex-ai/vertex-pipelines/tfx/tfx_taxifare_tips/model_training/model_runner.py | Glairly/introduction_to_tensorflow | aa0a44d9c428a6eb86d1f79d73f54c0861b6358d | [
"Apache-2.0"
] | null | null | null | self-paced-labs/vertex-ai/vertex-pipelines/tfx/tfx_taxifare_tips/model_training/model_runner.py | Glairly/introduction_to_tensorflow | aa0a44d9c428a6eb86d1f79d73f54c0861b6358d | [
"Apache-2.0"
] | null | null | null | """A run_fn method called by the TFX Trainer component."""
import os
import logging
from tfx import v1 as tfx
from tfx_taxifare_tips.model_training import defaults
from tfx_taxifare_tips.model_training import model_trainer
from tfx_taxifare_tips.model_training import model_exporter
# TFX Trainer will call ... | 34.492063 | 83 | 0.703175 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 523 | 0.240681 |
7a15cfeb891a079af5b1c667c60e264effefd0f3 | 4,602 | py | Python | main.py | Lorn-Hukka/academy-record-sender | 137ef9d1dff373662a046bc2a50d7dd5f4fad0ee | [
"MIT"
] | null | null | null | main.py | Lorn-Hukka/academy-record-sender | 137ef9d1dff373662a046bc2a50d7dd5f4fad0ee | [
"MIT"
] | null | null | null | main.py | Lorn-Hukka/academy-record-sender | 137ef9d1dff373662a046bc2a50d7dd5f4fad0ee | [
"MIT"
] | null | null | null | import random, os, string, subprocess, shutil, requests
from discord import Webhook, RequestsWebhookAdapter, Embed
from dotenv import dotenv_values
import argparse, colorama
from colorama import Fore
class Settings():
def __init__(self):
for k, v in dotenv_values(".settings").items():
setattr(... | 40.368421 | 140 | 0.526945 | 3,950 | 0.856276 | 0 | 0 | 0 | 0 | 0 | 0 | 1,217 | 0.26382 |
7a1607febbd34072033d2922ea13752164e46320 | 357 | py | Python | src/__init__.py | w9PcJLyb/GFootball | b271238bd0dc922787a0a9b984a8ae598cea2b2b | [
"Apache-2.0"
] | null | null | null | src/__init__.py | w9PcJLyb/GFootball | b271238bd0dc922787a0a9b984a8ae598cea2b2b | [
"Apache-2.0"
] | null | null | null | src/__init__.py | w9PcJLyb/GFootball | b271238bd0dc922787a0a9b984a8ae598cea2b2b | [
"Apache-2.0"
] | null | null | null | from .board import Board
from .slide import slide_action
from .corner import corner_action
from .control import control_action
from .penalty import penalty_action
from .throwin import throwin_action
from .kickoff import kickoff_action
from .goalkick import goalkick_action
from .freekick import freekick_action
from .wit... | 32.454545 | 45 | 0.859944 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7a1ab771a442031e1729dd19987c53780afb2187 | 3,447 | py | Python | tests/bin/test_tcex_list.py | phuerta-tc/tcex | 4a4e800e1a6114c1fde663f8c3ab7a1d58045c79 | [
"Apache-2.0"
] | null | null | null | tests/bin/test_tcex_list.py | phuerta-tc/tcex | 4a4e800e1a6114c1fde663f8c3ab7a1d58045c79 | [
"Apache-2.0"
] | null | null | null | tests/bin/test_tcex_list.py | phuerta-tc/tcex | 4a4e800e1a6114c1fde663f8c3ab7a1d58045c79 | [
"Apache-2.0"
] | null | null | null | """Bin Testing"""
# standard library
from importlib.machinery import SourceFileLoader
from importlib.util import module_from_spec, spec_from_loader
from typing import List
# third-party
from typer.testing import CliRunner
# dynamically load bin/tcex file
spec = spec_from_loader('app', SourceFileLoader('app', 'bin/tce... | 33.794118 | 83 | 0.642878 | 2,926 | 0.848854 | 0 | 0 | 147 | 0.042646 | 0 | 0 | 2,070 | 0.600522 |
7a1abf4048e07e8bc9343e0dfe167284107c6c27 | 16,752 | py | Python | sdk/python/pulumi_aws/ec2/managed_prefix_list.py | jen20/pulumi-aws | 172e00c642adc03238f89cc9c5a16b914a77c2b1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ec2/managed_prefix_list.py | jen20/pulumi-aws | 172e00c642adc03238f89cc9c5a16b914a77c2b1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ec2/managed_prefix_list.py | jen20/pulumi-aws | 172e00c642adc03238f89cc9c5a16b914a77c2b1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 41.465347 | 168 | 0.621299 | 16,283 | 0.972003 | 0 | 0 | 13,278 | 0.792622 | 0 | 0 | 9,013 | 0.538025 |
7a1b3ef788466c80c3a4e53bf1538ad6b91df51a | 1,847 | py | Python | scripts/ann_architectures/mnist/lenet5.py | qian-liu/snn_toolbox | 9693647f9b2421a4f1ab789a97cc19fd17781e87 | [
"MIT"
] | null | null | null | scripts/ann_architectures/mnist/lenet5.py | qian-liu/snn_toolbox | 9693647f9b2421a4f1ab789a97cc19fd17781e87 | [
"MIT"
] | null | null | null | scripts/ann_architectures/mnist/lenet5.py | qian-liu/snn_toolbox | 9693647f9b2421a4f1ab789a97cc19fd17781e87 | [
"MIT"
] | null | null | null | # coding=utf-8
"""LeNet for MNIST"""
import os
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D
from keras.utils import np_utils
from keras.callbacks import ModelCheckpoint, TensorBoard
from snntoolbox.parsing.utils import \
... | 33.581818 | 79 | 0.750947 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 376 | 0.203573 |
7a1eab82419109b15e6baf92f1df08cd9c6fa14b | 856 | py | Python | class_exercises/using_numpy.py | Eddz7/astr-19 | 380c6b45762e0207cd6c237fa28a4d796b1aef94 | [
"MIT"
] | null | null | null | class_exercises/using_numpy.py | Eddz7/astr-19 | 380c6b45762e0207cd6c237fa28a4d796b1aef94 | [
"MIT"
] | 1 | 2022-03-31T17:57:17.000Z | 2022-03-31T17:57:17.000Z | class_exercises/using_numpy.py | Eddz7/astr-19 | 380c6b45762e0207cd6c237fa28a4d796b1aef94 | [
"MIT"
] | null | null | null | import numpy as np
x = 1.0 #define a float
y = 2.0 #define another float
#trigonometry
print(f"np.sin({x}) = {np.sin(x)}") #sin(x)
print(f"np.cos({x}) = {np.cos(x)}") #cos(x)
print(f"np.tan({x}) = {np.tan(x)}") #tan(x)
print(f"np.arcsin({x}) = {np.arcsin(x)}") #arcsin(x)
print(f"np.arccos({x}) = {np.arccos(x)... | 40.761905 | 67 | 0.580607 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 687 | 0.80257 |
7a1ed1421848b1354b08c81026945785b3714d10 | 10,544 | py | Python | amy/workshops/migrations/0158_curriculum_workshoprequest.py | code-review-doctor/amy | 268c1a199510457891459f3ddd73fcce7fe2b974 | [
"MIT"
] | 53 | 2015-01-10T17:39:19.000Z | 2019-06-12T17:36:34.000Z | amy/workshops/migrations/0158_curriculum_workshoprequest.py | code-review-doctor/amy | 268c1a199510457891459f3ddd73fcce7fe2b974 | [
"MIT"
] | 1,176 | 2015-01-02T06:32:47.000Z | 2019-06-18T11:57:47.000Z | amy/workshops/migrations/0158_curriculum_workshoprequest.py | code-review-doctor/amy | 268c1a199510457891459f3ddd73fcce7fe2b974 | [
"MIT"
] | 44 | 2015-01-03T15:08:56.000Z | 2019-06-09T05:33:08.000Z | # Generated by Django 2.1.2 on 2018-10-27 15:50
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('workshops', '0157_auto_20181006_0859'),
]
operation... | 142.486486 | 860 | 0.71434 | 10,356 | 0.981984 | 0 | 0 | 0 | 0 | 0 | 0 | 6,420 | 0.608762 |
7a1ef72332e8f8f0f2089763d5744f430bdbbf1f | 2,365 | py | Python | log_parser/single_hand_efficiency_training_data.py | xinranhe/mahjong | 8cfc6234f9c80fd11267adf06b420b63f4c8d87d | [
"MIT"
] | null | null | null | log_parser/single_hand_efficiency_training_data.py | xinranhe/mahjong | 8cfc6234f9c80fd11267adf06b420b63f4c8d87d | [
"MIT"
] | null | null | null | log_parser/single_hand_efficiency_training_data.py | xinranhe/mahjong | 8cfc6234f9c80fd11267adf06b420b63f4c8d87d | [
"MIT"
] | null | null | null | import argparse
from mahjong.shanten import Shanten
from multiprocessing import Pool
import os
import sys
from log_parser.discard_prediction_parser import parse_discard_prediction
SHANTEN = Shanten()
INPUT_DATA_FOLDER = "data/raw"
OUTPUT_DATA_DIR = "data/single_hand_efficiency"
def tiles34_to_list(tiles):
resul... | 35.833333 | 124 | 0.60296 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 292 | 0.123467 |
e12e6ff3f71515946f2d758523bf5e5b716bfa6b | 1,942 | py | Python | apps/portalbase/system/system__alerts/methodclass/system_alerts.py | Jumpscale/jumpscale_portal8 | 3a4d56a1ba985b68fe9b525aed2486a54808332f | [
"Apache-2.0"
] | null | null | null | apps/portalbase/system/system__alerts/methodclass/system_alerts.py | Jumpscale/jumpscale_portal8 | 3a4d56a1ba985b68fe9b525aed2486a54808332f | [
"Apache-2.0"
] | 74 | 2015-12-28T16:17:20.000Z | 2021-09-08T12:28:59.000Z | apps/portalbase/system/system__alerts/methodclass/system_alerts.py | Jumpscale/jumpscale_portal8 | 3a4d56a1ba985b68fe9b525aed2486a54808332f | [
"Apache-2.0"
] | null | null | null | from JumpScale import j
class system_alerts(j.tools.code.classGetBase()):
"""
Alerts handler
"""
def __init__(self):
self._te = {}
self.actorname = "alertshandler"
self.appname = "system"
self.alertmodel = j.data.models.system.Alert
def update(self, state, aler... | 30.825397 | 89 | 0.581874 | 1,915 | 0.986097 | 0 | 0 | 0 | 0 | 0 | 0 | 355 | 0.182801 |
e12ea6090b7a3fc25058fb7f99f94d6f336e2f07 | 17,628 | py | Python | docs/pyqbdi.py | pbrunet/QBDI | 39a936b2efd000f0c5def0a8ea27538d7d5fab47 | [
"Apache-2.0"
] | 1 | 2019-10-01T08:32:41.000Z | 2019-10-01T08:32:41.000Z | docs/pyqbdi.py | pbrunet/QBDI | 39a936b2efd000f0c5def0a8ea27538d7d5fab47 | [
"Apache-2.0"
] | null | null | null | docs/pyqbdi.py | pbrunet/QBDI | 39a936b2efd000f0c5def0a8ea27538d7d5fab47 | [
"Apache-2.0"
] | null | null | null | # This file is only used to generate documentation
# VM class
class vm():
def getGPRState():
"""Obtain the current general purpose register state.
:returns: GPRState (an object containing the GPR state).
"""
pass
def getFPRState():
"""Obtain the current floating p... | 35.90224 | 271 | 0.645677 | 14,891 | 0.844736 | 0 | 0 | 0 | 0 | 0 | 0 | 14,255 | 0.808657 |
e13042781e2e380894da0aab1c6ec72861b3ce01 | 227 | py | Python | krkbipscraper/settings.py | pawmar/krkbipscraper | f2629bede33930cf91378caa7f2ee5d683cf1616 | [
"BSD-3-Clause"
] | null | null | null | krkbipscraper/settings.py | pawmar/krkbipscraper | f2629bede33930cf91378caa7f2ee5d683cf1616 | [
"BSD-3-Clause"
] | null | null | null | krkbipscraper/settings.py | pawmar/krkbipscraper | f2629bede33930cf91378caa7f2ee5d683cf1616 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Scrapy settings."""
BOT_NAME = 'krkbipscraper'
SPIDER_MODULES = ['krkbipscraper.spiders']
NEWSPIDER_MODULE = 'krkbipscraper.spiders'
ITEM_PIPELINES = ['krkbipscraper.pipelines.JsonWriterPipeline']
| 22.7 | 63 | 0.744493 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 150 | 0.660793 |
e1311759e08a6c90f2dd14452c29543ae793ad35 | 1,797 | py | Python | sap hana/connections and query execution with python/script.py | Phelipe-Sempreboni/databases | 3be823db9029994d7b50d23d1830209276e5f40a | [
"MIT"
] | 1 | 2020-10-27T21:50:28.000Z | 2020-10-27T21:50:28.000Z | sap hana/connections and query execution with python/script.py | Phelipe-Sempreboni/databases | 3be823db9029994d7b50d23d1830209276e5f40a | [
"MIT"
] | null | null | null | sap hana/connections and query execution with python/script.py | Phelipe-Sempreboni/databases | 3be823db9029994d7b50d23d1830209276e5f40a | [
"MIT"
] | null | null | null | # Importação da biblioteca.
# Certifique-se de ter a biblioteca instalada.
import pyhdb
# Essa função traz/chama outro arquivo que contém a senha, visando não deixar exposta na aplicação.
# Caso não queira utilizar esse método e inserir diretamente a senha na conexão, exclua esse bloco e insira a senha diretamente no... | 41.790698 | 171 | 0.670006 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,210 | 0.664105 |
e131340a4484b6722bf5a16704072d57bfdba8fe | 2,418 | py | Python | tests/mvae/distributions/test_von_mises_fisher.py | macio232/mvae | df3d5158ce29744e54b378ad663361e8b785632a | [
"Apache-2.0"
] | 53 | 2019-11-20T05:39:54.000Z | 2022-02-05T06:36:43.000Z | tests/mvae/distributions/test_von_mises_fisher.py | macio232/mvae | df3d5158ce29744e54b378ad663361e8b785632a | [
"Apache-2.0"
] | 8 | 2020-03-14T20:25:08.000Z | 2021-06-10T08:06:15.000Z | tests/mvae/distributions/test_von_mises_fisher.py | macio232/mvae | df3d5158ce29744e54b378ad663361e8b785632a | [
"Apache-2.0"
] | 10 | 2020-03-14T20:17:47.000Z | 2021-12-01T14:08:06.000Z | # Copyright 2019 Ondrej Skopek.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 37.2 | 110 | 0.669975 | 0 | 0 | 0 | 0 | 1,139 | 0.47105 | 0 | 0 | 911 | 0.376758 |
e13147c692ddf6997325ddaffddf29246eba0b66 | 1,033 | py | Python | cello/download_resources.py | Ann-Holmes/CellO | bc2192a2d27e0859f6df885a6fc246e26e54a7b0 | [
"MIT"
] | 42 | 2019-05-14T19:04:38.000Z | 2022-03-06T12:57:00.000Z | cello/download_resources.py | Ann-Holmes/CellO | bc2192a2d27e0859f6df885a6fc246e26e54a7b0 | [
"MIT"
] | 16 | 2020-08-04T12:34:08.000Z | 2022-03-31T22:30:48.000Z | cello/download_resources.py | Ann-Holmes/CellO | bc2192a2d27e0859f6df885a6fc246e26e54a7b0 | [
"MIT"
] | 6 | 2019-05-13T15:57:03.000Z | 2022-03-18T02:17:05.000Z | """
Download CellO's resources files. These files include CellO's pre-trained
models, gene ID-to-symbol mappings, and training sets for training CellO's
models on new gene sets.
Authors: Matthew Bernstein <[email protected]>
"""
import subprocess
from os.path import join
from shutil import which
def download(... | 31.30303 | 109 | 0.621491 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 662 | 0.640852 |
e1314b5fc0e2d4894cb7cecd74444fc00587afb1 | 190 | py | Python | prob_020.py | tansly/euler | 8b420cb05223cf60b6c01aac9bfe8ce5a3b96ddc | [
"MIT"
] | 1 | 2017-02-13T19:00:59.000Z | 2017-02-13T19:00:59.000Z | prob_020.py | tansly/euler | 8b420cb05223cf60b6c01aac9bfe8ce5a3b96ddc | [
"MIT"
] | null | null | null | prob_020.py | tansly/euler | 8b420cb05223cf60b6c01aac9bfe8ce5a3b96ddc | [
"MIT"
] | null | null | null | def sum_digit(n):
total = 0
while n != 0:
total += n % 10
n /= 10
return total
def factorial(n):
if n <= 0:
return 1
return n * factorial(n - 1)
| 15.833333 | 31 | 0.473684 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e133fe625681b1837857d1c7c1998eeec6f05e88 | 7,755 | py | Python | mmtrack/models/mot/trackers/base_tracker.py | sht47/mmtracking | 5a25e418e9c598d1b576bce8702f5e156cbbefe7 | [
"Apache-2.0"
] | 12 | 2021-09-05T20:47:16.000Z | 2022-03-23T07:00:35.000Z | mmtrack/models/mot/trackers/base_tracker.py | hellock/mmtracking | a22a36b2055d80cf4a7a5ef3913849abb56defcb | [
"Apache-2.0"
] | 2 | 2021-09-06T13:20:09.000Z | 2022-01-13T05:36:14.000Z | mmtrack/models/mot/trackers/base_tracker.py | hellock/mmtracking | a22a36b2055d80cf4a7a5ef3913849abb56defcb | [
"Apache-2.0"
] | 1 | 2022-02-28T19:33:49.000Z | 2022-02-28T19:33:49.000Z | from abc import ABCMeta, abstractmethod
import torch
import torch.nn.functional as F
from addict import Dict
from mmtrack.models import TRACKERS
@TRACKERS.register_module()
class BaseTracker(metaclass=ABCMeta):
"""Base tracker model.
Args:
momentums (dict[str:float], optional): Momentums to update ... | 34.466667 | 79 | 0.52392 | 7,577 | 0.977047 | 0 | 0 | 7,605 | 0.980658 | 0 | 0 | 2,427 | 0.312959 |
e134a13671522e1fa873cc9f15fcf37d47bcca9a | 3,675 | py | Python | test/conftest.py | pauldg/ro-crate-py | 695004f18175ca70b439534adece9e2242dca778 | [
"Apache-2.0"
] | null | null | null | test/conftest.py | pauldg/ro-crate-py | 695004f18175ca70b439534adece9e2242dca778 | [
"Apache-2.0"
] | null | null | null | test/conftest.py | pauldg/ro-crate-py | 695004f18175ca70b439534adece9e2242dca778 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2022 The University of Manchester, UK
# Copyright 2020-2022 Vlaams Instituut voor Biotechnologie (VIB), BE
# Copyright 2020-2022 Barcelona Supercomputing Center (BSC), ES
# Copyright 2020-2022 Center for Advanced Studies, Research and Development in Sardinia (CRS4), IT
# Copyright 2022 École Polytechni... | 37.5 | 98 | 0.71619 | 2,209 | 0.600598 | 0 | 0 | 1,892 | 0.51441 | 0 | 0 | 1,444 | 0.392605 |
e134f405b60309ac638075a35a6b8ff83d2c5ab6 | 3,791 | py | Python | tests/unit/test_marathon.py | seomoz/roger-mesos-tools | 88b4cb3550a4b49d0187cfb5e6a22246ff6b9765 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_marathon.py | seomoz/roger-mesos-tools | 88b4cb3550a4b49d0187cfb5e6a22246ff6b9765 | [
"Apache-2.0"
] | 47 | 2016-05-26T22:09:56.000Z | 2018-08-08T20:33:39.000Z | tests/unit/test_marathon.py | seomoz/roger-mesos-tools | 88b4cb3550a4b49d0187cfb5e6a22246ff6b9765 | [
"Apache-2.0"
] | 3 | 2017-09-20T22:39:03.000Z | 2017-11-07T22:29:29.000Z | #!/usr/bin/python
from __future__ import print_function
import unittest
import json
import os
import sys
import requests
sys.path.insert(0, os.path.abspath(os.path.join(
os.path.dirname(os.path.realpath(__file__)), os.pardir, "cli")))
from cli.marathon import Marathon
from cli.appconfig import AppConfig
from mocki... | 36.104762 | 80 | 0.613031 | 3,342 | 0.881562 | 0 | 0 | 94 | 0.024796 | 0 | 0 | 896 | 0.236349 |
e136e8225ad172a851846dc46f34389a3f760935 | 65 | py | Python | 1/0/10821/10821.py | chr0m3/boj-codes | d71d0a22d0a3ae62c225f382442461275f56fe8f | [
"MIT"
] | 3 | 2017-07-08T16:29:06.000Z | 2020-07-20T00:17:45.000Z | 1/0/10821/10821.py | chr0m3/boj-codes | d71d0a22d0a3ae62c225f382442461275f56fe8f | [
"MIT"
] | null | null | null | 1/0/10821/10821.py | chr0m3/boj-codes | d71d0a22d0a3ae62c225f382442461275f56fe8f | [
"MIT"
] | 2 | 2017-11-20T14:06:06.000Z | 2020-07-20T00:17:47.000Z | numbers = list(map(int, input().split(',')))
print(len(numbers))
| 21.666667 | 44 | 0.646154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0.046154 |
e137881799720563759aa64b3e6bb8a63eb7afae | 496 | py | Python | Chapter13/server.py | Joustie/Mastering-GitLab-12 | 5ac4700791e4274ef3de825bc789c46142af403e | [
"MIT"
] | 40 | 2019-07-06T04:40:27.000Z | 2022-03-31T09:25:07.000Z | Chapter13/server.py | Joustie/Mastering-GitLab-12 | 5ac4700791e4274ef3de825bc789c46142af403e | [
"MIT"
] | 1 | 2019-08-03T17:52:08.000Z | 2020-12-16T06:31:53.000Z | Chapter13/server.py | Joustie/Mastering-GitLab-12 | 5ac4700791e4274ef3de825bc789c46142af403e | [
"MIT"
] | 50 | 2019-07-26T08:49:49.000Z | 2022-03-17T21:01:03.000Z | from flask import Flask, request
import json
app = Flask(__name__)
def runsomething():
print "This is triggered"
@app.route('/',methods=['POST'])
def trigger():
data = json.loads(request.data)
print "New commit by: {}".format(data['commits'][0]['author']['name'])
print "New commit by: {}".format(data['c... | 24.8 | 74 | 0.635081 | 0 | 0 | 0 | 0 | 335 | 0.675403 | 0 | 0 | 164 | 0.330645 |
e1380bef90ab2ac303d6b8ab31b603e3157ac287 | 4,349 | py | Python | tests/test_nlp4e.py | EDTAKE/IA | 2731e8ccb9d1b72f564c8c7a1c46a855760edfac | [
"MIT"
] | null | null | null | tests/test_nlp4e.py | EDTAKE/IA | 2731e8ccb9d1b72f564c8c7a1c46a855760edfac | [
"MIT"
] | null | null | null | tests/test_nlp4e.py | EDTAKE/IA | 2731e8ccb9d1b72f564c8c7a1c46a855760edfac | [
"MIT"
] | 1 | 2019-10-26T22:33:40.000Z | 2019-10-26T22:33:40.000Z | import pytest
import nlp
from nlp4e import Rules, Lexicon, Grammar, ProbRules, ProbLexicon, ProbGrammar, E0
from nlp4e import Chart, CYK_parse, subspan, astar_search_parsing, beam_search_parsing
# Clumsy imports because we want to access certain nlp.py globals explicitly, because
# they are accessed by functions... | 31.977941 | 87 | 0.539894 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,127 | 0.25914 |
e13a783a47008677ccb95568f58fe7dd6ad2e4f3 | 1,598 | py | Python | integration_test/ESI/cosim/loopback.py | Patosga/circt | ebf06c9aa5a4e8ae2485b52fd3c564eec7df5754 | [
"Apache-2.0"
] | null | null | null | integration_test/ESI/cosim/loopback.py | Patosga/circt | ebf06c9aa5a4e8ae2485b52fd3c564eec7df5754 | [
"Apache-2.0"
] | null | null | null | integration_test/ESI/cosim/loopback.py | Patosga/circt | ebf06c9aa5a4e8ae2485b52fd3c564eec7df5754 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import binascii
import random
import cosim
class LoopbackTester(cosim.CosimBase):
"""Provides methods to test the loopback simulations."""
def test_list(self):
ifaces = self.cosim.list().wait().ifaces
assert len(ifaces) > 0
def test_open_close(self):
ifaces = self.cosim.list().... | 27.551724 | 72 | 0.6602 | 1,532 | 0.958698 | 0 | 0 | 0 | 0 | 0 | 0 | 178 | 0.111389 |
e13cf9268aca0f5ca5922030192f194f32c26039 | 48,282 | py | Python | pcdsdevices/targets.py | christina-pino/pcdsdevices | c696093b33b252a5fe6ca020063216b0d062aa61 | [
"BSD-3-Clause-LBNL"
] | 3 | 2019-06-17T20:08:54.000Z | 2022-01-11T17:55:21.000Z | pcdsdevices/targets.py | christina-pino/pcdsdevices | c696093b33b252a5fe6ca020063216b0d062aa61 | [
"BSD-3-Clause-LBNL"
] | 757 | 2017-12-21T23:16:41.000Z | 2022-03-31T22:56:06.000Z | pcdsdevices/targets.py | christina-pino/pcdsdevices | c696093b33b252a5fe6ca020063216b0d062aa61 | [
"BSD-3-Clause-LBNL"
] | 38 | 2018-01-26T00:01:35.000Z | 2022-02-17T00:48:55.000Z | """
Module for common target stage stack configurations.
"""
import logging
import numpy as np
from datetime import datetime
import os
from ophyd.device import Device
import json
import jsonschema
import yaml
from itertools import chain
from pcdsdevices.epics_motor import _GetMotorClass
from .interface import tweak_b... | 35.579956 | 79 | 0.558096 | 41,215 | 0.853631 | 0 | 0 | 5,893 | 0.122054 | 0 | 0 | 26,152 | 0.541651 |
e13d3df96caed4ad7bea9f68e21a31547457cf49 | 1,564 | py | Python | release/src-rt-6.x.4708/router/samba3/source4/scripting/python/samba/netcmd/time.py | zaion520/ATtomato | 4d48bb79f8d147f89a568cf18da9e0edc41f93fb | [
"FSFAP"
] | 2 | 2019-01-13T09:16:31.000Z | 2019-02-15T03:30:28.000Z | release/src-rt-6.x.4708/router/samba3/source4/scripting/python/samba/netcmd/time.py | zaion520/ATtomato | 4d48bb79f8d147f89a568cf18da9e0edc41f93fb | [
"FSFAP"
] | null | null | null | release/src-rt-6.x.4708/router/samba3/source4/scripting/python/samba/netcmd/time.py | zaion520/ATtomato | 4d48bb79f8d147f89a568cf18da9e0edc41f93fb | [
"FSFAP"
] | 2 | 2020-03-08T01:58:25.000Z | 2020-12-20T10:34:54.000Z | #!/usr/bin/env python
#
# time
#
# Copyright Jelmer Vernooij 2010 <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any ... | 32.583333 | 85 | 0.710997 | 720 | 0.460358 | 0 | 0 | 0 | 0 | 0 | 0 | 847 | 0.54156 |
e13edb5a04062ed656b823c80283871afa60af92 | 900 | py | Python | tests/job/test_redis.py | ulule/bokchoy | 58afaf325ce275edf5c4a955379afb1cc5eb5de3 | [
"MIT"
] | null | null | null | tests/job/test_redis.py | ulule/bokchoy | 58afaf325ce275edf5c4a955379afb1cc5eb5de3 | [
"MIT"
] | null | null | null | tests/job/test_redis.py | ulule/bokchoy | 58afaf325ce275edf5c4a955379afb1cc5eb5de3 | [
"MIT"
] | null | null | null | import unittest
import redis
import socket
import pytest
from bokchoy.conductors.dummy import DummyConductor
from bokchoy.results.redis import RedisResult
from bokchoy.serializers.json import JSONSerializer
from exam import fixture
from .base import JobTests
def redis_is_available():
try:
socket.create... | 21.95122 | 77 | 0.728889 | 328 | 0.364444 | 0 | 0 | 344 | 0.382222 | 0 | 0 | 49 | 0.054444 |
e13fba4b45b4ccda568c26a9f752c38c0cf1cb17 | 97 | py | Python | venv/lib/python3.8/site-packages/pip/_internal/network/__init__.py | realxwx/leetcode-solve | 3a7d7d8e92a5fd5fecc347d141a1c532b92e763e | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/pip/_internal/network/__init__.py | realxwx/leetcode-solve | 3a7d7d8e92a5fd5fecc347d141a1c532b92e763e | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/pip/_internal/network/__init__.py | realxwx/leetcode-solve | 3a7d7d8e92a5fd5fecc347d141a1c532b92e763e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020
# Author: xiaoweixiang
"""Contains purely network-related utilities.
"""
| 16.166667 | 45 | 0.71134 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 93 | 0.958763 |
e13fc219ca69c0c1e1bed3ebfc6ec504fbe94731 | 1,153 | py | Python | server/global_config.py | CLG0125/elemesdk | 344466398bad7cf026e082e47c77d3ca98621ef3 | [
"MIT"
] | 1 | 2021-04-03T05:11:29.000Z | 2021-04-03T05:11:29.000Z | server/global_config.py | CLG0125/elemesdk | 344466398bad7cf026e082e47c77d3ca98621ef3 | [
"MIT"
] | null | null | null | server/global_config.py | CLG0125/elemesdk | 344466398bad7cf026e082e47c77d3ca98621ef3 | [
"MIT"
] | null | null | null | class Global:
sand_box = True
app_key = None
# your secret
secret = None
callback_url = None
server_url = None
log = None
def __init__(self, config):
Global.sand_box = config.get_env()
Global.app_key = config.get_app_key()
Global.secret = config.get_secret()... | 20.589286 | 55 | 0.632264 | 1,153 | 1 | 0 | 0 | 685 | 0.594102 | 0 | 0 | 43 | 0.037294 |
e13fcadccf45c68be598d453263bc3fd7d573b02 | 3,004 | py | Python | Constants.py | micv-dev/DeepKubeGPUCluster | b1f674ea3c251a5287ee83d582b193248e04f9d6 | [
"Apache-2.0"
] | 2 | 2021-01-22T05:56:40.000Z | 2021-07-03T17:50:49.000Z | Constants.py | micv-dev/DeepKubeGPUCluster | b1f674ea3c251a5287ee83d582b193248e04f9d6 | [
"Apache-2.0"
] | null | null | null | Constants.py | micv-dev/DeepKubeGPUCluster | b1f674ea3c251a5287ee83d582b193248e04f9d6 | [
"Apache-2.0"
] | null | null | null | DEFAULT_KUBE_VERSION=1.14
KUBE_VERSION="kubeVersion"
USER_ID="userId"
DEFAULT_USER_ID=1
CLUSTER_NAME="clusterName"
CLUSTER_MASTER_IP="masterHostIP"
CLUSTER_WORKER_IP_LIST="workerIPList"
FRAMEWORK_TYPE= "frameworkType"
FRAMEWORK_VERSION="frameworkVersion"
FRAMEWORK_RESOURCES="frameworkResources"
FRAMEWORK_VOLUME_SIZE= ... | 25.243697 | 67 | 0.831891 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,153 | 0.383822 |
e13feb6e08fa5f3de107d84f4998b9cc0fdd3b93 | 1,582 | py | Python | mpcontribs-portal/mpcontribs/portal/urls.py | fraricci/MPContribs | 800e8fded594dce57807e7ef0ec8d3192ce54825 | [
"MIT"
] | null | null | null | mpcontribs-portal/mpcontribs/portal/urls.py | fraricci/MPContribs | 800e8fded594dce57807e7ef0ec8d3192ce54825 | [
"MIT"
] | null | null | null | mpcontribs-portal/mpcontribs/portal/urls.py | fraricci/MPContribs | 800e8fded594dce57807e7ef0ec8d3192ce54825 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf.urls import url
from django.views.generic.base import RedirectView
from mpcontribs.portal import views
app_name = "mpcontribs_portal"
urlpatterns = [
url(r"^$", views.index, name="index"),
url(r"^healthcheck/?$", views.healthcheck, name="healthcheck"),
url(
... | 31.019608 | 87 | 0.584071 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 634 | 0.400759 |
e1404018df8652fa89529ce0d2a499530d166df6 | 3,363 | py | Python | src/mp_api/dielectric/client.py | jmmshn/api | 5254a453f6ec749793639e4ec08bea14628c7dc3 | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/mp_api/dielectric/client.py | jmmshn/api | 5254a453f6ec749793639e4ec08bea14628c7dc3 | [
"BSD-3-Clause-LBNL"
] | 159 | 2020-11-16T16:02:31.000Z | 2022-03-28T15:03:38.000Z | src/mp_api/dielectric/client.py | jmmshn/api | 5254a453f6ec749793639e4ec08bea14628c7dc3 | [
"BSD-3-Clause-LBNL"
] | null | null | null | from typing import List, Optional, Tuple
from collections import defaultdict
from mp_api.core.client import BaseRester, MPRestError
import warnings
class DielectricRester(BaseRester):
suffix = "dielectric"
def get_dielectric_from_material_id(self, material_id: str):
"""
Get dielectric data... | 33.969697 | 106 | 0.600059 | 3,210 | 0.954505 | 2,617 | 0.778174 | 0 | 0 | 0 | 0 | 1,441 | 0.428486 |
e1404a753371b136c19314c274ee0f8405dd2c32 | 1,598 | py | Python | docs/example/advanced/view.py | Kozea/Pynuts | f2eb1839f59d2e8a4ec96175726186e67f85c4b0 | [
"BSD-3-Clause"
] | 1 | 2016-06-16T15:31:30.000Z | 2016-06-16T15:31:30.000Z | docs/example/advanced/view.py | Kozea/Pynuts | f2eb1839f59d2e8a4ec96175726186e67f85c4b0 | [
"BSD-3-Clause"
] | null | null | null | docs/example/advanced/view.py | Kozea/Pynuts | f2eb1839f59d2e8a4ec96175726186e67f85c4b0 | [
"BSD-3-Clause"
] | null | null | null | from wtforms import TextField, IntegerField, PasswordField
from wtforms.ext.sqlalchemy.fields import (
QuerySelectField, QuerySelectMultipleField)
from wtforms.validators import Required
from pynuts.view import BaseForm
import database
from application import nuts
class EmployeeView(nuts.ModelView):
model = ... | 35.511111 | 76 | 0.682728 | 1,322 | 0.827284 | 0 | 0 | 0 | 0 | 0 | 0 | 289 | 0.180851 |
e1412f411269485acbe2ebcad67a9f18d2b335f9 | 330 | py | Python | scripts/extract_hit_upstreams.py | waglecn/helD_search | 2b77e81419b9929d5cf5ecc519f27cb381178b2c | [
"MIT"
] | null | null | null | scripts/extract_hit_upstreams.py | waglecn/helD_search | 2b77e81419b9929d5cf5ecc519f27cb381178b2c | [
"MIT"
] | null | null | null | scripts/extract_hit_upstreams.py | waglecn/helD_search | 2b77e81419b9929d5cf5ecc519f27cb381178b2c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from Bio import SeqIO
import os
genome = sys.argv[1]
in_aa = f'hits/{genome}.hits'
in_up = f'fa/{genome}.upstream'
hits = SeqIO.to_dict(SeqIO.parse(in_aa, 'fasta'))
raes = SeqIO.to_dict(SeqIO.parse(in_up, 'fasta'))
for k in hits.keys():
i = k.split('|')[1]
print(raes[i].format('... | 17.368421 | 49 | 0.672727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 90 | 0.272727 |
e14130d3b319054f84f8b96b0e660e7e60ab2e53 | 11,674 | py | Python | homeassistant/components/airtouch4/climate.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 4 | 2021-07-11T09:11:00.000Z | 2022-02-27T14:43:50.000Z | homeassistant/components/airtouch4/climate.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 277 | 2021-10-04T06:39:33.000Z | 2021-12-28T22:04:17.000Z | homeassistant/components/airtouch4/climate.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2022-01-02T18:49:54.000Z | 2022-01-25T02:03:54.000Z | """AirTouch 4 component to control of AirTouch 4 Climate Devices."""
from __future__ import annotations
import logging
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
FAN_AUTO,
FAN_DIFFUSE,
FAN_FOCUS,
FAN_HIGH,
FAN_LOW,
FAN_MEDIUM... | 33.642651 | 91 | 0.668837 | 9,291 | 0.795871 | 0 | 0 | 3,884 | 0.332705 | 4,726 | 0.404831 | 2,563 | 0.219548 |
e1414f639d12d9584079f8b303441fd98b73dfdd | 772 | py | Python | giosgappsdk/giosg_api.py | mentholi/giosgapp-python-sdk | 2a5ea25e223dc4a88a32e917dd393cc9a07f9999 | [
"MIT"
] | null | null | null | giosgappsdk/giosg_api.py | mentholi/giosgapp-python-sdk | 2a5ea25e223dc4a88a32e917dd393cc9a07f9999 | [
"MIT"
] | null | null | null | giosgappsdk/giosg_api.py | mentholi/giosgapp-python-sdk | 2a5ea25e223dc4a88a32e917dd393cc9a07f9999 | [
"MIT"
] | null | null | null | import json
import requests
class GiosgApiMixin(object):
URL_USERS = '/api/v3/customer/personnel'
URL_CHATS = '/api/v3/chat/chatsessions'
def build_request_url(self, base, page_size=25, page=1):
domain = self.data.get('sub')
return '%s://%s%s?page_size=%s&page=%s' % (self._protocol, domai... | 38.6 | 120 | 0.700777 | 741 | 0.959845 | 0 | 0 | 0 | 0 | 0 | 0 | 92 | 0.119171 |
e1416e342916d61944b1391ba364f72736a6b340 | 1,415 | py | Python | Pixelfonts/Delete duplicate components.py | NaN-xyz/Glyphs-Scripts | bdacf455babc72e0801d8d8db5dc10f8e88aa37b | [
"Apache-2.0"
] | 1 | 2022-01-09T04:28:36.000Z | 2022-01-09T04:28:36.000Z | Pixelfonts/Delete duplicate components.py | NaN-xyz/Glyphs-Scripts | bdacf455babc72e0801d8d8db5dc10f8e88aa37b | [
"Apache-2.0"
] | null | null | null | Pixelfonts/Delete duplicate components.py | NaN-xyz/Glyphs-Scripts | bdacf455babc72e0801d8d8db5dc10f8e88aa37b | [
"Apache-2.0"
] | null | null | null | #MenuTitle: Delete Duplicate Components
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Looks for duplicate components (same component, same x/y values) and keeps only one of them.
"""
Font = Glyphs.font
selectedLayers = Font.selectedLayers
def getAttr( thisLayer,... | 27.745098 | 128 | 0.743463 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 223 | 0.157597 |
e141938b24307f066ff503fed7f111fa1bbefd00 | 3,317 | py | Python | src/structures/Errors.py | Xiddoc/ComPy | 7d26f95209d0615d7eb188fa02470ddae5311fca | [
"MIT"
] | null | null | null | src/structures/Errors.py | Xiddoc/ComPy | 7d26f95209d0615d7eb188fa02470ddae5311fca | [
"MIT"
] | 9 | 2022-02-23T10:32:44.000Z | 2022-03-27T17:55:43.000Z | src/structures/Errors.py | Xiddoc/ComPy | 7d26f95209d0615d7eb188fa02470ddae5311fca | [
"MIT"
] | null | null | null | """
Error classes, when needed for exceptions.
"""
from _ast import AST
from dataclasses import dataclass, field
from typing import Optional, Union
from src.compiler.Util import Util
@dataclass(frozen=True)
class ObjectAlreadyDefinedError(NameError):
"""
For our compilation scheme, objects can only be define... | 31.894231 | 118 | 0.67561 | 2,971 | 0.895689 | 0 | 0 | 3,115 | 0.939102 | 0 | 0 | 1,880 | 0.566777 |
e1419fb66f46497cc9f96ff1980d0c0ddc909d97 | 4,314 | py | Python | github/recorders/github/github_user_info_recorder.py | zvtvz/play-github | 30ad38ca88c1a57b2cec48b19ca31ffa28fa0154 | [
"MIT"
] | 2 | 2019-09-21T04:31:01.000Z | 2020-01-21T03:45:51.000Z | github/recorders/github/github_user_info_recorder.py | zvtvz/play-github | 30ad38ca88c1a57b2cec48b19ca31ffa28fa0154 | [
"MIT"
] | null | null | null | github/recorders/github/github_user_info_recorder.py | zvtvz/play-github | 30ad38ca88c1a57b2cec48b19ca31ffa28fa0154 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import argparse
from github.accounts.github_account import GithubAccount
from github.domain.github import GithubUser
from github.recorders.github.common import get_result
from zvdata.api import get_entities
from zvdata.domain import get_db_session
from zvdata.recorder import TimeSeriesDataRecor... | 38.176991 | 119 | 0.592721 | 3,535 | 0.815644 | 0 | 0 | 0 | 0 | 0 | 0 | 627 | 0.14467 |
e141a2ac84bf3c71baee17e1baf51d264eb93a13 | 94 | py | Python | pyEDAA/OutputFilter/__init__.py | edaa-org/pyEDAA.OutputFilter | ca602c9992b40df7bd117968c0dc333a4f16d255 | [
"Apache-2.0"
] | 1 | 2021-12-30T02:49:43.000Z | 2021-12-30T02:49:43.000Z | pyEDAA/OutputFilter/__init__.py | edaa-org/pyEDAA.OutputFilter | ca602c9992b40df7bd117968c0dc333a4f16d255 | [
"Apache-2.0"
] | null | null | null | pyEDAA/OutputFilter/__init__.py | edaa-org/pyEDAA.OutputFilter | ca602c9992b40df7bd117968c0dc333a4f16d255 | [
"Apache-2.0"
] | null | null | null |
from pyTooling.Decorators import export
__version__ = "0.1.0"
@export
class Filter:
pass
| 9.4 | 39 | 0.744681 | 19 | 0.202128 | 0 | 0 | 27 | 0.287234 | 0 | 0 | 7 | 0.074468 |
e141a89f1384646896cf35e7b57e68052818e1a7 | 1,766 | py | Python | tut/app.py | Tyler9937/titanic-test | 6a5200558caf203ed1dc3de71a6c9b5d488f847a | [
"MIT"
] | null | null | null | tut/app.py | Tyler9937/titanic-test | 6a5200558caf203ed1dc3de71a6c9b5d488f847a | [
"MIT"
] | null | null | null | tut/app.py | Tyler9937/titanic-test | 6a5200558caf203ed1dc3de71a6c9b5d488f847a | [
"MIT"
] | null | null | null | # Importing needed libraries
import uuid
from decouple import config
from dotenv import load_dotenv
from flask import Flask, render_template, request, jsonify
from sklearn.externals import joblib
import traceback
import pandas as pd
import numpy as np
from flask_sqlalchemy import SQLAlchemy
# Saving DB var
DB = SQLAlc... | 28.95082 | 86 | 0.623443 | 0 | 0 | 0 | 0 | 601 | 0.340317 | 0 | 0 | 552 | 0.312571 |
e143b369aa9fc5500990d0521c4867296c4568dc | 1,237 | py | Python | trainer.py | thedesertm/leapmotion_training_svm | 659a439be4209450b98d638e655ee025e5bd562b | [
"MIT"
] | null | null | null | trainer.py | thedesertm/leapmotion_training_svm | 659a439be4209450b98d638e655ee025e5bd562b | [
"MIT"
] | null | null | null | trainer.py | thedesertm/leapmotion_training_svm | 659a439be4209450b98d638e655ee025e5bd562b | [
"MIT"
] | null | null | null | import pandas as pd
import os
from sklearn.svm import SVC
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import classification_report, confusion_matrix
from sklearn.model_selection import train_test_split
import pickle
BASE_PATH = os.path.join(os.getcwd() , "dataset")
df = None
i = 0
for file_na... | 31.717949 | 87 | 0.735651 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 69 | 0.05578 |
e145c5c7a800878dc251c5025a3fb2b44ba71b0b | 6,266 | py | Python | 1 - Data Analysis/2_Analysis - Data Exploration.py | dkim319/NFL_Predictive_Model_v2 | 5884e10a681e2e34f54a2280c94d2f42fc442d17 | [
"CNRI-Python"
] | 1 | 2019-09-14T04:04:51.000Z | 2019-09-14T04:04:51.000Z | 1 - Data Analysis/2_Analysis - Data Exploration.py | dkim319/NFL_Predictive_Model_v2 | 5884e10a681e2e34f54a2280c94d2f42fc442d17 | [
"CNRI-Python"
] | null | null | null | 1 - Data Analysis/2_Analysis - Data Exploration.py | dkim319/NFL_Predictive_Model_v2 | 5884e10a681e2e34f54a2280c94d2f42fc442d17 | [
"CNRI-Python"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 14 20:21:23 2017
@author: DKIM
"""
import pandas as pd
import numpy as np
# required libraries loaded
import pandas as pd
import numpy as np
import matplotlib
matplotlib.style.use('ggplot')
import matplotlib.pyplot as plt
seednumber = 319
data = pd.read_csv('Data.csv... | 34.811111 | 141 | 0.76157 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,379 | 0.379668 |
e1473bb4e004b0d3642a2fee0b5a8667fbdf36d4 | 597 | py | Python | tests/functional/testplan/test_plan_timeout.py | dobragab/testplan | 407ac1dfd33d19753e41235a1f576aeb06118840 | [
"Apache-2.0"
] | null | null | null | tests/functional/testplan/test_plan_timeout.py | dobragab/testplan | 407ac1dfd33d19753e41235a1f576aeb06118840 | [
"Apache-2.0"
] | null | null | null | tests/functional/testplan/test_plan_timeout.py | dobragab/testplan | 407ac1dfd33d19753e41235a1f576aeb06118840 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Testplan that is expected to time out."""
import sys
import threading
import testplan
from testplan.testing import multitest
@multitest.testsuite
class TimeoutSuite(object):
@multitest.testcase
def blocks(self, env, result):
result.log('Blocking...')
threading.Event(... | 20.586207 | 58 | 0.643216 | 154 | 0.257956 | 0 | 0 | 379 | 0.634841 | 0 | 0 | 120 | 0.201005 |
e14841f80a1f905b5006c26969f6f10bf64c27b5 | 107 | py | Python | Codefights/arcade/intro/level-2/6.Make-Array-Consecutive-2/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | 7 | 2017-09-20T16:40:39.000Z | 2021-08-31T18:15:08.000Z | Codefights/arcade/intro/level-2/6.Make-Array-Consecutive-2/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | Codefights/arcade/intro/level-2/6.Make-Array-Consecutive-2/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | # Python3
def makeArrayConsecutive2(statues):
return (max(statues) - min(statues) + 1) - len(statues)
| 21.4 | 59 | 0.700935 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 0.084112 |
e14a89ff9896dc6d76ffe641bcbb01393e6b478d | 1,127 | py | Python | tests/classification_test.py | mjirik/lisa | 06c5cb8f375f51302341e768512f02236774c8a3 | [
"BSD-3-Clause"
] | 22 | 2015-01-26T12:58:54.000Z | 2021-04-15T17:48:13.000Z | tests/classification_test.py | mjirik/lisa | 06c5cb8f375f51302341e768512f02236774c8a3 | [
"BSD-3-Clause"
] | 31 | 2015-01-23T14:46:13.000Z | 2018-05-18T14:47:18.000Z | tests/classification_test.py | mjirik/lisa | 06c5cb8f375f51302341e768512f02236774c8a3 | [
"BSD-3-Clause"
] | 13 | 2015-06-30T08:54:27.000Z | 2020-09-11T16:08:19.000Z | # ! /usr/bin/python
# -*- coding: utf-8 -*-
# import funkcí z jiného adresáře
# import sys
import os.path
path_to_script = os.path.dirname(os.path.abspath(__file__))
# sys.path.append(os.path.join(path_to_script, "../extern/pyseg_base/src/"))
# sys.path.append(os.path.join(path_to_script, "../extern/sed3/"))
# sys.pat... | 29.657895 | 76 | 0.615794 | 642 | 0.567639 | 0 | 0 | 0 | 0 | 0 | 0 | 385 | 0.340407 |
e14b23b0342f7644f668cb1aa04ae3158b4e1e5b | 751 | py | Python | application.py | milindvb/python-docs-hello-world | 6d3c8b1936c10ee245cc7c4ffb448e94c8b4b9de | [
"MIT"
] | null | null | null | application.py | milindvb/python-docs-hello-world | 6d3c8b1936c10ee245cc7c4ffb448e94c8b4b9de | [
"MIT"
] | null | null | null | application.py | milindvb/python-docs-hello-world | 6d3c8b1936c10ee245cc7c4ffb448e94c8b4b9de | [
"MIT"
] | null | null | null | from flask import Flask
# import pyodbc
app = Flask(__name__)
@app.route("/")
def hello():
# Some other example server values are
# server = 'localhost\sqlexpress' # for a named instance
# server = 'myserver,port' # to specify an alternate port
# server = 'tcp:mytest.centralus.cloudapp.azure.com... | 28.884615 | 141 | 0.600533 | 0 | 0 | 0 | 0 | 686 | 0.913449 | 0 | 0 | 576 | 0.766977 |
e14ca387e55877393570685f057c5e66f54b5ec5 | 3,906 | py | Python | basefiles/sweeps/SMTBFsweep.py | hpec-2021-ccu-lanl/simulator | 21a7cc0dd12feef5ad26668a3cc216854cc2dd40 | [
"BSD-3-Clause"
] | null | null | null | basefiles/sweeps/SMTBFsweep.py | hpec-2021-ccu-lanl/simulator | 21a7cc0dd12feef5ad26668a3cc216854cc2dd40 | [
"BSD-3-Clause"
] | null | null | null | basefiles/sweeps/SMTBFsweep.py | hpec-2021-ccu-lanl/simulator | 21a7cc0dd12feef5ad26668a3cc216854cc2dd40 | [
"BSD-3-Clause"
] | null | null | null | from sweeps.sweepFunctions import *
import numpy as np
def SMTBFSweep(SMTBFSweepInput,ourInput):
myRange = SMTBFSweepInput["range"] if dictHasKey(SMTBFSweepInput,"range") else False
myStickyRange=SMTBFSweepInput["sticky-range"] if dictHasKey(SMTBFSweepInput,"sticky-range") else False
sticky=False if type(... | 48.222222 | 164 | 0.575269 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 959 | 0.24552 |
e14ce3e30f3e8ef1bb113abf4b81672a5245be55 | 1,708 | py | Python | tests/functional_pyecore/regressions/test_issue_34_resolving_pyecore.py | aranega/textX | abb04d272a1b74f937d43400be130cf7a3be3516 | [
"MIT"
] | 4 | 2017-12-04T11:07:11.000Z | 2021-06-21T20:54:09.000Z | tests/functional_pyecore/regressions/test_issue_34_resolving_pyecore.py | aranega/textX | abb04d272a1b74f937d43400be130cf7a3be3516 | [
"MIT"
] | null | null | null | tests/functional_pyecore/regressions/test_issue_34_resolving_pyecore.py | aranega/textX | abb04d272a1b74f937d43400be130cf7a3be3516 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import pytest # noqa
import sys
pytestmark = pytest.mark.skipif(sys.version_info[0] < 3,
reason="pyecore is not Python 2 compatible") # noqa
pyecore = pytest.importorskip("pyecore") # noqa
import textx
from textx.metamodel import metamodel_from_... | 25.878788 | 84 | 0.67096 | 0 | 0 | 121 | 0.070843 | 153 | 0.089578 | 0 | 0 | 985 | 0.576698 |
e14d0acbede38071c9f51e6e3d4fd2359e4f607b | 863 | py | Python | pylbd/s3_object.py | MacHu-GWU/pylbd-project | d9be28d1f9f7679237e4d3c86f63ea06f43249dd | [
"MIT"
] | null | null | null | pylbd/s3_object.py | MacHu-GWU/pylbd-project | d9be28d1f9f7679237e4d3c86f63ea06f43249dd | [
"MIT"
] | null | null | null | pylbd/s3_object.py | MacHu-GWU/pylbd-project | d9be28d1f9f7679237e4d3c86f63ea06f43249dd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import boto3
from botocore.exceptions import ClientError
import attr
from attrs_mate import AttrsClass
import weakref
@attr.s
class S3Object(AttrsClass):
aws_profile = attr.ib()
bucket = attr.ib() # type: str
key = attr.ib() # type: str
_s3_client_cache = weakref.WeakValueDic... | 26.151515 | 86 | 0.659328 | 708 | 0.820394 | 0 | 0 | 716 | 0.829664 | 0 | 0 | 49 | 0.056779 |
e14d1130b819743aa4189ff145d7b0695bac00b3 | 543 | py | Python | android_toast/toast.py | ShareASmile/car-locator | 765d26ad414ab86e4d93bc5338868769e8b3e90f | [
"MIT"
] | 21 | 2020-09-08T21:03:25.000Z | 2022-02-15T07:08:04.000Z | android_toast/toast.py | ShareASmile/car-locator | 765d26ad414ab86e4d93bc5338868769e8b3e90f | [
"MIT"
] | 3 | 2021-04-13T09:40:20.000Z | 2021-05-28T20:53:07.000Z | android_toast/toast.py | ShareASmile/car-locator | 765d26ad414ab86e4d93bc5338868769e8b3e90f | [
"MIT"
] | 9 | 2020-12-11T09:01:42.000Z | 2022-03-28T00:55:59.000Z |
from android.runnable import run_on_ui_thread
from jnius import autoclass, cast
mActivity = autoclass("org.kivy.android.PythonActivity").mActivity
Toast = autoclass("android.widget.Toast")
CharSequence = autoclass("java.lang.CharSequence")
String = autoclass("java.lang.String")
@run_on_ui_thread
def android_toast(t... | 28.578947 | 66 | 0.756906 | 0 | 0 | 0 | 0 | 259 | 0.47698 | 0 | 0 | 97 | 0.178637 |
e14d6f0551ebee50376c52df3cd3465b333386e1 | 9,395 | py | Python | ktsp.py | lum4chi/mylearn | 8a66fd5ebc32a70783132e185b4f5ce18ce14c5f | [
"MIT"
] | null | null | null | ktsp.py | lum4chi/mylearn | 8a66fd5ebc32a70783132e185b4f5ce18ce14c5f | [
"MIT"
] | null | null | null | ktsp.py | lum4chi/mylearn | 8a66fd5ebc32a70783132e185b4f5ce18ce14c5f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
# author: Francesco Lumachi <[email protected]>
import pandas as pd
import numpy as np
from itertools import islice
from sklearn.utils.validation import check_X_y
class KTopScoringPair:
""" K-Top Scoring Pair classifier.
This classifier evaluate maximum-li... | 41.570796 | 92 | 0.571368 | 9,179 | 0.977009 | 0 | 0 | 0 | 0 | 0 | 0 | 5,119 | 0.544864 |
e14da54b265b1cbaa55d62627f5c4770644546b4 | 11,089 | py | Python | picmodels/models/care_advisors/daily_metrics_models/services/read.py | bbcawodu/careadvisors-backend | 5ebd3c0fc189b2486cea92b2a13c0bd8a0ee3838 | [
"MIT"
] | null | null | null | picmodels/models/care_advisors/daily_metrics_models/services/read.py | bbcawodu/careadvisors-backend | 5ebd3c0fc189b2486cea92b2a13c0bd8a0ee3838 | [
"MIT"
] | null | null | null | picmodels/models/care_advisors/daily_metrics_models/services/read.py | bbcawodu/careadvisors-backend | 5ebd3c0fc189b2486cea92b2a13c0bd8a0ee3838 | [
"MIT"
] | null | null | null | import datetime
import picmodels.models
from picmodels.models.utils import filter_db_queryset_by_id
from picmodels.models.care_advisors.navigator_models.services.read import filter_navigator_objs_by_f_and_l_name
from picmodels.models.care_advisors.navigator_models.services.read import filter_navigator_objs_by_first_na... | 44.179283 | 155 | 0.742447 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 761 | 0.068627 |
e14daa2e05a40d76224587c816432879876d552a | 949 | py | Python | utils.py | YaelMoshe/CSV-Compressor | 82a72c1750a8d1fb4b6f3d312995a537edbda48c | [
"MIT"
] | null | null | null | utils.py | YaelMoshe/CSV-Compressor | 82a72c1750a8d1fb4b6f3d312995a537edbda48c | [
"MIT"
] | null | null | null | utils.py | YaelMoshe/CSV-Compressor | 82a72c1750a8d1fb4b6f3d312995a537edbda48c | [
"MIT"
] | null | null | null |
class CompressorUtils(object):
@staticmethod
def encode(_cell, _list):
if not _cell:
data = "-"
elif _cell not in _list:
data = str(len(_list))
_list.append(_cell)
else:
data = str(_list.index(_cell))
return data
... | 23.725 | 48 | 0.500527 | 945 | 0.995785 | 0 | 0 | 885 | 0.932561 | 0 | 0 | 22 | 0.023182 |
e14dbf37cac6b30fd02dacd5e179dc9f00f542ab | 3,405 | py | Python | beakerx/beakerx/commands.py | acq/beakerx | 584023ce0fdb052713855d8a9455e6d7422e53da | [
"Apache-2.0"
] | null | null | null | beakerx/beakerx/commands.py | acq/beakerx | 584023ce0fdb052713855d8a9455e6d7422e53da | [
"Apache-2.0"
] | null | null | null | beakerx/beakerx/commands.py | acq/beakerx | 584023ce0fdb052713855d8a9455e6d7422e53da | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 TWO SIGMA OPEN SOURCE, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 35.842105 | 138 | 0.698678 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,085 | 0.318649 |
e14e630e471443793b9fd29816d201fc888da13e | 2,512 | py | Python | attnganw/runner.py | cptanalatriste/AttnGAN | 6b8641cd5eb9c3a0bba73904b5c639784d6c3ec8 | [
"MIT"
] | null | null | null | attnganw/runner.py | cptanalatriste/AttnGAN | 6b8641cd5eb9c3a0bba73904b5c639784d6c3ec8 | [
"MIT"
] | null | null | null | attnganw/runner.py | cptanalatriste/AttnGAN | 6b8641cd5eb9c3a0bba73904b5c639784d6c3ec8 | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import List
import dateutil
from datasets import TextDataset
from miscc.config import cfg_from_file, cfg
from torchvision.transforms import transforms
from attnganw.train import GanTrainerWrapper, BirdGenerationFromCaption
def get_text_dataset(tree_base_size: int, tree_bran... | 44.857143 | 108 | 0.624602 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 45 | 0.017914 |
e150737ff1e7de27f34b49c4df0d1658c30b7b57 | 2,469 | py | Python | Gds/src/fprime_gds/common/data_types/sys_data.py | m-aleem/fprime | ae8a2a43a39d0e8a1908a82b48106467357d6cba | [
"Apache-2.0"
] | 1 | 2020-05-12T03:43:36.000Z | 2020-05-12T03:43:36.000Z | Gds/src/fprime_gds/common/data_types/sys_data.py | abcouwer-jpl/fprime | f28c92e31d58e7e44bff09ad57d574ca5d5e91c7 | [
"Apache-2.0"
] | 5 | 2020-05-26T21:38:02.000Z | 2020-05-26T21:43:33.000Z | Gds/src/fprime_gds/common/data_types/sys_data.py | abcouwer-jpl/fprime | f28c92e31d58e7e44bff09ad57d574ca5d5e91c7 | [
"Apache-2.0"
] | 3 | 2020-09-05T18:17:21.000Z | 2020-11-15T04:06:24.000Z | '''
@brief Base class for system data classes.
This class defines the interface for cata classes which are intended to hold
a specific data item (packet, channel, event). This data item includes the time
of the data as well as data such as channel value or argument value.
@date Created July 2, 2018
@author R. Joseph ... | 24.939394 | 79 | 0.617254 | 1,908 | 0.772783 | 0 | 0 | 493 | 0.199676 | 0 | 0 | 1,496 | 0.605913 |
e15162de1790d30c48e2c7c4e83b30934c311fba | 3,063 | py | Python | txdav/carddav/datastore/query/test/test_filter.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | txdav/carddav/datastore/query/test/test_filter.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | txdav/carddav/datastore/query/test/test_filter.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | ##
# Copyright (c) 2011-2015 Apple Inc. 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 applicable l... | 31.57732 | 224 | 0.647405 | 1,991 | 0.650016 | 0 | 0 | 0 | 0 | 0 | 0 | 1,127 | 0.36794 |
e151f9085880a3aa0708d3748aa966d97630b3db | 8,259 | py | Python | train/erfnet_pspnet_hier33.py | elnino9ykl/Sequential-Hierarchical-ERF-PSPNet | c7fe42967894b15f6ed82608cd1836a17fec0260 | [
"MIT"
] | null | null | null | train/erfnet_pspnet_hier33.py | elnino9ykl/Sequential-Hierarchical-ERF-PSPNet | c7fe42967894b15f6ed82608cd1836a17fec0260 | [
"MIT"
] | null | null | null | train/erfnet_pspnet_hier33.py | elnino9ykl/Sequential-Hierarchical-ERF-PSPNet | c7fe42967894b15f6ed82608cd1836a17fec0260 | [
"MIT"
] | null | null | null | # ERFNet full model definition for Pytorch
# Sept 2017
# Eduardo Romera
#######################
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
class DownsamplerBlock (nn.Module):
def __init__(self, ninput, noutput):
super().__init__()
self.conv = n... | 33.987654 | 124 | 0.593413 | 8,041 | 0.973605 | 0 | 0 | 0 | 0 | 0 | 0 | 1,133 | 0.137184 |
e15240f37f48e80c43aa04132d7d8be1877669db | 1,009 | py | Python | wsgi.py | nam4dev/evedom_demo | 3cba0cf8e37f6fa75af006c4a99a0b3fab7c2e13 | [
"MIT"
] | null | null | null | wsgi.py | nam4dev/evedom_demo | 3cba0cf8e37f6fa75af006c4a99a0b3fab7c2e13 | [
"MIT"
] | null | null | null | wsgi.py | nam4dev/evedom_demo | 3cba0cf8e37f6fa75af006c4a99a0b3fab7c2e13 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
WSGI script
Setup Application, Authentication, ...
"""
import os
from eve import Eve
from evedom import loader
# from your_app.authentication.token import TokenBasedAuth
__author__ = "nam4dev"
__created__ = '08/11/2017'
ROOT_PATH = os.path.dirname(
os.pa... | 16.274194 | 58 | 0.620416 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 365 | 0.361744 |
e152f4d6dde06ac4acdcd8bfa8623f41a066db20 | 1,654 | py | Python | workflow/migrations/0027_tolausercountryroles_tolauserprogramroles.py | mercycorps/TolaWorkflow | 59542132fafd611081adb0e8cfaa04abc5886d7a | [
"Apache-2.0"
] | null | null | null | workflow/migrations/0027_tolausercountryroles_tolauserprogramroles.py | mercycorps/TolaWorkflow | 59542132fafd611081adb0e8cfaa04abc5886d7a | [
"Apache-2.0"
] | 268 | 2020-03-31T15:46:59.000Z | 2022-03-31T18:01:08.000Z | workflow/migrations/0027_tolausercountryroles_tolauserprogramroles.py | Falliatcom-sa/falliatcom | 39fb926de072c296ed32d50cccfb8003ca870739 | [
"Apache-2.0"
] | 1 | 2021-01-05T01:58:24.000Z | 2021-01-05T01:58:24.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2019-01-18 17:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('workflow', '0026_auto_20190116_1357'),
]
operation... | 47.257143 | 151 | 0.628174 | 1,463 | 0.884522 | 0 | 0 | 0 | 0 | 0 | 0 | 438 | 0.264813 |
e15353b2bdb09ab7d8c47ead4ff13403eb177890 | 753 | py | Python | set-2/challenge-11.py | natehouk/cryptopals-crypto-challenges-solutions | 3b89a94d42a9b052b2f79d37ba3fa9e3ec17c869 | [
"MIT"
] | null | null | null | set-2/challenge-11.py | natehouk/cryptopals-crypto-challenges-solutions | 3b89a94d42a9b052b2f79d37ba3fa9e3ec17c869 | [
"MIT"
] | null | null | null | set-2/challenge-11.py | natehouk/cryptopals-crypto-challenges-solutions | 3b89a94d42a9b052b2f79d37ba3fa9e3ec17c869 | [
"MIT"
] | null | null | null | import sys, os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import random
from util.util import pad, detect_aes_ecb, generate_key, ammend_plaintext, encrypt_random
# Chosen plaintext
plaintext = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
# Generate data and encrypt plaintext
key = g... | 30.12 | 89 | 0.749004 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 238 | 0.316069 |
e1570b21e8b27475e013ab8eb1dbd45fef7957ed | 5,457 | py | Python | lib/python3.6/site-packages/example/authorize_driver.py | venkyyPoojari/Smart-Mirror | 256b7a870f8cda2965b848a66574ee38254274f5 | [
"MIT"
] | 187 | 2015-10-02T13:47:33.000Z | 2022-03-23T08:09:22.000Z | lib/python3.6/site-packages/example/authorize_driver.py | venkyyPoojari/Smart-Mirror | 256b7a870f8cda2965b848a66574ee38254274f5 | [
"MIT"
] | 44 | 2015-12-08T04:31:14.000Z | 2022-03-14T17:33:11.000Z | lib/python3.6/site-packages/example/authorize_driver.py | venkyyPoojari/Smart-Mirror | 256b7a870f8cda2965b848a66574ee38254274f5 | [
"MIT"
] | 88 | 2015-10-11T03:09:01.000Z | 2022-03-19T04:16:37.000Z | # Copyright (c) 2017 Uber Technologies, Inc.
#
# 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 limitation the rights
# to use, copy, modify, merge, publ... | 33.478528 | 79 | 0.721092 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,739 | 0.501924 |
e1572ceb180b2c59c917246045f255f6d9bcd968 | 10,766 | py | Python | orangeplus/OPTICS_w.py | panatronic-git/orange-plus | b51643d5edaa7de78388bc38a7695eec64331d27 | [
"CC0-1.0"
] | null | null | null | orangeplus/OPTICS_w.py | panatronic-git/orange-plus | b51643d5edaa7de78388bc38a7695eec64331d27 | [
"CC0-1.0"
] | null | null | null | orangeplus/OPTICS_w.py | panatronic-git/orange-plus | b51643d5edaa7de78388bc38a7695eec64331d27 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
""" A data clustering widget for the Orange3.
This is a data clustering widget for Orange3, that implements the OPTICS algorithm.
OPTICS stands for "Ordering Points To Identify the Clustering Structure".
This is a very useful algorithm for clustering data when the dataset is unlabel... | 34.396166 | 145 | 0.612205 | 7,285 | 0.670934 | 0 | 0 | 948 | 0.087309 | 0 | 0 | 3,468 | 0.319396 |
e157ca6b782a8b3accbd943a60246d4523efb4e1 | 2,590 | py | Python | message_prototypes/base_message.py | agratoth/py-message-prototypes | a23527f8264631e947ed2a6657b325036005330f | [
"MIT"
] | 1 | 2021-02-26T04:40:00.000Z | 2021-02-26T04:40:00.000Z | message_prototypes/base_message.py | agratoth/py-message-prototypes | a23527f8264631e947ed2a6657b325036005330f | [
"MIT"
] | null | null | null | message_prototypes/base_message.py | agratoth/py-message-prototypes | a23527f8264631e947ed2a6657b325036005330f | [
"MIT"
] | null | null | null | import json
from message_prototypes.exceptions import MissingModelException
class BaseMessage:
_serializable_fields = []
def pack(self, unpacking_info=True):
result = {
'_model': self.__class__.__name__,
} if unpacking_info else {}
def serialize_node(node=None):
... | 30.116279 | 70 | 0.508108 | 2,510 | 0.969112 | 0 | 0 | 1,425 | 0.550193 | 0 | 0 | 40 | 0.015444 |
e1597f1ccc9fdad83bd98d093bad683b7edf4352 | 2,015 | py | Python | Tests/Methods/Geometry/test_is_inside.py | Eomys/pyleecan | 9a8cea3e62f63bc73417fe09770bd4d480021e35 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | Tests/Methods/Geometry/test_is_inside.py | Eomys/pyleecan | 9a8cea3e62f63bc73417fe09770bd4d480021e35 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | Tests/Methods/Geometry/test_is_inside.py | Eomys/pyleecan | 9a8cea3e62f63bc73417fe09770bd4d480021e35 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | # -*- coding: utf-8 -*
import pytest
from pyleecan.Classes.Circle import Circle
from pyleecan.Classes.Segment import Segment
from pyleecan.Classes.SurfLine import SurfLine
# Configuring the test of is_inside
inside_test = list()
# Test 1 : checking if a point is inside a circle of radius 1 at 0 + 0j
C1 = ... | 31 | 89 | 0.651613 | 0 | 0 | 0 | 0 | 418 | 0.207444 | 0 | 0 | 556 | 0.275931 |
e15a7dcff0d33ea587927f028856b4941738c99e | 542 | py | Python | examples/polling_tweets_example.py | Cheetah97/nitter_scraper | 2da2cf9dca66c7ff9b02c06fccf1cfad772f14a5 | [
"MIT"
] | 21 | 2020-08-31T06:20:36.000Z | 2022-01-10T19:22:00.000Z | examples/polling_tweets_example.py | Cheetah97/nitter_scraper | 2da2cf9dca66c7ff9b02c06fccf1cfad772f14a5 | [
"MIT"
] | 2 | 2021-02-09T18:19:51.000Z | 2021-07-25T17:27:59.000Z | examples/polling_tweets_example.py | Cheetah97/nitter_scraper | 2da2cf9dca66c7ff9b02c06fccf1cfad772f14a5 | [
"MIT"
] | 4 | 2020-12-20T01:31:30.000Z | 2022-01-24T14:22:13.000Z | import time
from nitter_scraper import NitterScraper
last_tweet_id = None
with NitterScraper(port=8008) as nitter:
while True:
for tweet in nitter.get_tweets("dgnsrekt", pages=1, break_on_tweet_id=last_tweet_id):
if tweet.is_pinned is True:
continue
if tweet.is_r... | 21.68 | 93 | 0.605166 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0.01845 |
e15ca3d18b760bf74faf9a038392f2b6d8bb59b6 | 11,697 | py | Python | esse/mainapp/migrations/0003_auto_20210225_0350.py | alexeevivan/bookstore | d5698a5681a5d4f6b7616aacd3ac384d25b306e5 | [
"Unlicense"
] | null | null | null | esse/mainapp/migrations/0003_auto_20210225_0350.py | alexeevivan/bookstore | d5698a5681a5d4f6b7616aacd3ac384d25b306e5 | [
"Unlicense"
] | null | null | null | esse/mainapp/migrations/0003_auto_20210225_0350.py | alexeevivan/bookstore | d5698a5681a5d4f6b7616aacd3ac384d25b306e5 | [
"Unlicense"
] | null | null | null | # Generated by Django 3.1.6 on 2021-02-25 00:50
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
migrations.swa... | 62.550802 | 162 | 0.608703 | 11,539 | 0.986408 | 0 | 0 | 0 | 0 | 0 | 0 | 2,647 | 0.226278 |
e15ca6e7927c7dfaebe88887cd584126de16a196 | 45 | py | Python | mypo/sampler/__init__.py | sonesuke/my-portfolio | 4fd19fdee8a0aa13194cab0df53c83218c5664e3 | [
"MIT"
] | 2 | 2021-03-14T00:14:25.000Z | 2021-09-04T16:26:02.000Z | mypo/sampler/__init__.py | sonesuke/my-portfolio | 4fd19fdee8a0aa13194cab0df53c83218c5664e3 | [
"MIT"
] | 104 | 2021-02-21T08:11:11.000Z | 2021-09-26T03:02:27.000Z | mypo/sampler/__init__.py | sonesuke/mypo | 4fd19fdee8a0aa13194cab0df53c83218c5664e3 | [
"MIT"
] | null | null | null | # flake8: noqa
from .sampler import Sampler
| 11.25 | 28 | 0.755556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 0.311111 |
e15cf3b8a65ba6fdc8baa289bed190ee2b034ffe | 295 | py | Python | tools/com/test/test_alpha.py | AnthonyEdvalson/Machina | fefb058591dd7b62817c75277d5ca0eb6dbd8c3a | [
"MIT"
] | null | null | null | tools/com/test/test_alpha.py | AnthonyEdvalson/Machina | fefb058591dd7b62817c75277d5ca0eb6dbd8c3a | [
"MIT"
] | null | null | null | tools/com/test/test_alpha.py | AnthonyEdvalson/Machina | fefb058591dd7b62817c75277d5ca0eb6dbd8c3a | [
"MIT"
] | null | null | null | from tools.com.alpha import Flow, Path
def test_flow():
p = Path("TEST", "layer", ["TASK", "SUB"])
f = Flow(content="abc123", path=p, format="text", a=1, b=7, c="aaaa")
s = str(p).encode() + b"""
text
a: 1
b: 7
c: aaaa
abc123"""
assert f.to_bytes()[5:] == s
| 17.352941 | 74 | 0.522034 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 88 | 0.298305 |
e15d3dcf46973ac9dc62ab07128caefad49a8319 | 907 | py | Python | compile.py | DrSuiunbek/pbc | 6dd3dc4e480483a885d80cd9c01b80c4ae9fb076 | [
"MIT"
] | null | null | null | compile.py | DrSuiunbek/pbc | 6dd3dc4e480483a885d80cd9c01b80c4ae9fb076 | [
"MIT"
] | null | null | null | compile.py | DrSuiunbek/pbc | 6dd3dc4e480483a885d80cd9c01b80c4ae9fb076 | [
"MIT"
] | null | null | null | import argparse
import os
import subprocess
from subprocess import call
def compile_separate():
cmd = "docker run -v " + contractsdir + ":/data ethereum/solc:stable --bin --abi --overwrite -o /data /data/" + filename
print(cmd)
call(cmd, shell=True)
def comile_combined():
cmd = "docker run -v " + con... | 29.258065 | 136 | 0.680265 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 250 | 0.275634 |
e15d5e4f994eb2a0d1d81f21279363ad0216ad9f | 1,283 | py | Python | app/machine_learning/utils.py | jonzxz/project-piscator | 588c8b1ac9355f9a82ac449fdbeaa1ef7eb441ef | [
"MIT"
] | null | null | null | app/machine_learning/utils.py | jonzxz/project-piscator | 588c8b1ac9355f9a82ac449fdbeaa1ef7eb441ef | [
"MIT"
] | null | null | null | app/machine_learning/utils.py | jonzxz/project-piscator | 588c8b1ac9355f9a82ac449fdbeaa1ef7eb441ef | [
"MIT"
] | 1 | 2021-02-18T03:08:21.000Z | 2021-02-18T03:08:21.000Z | import re
import joblib
from sklearn.ensemble import RandomForestClassifier
from typing import List, Tuple
# Cleans up a messed up HTML / tabbed raw content into space delimited content
def clean_up_raw_body(raw_text: str) -> str:
return ' '.join([line.strip() for line in raw_text.strip().splitlines() \
if li... | 42.766667 | 82 | 0.747467 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 543 | 0.423227 |
e15e1ca2f5eb878425d154d27fca023b5942afb5 | 1,637 | py | Python | sendgrid_email.py | ssiddhantsharma/open-source-library-data-collector | 9def970707a3995239ef75958a9b03736da4a73e | [
"MIT"
] | null | null | null | sendgrid_email.py | ssiddhantsharma/open-source-library-data-collector | 9def970707a3995239ef75958a9b03736da4a73e | [
"MIT"
] | null | null | null | sendgrid_email.py | ssiddhantsharma/open-source-library-data-collector | 9def970707a3995239ef75958a9b03736da4a73e | [
"MIT"
] | null | null | null | import os
import sendgrid
from sendgrid.helpers.mail import Content, Email, Mail
from bs4 import BeautifulSoup
class SendGrid(object):
"""Send an email through SendGrid"""
def __init__(self):
# Check if we are not in heroku
sendgrid_api_key = os.environ.get('SENDGRID_APY_KEY') if os.environ.ge... | 41.974359 | 132 | 0.592547 | 1,523 | 0.93036 | 0 | 0 | 0 | 0 | 0 | 0 | 854 | 0.521686 |
e15e7f996a734bfc0abd1bd0f37b1c7a308de458 | 2,141 | py | Python | ckilpailija.py | bittikettu/JTimer | d0b4a6173e84c89286874865427741bd595cf955 | [
"MIT"
] | null | null | null | ckilpailija.py | bittikettu/JTimer | d0b4a6173e84c89286874865427741bd595cf955 | [
"MIT"
] | null | null | null | ckilpailija.py | bittikettu/JTimer | d0b4a6173e84c89286874865427741bd595cf955 | [
"MIT"
] | null | null | null | import json
class kilpailija:
def __init__(self,etunimi,sukunimi,puhelinnumero,seura,kilpasarja,bibnumber):
self.etunimi = etunimi
self.sukunimi = sukunimi
self.puhelinnumero = puhelinnumero
self.seura = seura
self.kilpasarja = kilpasarja
self.bibnumber = bibn... | 33.984127 | 176 | 0.566558 | 2,126 | 0.992994 | 0 | 0 | 0 | 0 | 0 | 0 | 243 | 0.113498 |
e15f0f7648e65dbaf7aa7dffa649f9d29bce17dd | 1,436 | py | Python | hessen/frankfurt.py | risklayer/corona-landkreis-crawler | 2e82448ff614240365de9493eafa0e6a620ac615 | [
"Unlicense"
] | 12 | 2022-02-23T11:06:06.000Z | 2022-03-04T17:21:44.000Z | hessen/frankfurt.py | risklayer/corona-landkreis-crawler | 2e82448ff614240365de9493eafa0e6a620ac615 | [
"Unlicense"
] | null | null | null | hessen/frankfurt.py | risklayer/corona-landkreis-crawler | 2e82448ff614240365de9493eafa0e6a620ac615 | [
"Unlicense"
] | null | null | null | #!/usr/bin/python3
## Tommy
from botbase import *
_frankfurt_st = re.compile(r"Stand:\s*(\d\d?\. *\w+ 20\d\d, \d\d?(?::\d\d)?) Uhr")
def frankfurt(sheets):
import locale
locale.setlocale(locale.LC_TIME, "de_DE.UTF-8")
soup = get_soup("https://frankfurt.de/service-und-rathaus/verwaltung/aemter-und-instituti... | 47.866667 | 180 | 0.66922 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 569 | 0.395413 |
e15f87d69b9f385338407a9fb5c01c89ecaa7425 | 2,065 | py | Python | lib/utils/timeout.py | kustodian/aerospike-admin | 931ee55ccd65ba3e20e6611a0294c92b09e8cfcb | [
"Apache-2.0"
] | null | null | null | lib/utils/timeout.py | kustodian/aerospike-admin | 931ee55ccd65ba3e20e6611a0294c92b09e8cfcb | [
"Apache-2.0"
] | null | null | null | lib/utils/timeout.py | kustodian/aerospike-admin | 931ee55ccd65ba3e20e6611a0294c92b09e8cfcb | [
"Apache-2.0"
] | null | null | null | # Copyright 2013-2018 Aerospike, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 29.927536 | 88 | 0.701695 | 745 | 0.360775 | 0 | 0 | 0 | 0 | 0 | 0 | 902 | 0.436804 |
e15f893232695e92454619ed0274fe5e5ba282b5 | 101 | py | Python | src/myapp/admin.py | anmquangw/viu-upload-file | bfbff413cc92e454226fced5fe504b7cebc6c102 | [
"MIT"
] | null | null | null | src/myapp/admin.py | anmquangw/viu-upload-file | bfbff413cc92e454226fced5fe504b7cebc6c102 | [
"MIT"
] | 2 | 2020-06-21T01:47:59.000Z | 2020-06-27T12:39:24.000Z | src/myapp/admin.py | sonnhfit/DocShare | 50d9b8c333144780385f970197519ddda61bd502 | [
"MIT"
] | null | null | null | """from django.contrib import admin
from .models import DemoModel
admin.site.register(DemoModel)"""
| 20.2 | 35 | 0.782178 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 100 | 0.990099 |
e15fdd67f6de5e7d590eb91ddbbf06d3e3d45dea | 2,015 | py | Python | straightlanespipeline.py | semeniuta/CarND-AdvancedLaneLines | 57fbdc6cc9596f299b4517514d487573f7c373b4 | [
"MIT"
] | null | null | null | straightlanespipeline.py | semeniuta/CarND-AdvancedLaneLines | 57fbdc6cc9596f299b4517514d487573f7c373b4 | [
"MIT"
] | null | null | null | straightlanespipeline.py | semeniuta/CarND-AdvancedLaneLines | 57fbdc6cc9596f299b4517514d487573f7c373b4 | [
"MIT"
] | null | null | null | import lanelines
from compgraph import CompGraph, CompGraphRunner
import numpy as np
import cv2
func_dict = {
'grayscale': lanelines.grayscale,
'get_image_shape': lambda im : im.shape,
'canny': lanelines.canny,
'define_lanes_region': lanelines.define_lanes_region,
'apply_region_mask': lanelines.ap... | 35.350877 | 135 | 0.68536 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,068 | 0.530025 |
e1601ec501793267dab5b7a344de5c414ede0c73 | 2,904 | py | Python | PA1/ArrayListTests/main_create_tests.py | tordisuna/SC-T-201-GSKI | 1e89e5b31e7d74aeecae3dffe2df7ac9e8bb40f2 | [
"MIT"
] | null | null | null | PA1/ArrayListTests/main_create_tests.py | tordisuna/SC-T-201-GSKI | 1e89e5b31e7d74aeecae3dffe2df7ac9e8bb40f2 | [
"MIT"
] | null | null | null | PA1/ArrayListTests/main_create_tests.py | tordisuna/SC-T-201-GSKI | 1e89e5b31e7d74aeecae3dffe2df7ac9e8bb40f2 | [
"MIT"
] | 1 | 2021-02-12T11:36:53.000Z | 2021-02-12T11:36:53.000Z |
import random
from random import Random
def write_test_line(f, r, c, clear, o = 0):
f.write("\n")
if(o == 0):
if clear == 0:
o = r.randint(1, 8)
elif clear == 1:
o = 9
else:
o = r.randint(1, 9)
if o == 1:
f.write("prepend")
f.wri... | 19.755102 | 43 | 0.512741 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 205 | 0.070592 |
e160ba46a79b2de84010dbbe846ade7d792604fe | 4,305 | py | Python | stock deep learning/7-2.LSTM(stock).py | nosy0411/Deep-learning-project | b0864579ec1fef4c6224397e3c39e4fce051c93a | [
"MIT"
] | null | null | null | stock deep learning/7-2.LSTM(stock).py | nosy0411/Deep-learning-project | b0864579ec1fef4c6224397e3c39e4fce051c93a | [
"MIT"
] | null | null | null | stock deep learning/7-2.LSTM(stock).py | nosy0411/Deep-learning-project | b0864579ec1fef4c6224397e3c39e4fce051c93a | [
"MIT"
] | null | null | null | # LSTM(GRU) 예시 : KODEX200 주가 (2010 ~ 현재)를 예측해 본다.
# KODEX200의 종가와, 10일, 40일 이동평균을 이용하여 향후 10일 동안의 종가를 예측해 본다.
# 과거 20일 (step = 20) 종가, 이동평균 패턴을 학습하여 예측한다.
# 일일 주가에 대해 예측이 가능할까 ??
#
# 2018.11.22, 아마추어퀀트 (조성현)
# --------------------------------------------------------------------------
import tensorflow as tf
import nump... | 30.75 | 102 | 0.625784 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,164 | 0.427922 |
e1627f07a28ba766216726e8582242703156a953 | 1,486 | py | Python | media.py | wduncanfraser/movie_trailer_website | deaa134862772df09cf8af79a6990d140848fb80 | [
"MIT"
] | null | null | null | media.py | wduncanfraser/movie_trailer_website | deaa134862772df09cf8af79a6990d140848fb80 | [
"MIT"
] | null | null | null | media.py | wduncanfraser/movie_trailer_website | deaa134862772df09cf8af79a6990d140848fb80 | [
"MIT"
] | null | null | null | """media.py: Module for movie_trailer_website, contains Movie class"""
import webbrowser
import urllib
import json
class Movie(object):
"""This class provides a way to store movie related information.
constructor takes movie title, imdb_id and a url for a youtube trailer as input.
All other values are po... | 37.15 | 101 | 0.672275 | 1,367 | 0.919919 | 0 | 0 | 0 | 0 | 0 | 0 | 648 | 0.43607 |
e163903fd0678839e9ef90435028e77dc1cbf097 | 103 | py | Python | src/moredataframes/mdf_core.py | GlorifiedStatistics/MoreDataframes | 147d5b8104d1cbd1cf2836220f43fb6c8ca099b7 | [
"MIT"
] | null | null | null | src/moredataframes/mdf_core.py | GlorifiedStatistics/MoreDataframes | 147d5b8104d1cbd1cf2836220f43fb6c8ca099b7 | [
"MIT"
] | null | null | null | src/moredataframes/mdf_core.py | GlorifiedStatistics/MoreDataframes | 147d5b8104d1cbd1cf2836220f43fb6c8ca099b7 | [
"MIT"
] | null | null | null | """
A collection of useful functions for manipulating/encoding pandas dataframes for data science.
"""
| 25.75 | 94 | 0.786408 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 102 | 0.990291 |
e163f95d62fc70e17e021921220d7ea02e910aa6 | 23,493 | py | Python | superslomo/model.py | myungsub/meta-interpolation | f7afee9d1786f67e6f548c2734f91858f803c5dc | [
"MIT"
] | 74 | 2020-04-03T06:26:39.000Z | 2022-03-25T16:51:28.000Z | superslomo/model.py | baiksung/meta-interpolation | 72dd3b2e56054bb411ed20301583a0e67d9ea293 | [
"MIT"
] | 6 | 2020-07-09T20:09:23.000Z | 2021-09-20T11:12:24.000Z | superslomo/model.py | baiksung/meta-interpolation | 72dd3b2e56054bb411ed20301583a0e67d9ea293 | [
"MIT"
] | 19 | 2020-04-16T09:18:38.000Z | 2021-12-28T08:25:12.000Z | import torch
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from model_utils import *
class down(nn.Module):
"""
A class for creating neural network blocks containing layers:
Average P... | 35.011923 | 293 | 0.548717 | 20,938 | 0.891244 | 0 | 0 | 0 | 0 | 0 | 0 | 8,753 | 0.372579 |
e164e5d3815dee52bdeb5d8a12184fbf1db5055b | 11,970 | py | Python | adaptfx/discrete_programs/updater_discrete.py | rmnldwg/Adaptive-fractionation | 5525cbd635e9afdbf5556b2a95dd31bdb222db66 | [
"MIT"
] | 1 | 2021-07-15T12:23:25.000Z | 2021-07-15T12:23:25.000Z | adaptfx/discrete_programs/updater_discrete.py | rmnldwg/Adaptive-fractionation | 5525cbd635e9afdbf5556b2a95dd31bdb222db66 | [
"MIT"
] | 1 | 2021-11-29T18:50:05.000Z | 2021-12-10T15:32:50.000Z | adaptfx/discrete_programs/updater_discrete.py | rmnldwg/Adaptive-fractionation | 5525cbd635e9afdbf5556b2a95dd31bdb222db66 | [
"MIT"
] | 1 | 2021-11-29T10:52:42.000Z | 2021-11-29T10:52:42.000Z | # -*- coding: utf-8 -*-
"""
In this file are all the needed functions to calculate an adaptive fractionation treatment plan. The value_eval and the result_calc function are the only ones that should be used
This file requires all sparing factors to be known, therefore, it isnt suited to do active treatment planning ... | 68.4 | 250 | 0.693317 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5,895 | 0.492481 |
e16731d27b2926a6e8972922d05bae1f6e5d75bb | 240 | py | Python | ltc/base/admin.py | v0devil/jltom | b302a39a187b8e1154c6deda636a4db8b30bb40b | [
"MIT"
] | 4 | 2016-12-30T13:26:59.000Z | 2017-04-26T12:07:36.000Z | ltc/base/admin.py | v0devil/jltom | b302a39a187b8e1154c6deda636a4db8b30bb40b | [
"MIT"
] | null | null | null | ltc/base/admin.py | v0devil/jltom | b302a39a187b8e1154c6deda636a4db8b30bb40b | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from ltc.base.models import Project, Test, Configuration
# Register your models here.
admin.site.register(Project)
admin.site.register(Test)
admin.site.register(Configuration)
| 24 | 56 | 0.808333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 56 | 0.233333 |